        /* ========== DESIGN TOKENS ========== */
        :root {
            --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
            --bg: #f4f6fa;
            --surface: #ffffff;
            --surface-alt: #f7f9fc;
            --border: #e3e7ee;
            --border-strong: #cfd6e0;
            --text: #1c252e;
            --text-muted: #5b6770;
            --text-faint: #8794a3;
            --primary: #2196f3;
            --primary-dark: #1976d2;
            --radius: 6px;
            --radius-lg: 10px;
            --shadow-xs: 0 1px 2px rgba(15,23,42,0.05);
            --shadow-sm: 0 2px 6px rgba(15,23,42,0.08);
            --shadow-md: 0 6px 18px rgba(15,23,42,0.12);
            --shadow-lg: 0 16px 40px rgba(15,23,42,0.18);
        }
        body { font-family: var(--font); margin: 0; padding: 0; background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
        h1, h2, h3, h4, h5, h6 { font-family: var(--font); color: var(--text); }
        .main-content h2 { font-size: 19px; font-weight: 600; letter-spacing: -0.2px; margin-top: 0; }
        .main-content h3 { font-size: 14px; font-weight: 600; }
        .main-content h4 { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; }

        .layout { display: flex; height: 100vh; overflow: hidden; }
        .sidebar { width: 220px; min-width: 220px; background: #1f2937; padding: 18px 12px; display: flex; flex-direction: column; overflow-y: auto; box-sizing: border-box; font-family: var(--font); }
        .sidebar button { margin-bottom: 4px; text-align: left; padding: 10px 12px; background: transparent; color: #d3dae3; border: none; cursor: pointer; border-radius: var(--radius); font-weight: 600; font-size: 13.5px; transition: background 0.15s, color 0.15s; display: flex; align-items: center; gap: 11px; font-family: var(--font); }
        .s-icon { width: 18px; height: 18px; flex-shrink: 0; color: inherit; }
        .s-badge { margin-left: auto; background: #f44336; color: #fff; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11px; font-weight: 700; line-height: 1; display: none; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,0.3); }
        .s-badge.show { display: inline-flex; }
        .s-badge.seen { background: #334155; }
        .sidebar button.s-subitem { padding: 6px 12px 6px 30px; font-size: 12px; font-weight: 500; color: #8b97a8; gap: 8px; }
        .sidebar button.s-subitem .s-icon { width: 13px; height: 13px; }
        .sidebar button.s-subitem:hover { color: #fff; background: #2a3548; }
        .sidebar button.s-subitem.aktif-tab { background: var(--primary); color: #fff; }

        /* Keep history pages from stretching across very wide screens */
        #checkin-history > *, #checkout-history > *, #syslog > *, #crm > *, #building > *, #laundry > *, #howto > *, #security > * { max-width: 1200px; }
        /* Lock column widths so tables don't shift between tabs */
        #dep-overdue-grid, #dep-today-grid, #dep-upcoming-grid,
        #checkin-history-grid, #checkout-history-grid { table-layout: fixed; width: 100%; }
        #dep-overdue-grid th, #dep-overdue-grid td,
        #dep-today-grid   th, #dep-today-grid   td,
        #dep-upcoming-grid th, #dep-upcoming-grid td,
        #checkin-history-grid th, #checkin-history-grid td,
        #checkout-history-grid th, #checkout-history-grid td { overflow: hidden; text-overflow: ellipsis; }
        /* History tables: When | Event | Flat | Guest Name | Source | By */
        #checkin-history-grid th:nth-child(1), #checkout-history-grid th:nth-child(1) { width: 180px; }
        #checkin-history-grid th:nth-child(2), #checkout-history-grid th:nth-child(2) { width: 130px; }
        #checkin-history-grid th:nth-child(3), #checkout-history-grid th:nth-child(3) { width: 80px;  }
        #checkin-history-grid th:nth-child(5), #checkout-history-grid th:nth-child(5) { width: 150px; }
        #checkin-history-grid th:nth-child(6), #checkout-history-grid th:nth-child(6) { width: 180px; }
        /* Checked Out (3 stacked tables): Flat | Guest | Departure | Days | Source | Payment | Action */
        #dep-overdue-grid th:nth-child(1), #dep-today-grid th:nth-child(1), #dep-upcoming-grid th:nth-child(1) { width: 80px;  }
        #dep-overdue-grid th:nth-child(3), #dep-today-grid th:nth-child(3), #dep-upcoming-grid th:nth-child(3) { width: 140px; }
        #dep-overdue-grid th:nth-child(4), #dep-today-grid th:nth-child(4), #dep-upcoming-grid th:nth-child(4) { width: 130px; }
        #dep-overdue-grid th:nth-child(5), #dep-today-grid th:nth-child(5), #dep-upcoming-grid th:nth-child(5) { width: 160px; }
        #dep-overdue-grid th:nth-child(6), #dep-today-grid th:nth-child(6), #dep-upcoming-grid th:nth-child(6) { width: 130px; }
        #dep-overdue-grid th:nth-child(7), #dep-today-grid th:nth-child(7), #dep-upcoming-grid th:nth-child(7) { width: 130px; }

        /* System Logs tables — fixed columns so they don't jitter between sub-tabs */
        #gecmis-grid, #editlog-grid, #guesthistory-grid { table-layout: fixed; width: 100%; }
        #gecmis-grid th, #gecmis-grid td,
        #editlog-grid th, #editlog-grid td,
        #guesthistory-grid th, #guesthistory-grid td { overflow: hidden; text-overflow: ellipsis; }
        #gecmis-grid th:nth-child(1) { width: 170px; }
        #gecmis-grid th:nth-child(2) { width: 140px; }
        #gecmis-grid th:nth-child(3) { width: 150px; }
        #gecmis-grid th:nth-child(4) { width: 80px;  }
        #editlog-grid th:nth-child(1) { width: 170px; }
        #editlog-grid th:nth-child(2) { width: 120px; }
        #editlog-grid th:nth-child(3) { width: 150px; }
        #guesthistory-grid th:nth-child(1) { width: 170px; }
        #guesthistory-grid th:nth-child(3) { width: 200px; }
        #guesthistory-grid th:nth-child(4) { width: 130px; }
        #guesthistory-grid th:nth-child(5) { width: 100px; }
        #guesthistory-grid th:nth-child(6) { width: 150px; }

        /* ===== ROLE-BASED VISIBILITY ===== */
        /* SECURITY role: hide most actions/buttons across pages */
        body.role-security #btn-detay + * { } /* no-op anchor */
        /* Live Occupancy: hide Copy Emails, Excel, Activity History panel */
        body.role-security #detay > div:first-child > div:last-child > button[onclick*="tumEmailleriniKopyala"],
        body.role-security #detay > div:first-child > div:last-child > button[onclick*="occupancyExcel"] { display: none !important; }
        body.role-security #activity-history-list,
        body.role-security #activity-history-list + * { display: none !important; }
        body.role-security .recent-bookings-panel { display: none !important; }
        /* Hide Action (col 1) and Room Status (col 2) columns in Live Occupancy */
        body.role-security #detay-grid th:nth-child(1),
        body.role-security #detay-grid td:nth-child(1),
        body.role-security #detay-grid th:nth-child(2),
        body.role-security #detay-grid td:nth-child(2),
        body.role-security #detay-grid th:nth-child(14),
        body.role-security #detay-grid td:nth-child(14) { display: none !important; }
        /* In House column (col 13) — visible to security but read-only */
        body.role-security #detay-grid td:nth-child(13) select { pointer-events: none; opacity: 0.85; background: #f5f5f5; }
        /* Arrivals + Checked Out: hide Excel buttons */
        body.role-security #arrivals > div:first-child > button,
        body.role-security #departures > div:first-child > button { display: none !important; }
        body.role-security #arrivals-upcoming-section,
        body.role-security #dep-upcoming-section { display: none !important; }
        /* Hide delete button in arrivals rows for security */
        body.role-security #arrivals button[onclick*="rezSil"] { display: none !important; }
        /* Hide Notification Settings sidebar button for non-admin/manager */
        body.role-staff #btn-notif-settings,
        body.role-security #btn-notif-settings { display: none !important; }

        /* Admin-only sections (Import from Excel) */
        body:not(.role-admin) .import-subsection { display: none !important; }
        body:not(.role-admin) #co-import-trigger { display: none !important; }
        body:not(.role-admin) #btn-clear-all-data, body:not(.role-admin) #admin-snapshots-panel { display: none !important; }

        /* Security Reports quick-template buttons */
        .sec-quick { padding: 5px 10px; font-size: 11px; font-weight: 600; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text); cursor: pointer; transition: background 0.15s, border-color 0.15s; font-family: var(--font); }
        .sec-quick:hover { background: #e3f2fd; border-color: #90caf9; color: var(--primary-dark); }

        /* Same width cap for the Arrivals + Checked Out pages so Guest Name column stays sensible */
        #arrivals > *, #departures > * { max-width: 1200px; }
        #arrivals .schedule-section,
        #departures .schedule-section { width: 100%; }

        /* Arrivals section headers */
        .arr-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; margin: 0 0 8px 0; display: flex; align-items: center; gap: 8px; }
        .arr-section-title .section-count { background: #455a64; color: #fff; padding: 2px 9px; border-radius: 10px; font-size: 11px; font-weight: 700; min-width: 22px; text-align: center; }

        /* Lock column widths so the three stacked arrival tables align vertically */
        #arrivals-overdue-grid,
        #arrivals-today-grid,
        #arrivals-upcoming-grid { table-layout: fixed !important; width: 100% !important; }
        #arrivals-overdue-grid th, #arrivals-overdue-grid td,
        #arrivals-today-grid   th, #arrivals-today-grid   td,
        #arrivals-upcoming-grid th, #arrivals-upcoming-grid td { overflow: hidden; text-overflow: ellipsis; }
        #arrivals-overdue-grid th:nth-child(1), #arrivals-today-grid th:nth-child(1), #arrivals-upcoming-grid th:nth-child(1) { width: 80px; }
        #arrivals-overdue-grid th:nth-child(3), #arrivals-today-grid th:nth-child(3), #arrivals-upcoming-grid th:nth-child(3) { width: 140px; }
        #arrivals-overdue-grid th:nth-child(4), #arrivals-today-grid th:nth-child(4), #arrivals-upcoming-grid th:nth-child(4) { width: 130px; }
        #arrivals-overdue-grid th:nth-child(5), #arrivals-today-grid th:nth-child(5), #arrivals-upcoming-grid th:nth-child(5) { width: 160px; }
        #arrivals-overdue-grid th:nth-child(6), #arrivals-today-grid th:nth-child(6), #arrivals-upcoming-grid th:nth-child(6) { width: 200px; }

        .sec-viewer-notice {
            margin: 0 0 14px;
            padding: 11px 14px;
            border: 1px solid #90caf9;
            border-radius: 8px;
            background: #e3f2fd;
            color: #0d47a1;
            font-size: 13px;
            font-weight: 600;
        }

        /* Soft yellow highlight for Overdue + Today only */
        #arrivals-overdue-body tr,
        #arrivals-today-body   tr,
        #dep-overdue-body      tr,
        #dep-today-body        tr { background-color: #fff9c4; }
        #arrivals-overdue-body tr:hover,
        #arrivals-today-body   tr:hover,
        #dep-overdue-body      tr:hover,
        #dep-today-body        tr:hover { background-color: #fff59d; }

        /* Inline feather-style icon (matches sidebar look) */
        .ico { width: 16px; height: 16px; vertical-align: -3px; flex-shrink: 0; display: inline-block; margin-right: 6px; }
        .ico-sm  { width: 13px; height: 13px; vertical-align: -2px; margin-right: 5px; }
        .ico-lg  { width: 22px; height: 22px; vertical-align: -5px; margin-right: 8px; }
        .ico-xl  { width: 36px; height: 36px; vertical-align: middle; margin-right: 0; }
        .ico-only { margin-right: 0; }
        .recent-booking-item .ico-sm { margin-right: 4px; }
        .sidebar button:hover { background: #2d3a4d; color: #fff; }
        .sidebar button.aktif-tab { background: var(--primary); color: #fff; }
        .sidebar h3 { color: #6b7a8c; font-size: 11px; font-weight: 700; text-transform: uppercase; margin: 18px 0 8px 12px; letter-spacing: 1px; }
.sidebar h3:hover { color: #d3dae3; }

.sidebar-user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px 14px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: #2563eb;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}
.sidebar-user-meta {
    min-width: 0;
}
.sidebar-user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user-role {
    margin-top: 2px;
    color: #9fb0c7;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
        .main-content { flex: 1; padding: 24px 28px; overflow-y: auto; background: var(--surface); }

        .controls-container { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
        .filter-group { background: #f9f9f9; padding: 10px; border-radius: 4px; border: 1px solid #ddd; display: flex; gap: 10px; align-items: center; }

        /* Calendar View toolbar (above the grid) */
        .cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 0; background: #fafafa; border: 1px solid #e0e0e0; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; }
        .cal-toolbar-group { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
        .cal-toolbar-group:not(:first-child) { padding-left: 14px; margin-left: 4px; border-left: 1px solid #ddd; }
        .cal-toolbar-label { font-size: 11px; font-weight: 700; color: #607d8b; text-transform: uppercase; letter-spacing: 0.8px; margin-right: 2px; }
        .cal-toolbar-arrow { color: #aaa; font-size: 13px; padding: 0 2px; }
        .cal-toolbar input[type="date"] { padding: 5px 8px; border: 1px solid #ccc; border-radius: 4px; font-size: 12px; height: 30px; box-sizing: border-box; background: #fff; }
        .cal-btn { padding: 6px 11px; color: white; border: none; cursor: pointer; font-weight: 600; font-size: 12px; border-radius: 4px; display: inline-flex; align-items: center; gap: 5px; height: 30px; box-sizing: border-box; line-height: 1; transition: filter 0.15s, transform 0.05s; }
        .cal-btn:hover { filter: brightness(0.92); }
        .cal-btn:active { transform: translateY(1px); }
        .cal-btn .ico { width: 14px; height: 14px; margin: 0; }
        .cal-btn-muted      { background: #757575; }
        .cal-btn-danger     { background: #e53935; }
        .cal-btn-amber      { background: #f39c12; }
        .cal-btn-purple     { background: #5e35b1; }
        .cal-btn-teal       { background: #009688; }
        .cal-btn-slate      { background: #607d8b; }
        .cal-btn-slate-dark { background: #455a64; }
        .cal-btn-info       { background: #2196f3; }

        /* ===== CRM page ===== */
        #crm > * { max-width: 1100px; }
        #crm h2 { text-align: left !important; color: var(--text); margin: 0 0 12px 0; }
        .crm-tabs { display: flex; gap: 6px; margin-bottom: 20px; }
        .crm-tab { padding: 8px 16px; font-family: var(--font); font-weight: 600; font-size: 13px; border: 1px solid var(--border); background: var(--surface-alt); color: var(--text-muted); cursor: pointer; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; transition: background 0.15s, color 0.15s, border-color 0.15s; }
        .crm-tab:hover { color: var(--text); border-color: var(--border-strong); }
        .crm-tab.is-active { background: var(--primary); color: #fff; border-color: var(--primary); }
        .crm-tab .ico { width: 14px; height: 14px; margin: 0; }
        .crm-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 16px; }
        .crm-toolbar .search-bar { flex: 1; min-width: 220px; margin: 0; max-width: none; }
        .crm-select { padding: 7px 10px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 12px; font-family: var(--font); background: var(--surface); height: 34px; box-sizing: border-box; width: auto; color: var(--text); }
        .crm-count { margin-left: auto; font-size: 12px; color: var(--text-muted); white-space: nowrap; font-weight: 600; }
        .crm-empty { text-align: center; padding: 56px 20px; color: var(--text-muted); background: var(--surface-alt); border: 1px dashed var(--border); border-radius: var(--radius-lg); }
        .crm-empty .crm-empty-icon { width: 44px; height: 44px; opacity: 0.45; display: block; margin: 0 auto 12px; color: var(--text-muted); }
        .crm-empty .crm-empty-title { font-size: 14px; font-weight: 600; color: var(--text-muted); }
        .crm-empty .crm-empty-sub   { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
        .guest-card .guest-avatar { background: #455a64 !important; }

        .tab-content { display: none; }
        .active { display: block; }

        .scroll-wrapper { overflow-x: auto; margin-left: 370px; margin-bottom: 2px; height: 16px; background: #f9f9f9; }
        #top-scrollbar-dummy { height: 1px; }

        .tablo-alani { overflow-x: auto; max-height: 75vh; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-xs); }
        table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-family: var(--font); }

        /* --- #grid (Calendar) sticky rules -------------------------------- */
        #grid { border-collapse: separate; border-spacing: 0; }
        /* Skip painting/laying out off-screen body rows — big perf win for the ~40k-cell grid. */
        #grid tbody tr { content-visibility: auto; contain-intrinsic-size: auto 30px; }

        /* Spinner shown while the calendar table is being built */
        .cal-spinner { width: 42px; height: 42px; margin: 0 auto; border: 4px solid #e0e0e0; border-top-color: #455a64; border-radius: 50%; animation: cal-spin 0.8s linear infinite; }
        @keyframes cal-spin { to { transform: rotate(360deg); } }
        #grid th, #grid td { border: none; border-right: 1px solid #e8e8e8; border-bottom: 1px solid #e0e0e0; }
        #grid thead tr:first-child th { border-top: 1px solid #ccc; }
        #grid tr td:first-child, #grid tr th:first-child { border-left: 1px solid #ccc; }
        /* Do NOT put position:sticky on <thead> itself — each <th> has its own
           sticky + z-index via inline styles. A sticky thead creates a stacking
           context that traps children's z-index. */
        #grid thead { position: static; z-index: auto; }

        /* Non-#grid tables still get a simple sticky header */
        thead { position: sticky; top: 0; z-index: 10; }

        /* Calendar left-column sticky rules */
        .sabit-oda { position: sticky; left: 0; width: 60px; min-width: 60px; background-color: #fff; z-index: 5; box-shadow: inset -1px 0 0 0 #aaa; }
        .sabit-tur { position: sticky; left: 60px; width: 230px; min-width: 230px; background-color: #fff; z-index: 5; text-align: left; box-shadow: inset -1px 0 0 0 #aaa; }
        .sabit-kat { position: sticky; left: 290px; width: 80px; min-width: 80px; background-color: #fff; z-index: 5; box-shadow: inset -2px 0 0 0 #555, 3px 0 3px -1px rgba(0,0,0,0.15); }
        /* Header corner cells: higher z-index + dark background */
        thead th.sabit-oda { background-color: #4a4a4a !important; color: white; z-index: 60 !important; }
        thead th.sabit-tur { background-color: #4a4a4a !important; color: white; z-index: 60 !important; }
        thead th.sabit-kat { background-color: #4a4a4a !important; color: white; z-index: 60 !important; }

        /* Selection highlight states */
        .sabit-oda.row-selected, .sabit-tur.row-selected, .sabit-kat.row-selected { background-color: #ddd !important; }
        .sabit-oda.col-selected, .sabit-tur.col-selected, .sabit-kat.col-selected { background-color: #ddd !important; }
        .sabit-oda.cell-selected, .sabit-tur.cell-selected, .sabit-kat.cell-selected { background-color: #ddd !important; }

        th, td { border: 1px solid #ebeef2; padding: 7px 8px; text-align: center; white-space: nowrap; box-sizing: border-box; }

        .cell-selected { background-color: rgba(100,100,100,0.15) !important; }
        .col-highlighted { background-color: rgba(0,0,0,0.06) !important; }
        .col-selected { background-color: rgba(100,100,100,0.15); }
        .row-selected { background-color: rgba(100,100,100,0.15) !important; }
        .row-dirty   td { background-color: #ef5350 !important; color: #fff !important; }
        .row-storage td { background-color: #b71c1c !important; color: #fff !important; }
        .row-ready   td { background-color: #81c784 !important; color: #1b5e20 !important; }
        .row-custom     { }
        .input-error { border: 1px solid #e53935 !important; background-color: #fdecec !important; box-shadow: 0 0 0 3px rgba(229,57,53,0.12) !important; }

        .note-tooltip { position: relative; cursor: pointer; }
        .note-tooltip .tooltip-text { visibility: hidden; background: #1c252e; color: #fff; padding: 9px 13px; border-radius: var(--radius); font-size: 12px; position: absolute; z-index: 1000; bottom: 125%; left: 50%; transform: translateX(-50%); white-space: normal; max-width: 300px; min-width: 150px; box-shadow: var(--shadow-md); line-height: 1.45; text-align: left; }
        .note-tooltip .tooltip-text::after { content:''; position:absolute; top:100%; left:50%; margin-left:-5px; border:5px solid transparent; border-top-color: #1c252e; }
        .note-tooltip:hover .tooltip-text { visibility: visible; }

        .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; max-width: 600px; }
        .form-group { margin-bottom: 5px; }
        input[type="text"], input[type="date"], input[type="email"], input[type="tel"], input[type="number"], select, textarea {
            padding: 8px 10px; width: 100%; box-sizing: border-box;
            border: 1px solid var(--border); border-radius: var(--radius);
            outline: none; font-family: var(--font); font-size: 13px;
            color: var(--text); background: var(--surface);
            transition: border-color 0.15s, box-shadow 0.15s;
        }

        .checkbox-wrapper { display: flex; align-items: center; gap: 10px; margin-top: 5px; }
        .checkbox-wrapper input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; margin: 0; }
        .checkbox-wrapper label { cursor: pointer; font-weight: bold; }

        .btn-standart {
            padding: 8px 14px; color: white; border: none; cursor: pointer;
            font-family: var(--font); font-weight: 600; font-size: 13px; line-height: 1.2;
            border-radius: var(--radius);
            display: inline-flex; align-items: center; justify-content: center; gap: 6px;
            letter-spacing: 0.2px;
            transition: filter 0.15s, transform 0.05s, box-shadow 0.15s;
        }
        .btn-standart:hover { filter: brightness(0.94); box-shadow: var(--shadow-xs); }
        .btn-standart:active { transform: translateY(1px); }
        .btn-standart .ico { width: 14px; height: 14px; margin-right: 0; }
        .kaydet-btn { padding: 12px 28px; background: var(--primary); font-size: 14px; margin-top: 18px; }
        .today-btn { background: #f39c12; }
        .block-btn { background: #607d8b; letter-spacing: 0.3px; }
        .find-btn  { background: #00897b; }
        .clear-btn { background: #e53935; display: none; }

        .action-menu { position: relative; display: inline-block; }
        .action-btn { background: var(--text); border: 1px solid var(--text); color: #fff; font-size: 12px; cursor: pointer; padding: 5px 12px; font-weight: 600; border-radius: var(--radius); letter-spacing: 0.2px; font-family: var(--font); transition: filter 0.15s; }
        .action-btn:hover { filter: brightness(1.25); }
        .action-content { display: none; position: fixed; background-color: var(--surface); min-width: 180px; box-shadow: var(--shadow-md); z-index: 9998; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
        .action-content button { color: var(--text); padding: 10px 14px; text-decoration: none; display: block; width: 100%; border: none; background: var(--surface); text-align: left; cursor: pointer; font-size: 13px; border-bottom: 1px solid #f0f2f5; font-weight: 600; font-family: var(--font); transition: background 0.12s; }
        .action-content button:last-child { border-bottom: none; }
        .action-content button:hover { background-color: var(--surface-alt); }
        .action-content button.red-text { color: #f44336; }
        .show-menu { display: block; }

        /* Live Occupancy List — keep every row the same height */
        #detay-grid tbody tr { height: 42px; }
        #detay-grid tbody td { height: 42px; padding-top: 4px; padding-bottom: 4px; vertical-align: middle; }

        .modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15,23,42,0.55); z-index: 9999; justify-content: center; align-items: center; backdrop-filter: blur(2px); }
        .modal-content { background: var(--surface); padding: 24px 26px; border-radius: var(--radius-lg); width: 420px; max-width: 92vw; display: flex; flex-direction: column; gap: 11px; box-shadow: var(--shadow-lg); }
        .modal-content h3 { margin: 0 0 6px 0; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 600; color: var(--text); }

        .custom-dialog-content { background: var(--surface); padding: 26px 24px 20px; border-radius: var(--radius-lg); width: 380px; max-width: 92vw; text-align: center; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 18px; }
        .custom-dialog-content p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--text); font-family: var(--font); }
        .custom-dialog-btns { display: flex; gap: 10px; justify-content: center; }

        .new-record-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 28px 20px; max-width: 660px; box-shadow: var(--shadow-sm); }
        .form-section-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin: 20px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; }
        .form-group label { font-size: 12.5px; font-weight: 600; color: var(--text); display: block; margin-bottom: 5px; }
        input:focus, select:focus, textarea:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(33,150,243,0.15) !important; }

        .search-bar { padding: 9px 12px; width: 100%; max-width: 400px; margin-bottom: 15px; border: 1px solid var(--border); border-radius: var(--radius); font-family: var(--font); font-size: 13px; background: var(--surface); color: var(--text); }

        .checked-out-row { opacity: 0.55; background-color: #f5f5f5 !important; }
        .recent-bookings-panel { margin-top: 25px; max-width: 700px; border-top: 1px solid var(--border); padding-top: 15px; }
        .recent-bookings-panel h4 { color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; margin: 0 0 10px 0; }
        .recent-booking-item { display: grid; grid-template-columns: 160px 80px 1fr 90px; align-items: center; padding: 9px 14px; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 5px; cursor: pointer; font-size: 12px; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s; gap: 10px; }
        .recent-booking-item:hover { background: #eaf3fd; border-color: #90caf9; box-shadow: var(--shadow-xs); }
        .recent-booking-item .rb-name { font-weight: bold; color: #2c3e50; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .recent-booking-item .rb-room { background: #2196F3; color: white; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: bold; display: inline-block; text-align: center; }
        .recent-booking-item .rb-dates { color: #555; white-space: nowrap; }
        .recent-booking-item .rb-time { color: #999; font-size: 11px; text-align: right; }
        .sortable-header { cursor: pointer; user-select: none; transition: background 0.12s; }
        .sortable-header:hover { background-color: #5c6772 !important; }
        .ci-subtab-active { background: #2c3e50 !important; color: white !important; }

        .guest-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; display: flex; gap: 14px; align-items: flex-start; cursor: pointer; transition: box-shadow 0.2s, border-color 0.2s; margin-bottom: 8px; }
        .guest-card:hover { box-shadow: var(--shadow-sm); border-color: #90caf9; }
        .guest-avatar { width:48px; height:48px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:bold; color:white; flex-shrink:0; }
        .guest-profile-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-top: 20px; box-shadow: var(--shadow-sm); }
        .gp-stat-box { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; text-align: center; flex: 1; min-width: 90px; }
        .gp-stat-box .stat-num { font-size: 22px; font-weight: 700; color: var(--text); }
        .gp-stat-box .stat-lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; font-weight: 600; letter-spacing: 0.4px; }

/* ===== VISUAL REFRESH — scoped polish, no Calendar grid changes ===== */
:root {
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --border: #dfe5ee;
    --border-strong: #c8d2df;
    --text: #17212b;
    --text-muted: #5f6b7a;
    --text-faint: #8a97a8;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --danger: #dc2626;
    --warning: #d97706;
    --teal: #0f766e;
    --purple: #6d28d9;
    --slate: #475569;
    --shadow-xs: 0 1px 2px rgba(15,23,42,0.04);
    --shadow-sm: 0 6px 18px rgba(15,23,42,0.07);
    --shadow-md: 0 12px 28px rgba(15,23,42,0.12);
    --shadow-lg: 0 22px 60px rgba(15,23,42,0.22);
}

body {
    background:
        linear-gradient(180deg, #f9fbfd 0%, var(--bg) 42%, #f2f5f9 100%);
}

.sidebar {
    background: #182230;
    border-right: 1px solid rgba(255,255,255,0.06);
    box-shadow: 10px 0 28px rgba(15,23,42,0.12);
}
.sidebar button {
    min-height: 38px;
    color: #c8d2df;
    border: 1px solid transparent;
}
.sidebar button:hover {
    background: rgba(255,255,255,0.075);
    border-color: rgba(255,255,255,0.06);
}
.sidebar button.aktif-tab,
.sidebar button.s-subitem.aktif-tab {
    background: linear-gradient(180deg, #2f7df4, var(--primary));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 8px 16px rgba(37,99,235,0.22);
}
.sidebar button#btn-logout {
    background: rgba(220,38,38,0.14) !important;
    color: #fecaca;
    border-color: rgba(248,113,113,0.24);
}
.sidebar button#btn-logout:hover {
    background: rgba(220,38,38,0.22) !important;
    color: #fff;
}
.sidebar h3 {
    color: #7d8da1;
    letter-spacing: 0.08em;
}
.s-badge {
    background: var(--danger);
    box-shadow: 0 0 0 2px rgba(24,34,48,1);
}

.main-content {
    background: transparent;
    padding: 26px 30px;
}
.tab-content:not(#takvim) > h2,
.tab-content:not(#takvim) > div:first-child h2 {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
}
.main-content h4 {
    letter-spacing: 0.06em;
}

.new-record-card,
.guest-profile-panel,
.guest-card,
.recent-booking-item,
.tablo-alani:not(#main-tablo) {
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}
.new-record-card {
    border-radius: 8px;
}
.recent-bookings-panel {
    border-top-color: var(--border);
}

input[type="text"],
input[type="date"],
input[type="email"],
input[type="tel"],
input[type="number"],
select,
textarea,
.search-bar,
.crm-select {
    border-color: var(--border);
    background: #fff;
    min-height: 34px;
}
textarea {
    line-height: 1.4;
}
input:hover,
select:hover,
textarea:hover {
    border-color: var(--border-strong);
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.13) !important;
}
.form-section-label {
    color: var(--slate);
    letter-spacing: 0.07em;
}

.btn-standart,
.cal-btn,
.crm-tab,
.sec-quick,
.action-btn {
    border-radius: 6px;
    letter-spacing: 0;
}
.btn-standart {
    min-height: 32px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
}
.btn-standart:hover,
.cal-btn:hover {
    filter: none;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn-standart:active,
.cal-btn:active {
    transform: translateY(0);
}
.kaydet-btn,
.cal-btn-info,
.btn-standart[style*="#2196"],
.btn-standart[style*="#2196F3"],
.btn-standart[style*="#2196f3"] {
    background: var(--primary) !important;
}
.btn-standart[style*="#4CAF50"],
.btn-standart[style*="#43a047"],
.btn-standart[style*="#388E3C"] {
    background: var(--success) !important;
}
.btn-standart[style*="#f44336"],
.btn-standart[style*="#e53935"] {
    background: var(--danger) !important;
}
.btn-standart[style*="#607d8b"],
.btn-standart[style*="#455a64"],
.btn-standart[style*="#555"],
.btn-standart[style*="#888"],
.cal-btn-slate,
.cal-btn-slate-dark,
.cal-btn-muted {
    background: var(--slate) !important;
}
.cal-btn-amber {
    background: var(--warning) !important;
}
.cal-btn-purple {
    background: var(--purple) !important;
}
.cal-btn-teal {
    background: var(--teal) !important;
}

.action-btn {
    background: #253244;
    border-color: #253244;
}
.action-content {
    border-radius: 8px;
    box-shadow: var(--shadow-md);
}
.action-content button {
    font-size: 12.5px;
}

.crm-toolbar,
.filter-group,
.cal-toolbar {
    background: rgba(255,255,255,0.86);
    border-color: var(--border);
    box-shadow: var(--shadow-xs);
}
.crm-tab {
    background: #fff;
}
.crm-tab.is-active {
    background: var(--primary);
    border-color: var(--primary);
}
.crm-empty {
    background: #fff;
    border-color: var(--border);
}

/* Tables outside the room-tracking calendar grid. */
.tablo-alani:not(#main-tablo) table:not(#grid) {
    border-collapse: separate;
    border-spacing: 0;
}
.tablo-alani:not(#main-tablo) table:not(#grid) thead tr {
    background: #334155 !important;
    color: #fff !important;
}
.tablo-alani:not(#main-tablo) table:not(#grid) th {
    background: #334155;
    color: #fff;
    border-color: #334155;
    font-size: 11.5px;
    font-weight: 700;
}
.tablo-alani:not(#main-tablo) table:not(#grid) td {
    border-color: #edf1f6;
}
.tablo-alani:not(#main-tablo) table:not(#grid) tbody tr:nth-child(even) td {
    background-color: #fbfcfe;
}
.tablo-alani:not(#main-tablo) table:not(#grid) tbody tr:hover td {
    background-color: #eff6ff;
}
#arrivals-overdue-body tr td,
#arrivals-today-body tr td,
#dep-overdue-body tr td,
#dep-today-body tr td {
    background-color: #fff9c4 !important;
}
#arrivals-overdue-body tr:hover td,
#arrivals-today-body tr:hover td,
#dep-overdue-body tr:hover td,
#dep-today-body tr:hover td {
    background-color: #fff59d !important;
}
.sortable-header:hover {
    background-color: #40516a !important;
}

/* Live Occupancy filter controls need enough room for labels like "All Statuses". */
#detay-grid th:nth-child(2),
#detay-grid td:nth-child(2) {
    min-width: 128px;
}
#detay-grid tr:first-child td:nth-child(2) select {
    min-width: 118px;
    padding-right: 26px;
    text-align: center;
    text-align-last: center;
}

.modal-overlay {
    background: rgba(15,23,42,0.62);
}
.modal-content,
.custom-dialog-content {
    border: 1px solid rgba(255,255,255,0.68);
    border-radius: 10px;
}
.custom-dialog-btns .btn-standart {
    min-width: 86px;
}

#infoModal .booking-detail-modal {
    width: 640px;
    max-width: min(92vw, 640px);
    gap: 16px;
    padding: 22px;
}
#infoModal .booking-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
#infoModal .booking-detail-head h3 {
    border: 0;
    padding: 0;
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 800;
}
#infoModal .booking-detail-subtitle {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
#infoModal .booking-detail-x {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    color: var(--text);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}
#infoModal .booking-detail-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: linear-gradient(135deg, #f8fafc, #eef6ff);
}
#infoModal .booking-room-pill {
    min-width: 104px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #1f6feb;
    color: #fff;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}
#infoModal .booking-room-pill span {
    display: block;
    font-size: 26px;
    line-height: 1.1;
    margin-top: 2px;
}
#infoModal .booking-guest-name {
    color: var(--text);
    font-size: 22px;
    font-weight: 800;
}
#infoModal .booking-code-line {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}
#infoModal .booking-code-line span {
    color: var(--text);
    font-weight: 800;
}
#infoModal .booking-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
#infoModal .booking-detail-item,
#infoModal .booking-detail-long > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
}
#infoModal .booking-detail-item span,
#infoModal .booking-detail-long span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
#infoModal .booking-detail-item strong,
#infoModal .booking-detail-long strong {
    display: block;
    min-height: 20px;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}
#infoModal .booking-detail-long {
    display: grid;
    gap: 10px;
}
#infoModal .booking-detail-edit-form {
    gap: 10px;
}
#infoModal .booking-edit-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
#infoModal .booking-detail-edit-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
#infoModal .booking-detail-edit-form input,
#infoModal .booking-detail-edit-form select,
#infoModal .booking-detail-edit-form textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
#infoModal .booking-detail-edit-form input,
#infoModal .booking-detail-edit-form select {
    height: 40px;
}
#infoModal .booking-edit-wide {
    margin-top: 0;
}
#infoModal .booking-detail-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding-top: 2px;
}
#infoModal .booking-detail-close,
#infoModal .booking-detail-edit {
    justify-content: center;
    min-height: 40px;
}
#infoModal .booking-detail-close {
    background: #607d8b !important;
}
#infoModal .booking-detail-edit {
    background: #1f6feb !important;
}
#infoModal .booking-detail-save {
    justify-content: center;
    min-height: 40px;
    background: #2e7d32 !important;
}

@media (max-width: 560px) {
    #infoModal .booking-detail-modal {
        padding: 18px;
    }
    #infoModal .booking-detail-hero,
    #infoModal .booking-detail-grid,
    #infoModal .booking-edit-grid,
    #infoModal .booking-detail-actions {
        grid-template-columns: 1fr;
    }
    #infoModal .booking-room-pill {
        min-width: 0;
    }
}

#login-overlay {
    background:
        radial-gradient(circle at 50% 0%, rgba(59,130,246,0.24), transparent 38%),
        #17212f !important;
}
#login-overlay > div {
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: var(--shadow-lg) !important;
}

/* Calendar surrounding controls only; the actual room-tracking table is untouched. */
.cal-toolbar {
    border-radius: 8px;
    padding: 12px 14px;
}
.cal-toolbar-label {
    color: var(--slate);
}
.cal-toolbar input[type="date"] {
    border-color: var(--border);
}
.calendar-legend-row {
    background: rgba(255,255,255,0.7);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
}
.calendar-legend-row span {
    border-radius: 5px !important;
    font-weight: 600;
}
#occupancy-bar-area {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: var(--shadow-xs);
}

/* ===== PRINT — only one template is visible, depending on body class ===== */
@media print {
    /* Hide everything on the page */
    body > * { display: none !important; }

    /* Default print: show check-in form template */
    body:not(.printing-occupancy) #print-template { display: block !important; }
    body:not(.printing-occupancy) #print-template * { display: revert !important; visibility: visible; }

    /* Occupancy print mode: show only the occupancy template */
    body.printing-occupancy #occupancy-print-template { display: block !important; }
    body.printing-occupancy #occupancy-print-template * { display: revert !important; visibility: visible; }
    body.printing-occupancy #occupancy-print-template,
    body.printing-occupancy #occupancy-print-template * {
        background: #fff !important;
        background-color: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
    }
    body.printing-occupancy .occ-print-block { page-break-inside: auto; }
    body.printing-occupancy .occ-print-block h2 { font-size: 14pt; margin: 0 0 8px 0; font-family: Arial, sans-serif; }
    body.printing-occupancy .occ-print-block table {
        width: 100%; border-collapse: collapse; font-size: 8.5pt;
        table-layout: fixed; font-family: Arial, sans-serif;
    }
    body.printing-occupancy .occ-print-block thead { display: table-header-group; }
    body.printing-occupancy .occ-print-block tr { page-break-inside: avoid; }
    body.printing-occupancy .occ-print-block th,
    body.printing-occupancy .occ-print-block td {
        border: 1px solid #555 !important;
        padding: 3px 5px; text-align: left;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    body.printing-occupancy .occ-print-block th { font-weight: bold; }
    body.printing-occupancy .occ-print-divider {
        text-align: center; font-size: 22pt; font-weight: 900; letter-spacing: 6px;
        font-family: Arial, sans-serif; margin: 18px 0 12px 0;
        border-top: 2px solid #000 !important; border-bottom: 2px solid #000 !important;
        padding: 10px 0;
        page-break-inside: avoid; page-break-after: avoid;
    }

    /* Remove browser chrome decorations */
    @page { margin: 15mm; }
}
