/* Admin panel — clean, professional working dashboard. Brand colors
   show up as accents (buttons, badges, links), not as thick cartoon
   outlines or loud candy fills — that style stays on the public site,
   where it belongs. This is a tool you use every day, not a storefront. */
:root {
    --cream: #FFF6E9;
    --mustard: #D98E04;
    --tomato: #DC3545;
    --teal: #0F8A7C;
    --charcoal: #1F2430;
    --charcoal-soft: #6B7280;
    --white: #FFFFFF;
    --border: #E3E4E8;
    --ink: #1F2430;
    --paper: #FFFFFF;
    --shadow-sm: 0 1px 2px rgba(16,24,40,0.06);
    --shadow-md: 0 1px 3px rgba(16,24,40,0.08), 0 1px 2px rgba(16,24,40,0.04);
}

[data-theme="dark"] {
    --cream: #2B1024;
    --mustard: #E0A030;
    --tomato: #E8687A;
    --teal: #2DBFA8;
    --charcoal: #E8DCC0;
    --charcoal-soft: #B8A8B0;
    --white: #3D1A33;
    --border: #4A2540;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 2px 6px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body.admin-body {
    margin: 0;
    background: var(--cream);
    color: var(--charcoal);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

h1 { font-size: 1.5rem; font-weight: 700; }

.admin-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.admin-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.admin-card h1 { margin-top: 0; font-size: 1.3rem; }

form label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--charcoal-soft);
    margin-bottom: 14px;
}
form input[type=text], form input[type=password], form input[type=number],
form select, form textarea {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: 7px;
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--charcoal);
    background: var(--white);
}
form input:focus, form select:focus, form textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(15,138,124,0.12);
}
form textarea { resize: vertical; min-height: 80px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ink);
    color: var(--paper);
    border: none;
    border-radius: 7px;
    padding: 9px 18px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    transition: filter 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover { text-decoration: none; filter: brightness(1.12); box-shadow: var(--shadow-md); }
.btn:active { filter: brightness(0.95); }
.btn-small { padding: 5px 12px; font-size: 0.8rem; }
.btn-teal { background: var(--teal); }
.btn-tomato { background: var(--tomato); }
.btn-outline {
    background: transparent;
    color: var(--charcoal);
    border: 1px solid var(--border);
    box-shadow: none;
}
.btn-outline:hover { filter: none; background: var(--cream); }

.admin-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 16px;
    border: 1px solid transparent;
}
.admin-alert-error { background: #FDF0F1; border-color: #F3C7CB; color: #A32131; }
.admin-alert-success { background: #EDF9F6; border-color: #BFE8DE; color: #0E5F51; }

/* ---- App shell (logged-in pages) ---- */
.admin-topbar {
    /* Deliberately fixed — always a dark bar regardless of site theme,
       same convention as most admin dashboards. Not tied to the
       flipping theme variables on purpose. */
    background: #1F2430;
    color: #F5F5F7;
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
}
.admin-topbar a { color: #F5F5F7; text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.admin-topbar > a { font-weight: 700; color: #FFFFFF; }
.admin-topbar .admin-nav-links { display: flex; gap: 20px; align-items: center; }
.admin-topbar .admin-nav-links a:hover { color: var(--mustard); }
.admin-topbar .admin-nav-links span { color: #A0A3AD; font-size: 0.88rem; }
.theme-toggle-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.12s ease;
}
.theme-toggle-btn:hover { border-color: var(--mustard); }

.admin-container { max-width: 1040px; margin: 0 auto; padding: 32px 24px 80px; }
.admin-container > p:first-child a,
.admin-container a:not(.btn):not(.status-tabs a) {
    color: var(--teal);
    font-weight: 600;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 24px 0 32px;
}
.stat-box {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-box .stat-number { font-size: 1.9rem; font-weight: 700; color: var(--charcoal); }
.stat-box .stat-label { font-size: 0.75rem; color: var(--charcoal-soft); text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; margin-top: 2px; }

table.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
table.admin-table th, table.admin-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
table.admin-table th { background: var(--cream); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--charcoal-soft); }
table.admin-table tr:last-child td { border-bottom: none; }
table.admin-table tr:hover td { background: rgba(0,0,0,0.015); }

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    background: var(--white);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.dropzone.dragover { background: var(--cream); border-color: var(--teal); }
.dropzone p { margin: 4px 0; color: var(--charcoal-soft); }
.dropzone img.preview { max-width: 240px; max-height: 240px; border-radius: 10px; margin-top: 14px; box-shadow: var(--shadow-md); }

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}
.quick-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}
@media (max-width: 720px) {
    .quick-links { grid-template-columns: repeat(2, 1fr); }
}

.status-tabs { display: flex; gap: 8px; margin: 16px 0 20px; }
.status-tabs a {
    padding: 7px 16px; border-radius: 999px; border: 1px solid var(--border);
    text-decoration: none; color: var(--charcoal-soft); font-weight: 600; font-size: 0.85rem;
    transition: background 0.12s ease, color 0.12s ease;
}
.status-tabs a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.status-tabs a:hover:not(.active) { background: var(--cream); }