/* ============================================================
   HOGAN ESTATES — ADMIN DESIGN SYSTEM
   ============================================================ */
:root {
    --adm-navy: #060A38;
    --adm-navy-2: #04072A;
    --adm-navy-light: #0E125C;
    --adm-red: #EB0101;
    --adm-red-dark: #C40000;
    --adm-bg: #ECEEF5;
    --adm-card: #FFFFFF;
    --adm-border: #DDE2F0;
    --adm-text: #0F172A;
    --adm-muted: #64748B;
    --adm-soft: #F4F6FC;
    --adm-green: #16A34A;
    --adm-amber: #D97706;
    --adm-blue: #2563EB;
    --adm-purple: #7C3AED;
    --adm-cyan: #0891B2;
    --adm-radius: 14px;
    --adm-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 4px 16px rgba(16, 24, 40, 0.06);
    --adm-shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14);
}

* { box-sizing: border-box; }

body.admin-body {
    display: flex;
    min-height: 100vh;
    margin: 0;
    background: var(--adm-bg);
    font-family: 'Poppins', 'Segoe UI', -apple-system, sans-serif;
    color: var(--adm-text);
    overflow-x: hidden;
}

body.admin-body a { text-decoration: none; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.admin-sidebar {
    width: 264px;
    background: linear-gradient(180deg, var(--adm-navy) 0%, var(--adm-navy-2) 100%);
    color: #B0B7E8;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
    z-index: 100;
    border-right: 1px solid rgba(255,255,255,0.04);
}

/* Scrollable menu area with hidden scrollbar */
.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 12px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.sidebar-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #FFF;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-brand .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--adm-red);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 6px 14px rgba(235, 1, 1, 0.4);
}

.admin-brand .brand-logo {
    height: 44px;
    width: auto;
    display: block;
}

.admin-brand .brand-text { line-height: 1.1; }
.admin-brand .brand-sub { display: block; font-size: 10px; font-weight: 600; letter-spacing: 2.5px; color: #7C84D9; }

.sidebar-section {
    padding: 18px 22px 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.8px;
    color: #6A72C4;
    text-transform: uppercase;
}

.admin-menu {
    list-style: none;
    margin: 0;
    padding: 4px 12px 20px;
}

.admin-menu li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    margin-bottom: 3px;
    color: #AEB4E8;
    font-weight: 500;
    font-size: 14px;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.admin-menu li a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    transition: all 0.2s ease;
}

.admin-menu li a:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #FFF;
}

.admin-menu li a.active {
    background: var(--adm-red);
    color: #FFF;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(235, 1, 1, 0.35);
}

.admin-menu li a.logout-link { color: #FCA5A5; }
.admin-menu li a.logout-link:hover { background: rgba(220, 38, 38, 0.18); color: #FFF; }

.sidebar-foot {
    margin-top: auto;
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    color: #7C84D9;
}

/* ============================================================
   MAIN / TOPBAR
   ============================================================ */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100vh;
    overflow-y: auto;
}

.admin-topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--adm-border);
    position: sticky;
    top: 0;
    z-index: 90;
}

.topbar-title h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: var(--adm-text);
}

.topbar-title p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--adm-muted);
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--adm-soft);
    border: 1px solid var(--adm-border);
    padding: 6px 14px 6px 6px;
    border-radius: 999px;
}

.user-chip .avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--adm-navy);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.user-chip .chip-name { font-size: 13px; font-weight: 600; color: var(--adm-text); line-height: 1.15; }
.user-chip .chip-role { font-size: 11px; color: var(--adm-muted); text-transform: capitalize; }

.admin-content {
    padding: 28px;
    flex-grow: 1;
    max-width: 1600px;
    width: 100%;
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.flash-msg {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid transparent;
    animation: fadeInStep 0.3s ease;
}

.flash-success { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.flash-error { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

/* ============================================================
   STAT CARDS
   ============================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 26px;
}

.stat-card {
    background: var(--adm-card);
    padding: 20px;
    border-radius: var(--adm-radius);
    box-shadow: var(--adm-shadow);
    border: 1px solid var(--adm-border);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--adm-shadow-lg);
}

.stat-sub {
    display: block;
    font-size: 11.5px;
    color: var(--adm-muted);
    margin-top: 2px;
    font-weight: 500;
}

.stat-card[data-open-modal]:hover .stat-sub {
    color: var(--adm-accent, #4F46E5);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 21px;
    flex-shrink: 0;
}

.stat-icon.red { background: #FEE2E2; color: #DC2626; }
.stat-icon.navy { background: #E0E7FF; color: #3730A3; }
.stat-icon.green { background: #DCFCE7; color: #16A34A; }
.stat-icon.blue { background: #DBEAFE; color: #2563EB; }
.stat-icon.amber { background: #FEF3C7; color: #D97706; }
.stat-icon.purple { background: #EDE9FE; color: #7C3AED; }
.stat-icon.cyan { background: #CFFAFE; color: #0891B2; }

.stat-info { min-width: 0; }
.stat-info h3 {
    font-size: 26px;
    font-weight: 800;
    margin: 0;
    line-height: 1.1;
    color: var(--adm-text);
}

.stat-info p {
    margin: 2px 0 0;
    color: var(--adm-muted);
    font-size: 13px;
    font-weight: 500;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    font-weight: 700;
    margin-top: 5px;
    padding: 2px 8px;
    border-radius: 999px;
}

.stat-trend.up { background: #DCFCE7; color: #15803D; }
.stat-trend.warn { background: #FEF3C7; color: #B45309; }

/* ============================================================
   PANELS / CARDS
   ============================================================ */
.panel {
    background: var(--adm-card);
    border-radius: var(--adm-radius);
    border: 1px solid var(--adm-border);
    box-shadow: var(--adm-shadow);
    overflow: hidden;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--adm-border);
    flex-wrap: wrap;
}

.panel-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--adm-text);
}

.panel-sub {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: var(--adm-muted);
}

.panel-body { padding: 22px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-admin {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    background: var(--adm-red);
    color: #FFF;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.btn-admin:hover { background: var(--adm-red-dark); box-shadow: 0 8px 18px rgba(235, 1, 1, 0.3); transform: translateY(-1px); }

.btn-admin-secondary {
    background: var(--adm-navy);
}
.btn-admin-secondary:hover { background: var(--adm-navy-2); box-shadow: 0 8px 18px rgba(14, 18, 92, 0.25); }

.btn-admin-success { background: var(--adm-green); }
.btn-admin-success:hover { background: #15803D; box-shadow: 0 8px 18px rgba(22, 163, 74, 0.3); }

.btn-admin-danger { background: #DC2626; }
.btn-admin-danger:hover { background: #B91C1C; box-shadow: 0 8px 18px rgba(220, 38, 38, 0.3); }

.btn-admin-outline {
    background: #FFF;
    color: var(--adm-navy);
    border: 1.5px solid var(--adm-border);
}
.btn-admin-outline:hover { background: var(--adm-soft); border-color: #CBD5E1; transform: none; box-shadow: none; }

.btn-admin-sm { padding: 7px 13px; font-size: 12.5px; border-radius: 8px; }
.btn-admin-lg { padding: 14px 26px; font-size: 15px; }

/* ============================================================
   FORMS
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.filter-group,
.form-group {
    margin-bottom: 16px;
}

.filter-group label,
.form-group label,
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--adm-text);
    background: #FFF;
    border: 1.5px solid #D3DAE8;
    border-radius: 10px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--adm-navy);
    box-shadow: 0 0 0 3px rgba(14, 18, 92, 0.12);
}

textarea.form-control { resize: vertical; min-height: 90px; }

.form-hint { font-size: 12px; color: var(--adm-muted); margin-top: 5px; }

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch .slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #CBD5E1;
    border-radius: 999px;
    transition: 0.25s;
}

.switch .slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #FFF;
    border-radius: 50%;
    transition: 0.25s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.switch input:checked + .slider { background: var(--adm-green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* File upload */
.file-drop {
    border: 2px dashed #CBD5E1;
    border-radius: 12px;
    padding: 26px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--adm-soft);
    color: var(--adm-muted);
}

.file-drop:hover { border-color: var(--adm-navy); background: #EEF2FF; }
.file-drop i { font-size: 26px; display: block; margin-bottom: 8px; color: var(--adm-navy); }
.file-drop strong { color: var(--adm-navy); }

/* ============================================================
   BADGES
   ============================================================ */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-badge.for-sale { background: #DCFCE7; color: #15803D; }
.status-badge.to-let { background: #DBEAFE; color: #1D4ED8; }
.status-badge.sale-agreed { background: #FEF3C7; color: #B45309; }
.status-badge.let-agreed { background: #FEF9C3; color: #A16207; }
.status-badge.sold { background: #FEE2E2; color: #B91C1C; }
.status-badge.featured { background: #FCE7F3; color: #BE185D; }
.status-badge.draft { background: #F1F5F9; color: #475569; }
.status-badge.admin { background: #E0E7FF; color: #3730A3; }
.status-badge.agent { background: #F1F5F9; color: #475569; }
.status-badge.danger { background: #FEE2E2; color: #B91C1C; }
.status-badge.success { background: #DCFCE7; color: #15803D; }
.status-badge.info { background: #DBEAFE; color: #1D4ED8; }
.status-badge.warn { background: #FEF3C7; color: #B45309; }

/* ============================================================
   TABLES
   ============================================================ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

.data-table th, .data-table td {
    padding: 13px 16px;
    text-align: left;
    border-bottom: 1px solid var(--adm-border);
    font-size: 13.5px;
    vertical-align: middle;
}

.data-table th {
    background: var(--adm-soft);
    font-weight: 700;
    font-size: 11.5px;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: #64748B;
    position: sticky;
    top: 0;
}

.data-table tbody tr {
    transition: background 0.15s ease;
}

.data-table tbody tr:hover { background: #F8FAFF; }
.data-table tbody tr.selected { background: #EEF2FF; }

.data-table td:first-child { border-top-left-radius: 0; }

.prop-thumb {
    width: 56px;
    height: 42px;
    border-radius: 8px;
    object-fit: cover;
    background: #E2E8F0;
    display: block;
}

.cell-title { font-weight: 600; color: var(--adm-text); }
.cell-muted { color: var(--adm-muted); font-size: 12.5px; }

.row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    white-space: nowrap;
}

.row-actions a, .row-actions button {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 13px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--adm-soft);
    color: var(--adm-muted);
}

.row-actions .act-view { color: var(--adm-blue); }
.row-actions .act-edit { color: var(--adm-navy); }
.row-actions .act-del { color: #DC2626; }
.row-actions a:hover, .row-actions button:hover { background: var(--adm-border); transform: translateY(-1px); }
.row-actions .act-del:hover { background: #FEE2E2; }

/* Row checkbox */
.row-check, .check-all { width: 17px; height: 17px; accent-color: var(--adm-red); cursor: pointer; }

/* ============================================================
   BULK ACTION BAR
   ============================================================ */
.bulk-bar {
    display: none;
    align-items: center;
    gap: 12px;
    background: var(--adm-navy);
    color: #FFF;
    padding: 10px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 8px 20px rgba(14, 18, 92, 0.3);
    animation: fadeInStep 0.25s ease;
    flex-wrap: wrap;
}

.bulk-bar.show { display: flex; }

.bulk-bar .bulk-count { font-size: 13px; font-weight: 600; }
.bulk-bar select {
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    background: #FFF;
    color: var(--adm-text);
    min-width: 180px;
}

.bulk-bar .btn-admin-sm { background: var(--adm-red); }
.bulk-bar .btn-clear { background: transparent; border: 1px solid rgba(255,255,255,0.3); color: #FFF; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.pagination a, .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    background: #FFF;
    color: var(--adm-navy);
    border: 1px solid var(--adm-border);
    transition: all 0.15s ease;
}

.pagination a:hover { border-color: var(--adm-navy); background: #EEF2FF; }

.pagination .current {
    background: var(--adm-red);
    border-color: var(--adm-red);
    color: #FFF;
    box-shadow: 0 6px 14px rgba(235, 1, 1, 0.3);
}

.pagination .dots { border: none; background: none; color: var(--adm-muted); }

/* ============================================================
   TOOLBAR (search / filter row above tables)
   ============================================================ */
.toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar .search-box {
    flex: 1;
    min-width: 220px;
    position: relative;
}

.toolbar .search-box i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--adm-muted);
    font-size: 14px;
}

.toolbar .search-box input { padding-left: 40px; }

.toolbar select { min-width: 160px; }

/* ============================================================
   WIZARD (property form)
   ============================================================ */
.wizard-progress {
    display: flex;
    gap: 6px;
    margin: 4px 0 26px;
}

.wizard-progress .step {
    flex: 1;
    height: 6px;
    border-radius: 999px;
    background: #E2E8F0;
    transition: background 0.3s ease;
}

.wizard-progress .step.active { background: var(--adm-red); }
.wizard-progress .step.done { background: var(--adm-green); }

.wizard-tabs-nav {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid var(--adm-border);
    margin-bottom: 28px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.wizard-tab-btn {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--adm-muted);
    padding: 13px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}

.wizard-tab-btn .step-num {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: #E2E8F0;
    color: var(--adm-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.25s ease;
}

.wizard-tab-btn:hover { color: var(--adm-navy); }

.wizard-tab-btn.active {
    color: var(--adm-red);
    border-bottom-color: var(--adm-red);
}

.wizard-tab-btn.active .step-num { background: var(--adm-red); color: #FFF; }

.wizard-tab-btn.done .step-num { background: var(--adm-green); color: #FFF; }

.wizard-tab-pane { display: none; }
.wizard-tab-pane.active { display: block; animation: fadeInStep 0.35s ease-in-out; }

@keyframes fadeInStep {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MODAL
   ============================================================ */
.admin-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 9999;
    padding: 20px;
}

.admin-modal.is-open { opacity: 1; pointer-events: auto; }

.admin-modal-box {
    background: var(--adm-card);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    padding: 30px;
    box-shadow: var(--adm-shadow-lg);
    transform: scale(0.92) translateY(10px);
    transition: all 0.3s ease;
}

.admin-modal.is-open .admin-modal-box { transform: scale(1) translateY(0); }

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: var(--adm-soft);
    color: var(--adm-muted);
    cursor: pointer;
    font-size: 14px;
}

/* ============================================================
   QUICK ACTIONS
   ============================================================ */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
}

.quick-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    background: var(--adm-card);
    border: 1px solid var(--adm-border);
    border-radius: var(--adm-radius);
    padding: 18px;
    color: var(--adm-text);
    transition: all 0.2s ease;
    box-shadow: var(--adm-shadow);
}

.quick-card i { font-size: 20px; color: var(--adm-red); }
.quick-card span { font-size: 13px; font-weight: 600; }
.quick-card small { font-size: 11.5px; color: var(--adm-muted); }
.quick-card:hover { transform: translateY(-3px); box-shadow: var(--adm-shadow-lg); border-color: var(--adm-red); }

/* Breakdown bars */
.breakdown { display: flex; flex-direction: column; gap: 14px; }
.breakdown-row { display: flex; align-items: center; gap: 12px; }
.breakdown-row .bd-label { width: 110px; font-size: 12.5px; font-weight: 600; color: var(--adm-muted); }
.breakdown-row .bd-bar { flex: 1; height: 10px; background: #E2E8F0; border-radius: 999px; overflow: hidden; }
.breakdown-row .bd-fill { height: 100%; border-radius: 999px; }
.breakdown-row .bd-count { width: 40px; text-align: right; font-weight: 700; font-size: 13px; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--adm-muted);
}

.empty-state i { font-size: 44px; color: #CBD5E1; margin-bottom: 14px; }
.empty-state h4 { font-size: 17px; font-weight: 700; color: var(--adm-text); margin: 0 0 6px; }
.empty-state p { font-size: 13.5px; margin: 0 0 18px; }

/* ============================================================
   TWO-COLUMN LAYOUT
   ============================================================ */
.admin-grid-2 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 22px;
    align-items: start;
}

.admin-grid-2-rev { grid-template-columns: 2fr 1fr; }

/* ============================================================
   DASHBOARD GREETING / HERO
   ============================================================ */
.dash-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    background: linear-gradient(120deg, #0E125C 0%, #1A2185 60%, #7C3AED 130%);
    color: #FFF;
    border-radius: var(--adm-radius);
    padding: 26px 30px;
    margin-bottom: 24px;
    box-shadow: 0 12px 30px rgba(14, 18, 92, 0.25);
    flex-wrap: wrap;
}

.dash-hero h2 { margin: 0; font-size: 24px; font-weight: 800; }
.dash-hero p { margin: 4px 0 0; color: rgba(255, 255, 255, 0.7); font-size: 13.5px; }
.dash-hero .hero-date { text-align: right; font-size: 13px; color: rgba(255, 255, 255, 0.8); }
.dash-hero .hero-date b { display: block; font-size: 18px; font-weight: 700; color: #FFF; }

/* ============================================================
   BAR CHART (monthly listings)
   ============================================================ */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    height: 240px;
    padding: 10px 4px 0;
}

.bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    gap: 8px;
    min-width: 0;
}

.bar-val { font-size: 12.5px; font-weight: 700; color: var(--adm-navy); }

.bar-track {
    width: 100%;
    max-width: 48px;
    height: 180px;
    background: #EEF2FF;
    border-radius: 8px 8px 4px 4px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.bar-fill {
    width: 100%;
    background: linear-gradient(180deg, #2A33A8, #0E125C);
    border-radius: 8px 8px 4px 4px;
    min-height: 2px;
    transition: height 0.6s ease;
}

.bar-col:hover .bar-fill { background: linear-gradient(180deg, #EB0101, #C40000); }
.bar-label { font-size: 11px; color: var(--adm-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* ============================================================
   DONUT CHART (status distribution)
   ============================================================ */
.donut-wrap {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
    justify-content: center;
}

.donut {
    width: 190px;
    height: 190px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.donut::before {
    content: "";
    position: absolute;
    inset: 24px;
    background: #FFF;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #E5E9F2;
}

.donut-center { position: relative; z-index: 1; text-align: center; }
.donut-center b { display: block; font-size: 30px; font-weight: 800; color: var(--adm-text); line-height: 1; }
.donut-center span { font-size: 11.5px; color: var(--adm-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }

.legend { display: flex; flex-direction: column; gap: 10px; min-width: 170px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.legend-item .dot { width: 12px; height: 12px; border-radius: 4px; flex-shrink: 0; }
.legend-item .lg-label { flex: 1; color: var(--adm-muted); font-weight: 500; }
.legend-item .lg-val { font-weight: 700; color: var(--adm-text); }
.legend-item .lg-pct { color: var(--adm-muted); font-size: 12px; width: 42px; text-align: right; }

/* ============================================================
   TOP AGENTS
   ============================================================ */
.agent-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--adm-border);
}

.agent-row:last-child { border-bottom: none; }

.agent-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, #0E125C, #1A2185);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.agent-row .grow { flex: 1; min-width: 0; }
.agent-row .grow b { font-size: 14px; color: var(--adm-text); display: block; }
.agent-row .grow span { font-size: 12px; color: var(--adm-muted); }
.agent-row .cnt { font-weight: 800; color: var(--adm-red); font-size: 14px; text-align: right; }
.agent-row .cnt small { display: block; font-size: 10.5px; color: var(--adm-muted); font-weight: 600; }

/* ============================================================
   STAT CHIPS (inquiry pipeline)
   ============================================================ */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-chip {
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    display: flex;
    gap: 8px;
    align-items: center;
    border: 1px solid transparent;
}
.stat-chip b { font-size: 15px; font-weight: 800; }
.stat-chip.new { background: #DBEAFE; color: #1D4ED8; border-color: #BFDBFE; }
.stat-chip.read { background: #F1F5F9; color: #475569; border-color: #E2E8F0; }
.stat-chip.replied { background: #DCFCE7; color: #15803D; border-color: #BBF7D0; }

/* ============================================================
   THREE-COLUMN GRID
   ============================================================ */
.admin-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
    align-items: start;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1199px) {
    .admin-grid-3 { grid-template-columns: 1fr 1fr; }
    .bar-chart { height: 200px; }
    .bar-track { height: 140px; }
    .admin-grid-2, .admin-grid-2-rev { grid-template-columns: 1fr; }
}



@media (max-width: 520px) {
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { flex-direction: column; align-items: flex-start; gap: 10px; padding: 16px; }
    .stat-info h3 { font-size: 21px; }
    .user-chip .chip-name, .user-chip .chip-role { display: none; }
    .user-chip { padding: 6px; }
}

/* ============================================================
   TOPBAR ICONS & PROFILE DROPDOWN
   ============================================================ */
.topbar-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--adm-border);
    background: #FFF;
    color: var(--adm-navy);
    font-size: 15px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.topbar-icon-btn:hover {
    background: var(--adm-navy);
    color: #FFF;
    border-color: var(--adm-navy);
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(14, 18, 92, 0.25);
}

.topbar-add-btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 11px;
    font-weight: 600;
}

.profile-dropdown { position: relative; }
.profile-btn {
    height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: #FFF;
    border: 1px solid var(--adm-border);
    border-radius: 11px;
    padding: 4px 12px 4px 5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    max-width: 190px;
}
.profile-btn:hover { border-color: #C9D2E3; background: var(--adm-soft); }
.profile-btn:focus { outline: none; border-color: var(--adm-navy); }
.profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--adm-navy);
    color: #FFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
    flex-shrink: 0;
}
.profile-avatar-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.profile-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--adm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-caret { font-size: 10px; color: var(--adm-muted); }
.profile-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 210px;
    background: #FFF;
    border: 1px solid var(--adm-border);
    border-radius: 13px;
    box-shadow: var(--adm-shadow-lg);
    padding: 8px;
    display: none;
    z-index: 120;
}
.profile-menu.open { display: block; animation: dropdownIn 0.16s ease; }
@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}
.profile-menu a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--adm-text);
    transition: background 0.15s ease;
}
.profile-menu a i { width: 17px; text-align: center; color: var(--adm-muted); }
.profile-menu a:hover { background: var(--adm-soft); color: var(--adm-navy); }
.profile-menu a:hover i { color: var(--adm-navy); }
.profile-menu a.profile-logout { color: #DC2626; }
.profile-menu a.profile-logout i { color: #DC2626; }
.profile-menu a.profile-logout:hover { background: #FEF2F2; }
.profile-divider { border-top: 1px solid var(--adm-border); margin: 6px 4px; }

/* ============================================================
   PAGE TOOLBAR (new admin pages)
   ============================================================ */
.page-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}
.page-toolbar-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--adm-text);
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.page-toolbar .panel-sub { margin: 0; }

/* ============================================================
   FORM GRID & INLINE HELPERS
   ============================================================ */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 20px;
}
.form-hint { font-size: 12px; color: var(--adm-muted); display: block; margin-top: 6px; line-height: 1.5; }
.check-inline {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--adm-text);
    cursor: pointer;
    margin-top: 14px;
}
.check-inline input { width: 16px; height: 16px; accent-color: var(--adm-navy); }

.user-avatar-img {
    width: 38px; height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #FFF;
    box-shadow: 0 2px 6px rgba(16, 24, 40, 0.15);
    flex-shrink: 0;
}

.row-action {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--adm-border);
    background: #FFF;
    border-radius: 8px;
    color: var(--adm-navy);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
}
.row-action:hover { background: var(--adm-navy); color: #FFF; border-color: var(--adm-navy); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(14, 18, 92, 0.2); }
.row-action-danger { color: #DC2626; }
.row-action-danger:hover { background: #DC2626; border-color: #DC2626; color: #FFF; box-shadow: 0 4px 10px rgba(220, 38, 38, 0.25); }

.audit-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--adm-muted);
    line-height: 1.4;
}
.audit-cell i { color: #94A3B8; margin-right: 4px; font-size: 11px; }

/* ============================================================
   MODAL SYSTEM
   ============================================================ */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(3px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 48px 20px 20px;
    z-index: 1000;
    overflow-y: auto;
}
.modal-backdrop.open { display: flex; }
.modal {
    background: #FFF;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
    width: 100%;
    max-width: 560px;
    animation: modalIn 0.2s ease;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
    overflow: hidden;
}
.modal-sm { max-width: 460px; }
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 1060px; }
@keyframes modalIn {
    from { opacity: 0; transform: translateY(14px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--adm-border);
}
.modal-title { font-size: 16px; font-weight: 700; margin: 0; color: var(--adm-text); }
.modal-close {
    width: 32px; height: 32px;
    border: none;
    background: var(--adm-soft);
    border-radius: 9px;
    color: var(--adm-muted);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
}
.modal-close:hover { background: #FEE2E2; color: #DC2626; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.user-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--adm-border);
    flex-shrink: 0;
}
.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 22px;
    border-top: 1px solid var(--adm-border);
    background: var(--adm-soft);
    border-radius: 0 0 16px 16px;
}
.confirm-icon {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #FEF3C7;
    color: #D97706;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 16px;
}
.confirm-message { text-align: center; font-size: 14px; color: var(--adm-text); line-height: 1.65; margin: 0; }

/* ============================================================
   AMENITIES
   ============================================================ */
.amenity-icon {
    width: 36px; height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--adm-soft);
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    color: var(--adm-navy);
    font-size: 14px;
}
.amenity-icon-lg { width: 44px; height: 44px; font-size: 17px; flex-shrink: 0; }

/* ============================================================
   SETTINGS PAGE
   ============================================================ */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}
.settings-grid .panel:last-child { grid-column: 1 / -1; }
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--adm-border);
}
.setting-row:last-of-type { border-bottom: none; }
.setting-row strong { font-size: 14px; color: var(--adm-text); }
.setting-row p { margin: 4px 0 0; }

.switch { position: relative; display: inline-block; width: 46px; height: 25px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #CBD5E1;
    border-radius: 999px;
    transition: all 0.25s ease;
}
.switch-slider::before {
    content: '';
    position: absolute;
    width: 19px; height: 19px;
    left: 3px; top: 3px;
    background: #FFF;
    border-radius: 50%;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider { background: var(--adm-green); }
.switch input:checked + .switch-slider::before { transform: translateX(21px); }
.switch input:focus-visible + .switch-slider { outline: 2px solid var(--adm-navy); outline-offset: 2px; }

.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.color-picker-row { display: flex; align-items: center; gap: 10px; }
.color-picker-row input[type="color"] {
    width: 44px; height: 42px;
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    background: #FFF;
    padding: 3px;
    cursor: pointer;
    flex-shrink: 0;
}

.logo-upload { display: flex; flex-direction: column; gap: 10px; }
.logo-preview {
    height: 56px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    border: 1px dashed var(--adm-border);
    border-radius: 10px;
    padding: 8px 14px;
    background: #FFF;
}
.logo-preview-dark { background: #FFF; }

.api-key-box {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    background: #0E125C;
    color: #B7C3FF;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    word-break: break-all;
}
.api-key-box code { color: #E4E9FF; }
.api-endpoint {
    background: var(--adm-soft);
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 12px;
}
.api-endpoint strong { display: block; font-size: 12px; color: var(--adm-muted); margin-bottom: 5px; }
.api-endpoint code { font-size: 13px; color: var(--adm-navy); word-break: break-all; }
.api-example {
    margin-top: 14px;
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    background: var(--adm-soft);
    padding: 12px 14px;
}
.api-example summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--adm-navy); }
.api-example pre {
    background: #0F172A;
    color: #E2E8F0;
    border-radius: 8px;
    padding: 14px;
    font-size: 12px;
    overflow-x: auto;
    margin: 12px 0 0;
    line-height: 1.6;
}
.method-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    letter-spacing: 0.3px;
}
.method-get { background: #DCFCE7; color: #15803D; }
.method-post { background: #DBEAFE; color: #1D4ED8; }
.method-put { background: #FEF3C7; color: #B45309; }
.method-delete { background: #FEE2E2; color: #B91C1C; }
/* ============================================================
   SETTINGS PAGE (ACP-Style)
   ============================================================ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 20px;
    align-items: start;
}
.settings-grid .s-card-full { grid-column: 1 / -1; }

.settings-tabs {
    display: flex;
    gap: 6px;
    padding: 6px;
    background: #FFF;
    border: 1px solid var(--adm-border);
    border-radius: 14px;
    box-shadow: var(--adm-shadow);
    margin-bottom: 26px;
    overflow-x: auto;
}
.settings-tabs .tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    font-family: inherit;
    color: var(--adm-muted);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.settings-tabs .tab-btn i { font-size: 14px; transition: color 0.25s ease; }
.settings-tabs .tab-btn:hover { background: var(--adm-soft); color: #334155; }
.settings-tabs .tab-btn.active {
    background: linear-gradient(135deg, #0E125C, #162544);
    color: #FFF;
    box-shadow: 0 4px 14px rgba(11, 25, 44, 0.35);
}
.settings-tabs .tab-btn.active i { color: #D4AF37; }

.settings-section { display: none; }
.settings-section.active { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.s-card {
    background: #FFF;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(16, 24, 40, 0.06);
    border: 1px solid var(--adm-border);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.s-card:hover { box-shadow: 0 4px 16px rgba(16, 24, 40, 0.08); }
.s-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--adm-soft);
}
.s-card-header .icon-wrap {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}
.s-card-header .icon-wrap.primary { background: rgba(37, 99, 235, 0.1); color: #1D4ED8; }
.s-card-header .icon-wrap.success { background: rgba(22, 163, 74, 0.1); color: #059669; }
.s-card-header .icon-wrap.danger { background: rgba(220, 38, 38, 0.1); color: #DC2626; }
.s-card-header .icon-wrap.info { background: rgba(14, 165, 233, 0.1); color: #0284C7; }
.s-card-header .icon-wrap.warning { background: rgba(245, 158, 11, 0.12); color: #D97706; }
.s-card-header .icon-wrap.navy { background: rgba(14, 18, 92, 0.08); color: #0E125C; }
.s-card-header .text-block h6 { margin: 0; font-size: 14px; font-weight: 700; color: var(--adm-text); }
.s-card-header .text-block p { margin: 2px 0 0; font-size: 12px; color: var(--adm-muted); }
.s-card-body { padding: 20px 24px 24px; }

/* Form fields */
.s-field label { display: block; font-size: 12px; font-weight: 600; color: #475569; margin-bottom: 5px; }
.s-field .help { font-size: 11.5px; color: var(--adm-muted); margin-top: 4px; line-height: 1.4; }
.s-field input[type=text],
.s-field input[type=email],
.s-field input[type=number],
.s-field input[type=date],
.s-field input[type=password],
.s-field select {
    width: 100%;
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1E293B;
    background: #FFF;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.s-field input:focus, .s-field select:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Spacing helpers (no Bootstrap in admin) */
.mb-0 { margin-bottom: 0 !important; }
.mb-3 { margin-bottom: 12px !important; }

/* Color picker */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--adm-soft);
    border-radius: 12px;
    border: 1px solid var(--adm-border);
    transition: border-color 0.2s;
}
.color-picker-row:hover { border-color: #CBD5E1; }
.color-picker-row .swatch {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 2px solid var(--adm-border);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.color-picker-row .swatch:hover { transform: scale(1.08); box-shadow: 0 2px 8px rgba(16, 24, 40, 0.12); }
.color-picker-row .swatch input[type=color] {
    position: absolute;
    top: -6px; left: -6px;
    width: calc(100% + 12px);
    height: calc(100% + 12px);
    border: none;
    cursor: pointer;
    opacity: 0;
}
.color-picker-row .meta { flex: 1; min-width: 0; }
.color-picker-row .meta .label { font-size: 12.5px; font-weight: 600; color: #334155; display: block; margin-bottom: 2px; }
.color-picker-row .meta .desc { font-size: 11px; color: var(--adm-muted); display: block; }
.color-picker-row .hex-input {
    width: 100px;
    font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    border: 1px solid var(--adm-border);
    border-radius: 8px;
    padding: 6px 8px;
    color: #334155;
    background: #FFF;
    text-transform: uppercase;
    transition: border-color 0.2s;
}
.color-picker-row .hex-input:focus {
    outline: none;
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Info callout */
.info-callout {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.5;
    margin-bottom: 16px;
}
.info-callout.info { background: #F0F9FF; border: 1px solid #BAE6FD; color: #0369A1; }
.info-callout.success { background: #F0FDF4; border: 1px solid #BBF7D0; color: #166534; }
.info-callout.warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.info-callout.danger { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }
.info-callout i { margin-top: 2px; flex-shrink: 0; }

/* Toggle switch */
.s-toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    padding: 14px 16px;
    background: var(--adm-soft);
    border-radius: 12px;
    border: 1px solid var(--adm-border);
    transition: all 0.25s;
}
.s-toggle:hover { border-color: #CBD5E1; }
.s-toggle input { display: none; }
.s-toggle .track {
    width: 46px;
    height: 26px;
    background: #CBD5E1;
    border-radius: 13px;
    position: relative;
    transition: background 0.25s;
    flex-shrink: 0;
}
.s-toggle .track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 20px; height: 20px;
    background: #FFF;
    border-radius: 50%;
    transition: transform 0.25s;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.15);
}
.s-toggle input:checked + .track { background: #1D4ED8; }
.s-toggle input:checked + .track::after { transform: translateX(20px); }
.s-toggle .toggle-text { flex: 1; }
.s-toggle .toggle-text .tt-title { font-size: 13px; font-weight: 600; color: #1E293B; }
.s-toggle .toggle-text .tt-desc { font-size: 11.5px; color: var(--adm-muted); margin-top: 2px; line-height: 1.45; }
.s-toggle code { background: #EEF2FF; color: #3730A3; padding: 1px 5px; border-radius: 5px; font-size: 11px; }

/* Logo upload */
.logo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}
.logo-upload-zone {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    background: var(--adm-soft);
    border: 2px dashed var(--adm-border);
    border-radius: 12px;
    transition: border-color 0.2s, background 0.2s;
    cursor: pointer;
}
.logo-upload-zone:hover { border-color: #2563EB; background: #F0F7FF; }
.logo-upload-zone .zone-preview {
    width: 64px; height: 48px;
    border-radius: 10px;
    background: #0E125C;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.logo-upload-zone .zone-img {
    max-width: 90%;
    max-height: 70%;
    object-fit: contain;
}
.logo-upload-zone .text-block { flex: 1; min-width: 0; }
.logo-upload-zone .text-block .tt { font-size: 12.5px; font-weight: 600; color: #334155; }
.logo-upload-zone .text-block .td { font-size: 11px; color: var(--adm-muted); margin-top: 2px; }

/* Save bar */
.save-bar {
    position: sticky;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--adm-border);
    padding: 16px 28px;
    margin: 24px -28px 0;
}
.save-bar .btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 32px;
    font-weight: 700;
    font-size: 13.5px;
    font-family: inherit;
    border-radius: 10px;
    background: linear-gradient(135deg, #1D4ED8, #2563EB);
    border: none;
    color: #FFF;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.3);
    transition: all 0.2s;
}
.save-bar .btn-save:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(29, 78, 216, 0.4);
    background: linear-gradient(135deg, #1E40AF, #1D4ED8);
}
.save-bar .btn-save:active { transform: translateY(0); }
.save-status { font-size: 12px; color: var(--adm-muted); }

/* API How-to steps */
.api-step {
    display: flex;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px dashed var(--adm-border);
}
.api-step:last-of-type { border-bottom: none; padding-bottom: 4px; }
.api-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0E125C, #162544);
    color: #D4AF37;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}
.api-step-body { flex: 1; min-width: 0; }
.api-step-body h6 { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--adm-text); }
.api-step-body p { margin: 0 0 10px; font-size: 12.5px; color: var(--adm-muted); line-height: 1.55; }
.api-step-body p code, .info-callout code { background: #EEF2FF; color: #3730A3; padding: 1px 5px; border-radius: 5px; font-size: 11.5px; }
.api-code {
    background: #0F172A;
    color: #E2E8F0;
    border-radius: 8px;
    padding: 14px;
    font-size: 12px;
    overflow-x: auto;
    margin: 10px 0 0;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .settings-tabs .tab-btn { padding: 10px 12px; font-size: 12px; }
    .s-card-body { padding: 16px; }
    .color-picker-row { flex-wrap: wrap; }
    .color-picker-row .hex-input { width: 100%; }
    .save-bar { margin: 20px -14px 0; padding: 14px; }
}
.key-mask { background: var(--adm-soft); padding: 3px 8px; border-radius: 6px; font-size: 12px; }

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-layout {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: 22px;
    align-items: start;
}
.profile-avatar-block {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--adm-border);
}
.profile-page-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--adm-navy);
    color: #FFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    border: 3px solid #FFF;
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.18);
    flex-shrink: 0;
}

/* ============================================================
   FLASH INFO
   ============================================================ */
.flash-info {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1E40AF;
}

/* ============================================================
   DASHBOARD POLISH
   ============================================================ */
.dash-hero {
    border-radius: 18px;
    padding: 28px 30px;
    background: linear-gradient(120deg, var(--adm-navy) 0%, var(--adm-navy-2) 60%, #EB0101 135%);
    color: #FFF;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    box-shadow: 0 14px 34px rgba(14, 18, 92, 0.28);
    margin-bottom: 24px;
}
.stat-card {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--adm-shadow-lg);
}
.agent-row {
    transition: background 0.15s ease;
}
.agent-row:hover { background: #F8FAFF; }

/* Responsive additions */
.admin-mobile-toggle {
    display: none;
    background: var(--adm-soft);
    border: 1px solid var(--adm-border);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    font-size: 18px;
    color: var(--adm-navy);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-close-mobile {
    display: none;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #FFF;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.admin-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(14, 18, 92, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99988;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.admin-sidebar-overlay.is-open {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* Wizard Tabs Touch Scrolling */
.wizard-tabs-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 6px;
}
.wizard-tabs-nav::-webkit-scrollbar { display: none; }
.wizard-tab-btn {
    flex-shrink: 0;
}

/* Stat Grid Layout */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}


@media (max-width: 1199px) {
    .settings-grid { grid-template-columns: 1fr; }
    .settings-grid .panel:last-child { grid-column: auto; }
    .profile-layout { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
    body.admin-body {
        flex-direction: column;
    }

    .admin-mobile-toggle {
        display: inline-flex;
    }

    .sidebar-close-mobile {
        display: inline-flex;
    }

    .admin-sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        bottom: 0;
        width: 270px;
        height: 100vh;
        z-index: 99999;
        transition: left 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
        box-shadow: 0 0 30px rgba(0,0,0,0.3);
    }

    .admin-sidebar.is-open {
        left: 0;
    }

    .admin-main {
        width: 100% !important;
        padding: 16px !important;
    }

    .admin-topbar {
        gap: 12px;
        padding: 14px 16px;
    }

    .dash-hero {
        padding: 20px;
        flex-direction: column;
        align-items: flex-start;
    }

    .table-wrapper, .panel-table, .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .wizard-tab-pane [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }

    #gallery-sortable-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    #amenities-grid-container {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .form-grid { grid-template-columns: 1fr; }
    .color-grid { grid-template-columns: 1fr; }
    .profile-name { display: none; }
    .profile-btn { padding-right: 8px; }
    .modal { margin: 0; max-height: 94vh; }
    .modal-backdrop { padding: 12px; }
}

@media (max-width: 576px) {
    .stat-grid {
        grid-template-columns: 1fr !important;
    }

    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .topbar-title h1 {
        font-size: 20px;
    }
    
    .topbar-title p {
        display: none;
    }

    #gallery-sortable-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    #amenities-grid-container {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   API KEYS — usage stats, table & documentation
   ============================================================ */
.text-right { text-align: right; }

.api-stat-grid { margin-bottom: 18px; }

.usage-num {
    display: block;
    font-weight: 800;
    font-size: 15px;
    color: var(--adm-text);
    line-height: 1.2;
}
.usage-num.usage-in { color: #059669; }
.usage-num.usage-out { color: #B45309; }
.usage-sub {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--adm-muted);
    margin-top: 2px;
}
.usage-sub code { font-size: 10.5px; }

.api-keys-table { min-width: 1080px; }
.api-keys-table td, .api-keys-table th { vertical-align: middle; }
.api-keys-table td code { word-break: break-all; }

.last-action-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--adm-soft);
    color: var(--adm-navy);
    white-space: nowrap;
}

.row-action-green { color: #16A34A; }
.row-action-green:hover { background: #16A34A; border-color: #16A34A; color: #FFF; box-shadow: 0 4px 10px rgba(22, 163, 74, 0.25); }
.row-action-amber { color: #D97706; }
.row-action-amber:hover { background: #D97706; border-color: #D97706; color: #FFF; box-shadow: 0 4px 10px rgba(217, 119, 6, 0.25); }

.doc-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    border: 1px solid #C7D2FE;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 14px 0;
}
.dcta-text { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dcta-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #0E125C;
    color: #D4AF37;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}
.doc-cta h6 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--adm-text); }
.doc-cta p { margin: 2px 0 0; font-size: 12px; color: var(--adm-muted); }
.doc-cta .btn-admin { flex-shrink: 0; }

.endpoint-table td code { white-space: nowrap; }
.endpoint-table .ep-desc { font-size: 12.5px; color: var(--adm-muted); }

.param-table { min-width: 640px; }
.param-table td, .param-table th { vertical-align: middle; }
.param-table td { font-size: 12.5px; }
.param-table code { white-space: nowrap; }
.param-required {
    font-size: 10.5px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 5px;
    background: #FEE2E2;
    color: #B91C1C;
}



/* Added-by source badges (properties list) */
.added-by-source.api {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 5px;
    background: rgba(16,185,129,0.1);
    color: #0F766E;
    font-size: 12px;
    font-weight: 600;
}

/* API key name input (slug, max 20) */
.key-name-input { position: relative; display: flex; align-items: center; }
.key-name-input input {
    font-family: 'Consolas', 'Menlo', monospace;
    text-transform: lowercase;
    padding-right: 52px;
}
.key-name-input input:focus { border-color: #0E125C; }
.key-name-count {
    position: absolute;
    right: 10px;
    font-size: 11px;
    font-weight: 700;
    color: #94A3B8;
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 20px;
    pointer-events: none;
}
.key-name-hint { margin-top: 6px; font-size: 12px; font-weight: 600; }
.key-name-hint.ok { color: #059669; }
.key-name-hint.err { color: #DC2626; }

.key-slug-name {
    font-family: 'Consolas', 'Menlo', monospace;
    font-size: 13px;
    color: #0E125C;
    background: #F1F5F9;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* API key scope picker + badge */
.scope-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scope-picker label { position: relative; cursor: pointer; display: block; }
.scope-picker input { position: absolute; opacity: 0; pointer-events: none; }
.scope-picker .scope-opt {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid var(--adm-border);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--adm-soft);
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.scope-picker .scope-opt strong { font-size: 12.5px; color: var(--adm-text); }
.scope-picker .scope-opt span { font-size: 11px; color: var(--adm-muted); line-height: 1.35; }
.scope-picker label:hover .scope-opt { border-color: #C7D2FE; }
.scope-picker input:checked + .scope-opt { border-color: #0E125C; background: #EEF2FF; box-shadow: 0 0 0 1px #0E125C inset; }
.scope-picker input:checked + .scope-opt strong { color: #0E125C; }
@media (max-width: 720px) {
    .scope-picker { grid-template-columns: 1fr; }
}

.scope-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
}
.scope-badge.rw { background: #DCFCE7; color: #15803D; }
.scope-badge.ro { background: #E0F2FE; color: #0369A1; }
.scope-badge.wo { background: #FEF3C7; color: #B45309; }
