﻿/* ═══════════════════════════════════════════════════════════════════
   ADMIN PANEL — SAAS DESIGN SYSTEM
   Fixed sidebar layout, top bar, metrics grid, tables, forms, badges
   ═══════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:wght@600;700&display=swap');

/* ── Tokens ──────────────────────────────────────────────────────── */
:root {
    --sb-w: 260px;
    --sb-bg: #071529;
    --sb-bg2: #0c1f3a;
    --sb-text: rgba(255,255,255,0.72);
    --sb-active-bg: linear-gradient(135deg, #c9a84c 0%, #e8c96a 100%);
    --sb-active-text: #071529;
    --sb-border: rgba(255,255,255,0.06);
    --sb-hover: rgba(255,255,255,0.05);

    --gold: #c9a84c;
    --gold-deep: #a8842e;
    --gold-soft: rgba(201,168,76,0.12);
    --gold-border: rgba(201,168,76,0.22);
    --gold-border-strong: rgba(201,168,76,0.45);

    --bg: #f0f3f8;
    --surface: #ffffff;
    --surface2: #f7f9fc;
    --text: #1a2432;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(8,20,36,0.08);
    --shadow-lg: 0 12px 36px rgba(8,20,36,0.12);
}

/* ── Reset & Base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg) !important;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── App Shell ───────────────────────────────────────────────────── */
#admin-app { display: flex; min-height: 100vh; }

/* ════════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════════ */
#admin-sidebar {
    width: var(--sb-w);
    min-width: var(--sb-w);
    background: var(--sb-bg);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 200;
    border-right: 1px solid var(--sb-border);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
}
#admin-sidebar::-webkit-scrollbar { display: none; }

.sb-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 20px 18px;
    border-bottom: 1px solid var(--sb-border);
    text-decoration: none;
    flex-shrink: 0;
}
.sb-logo-mark {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 16px;
    color: var(--sb-bg);
    flex-shrink: 0; overflow: hidden;
}
.sb-logo-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; }
.sb-logo-text { display: flex; flex-direction: column; }
.sb-logo-name { font-size: 12px; font-weight: 700; color: #fff; line-height: 1.2; letter-spacing: 0.1px; }
.sb-logo-sub  { font-size: 10px; color: rgba(255,255,255,0.4); letter-spacing: 0.3px; }

.sb-nav { flex: 1; padding: 14px 12px; }
.sb-section-label {
    font-size: 9px; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1.5px; color: rgba(255,255,255,0.28);
    padding: 0 8px; margin: 14px 0 5px;
}
.sb-section-label:first-child { margin-top: 0; }

.sb-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px;
    color: var(--sb-text); text-decoration: none;
    font-size: 13px; font-weight: 500;
    transition: all 0.18s ease; margin-bottom: 2px;
}
.sb-link i { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; opacity: 0.75; transition: opacity 0.18s; }
.sb-link:hover { background: var(--sb-hover); color: #fff; }
.sb-link:hover i { opacity: 1; }
.sb-link.active {
    background: var(--sb-active-bg);
    color: var(--sb-active-text) !important;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(201,168,76,0.3);
}
.sb-link.active i { opacity: 1; color: var(--sb-active-text) !important; }

.sb-divider { border: none; border-top: 1px solid var(--sb-border); margin: 8px 0; }

.sb-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--sb-border);
    display: flex; align-items: center; gap: 10px;
    flex-shrink: 0;
}
.sb-avatar {
    width: 32px; height: 32px; border-radius: 8px;
    background: linear-gradient(135deg, var(--gold), #e8c96a);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--sb-bg); flex-shrink: 0;
}
.sb-user-name { font-size: 12px; font-weight: 600; color: #fff; line-height: 1.2; }
.sb-user-role { font-size: 10px; color: rgba(255,255,255,0.4); }

/* ════════════════════════════════════════════════════════════════════
   CONTENT AREA & TOPBAR
   ════════════════════════════════════════════════════════════════════ */
#admin-content { flex: 1; margin-left: var(--sb-w); display: flex; flex-direction: column; min-height: 100vh; }

#admin-topbar {
    height: 58px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 16px;
    padding: 0 28px;
    position: sticky; top: 0; z-index: 100;
}
.topbar-hamburger {
    display: none; background: none; border: none; cursor: pointer;
    padding: 4px; color: var(--text-muted); font-size: 18px;
    border-radius: 6px; transition: background 0.15s; line-height: 1;
}
.topbar-hamburger:hover { background: var(--surface2); }
.topbar-title { font-size: 16px; font-weight: 700; color: var(--text); flex: 1; }
.topbar-badge {
    display: flex; align-items: center; gap: 8px;
    background: var(--gold-soft); border: 1px solid var(--gold-border);
    border-radius: 8px; padding: 5px 12px 5px 8px;
    font-size: 12px; font-weight: 600; color: var(--gold-deep);
}
.topbar-badge i { font-size: 11px; }

#admin-body { flex: 1; padding: 28px; }

/* ════════════════════════════════════════════════════════════════════
   PAGE HEADER
   ════════════════════════════════════════════════════════════════════ */
.page-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 16px; margin-bottom: 24px; flex-wrap: wrap;
}
.page-header-left { display: flex; flex-direction: column; gap: 3px; }
.page-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 1px; color: var(--gold-deep);
}
.page-title { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ════════════════════════════════════════════════════════════════════
   METRIC CARDS
   ════════════════════════════════════════════════════════════════════ */
.metric-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    position: relative; overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}
.metric-card::before {
    content: ''; position: absolute; top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--mc-accent, var(--gold));
    border-radius: 3px 0 0 3px;
}
.metric-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.metric-icon {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--mc-icon-bg, var(--gold-soft));
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--mc-icon-color, var(--gold-deep));
    margin-bottom: 12px;
}
.metric-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); }
.metric-value { font-size: 30px; font-weight: 800; color: var(--text); line-height: 1; margin-top: 6px; }

/* ════════════════════════════════════════════════════════════════════
   CARDS
   ════════════════════════════════════════════════════════════════════ */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-header { padding: 18px 22px 0; border-bottom: none; background: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--gold-deep); font-size: 14px; }
.card-body { padding: 20px 22px; }

/* ════════════════════════════════════════════════════════════════════
   TABLES
   ════════════════════════════════════════════════════════════════════ */
.admin-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.table-toolbar-title { font-size: 14px; font-weight: 700; color: var(--text); }

.table { width: 100%; border-collapse: collapse; margin-bottom: 0; }
.table thead th {
    background: var(--surface2); font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted);
    padding: 11px 18px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; background: var(--surface); }
.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: var(--surface2); }
.table tbody td { padding: 13px 18px; font-size: 13px; vertical-align: middle; color: var(--text); border: none; }

/* ════════════════════════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 10px; border-radius: 20px;
    font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
    text-transform: uppercase; border: 1px solid transparent;
}
.badge.text-bg-success  { background: rgba(34,197,94,0.1) !important; color: #15803d !important; border-color: rgba(34,197,94,0.22) !important; }
.badge.text-bg-warning  { background: rgba(245,158,11,0.1) !important; color: #b45309 !important; border-color: rgba(245,158,11,0.22) !important; }
.badge.text-bg-danger   { background: rgba(239,68,68,0.1) !important; color: #b91c1c !important; border-color: rgba(239,68,68,0.22) !important; }
.badge.text-bg-primary  { background: rgba(59,130,246,0.1) !important; color: #1d4ed8 !important; border-color: rgba(59,130,246,0.22) !important; }
.badge.text-bg-info     { background: rgba(6,182,212,0.1) !important; color: #0891b2 !important; border-color: rgba(6,182,212,0.22) !important; }
.badge.text-bg-secondary{ background: rgba(100,116,139,0.1) !important; color: #475569 !important; border-color: rgba(100,116,139,0.22) !important; }

.badge-unread, .badge-new { background: rgba(59,130,246,0.1); color: #1d4ed8; border: 1px solid rgba(59,130,246,0.22); border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-contacted         { background: rgba(34,197,94,0.1); color: #15803d; border: 1px solid rgba(34,197,94,0.22); border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-closed            { background: rgba(100,116,139,0.1); color: #475569; border: 1px solid rgba(100,116,139,0.22); border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; }

/* ════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════ */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer; text-decoration: none;
    transition: all 0.18s ease; white-space: nowrap; font-family: 'Inter', sans-serif;
}
.btn:hover { transform: translateY(-1px); }
.btn-sm  { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn-lg  { padding: 11px 22px; font-size: 14px; }

.btn-primary { background: linear-gradient(135deg, var(--gold) 0%, #e8c96a 100%) !important; color: #071529 !important; border: none !important; box-shadow: 0 2px 8px rgba(201,168,76,0.28); }
.btn-primary:hover { box-shadow: 0 4px 16px rgba(201,168,76,0.42); }

.btn-dark, .btn-secondary { background: linear-gradient(135deg, #071529 0%, #0c1f3a 100%) !important; color: #fff !important; border: none !important; box-shadow: 0 2px 8px rgba(7,21,41,0.22); }
.btn-dark:hover { box-shadow: 0 4px 14px rgba(7,21,41,0.38); }

.btn-outline { background: var(--surface); border-color: var(--border) !important; color: var(--text) !important; }
.btn-outline:hover { background: var(--surface2); border-color: var(--gold-border) !important; color: var(--gold-deep) !important; }

.btn-outline-danger  { background: transparent; border-color: rgba(239,68,68,0.35) !important; color: #dc2626 !important; }
.btn-outline-danger:hover { background: rgba(239,68,68,0.06); }

.btn-outline-success { background: transparent; border-color: rgba(34,197,94,0.35) !important; color: #16a34a !important; }
.btn-outline-success:hover { background: rgba(34,197,94,0.06); }

.btn-outline-primary { background: transparent; border-color: rgba(59,130,246,0.35) !important; color: #2563eb !important; }
.btn-outline-primary:hover { background: rgba(59,130,246,0.06); }

/* ════════════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════════════ */
.form-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--text-muted); display: block; margin-bottom: 5px; }
.form-control, .form-select {
    width: 100%; padding: 9px 13px; border: 1.5px solid var(--border); border-radius: 8px;
    font-size: 13px; color: var(--text); background: var(--surface);
    transition: border-color 0.18s, box-shadow 0.18s; outline: none; font-family: 'Inter', sans-serif;
}
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,76,0.14); }
.form-control-lg, .form-select-lg { padding: 11px 15px; font-size: 14px; border-radius: 10px; }
.form-text { font-size: 11px; color: var(--text-light); margin-top: 4px; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ════════════════════════════════════════════════════════════════════
   STATUS FILTER PILLS
   ════════════════════════════════════════════════════════════════════ */
.status-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.status-btn { display: inline-flex; align-items: center; gap: 5px; padding: 5px 14px; border-radius: 20px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: 12px; font-weight: 600; text-decoration: none; transition: all 0.15s; }
.status-btn:hover, .status-btn.active { background: var(--gold); border-color: var(--gold); color: #071529; box-shadow: 0 2px 8px rgba(201,168,76,0.3); }

/* ════════════════════════════════════════════════════════════════════
   INQUIRY CARDS & PANELS
   ════════════════════════════════════════════════════════════════════ */
.inquiry-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s; }
.inquiry-card:hover { box-shadow: var(--shadow); }

.inquiry-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; padding: 16px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 14px 0; }
.meta-item-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 4px; }
.meta-item-value { font-size: 13px; font-weight: 600; color: var(--text); }
.meta-item-value a { color: var(--gold-deep); text-decoration: none; }

.inquiry-message-box { background: var(--surface2); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; padding: 14px 16px; font-size: 13px; color: #374151; line-height: 1.65; margin-top: 14px; }

.soft-panel { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }

/* ════════════════════════════════════════════════════════════════════
   MODALS & ALERTS
   ════════════════════════════════════════════════════════════════════ */
.modal-content { border: none; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { background: var(--sb-bg); color: #fff; padding: 18px 22px; border-bottom: none; }
.modal-header .modal-title { font-weight: 700; font-size: 15px; }
.modal-body { padding: 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--border); background: var(--surface2); }

.alert { padding: 12px 16px; border-radius: 10px; font-size: 13px; font-weight: 500; border: 1px solid transparent; display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; }
.alert-success { background: rgba(34,197,94,0.08); border-color: rgba(34,197,94,0.25); color: #15803d; }
.alert-danger  { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25); color: #b91c1c; }
.alert-warning { background: rgba(245,158,11,0.08); border-color: rgba(245,158,11,0.25); color: #b45309; }

/* ════════════════════════════════════════════════════════════════════
   SIDEBAR OVERLAY (MOBILE)
   ════════════════════════════════════════════════════════════════════ */
#sb-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 190; opacity: 0; transition: opacity 0.28s; }
#sb-overlay.visible { opacity: 1; }

#progress-bar { position: fixed; top: 0; left: var(--sb-w); height: 3px; background: linear-gradient(90deg, var(--gold), #e8c96a); z-index: 9999; width: 0; transition: width 0.1s; }

/* ════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ════════════════════════════════════════════════════════════════════ */
body.admin-login-page {
    background: linear-gradient(135deg, #030b18 0%, #071529 50%, #0c1f3a 100%) !important;
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 24px;
}
.login-card { width: 100%; max-width: 420px; background: var(--surface); border-radius: 20px; overflow: hidden; box-shadow: 0 32px 80px rgba(0,0,0,0.4); }
.login-card-top { background: var(--sb-bg); padding: 32px 32px 28px; text-align: center; border-bottom: 1px solid var(--sb-border); }
.login-logo-circle { width: 56px; height: 56px; border-radius: 16px; background: var(--gold); display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 800; color: var(--sb-bg); margin: 0 auto 16px; overflow: hidden; }
.login-logo-circle img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px; }
.login-title { font-size: 20px; font-weight: 700; color: #fff; }
.login-subtitle { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 4px; }
.login-body { padding: 28px 32px 32px; }
.login-body .vstack { gap: 16px; }
.login-return { font-size: 12px; text-align: center; color: var(--text-muted); margin-top: 18px; }
.login-return a { color: var(--gold-deep); text-decoration: none; font-weight: 600; }
.login-return a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════════════════════════════════ */
@media (max-width: 991px) {
    #admin-sidebar { transform: translateX(-100%); }
    #admin-sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.3); }
    #sb-overlay { display: block; }
    #admin-content { margin-left: 0; }
    #progress-bar { left: 0; }
    .topbar-hamburger { display: flex; align-items: center; justify-content: center; }
    #admin-body { padding: 18px; }
}
@media (max-width: 480px) {
    #admin-body { padding: 14px; }
    .metric-card { padding: 16px; }
    .inquiry-card { padding: 16px; }
}