/* ═══════════════════════════════════════════════════════════════
   Admin Layout — Reusable components
   Cards, buttons, toast, stat tiles, topbar action buttons.
   Depends on CSS variables from theme-light.css / theme-dark.css.
   ═══════════════════════════════════════════════════════════════ */

/* ── Toast ────────────────────────────────────────────────────────────── */
.sf-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 18px;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    display: none;
    align-items: center;
    gap: 8px;
    z-index: 100001;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15), 0 4px 10px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    opacity: 0;
    transform: translateY(16px);
}

    .sf-toast.show {
        opacity: 1;
        transform: translateY(0);
    }

#toast-container > .toast-success,
.sf-toast.toast-success { background-color: #16A34A !important; color: #fff !important; }
#toast-container > .toast-error,
.sf-toast.toast-error   { background-color: #DC2626 !important; color: #fff !important; }
#toast-container > .toast-warning,
.sf-toast.toast-warning { background-color: #D97706 !important; color: #fff !important; }
#toast-container > .toast-info,
.sf-toast.toast-info    { background-color: #2563EB !important; color: #fff !important; }

@media (max-width: 640px) {
    .sf-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
        min-width: auto;
    }
}

/* ── Search box ───────────────────────────────────────────────────────── */
.search-box {
    flex: 1;
    max-width: 720px;
    position: relative;
}

    .search-box input {
        width: 100%;
        padding: 10px 16px 10px 40px;
        border-radius: 8px;
        border: 1px solid var(--admin-border);
        background: #F9FAFB;
        color: #374151;
        font-size: 14px;
        transition: all 0.15s ease;
        font-family: inherit;
    }

        .search-box input::placeholder {
            color: #9CA3AF;
        }

        .search-box input:focus {
            outline: none;
            border-color: var(--admin-primary-light);
            background: white;
            box-shadow: 0 0 0 4px rgba(91,33,182,0.12);
        }

    .search-box input[type="text"] {
        padding: 10px 16px 10px 40px !important;
        border-radius: 8px !important;
        border: 1px solid var(--admin-border) !important;
        background: #F9FAFB !important;
        font-family: inherit !important;
    }

        .search-box input[type="text"]:focus {
            border-color: var(--admin-primary-light) !important;
            background: white !important;
            box-shadow: 0 0 0 4px rgba(91,33,182,0.12) !important;
        }

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    pointer-events: none;
}

/* ── Icon button ──────────────────────────────────────────────────────── */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F9FAFB;
    color: #6B7280;
    border: 1px solid var(--admin-border-light);
    cursor: pointer;
    transition: all 0.15s ease;
}

    .icon-btn:hover {
        background: #F3F4F6;
        color: var(--admin-primary);
        border-color: var(--admin-border);
    }

    .icon-btn.active {
        background: var(--admin-primary);
        color: white;
        border-color: var(--admin-primary);
    }

/* ── Cards ────────────────────────────────────────────────────────────── */
.card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    box-shadow: var(--admin-shadow);
    overflow: hidden;
    transition: all 0.2s ease;
}

    .card:hover {
        box-shadow: var(--admin-shadow-lg);
        transform: translateY(-2px);
        border-color: var(--admin-border);
    }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--admin-border-light);
    background: linear-gradient(135deg, rgba(15,58,125,0.02) 0%, rgba(91,33,182,0.02) 100%);
}

    .card-header h3 {
        font-size: 16px;
        font-weight: 700;
        color: #111827;
        letter-spacing: -0.2px;
        margin: 0;
    }

.card-body {
    padding: 24px;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    letter-spacing: -0.2px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(15,58,125,0.25);
}

    .btn-primary:hover {
        box-shadow: 0 6px 20px rgba(15,58,125,0.35);
        transform: translateY(-2px);
        text-decoration: none;
    }

.btn-secondary {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid var(--admin-border);
}

    .btn-secondary:hover {
        background: #E5E7EB;
        color: #111827;
        text-decoration: none;
    }

.create-btn {
    padding: 10px 20px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-primary-light) 100%);
    color: white;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.15s ease;
    box-shadow: 0 4px 12px rgba(15,58,125,0.25);
    letter-spacing: -0.2px;
}

    .create-btn:hover {
        box-shadow: 0 6px 20px rgba(15,58,125,0.35);
        transform: translateY(-2px);
    }

/* ── Shared topbar action button classes ──────────────────────────────── */
.sf-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: opacity .15s, background .15s;
    white-space: nowrap;
    line-height: 1;
    border: none;
    font-family: inherit;
}

.sf-btn:focus-visible {
    outline: 2px solid var(--admin-primary);
    outline-offset: 2px;
}

.sf-btn:disabled,
.sf-btn[disabled] {
    opacity: .5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Solid brand blue */
.sf-btn-primary {
    background: var(--admin-sidebar-bg);
    color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.sf-btn-primary:hover {
    box-shadow: 0 6px 20px rgba(15,58,125,0.35);
    transform: translateY(-2px);
    text-decoration: none;
}

/* Ghost / secondary */
.sf-btn-secondary {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.sf-btn-secondary:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

/* Back navigation */
.sf-btn-back {
    background: #fff;
    color: #374151;
    border: 1px solid #d1d5db;
}

.sf-btn-back:hover {
    background: #f3f4f6;
    color: #111827;
    text-decoration: none;
}

/* Topbar row wrapper */
.sf-topbar-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
    flex-wrap: wrap;
}

.sf-topbar-title {
    font-family: var(--admin-font-heading, 'Inter', sans-serif);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--admin-text-primary);
}

.sf-topbar-subtitle {
    color: var(--admin-text-muted);
    font-weight: 400;
    font-size: 13px;
    margin-left: 6px;
    font-family: var(--admin-font-body, 'Poppins', Helvetica, Arial, sans-serif);
}

.sf-topbar-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Dashboard stat tiles ─────────────────────────────────────────────── */
.stat-card {
    background: var(--admin-surface);
    border: 1px solid var(--admin-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--admin-shadow);
    transition: all 0.2s ease;
}

    .stat-card:hover {
        box-shadow: var(--admin-shadow-lg);
        transform: translateY(-4px);
    }

    .stat-card::before {
        content: '';
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: linear-gradient(90deg, var(--admin-primary), var(--admin-primary-light));
        opacity: 0;
        transition: opacity 0.2s ease;
    }

    .stat-card:hover::before {
        opacity: 1;
    }

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

.stat-change {
    font-size: 12px;
    margin-top: 6px;
}

    .stat-change.positive {
        color: #059669;
    }

    .stat-change.negative {
        color: #DC2626;
    }

/* ── User profile popover (topbar) ───────────────────────────────────────
   Theme-aware — used by _LayoutAdmin.cshtml's top-right account dropdown,
   which also hosts the dark/light theme toggle. */
.sf-user-popover {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--admin-popover-bg);
    border: 1px solid var(--admin-popover-border);
    border-radius: 10px;
    box-shadow: var(--admin-popover-shadow);
    min-width: 220px;
    z-index: 9999;
    overflow: hidden;
}

    .sf-user-popover.open {
        display: block;
    }

.sf-user-popover-header {
    padding: 10px 14px;
    border-bottom: 1px solid var(--admin-popover-divider);
}

.sf-user-popover-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sf-user-popover-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--admin-text-primary);
}

.sf-user-popover-role {
    font-size: 11px;
    color: var(--admin-text-muted);
}

.sf-user-popover-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    text-decoration: none;
    color: var(--admin-danger);
    font-size: 13px;
    font-weight: 600;
    transition: background .15s;
}

    .sf-user-popover-logout:hover {
        background: var(--admin-danger-bg-hover);
        text-decoration: none;
    }

/* ── Theme toggle row + switch ────────────────────────────────────────── */
.sf-theme-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--admin-popover-divider);
}

.sf-theme-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--admin-text-primary);
}

.sf-theme-toggle-icon {
    font-size: 18px;
    color: var(--admin-text-muted);
}

.sf-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    cursor: pointer;
}

    .sf-switch input {
        position: absolute;
        inset: 0;
        opacity: 0;
        margin: 0;
        cursor: pointer;
    }

.sf-switch-track {
    position: absolute;
    inset: 0;
    background: #d1d5db;
    border-radius: 999px;
    transition: background .2s ease;
}

.sf-switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .2s ease;
}

.sf-switch input:checked + .sf-switch-track {
    background: var(--admin-primary);
}

.sf-switch input:checked + .sf-switch-track .sf-switch-thumb {
    transform: translateX(18px);
}

.sf-switch input:focus-visible + .sf-switch-track {
    outline: 2px solid var(--admin-primary);
    outline-offset: 2px;
}

@media (max-width: 480px) {
    .sf-user-popover {
        min-width: 200px;
    }
}

.notif-dropdown-menu {
    background: var(--admin-popover-bg);
    border: 1px solid var(--admin-popover-border);
    box-shadow: var(--admin-popover-shadow);
}

.notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-popover-divider);
    background: var(--admin-popover-bg);
}

.notif-dropdown-title {
    font-weight: 700;
    font-size: 14px;
    color: var(--admin-text-primary);
}

.notif-dropdown-link {
    font-size: 12px;
    color: var(--admin-text-muted);
    text-decoration: none;
    transition: color .15s;
}

.notif-dropdown-link:hover {
    color: var(--admin-primary);
    text-decoration: underline;
}

.notif-dropdown-markall {
    font-size: 12px;
    color: var(--admin-primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

.notif-dropdown-markall:hover {
    text-decoration: underline;
}

.notif-drop-list {
    max-height: 400px;
    overflow-y: auto;
    background: var(--admin-popover-bg);
}

.notif-drop-empty {
    padding: 32px 16px;
    text-align: center;
    color: var(--admin-text-muted);
    font-size: 13px;
}

.notif-drop-item {
    display: flex;
    gap: 12px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--admin-popover-divider);
    cursor: pointer;
    transition: background .15s;
    background: var(--admin-popover-bg);
}

.notif-drop-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

:root:not([data-theme="dark"]) .notif-drop-item:hover {
    background: #f8fafc;
}

.notif-drop-item.unread {
    background: rgba(59, 130, 246, 0.08);
    border-left: 3px solid var(--admin-primary);
}

.notif-drop-item.unread:hover {
    background: rgba(59, 130, 246, 0.14);
}

.notif-drop-item.read {
    border-left: 3px solid transparent;
}

.notif-item-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--admin-text-primary);
    margin-bottom: 2px;
}

.notif-item-msg {
    font-size: 12px;
    color: var(--admin-text-muted);
    margin-bottom: 4px;
    line-height: 1.45;
}

.notif-item-time {
    font-size: 11px;
    color: var(--admin-text-muted);
    opacity: 0.8;
}

.notif-item-btn-read {
    font-size: 11px;
    color: var(--admin-primary);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    padding: 0;
}

.notif-item-btn-read:hover {
    text-decoration: underline;
}

.notif-item-btn-view {
    font-size: 11px;
    color: var(--admin-text-muted);
    border: 1px solid var(--admin-popover-border);
    border-radius: 5px;
    padding: 2px 8px;
    text-decoration: none;
    transition: all .15s;
}

.notif-item-btn-view:hover {
    color: var(--admin-primary);
    border-color: var(--admin-primary);
}

.sf-vacant-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1.5px 6.5px;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.25;
    border-radius: 4px;
    background: var(--sf-primary-soft, #EFF6FF);
    color: var(--sf-primary, #0F3A7D);
    border: 1px solid rgba(15, 58, 125, 0.2);
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    margin-bottom: 3px;
    width: fit-content;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.sf-vacant-badge:hover {
    background: #DBEAFE;
    color: var(--sf-primary-dark, #0A2654);
    border-color: rgba(15, 58, 125, 0.4);
    text-decoration: none;
    transform: scale(1.05);
}

.sf-vacant-badge svg {
    flex-shrink: 0;
}

.sf-vacant-badge .material-symbols-outlined,
.sf-vacant-badge .material-icons {
    font-size: 14px !important;
    line-height: 1 !important;
    margin: 0 !important;
}

[data-theme="dark"] .sf-vacant-badge {
    background: rgba(91, 141, 239, 0.15);
    color: #93C5FD;
    border-color: rgba(91, 141, 239, 0.35);
}

[data-theme="dark"] .sf-vacant-badge:hover {
    background: rgba(91, 141, 239, 0.25);
    color: #BFDBFE;
    border-color: rgba(91, 141, 239, 0.5);
}

/* ── Google Maps Autocomplete Dropdown in Modals & Forms ── */
.pac-container {
    z-index: 100000 !important;
    font-family: inherit;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--sf-border, #E2E8F0);
    margin-top: 4px;
    pointer-events: auto !important;
}
.pac-item {
    cursor: pointer;
    padding: 6px 10px;
    font-size: 13px;
}
[data-theme="dark"] .pac-container {
    background-color: #1E293B !important;
    border-color: #334155 !important;
    color: #F1F5F9 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .pac-item {
    border-top-color: #334155 !important;
    color: #94A3B8 !important;
}
[data-theme="dark"] .pac-item:hover,
[data-theme="dark"] .pac-item-selected {
    background-color: rgba(255, 255, 255, 0.06) !important;
}
[data-theme="dark"] .pac-item-query {
    color: #F8FAFC !important;
}
/* ═════════════════════════════════════════════════════════════════
   Shared Stripe Split-Field Card Input Component Styles
   Used across Agent, Office Manager, Admin, and User portals
   ═════════════════════════════════════════════════════════════════ */
.sf-split-card-fields {
    width: 100%;
}
.sf-split-card-fields .sf-form-group {
    margin-bottom: 12px;
}
.sf-split-card-fields .sf-form-group:last-child {
    margin-bottom: 0;
}
.sf-split-card-fields .sf-form-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text, #333333);
    margin-bottom: 5px;
    text-transform: none;
    letter-spacing: 0.01em;
}
[data-theme="dark"] .sf-split-card-fields .sf-form-label {
    color: #cbd5e1;
}
.sf-split-card-fields .sf-form-input {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    color: var(--text, #111111);
    background: var(--input-bg, #ffffff);
    border: 1px solid var(--border, rgba(0, 0, 0, 0.15));
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
[data-theme="dark"] .sf-split-card-fields .sf-form-input {
    background: #0f172a;
    border-color: rgba(255, 255, 255, 0.15);
    color: #f1f5f9;
}
.sf-split-card-fields .sf-form-input:focus,
.sf-split-card-fields .sf-form-input.sf-stripe-input-wrapper:focus-within {
    border-color: var(--primary, #185FA5);
    box-shadow: 0 0 0 1px var(--primary, #185FA5);
}
[data-theme="dark"] .sf-split-card-fields .sf-form-input:focus,
[data-theme="dark"] .sf-split-card-fields .sf-form-input.sf-stripe-input-wrapper:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px #3b82f6;
}
.sf-split-card-fields .sf-form-input::placeholder {
    color: var(--muted, #94a3b8);
    opacity: 1;
}
[data-theme="dark"] .sf-split-card-fields .sf-form-input::placeholder {
    color: #64748b;
}
.sf-split-card-fields .sf-stripe-input-wrapper {
    display: flex;
    align-items: center;
}
.sf-split-card-fields .sf-stripe-input-wrapper > div {
    width: 100%;
}
.sf-split-card-fields .sf-form-row-2col {
    display: flex;
    gap: 12px;
}
.sf-split-card-fields .sf-form-row-2col .sf-form-group {
    flex: 1;
    min-width: 0;
}
.sf-card-processor-reassurance {
    font-size: 11.5px;
    color: var(--muted, #666666);
    margin: 4px 0 16px 0;
    line-height: 1.4;
    font-weight: 400;
}
[data-theme="dark"] .sf-card-processor-reassurance {
    color: #94a3b8;
}



