:root {
    --sidebar-width: 240px;
    --ink: #111111;
    --ink-soft: #2a2a2a;
    --muted: #6b6b6b;
    --line: #e5e5e5;
    --line-strong: #d0d0d0;
    --surface: #ffffff;
    --surface-soft: #f7f7f7;
    --surface-muted: #f0f0f0;
    --status-pending: #d4a017;
    --status-pending-bg: #fff4d6;
    --status-approved: #2f9e44;
    --status-approved-bg: #e6f6ea;
    --status-rejected: #c92a2a;
    --status-rejected-bg: #fde8e8;
    --status-cancelled: #868e96;
}

/* Bootstrap primary → monochrome */
.btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--ink);
    --bs-btn-border-color: var(--ink);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #000;
    --bs-btn-hover-border-color: #000;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #000;
    --bs-btn-active-border-color: #000;
    --bs-btn-disabled-bg: #999;
    --bs-btn-disabled-border-color: #999;
}

.btn-outline-primary {
    --bs-btn-color: var(--ink);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ink);
    --bs-btn-hover-border-color: var(--ink);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--ink);
    --bs-btn-active-border-color: var(--ink);
}

.btn-outline-secondary {
    --bs-btn-color: var(--ink-soft);
    --bs-btn-border-color: var(--line-strong);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--ink-soft);
    --bs-btn-hover-border-color: var(--ink-soft);
}

.btn-outline-primary.active,
.btn-outline-primary:active {
    color: #fff !important;
    background: var(--ink) !important;
    border-color: var(--ink) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #999;
    box-shadow: 0 0 0 0.2rem rgba(0, 0, 0, 0.08);
}

body {
    background: var(--surface-soft);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    overflow: hidden;
}

.app-shell {
    min-height: 100vh;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--ink);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    flex-shrink: 0;
    border-right: 1px solid #000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
}

.sidebar-user {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
}

.sidebar-user-name {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.3;
}

.sidebar-user-dept {
    font-size: 0.78rem;
    opacity: 0.55;
    margin-top: 0.15rem;
}

.sidebar-brand {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar-logo-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.sidebar-logo {
    display: block;
    width: auto;
    max-width: 112px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.login-logo {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: 168px;
    height: auto;
}

.login-hint {
    line-height: 1.45;
}

.app-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.72);
    border-radius: 0.4rem;
    margin-bottom: 0.15rem;
    padding: 0.6rem 0.8rem;
    font-size: 0.92rem;
}

.app-sidebar .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.app-sidebar .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

.app-sidebar .sidebar-section {
    letter-spacing: 0.08em;
    font-size: 0.68rem;
}

.app-main {
    min-width: 0;
    background: var(--surface-soft);
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.app-topbar {
    background: var(--surface) !important;
    border-bottom: 1px solid var(--line) !important;
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-main > main {
    flex: 1 1 auto;
}

.app-topbar h1 {
    font-weight: 600;
    letter-spacing: -0.02em;
}

main.p-4 {
    padding: 1.25rem 1.5rem !important;
}

.card {
    border: 1px solid var(--line) !important;
    box-shadow: none !important;
    background: var(--surface);
}

.table > :not(caption) > * > * {
    border-bottom-color: var(--line);
}

.table-light {
    --bs-table-bg: var(--surface-muted);
    --bs-table-color: var(--ink);
}

.badge-mono {
    background: var(--surface-muted);
    color: var(--ink-soft);
    border: 1px solid var(--line);
    font-weight: 500;
}

.badge-status-pending {
    background: var(--status-pending-bg) !important;
    color: #8a6a00 !important;
}

.badge-status-approved {
    background: var(--status-approved-bg) !important;
    color: #1b6b2c !important;
}

.badge-status-rejected {
    background: var(--status-rejected-bg) !important;
    color: #9b1c1c !important;
}

.badge-status-cancelled {
    background: #ececec !important;
    color: #555 !important;
}

.login-page {
    background:
        linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--line) !important;
}

/* Dashboard */
.dashboard-toolbar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    padding: 0.9rem 1.15rem;
    margin-bottom: 1rem;
}

.dashboard-toolbar .form-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.35rem;
    display: block;
}

.dashboard-toolbar-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem 2rem;
}

.dashboard-toolbar-row-3 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: end;
    gap: 1rem 1.5rem;
}

.dashboard-toolbar-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas:
        "date-label view-labels new-btn"
        "date-input view-btns   legend";
    column-gap: 1.5rem;
    row-gap: 0.35rem;
    align-items: center;
}

.dashboard-cell-date-label { grid-area: date-label; }
.dashboard-cell-view-labels {
    grid-area: view-labels;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
}
.dashboard-cell-new {
    grid-area: new-btn;
    justify-self: end;
}
.dashboard-cell-date { grid-area: date-input; }
.dashboard-cell-view-btns {
    grid-area: view-btns;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
}
.dashboard-cell-legend {
    grid-area: legend;
    justify-self: end;
}

.dashboard-cell-view-labels .dashboard-toolbar-group,
.dashboard-cell-view-btns .dashboard-toolbar-group {
    min-width: 7.5rem;
}

.dashboard-toolbar-left {
    flex: 0 1 auto;
}

.dashboard-toolbar-center {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: center;
    gap: 1rem 1.5rem;
}

.dashboard-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 1.25rem 1.75rem;
}

@media (max-width: 991.98px) {
    .dashboard-toolbar-row-3 {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .dashboard-toolbar-grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "date-label"
            "date-input"
            "view-labels"
            "view-btns"
            "new-btn"
            "legend";
        justify-items: start;
    }

    .dashboard-cell-new,
    .dashboard-cell-legend {
        justify-self: start;
    }

    .dashboard-cell-view-labels,
    .dashboard-cell-view-btns {
        justify-content: flex-start;
    }

    .dashboard-toolbar-center,
    .dashboard-toolbar-right {
        justify-content: flex-start;
    }
}

.dashboard-toolbar-group {
    min-width: 0;
}

.week-picker-input {
    width: 240px;
    max-width: 100%;
    cursor: pointer;
    background: var(--surface);
}

.list-search-group {
    min-width: 240px;
}

.list-search-group .input-group {
    min-width: 260px;
}

.list-filter-dropdown .dropdown-toggle {
    min-width: 7.5rem;
}

.list-filter-dropdown .dropdown-toggle.active,
.list-filter-dropdown .dropdown-toggle.show {
    border-color: var(--text, #212529);
    color: var(--text, #212529);
}

.list-filter-dropdown .dropdown-menu {
    max-height: 280px;
    overflow-y: auto;
    min-width: 14rem;
}

.list-filter-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0;
    padding: 0.35rem 0.45rem;
    border-radius: 0.35rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.35;
}

.list-filter-option:hover {
    background: rgba(0, 0, 0, 0.04);
}

.list-filter-option .form-check-input {
    margin-top: 0.15rem;
    flex: 0 0 auto;
}

.list-table-wrap {
    overflow-x: auto;
    overflow-y: visible;
}

.list-data-table thead th.list-col-head {
    vertical-align: top;
    min-width: 7rem;
    padding-top: 0.55rem;
    padding-bottom: 0.45rem;
}

.list-col-label {
    display: inline-block;
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.list-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 0;
    background: transparent;
    padding: 0;
    margin-bottom: 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    cursor: pointer;
}

.list-sort-btn:hover,
.list-sort-btn.active {
    color: var(--ink);
}

.list-pagination .page-link {
    color: var(--ink-soft);
}

.list-pagination .page-item.active .page-link {
    background: var(--ink);
    border-color: var(--ink);
    color: #fff;
}

.activity-changes li {
    margin-bottom: 0.2rem;
    line-height: 1.35;
}

.activity-changes-trigger {
    text-decoration: none;
    color: var(--ink-soft);
    max-width: 16rem;
}

.activity-changes-trigger:hover {
    color: var(--ink);
    text-decoration: underline;
}

.activity-changes-preview {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-diff-table td {
    vertical-align: top;
    word-break: break-word;
}

.activity-diff-old {
    color: var(--muted);
    background: #fafafa;
}

.activity-diff-new {
    color: var(--ink);
    background: #f3f7f4;
}

.room-calendars-grid .room-calendar-col {
    display: block;
}

.flatpickr-day.week.selected {
    box-shadow: none;
    border-radius: 0;
    border: none;
    background: var(--ink);
    color: #fff;
}

.flatpickr-day.week.startRange,
.flatpickr-day.week.endRange {
    border-radius: 0;
}

.room-panel {
    border: 1px solid var(--line);
    border-radius: 0.75rem;
    background: var(--surface);
    overflow: hidden;
    height: 100%;
}

.room-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.room-panel-header h2 {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.room-panel-header .meta {
    font-size: 0.75rem;
    color: var(--muted);
}

.room-panel-body {
    padding: 0.35rem 0.45rem 0.45rem;
}

.room-calendar {
    min-height: 0;
}

.room-calendar .fc {
    font-size: 0.78rem;
}

.room-calendar .fc-theme-standard td,
.room-calendar .fc-theme-standard th,
.room-calendar .fc-theme-standard .fc-scrollgrid {
    border-color: var(--line) !important;
}

.room-calendar .fc-col-header-cell {
    background: var(--surface-muted);
}

.room-calendar .fc-col-header-cell-cushion {
    color: var(--ink-soft);
    font-weight: 600;
    padding: 0.3rem 0.15rem;
    display: block;
    white-space: normal;
}

.room-calendar .fc-day-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    line-height: 1.15;
    white-space: normal;
}

.room-calendar .fc-day-head-name {
    display: block;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--ink-soft);
}

.room-calendar .fc-day-head-date {
    display: block;
    font-size: 0.58rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0;
}

.room-calendar .fc-timegrid-axis-cushion,
.room-calendar .fc-timegrid-slot-label-cushion {
    color: var(--muted);
    font-size: 0.72rem;
}

.room-calendar .fc-event {
    cursor: pointer;
    border: none !important;
    border-radius: 3px !important;
    font-size: 0.72rem;
    box-shadow: none;
}

.room-calendar .fc-event.fc-event-own {
    background-color: #16a34a !important;
    border-color: #16a34a !important;
}

.room-calendar .fc-event.fc-event-guest {
    background-color: #c2410c !important;
    border-color: #c2410c !important;
}

.room-calendar .fc-event.fc-event-other {
    background-color: #475569 !important;
    border-color: #475569 !important;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem 1.25rem;
    font-size: 0.8rem;
    color: var(--muted);
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.calendar-legend-swatch {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 2px;
    flex-shrink: 0;
}

.calendar-legend-own { background: #16a34a; }
.calendar-legend-guest { background: #c2410c; }
.calendar-legend-other { background: #475569; }

.room-calendar .fc-event-lines {
    padding: 2px 4px;
    line-height: 1.25;
    overflow: hidden;
}

.room-calendar .fc-event-lines .fc-line {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.room-calendar .fc-timegrid-slot {
    height: 1.55rem !important;
}

.room-calendar .fc-timegrid-slot-label {
    vertical-align: middle;
}

.room-calendar .fc-scroller,
.room-calendar .fc-scroller-liquid-absolute {
    overflow: visible !important;
    height: auto !important;
}

.room-calendar .fc-scrollgrid,
.room-calendar .fc-scrollgrid-section,
.room-calendar .fc-scrollgrid-section > td {
    height: auto !important;
}

.room-calendar .fc-timegrid-body,
.room-calendar .fc-timegrid-body table {
    height: auto !important;
}

.room-calendar .fc-non-business,
.room-calendar .fc-day-closed,
.room-calendar .fc-slot-closed {
    background: repeating-linear-gradient(
        -45deg,
        #f5f5f5,
        #f5f5f5 5px,
        #ebebeb 5px,
        #ebebeb 10px
    ) !important;
}

.room-calendar .fc-day-sat .fc-col-header-cell-cushion,
.room-calendar .fc-day-sun .fc-col-header-cell-cushion,
.room-calendar .fc-day-closed .fc-col-header-cell-cushion,
.room-calendar .fc-day-sat .fc-day-head-name,
.room-calendar .fc-day-sun .fc-day-head-name,
.room-calendar .fc-day-sat .fc-day-head-date,
.room-calendar .fc-day-sun .fc-day-head-date {
    color: #b0b0b0;
}

.room-calendar .fc-day-sat,
.room-calendar .fc-day-sun {
    background-color: #f5f5f5;
}

.room-calendar .fc-now-indicator-line {
    border-color: var(--ink);
}

.room-calendar .fc-now-indicator-arrow {
    border-top-color: var(--ink);
    border-bottom-color: var(--ink);
}

/* Flatpickr monochrome */
.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
    background: var(--ink) !important;
    border-color: var(--ink) !important;
}

.flatpickr-day:hover {
    background: var(--surface-muted);
}

@media (max-width: 991px) {
    body {
        overflow: auto;
    }
    .app-shell {
        height: auto;
        overflow: visible;
        flex-direction: column;
    }
    .app-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        left: auto;
        top: auto;
    }
    .app-main {
        margin-left: 0;
        width: 100%;
        height: auto;
        overflow: visible;
    }
}

/* Sabit toast bildirim — layout kaydırmaz */
.app-toast-stack {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    width: min(520px, calc(100vw - 2rem));
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.app-toast {
    pointer-events: auto;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
    border: 0;
    backdrop-filter: blur(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.app-toast-success {
    background: rgba(230, 246, 234, 0.88) !important;
    color: #1f6b32 !important;
}

.app-toast-error {
    background: rgba(253, 232, 232, 0.9) !important;
    color: #9b1c1c !important;
}

.app-toast-hide {
    opacity: 0;
    transform: translateY(-8px);
}
