/* ── Lymora Admin Panel CSS ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #0a1628;
    --navy-dark: #060e1c;
    --gold: #c9972a;
    --white: #fff;
    --sidebar-w: 220px;
    --text: #1a2b4a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --off-white: #f8fafc;
    --orange: #c9972a;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--off-white);
    color: var(--text);
    min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ── Layout ── */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ── */
.admin-sidebar {
    width: var(--sidebar-w);
    background: var(--navy-dark);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.admin-logo {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    margin-bottom: 1rem;
    letter-spacing: .02em;
}

.admin-nav {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: 0 .75rem;
    flex: 1;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem 1rem;
    border-radius: 8px;
    font-size: .88rem;
    font-weight: 500;
    color: rgba(255,255,255,.55);
    transition: background .15s, color .15s;
}
.admin-nav a i { font-size: 1.1rem; }
.admin-nav a:hover { background: rgba(255,255,255,.07); color: var(--white); }
.admin-nav a.active { background: var(--gold); color: var(--navy-dark); font-weight: 600; }
.admin-nav a[style*="margin-top:auto"] { margin-top: auto !important; }

/* ── Main ── */
.admin-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    padding: 2rem 2.5rem;
    min-height: 100vh;
}

/* ── Topbar ── */
.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}
.admin-topbar h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
}

/* ── Stat Cards ── */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
.stat-card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    background: #fef3c7;
    color: var(--gold);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}
.stat-card-info strong {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1;
}
.stat-card-info span {
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Table ── */
.table-wrap {
    background: var(--white);
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 1px 4px rgba(0,0,0,.05);
    overflow: hidden;
}
.table-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
}
.table-head h2 { font-size: 1rem; font-weight: 600; color: var(--navy); }
table { width: 100%; border-collapse: collapse; }
thead tr { background: var(--off-white); }
th {
    text-align: left;
    padding: .75rem 1rem;
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
td {
    padding: .85rem 1rem;
    font-size: .88rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fafc; }

/* ── Badges ── */
.badge {
    display: inline-block;
    padding: .2rem .65rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-contacted { background: #d1fae5; color: #065f46; }
.badge-closed { background: #f3f4f6; color: #6b7280; }
.badge-published { background: #d1fae5; color: #065f46; }
.badge-draft { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-pending { background: #fef3c7; color: #92400e; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .55rem 1.1rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    border: 1.5px solid transparent;
    transition: all .15s;
    text-decoration: none;
}
.btn-primary { background: var(--gold); color: var(--navy-dark); border-color: var(--gold); }
.btn-primary:hover { background: #b8851f; border-color: #b8851f; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--border); }
.btn-outline:hover { border-color: var(--navy); background: var(--off-white); }
.btn-danger { background: #ef4444; color: #fff; border-color: #ef4444; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: .35rem .8rem; font-size: .78rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block; font-size: .78rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .05em;
    color: var(--text-muted); margin-bottom: .4rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%; border: 1.5px solid var(--border);
    border-radius: 8px; padding: .65rem 1rem;
    font-size: .92rem; color: var(--text);
    background: var(--white); outline: none;
    transition: border-color .15s;
    font-family: inherit;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--navy); }
.form-group textarea { resize: vertical; min-height: 120px; }

/* ── Alert ── */
.alert {
    padding: .85rem 1.25rem; border-radius: 8px;
    font-size: .88rem; margin-bottom: 1.25rem; font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* ── Mobile topbar (hidden on desktop) ── */
.admin-mobile-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    background: var(--navy-dark);
    padding: .85rem 1.25rem;
    position: sticky;
    top: 0;
    z-index: 110;
}
.admin-mobile-bar .admin-logo { padding: 0; border-bottom: none; margin-bottom: 0; }
.admin-menu-toggle {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: .25rem;
}

/* ── Sidebar overlay (mobile) ── */
.admin-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.45);
    z-index: 99;
}

/* ── Responsive: Tablet & Mobile ── */
@media (max-width: 992px) {
    .admin-mobile-bar { display: flex; }

    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 200;
        width: 240px;
    }
    .admin-sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 30px rgba(0,0,0,.3);
    }
    .admin-sidebar-overlay.open { display: block; }

    .admin-main {
        margin-left: 0;
        padding: 1.25rem;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: .75rem;
    }
    .admin-topbar > div {
        width: 100%;
        flex-wrap: wrap;
    }

    .stat-cards {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 580px) {
    .admin-main { padding: 1rem; }
    .admin-topbar h1 { font-size: 1.3rem; }
    .stat-cards { grid-template-columns: 1fr 1fr; gap: .75rem; }
    .stat-card { padding: 1rem; gap: .75rem; }
    .stat-card-icon { width: 38px; height: 38px; font-size: 1.1rem; }
    .stat-card-info strong { font-size: 1.25rem; }

    /* Make tables horizontally scrollable instead of overflowing */
    .table-wrap { overflow-x: auto; }
    table { min-width: 560px; }

    .table-head {
        flex-direction: column;
        align-items: flex-start;
        gap: .6rem;
    }
}
