:root {
    --admin-bg: #f4f2ef;
    --admin-sidebar: #1a1410;
    --admin-accent: #c4a265;
    --admin-text: #2c2420;
    --admin-muted: #7a7168;
    --admin-border: #e0dbd3;
    --font-ui: 'Outfit', system-ui, sans-serif;
    --font-display: 'Cormorant Garamond', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font-ui);
    background: var(--admin-bg);
    color: var(--admin-text);
    line-height: 1.5;
}

a { color: var(--admin-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.admin-layout { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 240px;
    background: var(--admin-sidebar);
    color: #f5f0e8;
    padding: 1.5rem 0;
    flex-shrink: 0;
}

.sidebar-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-style: italic;
    padding: 0 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(196, 162, 101, 0.2);
    margin-bottom: 1rem;
}
.sidebar-brand span { color: var(--admin-accent); }

.sidebar-nav { list-style: none; }
.sidebar-nav a {
    display: block;
    padding: 0.65rem 1.5rem;
    color: #c9bfb0;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(196, 162, 101, 0.12);
    color: var(--admin-accent);
    text-decoration: none;
}

.admin-main { flex: 1; display: flex; flex-direction: column; }

.admin-topbar {
    background: #fff;
    border-bottom: 1px solid var(--admin-border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-topbar h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 400;
}

.admin-content { padding: 2rem; flex: 1; }

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--admin-border);
    padding: 1.25rem;
    border-radius: 4px;
}
.stat-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--admin-muted);
}
.stat-card .value {
    font-size: 1.75rem;
    font-weight: 500;
    margin-top: 0.25rem;
    color: var(--admin-text);
}

/* Tables */
.admin-table {
    width: 100%;
    background: #fff;
    border: 1px solid var(--admin-border);
    border-collapse: collapse;
    border-radius: 4px;
    overflow: hidden;
}
.admin-table th, .admin-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--admin-border);
    font-size: 0.9rem;
}
.admin-table th {
    background: #faf9f7;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--admin-muted);
    font-weight: 500;
}
.admin-table tr:last-child td { border-bottom: none; }

/* Forms */
.admin-form {
    background: #fff;
    border: 1px solid var(--admin-border);
    padding: 2rem;
    border-radius: 4px;
    max-width: 720px;
}
.form-row { margin-bottom: 1.25rem; }
.form-row label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--admin-muted);
}
.form-row input, .form-row textarea, .form-row select {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--admin-border);
    border-radius: 3px;
    font-family: var(--font-ui);
    font-size: 0.95rem;
}
.form-row textarea { min-height: 120px; resize: vertical; }
.form-row.checkbox { display: flex; align-items: center; gap: 0.5rem; }
.form-row.checkbox input { width: auto; }

.form-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; }

.btn {
    display: inline-block;
    padding: 0.55rem 1.25rem;
    font-family: var(--font-ui);
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary { background: var(--admin-sidebar); color: #fff; }
.btn-primary:hover { background: #2c2420; text-decoration: none; }
.btn-accent { background: var(--admin-accent); color: var(--admin-sidebar); }
.btn-danger { background: #c0392b; color: #fff; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--admin-border);
    color: var(--admin-text);
}

.alert {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 3px;
    font-size: 0.9rem;
}
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.alert-error { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 2px;
    font-weight: 500;
}
.badge-pending { background: #fff3e0; color: #e65100; }
.badge-processing { background: #e3f2fd; color: #1565c0; }
.badge-shipped { background: #e8eaf6; color: #283593; }
.badge-delivered { background: #e8f5e9; color: #2e7d32; }
.badge-cancelled { background: #ffebee; color: #c62828; }

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--admin-sidebar);
}
.login-box {
    background: #fff;
    padding: 2.5rem;
    width: min(400px, 90vw);
    border-radius: 4px;
}
.login-box h1 {
    font-family: var(--font-display);
    font-size: 1.75rem;
    text-align: center;
    margin-bottom: 0.25rem;
}
.login-box .subtitle {
    text-align: center;
    color: var(--admin-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 3px; background: var(--admin-border); }

@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
}
