/* ══════════════════════════════════════════════════════════
   DECENT CRAFT — Admin Panel CSS
   Design: Premium Dark Dashboard
   Colors: Deep Slate + Indigo accent
══════════════════════════════════════════════════════════ */

/* ── Google Fonts loaded via HTML, variables here ──────── */
:root {
    /* Sidebar */
    --sb-bg:        #0E1117;
    --sb-border:    rgba(255,255,255,0.06);
    --sb-text:      #8B95A8;
    --sb-hover-bg:  rgba(99,102,241,0.1);
    --sb-active-bg: rgba(99,102,241,0.15);
    --sb-active:    #818CF8;
    --sb-width:     260px;

    /* Body / Layout */
    --body-bg:      #131720;
    --card-bg:      #1C2130;
    --card-border:  rgba(255,255,255,0.07);
    --elevated-bg:  #222840;

    /* Accent */
    --accent:       #6366F1;
    --accent-light: #818CF8;
    --accent-glow:  rgba(99,102,241,0.3);

    /* Text */
    --text-primary: #E2E8F0;
    --text-muted:   #64748B;
    --text-dim:     #475569;

    /* Status */
    --success:      #10B981;
    --warning:      #F59E0B;
    --danger:       #EF4444;
    --info:         #3B82F6;

    /* Misc */
    --radius:       10px;
    --radius-sm:    6px;
    --shadow:       0 4px 24px rgba(0,0,0,0.4);
    --transition:   all 0.25s ease;
    --font:         'Inter', -apple-system, sans-serif;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font);
    background-color: var(--body-bg);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }

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

/* ── SIDEBAR ───────────────────────────────────────────── */
.admin-sidebar {
    width: var(--sb-width);
    background: var(--sb-bg);
    border-right: 1px solid var(--sb-border);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: var(--transition);
}
.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Sidebar Brand */
.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid var(--sb-border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.sidebar-brand .brand-icon {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.sidebar-brand .brand-text {
    display: flex; flex-direction: column;
}
.sidebar-brand .brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.sidebar-brand .brand-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* Sidebar Nav */
.sidebar-nav { padding: 16px 0; flex: 1; }
.nav-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 12px 20px 6px;
    margin-top: 8px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--sb-text);
    border-radius: 0;
    transition: var(--transition);
    position: relative;
    font-size: 0.88rem;
    font-weight: 500;
    margin: 2px 0;
}
.sidebar-nav a::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
    transform: scaleY(0);
    transition: var(--transition);
}
.sidebar-nav a:hover {
    background: var(--sb-hover-bg);
    color: var(--text-primary);
}
.sidebar-nav a.active {
    background: var(--sb-active-bg);
    color: var(--sb-active);
}
.sidebar-nav a.active::before {
    transform: scaleY(1);
}
.sidebar-nav a .nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.sidebar-nav a .nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--sb-border);
}
.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
}
.admin-user .avatar {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent), #A78BFA);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
.admin-user .user-info { flex: 1; min-width: 0; }
.admin-user .user-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.admin-user .user-role {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.admin-user .logout-btn {
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}
.admin-user .logout-btn:hover { color: var(--danger); }

/* ── MAIN CONTENT ───────────────────────────────────────── */
.admin-main {
    flex: 1;
    margin-left: var(--sb-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── TOP HEADER ─────────────────────────────────────────── */
.admin-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--card-border);
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}
.header-left { display: flex; align-items: center; gap: 16px; }
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    padding: 6px;
}
.breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.breadcrumb-nav .current { color: var(--text-primary); font-weight: 600; }
.breadcrumb-nav i { font-size: 0.65rem; }

.header-right { display: flex; align-items: center; gap: 12px; }
.header-icon-btn {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    transition: var(--transition);
    font-size: 0.9rem;
}
.header-icon-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.header-icon-btn.has-dot { position: relative; }
.header-icon-btn.has-dot::after {
    content: '';
    position: absolute;
    top: 6px; right: 6px;
    width: 7px; height: 7px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--card-bg);
}
.store-link {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 14px;
    background: rgba(99,102,241,0.1);
    border: 1px solid rgba(99,102,241,0.25);
    border-radius: var(--radius-sm);
    color: var(--accent-light);
    font-size: 0.8rem;
    font-weight: 600;
    transition: var(--transition);
}
.store-link:hover { background: rgba(99,102,241,0.2); }

/* ── CONTENT AREA ───────────────────────────────────────── */
.admin-content { padding: 28px; flex: 1; }
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--text-primary); }
.page-subtitle { font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* ── STAT CARDS ─────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}
.stat-card:hover {
    border-color: rgba(99,102,241,0.25);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--card-accent, linear-gradient(90deg, var(--accent), var(--accent-light)));
}
.stat-card .card-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    margin-bottom: 16px;
}
.stat-card .card-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.stat-card .card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}
.stat-card .card-trend {
    font-size: 0.78rem;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.trend-up   { color: var(--success); }
.trend-down { color: var(--danger); }

/* Stat card color themes */
.stat-indigo .card-icon { background: rgba(99,102,241,0.15); color: var(--accent-light); }
.stat-indigo { --card-accent: linear-gradient(90deg, #6366F1, #818CF8); }
.stat-orange .card-icon { background: rgba(245,158,11,0.15); color: var(--warning); }
.stat-orange { --card-accent: linear-gradient(90deg, #F59E0B, #FCD34D); }
.stat-green  .card-icon { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-green  { --card-accent: linear-gradient(90deg, #10B981, #34D399); }
.stat-red    .card-icon { background: rgba(239,68,68,0.15); color: var(--danger); }
.stat-red    { --card-accent: linear-gradient(90deg, #EF4444, #F87171); }

/* ── TABLE CONTAINER ────────────────────────────────────── */
.table-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid var(--card-border);
}
.table-header h2 {
    font-size: 1rem;
    font-weight: 600;
}
.table-header .table-actions { display: flex; gap: 10px; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    padding: 12px 22px;
    text-align: left;
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--card-border);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}
.admin-table td {
    padding: 14px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary);
    font-size: 0.88rem;
}
.admin-table tbody tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ── BUTTONS ────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border: 1px solid var(--card-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); }
.btn-danger  { background: var(--danger);  color: #fff; }
.btn-danger:hover  { opacity: 0.85; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { opacity: 0.85; }
.btn-warning { background: var(--warning); color: #000; font-weight: 700; }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

/* ── BADGES ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.badge-success   { background: rgba(16,185,129,0.15);  color: #34D399; }
.badge-warning   { background: rgba(245,158,11,0.15);  color: #FCD34D; }
.badge-danger    { background: rgba(239,68,68,0.15);   color: #F87171; }
.badge-info      { background: rgba(59,130,246,0.15);  color: #60A5FA; }
.badge-secondary { background: rgba(255,255,255,0.07); color: var(--text-muted); }

/* ── FORMS ──────────────────────────────────────────────── */
.form-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 28px;
}
.form-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--card-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid.cols-1 { grid-template-columns: 1fr; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: var(--font);
    transition: var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(99,102,241,0.06);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-dim); }
select.form-control { appearance: auto; }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── ALERTS ─────────────────────────────────────────────── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.88rem;
    font-weight: 500;
}
.alert-error   { background: rgba(239,68,68,0.1);   border: 1px solid rgba(239,68,68,0.25);   color: #F87171; }
.alert-success { background: rgba(16,185,129,0.1);  border: 1px solid rgba(16,185,129,0.25);  color: #34D399; }
.alert-warning { background: rgba(245,158,11,0.1);  border: 1px solid rgba(245,158,11,0.25);  color: #FCD34D; }
.alert-info    { background: rgba(59,130,246,0.1);  border: 1px solid rgba(59,130,246,0.25);  color: #60A5FA; }

/* ── LOGIN PAGE ─────────────────────────────────────────── */
.login-bg {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--body-bg);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.07) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(167,139,250,0.05) 0%, transparent 50%);
    padding: 20px;
}
.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo .logo-icon {
    width: 56px; height: 56px;
    background: linear-gradient(135deg, var(--accent), #A78BFA);
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px var(--accent-glow);
}
.login-logo h1 {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.login-logo p {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.login-card .btn-primary {
    width: 100%;
    padding: 13px;
    font-size: 0.95rem;
    justify-content: center;
    margin-top: 6px;
}
.login-back {
    text-align: center;
    margin-top: 24px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.login-back a { color: var(--accent-light); }
.login-back a:hover { text-decoration: underline; }
.password-toggle {
    position: relative;
}
.password-toggle .form-control { padding-right: 44px; }
.password-toggle .toggle-btn {
    position: absolute;
    right: 12px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    color: var(--text-muted);
    cursor: pointer; font-size: 0.9rem;
    padding: 4px;
}
.password-toggle .toggle-btn:hover { color: var(--text-primary); }

/* ── MISC UTILITIES ─────────────────────────────────────── */
.text-muted   { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.mb-0 { margin-bottom: 0; }
.mt-20 { margin-top: 20px; }
.gap-10 { display: flex; gap: 10px; }

/* ── FOOTER ─────────────────────────────────────────────── */
.admin-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--card-border);
    font-size: 0.78rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
}

/* ── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .admin-sidebar.open { transform: translateX(0); box-shadow: 4px 0 30px rgba(0,0,0,0.5); }
    .admin-main { margin-left: 0; }
    .mobile-toggle { display: flex !important; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid.cols-3 { grid-template-columns: 1fr; }
    .admin-content { padding: 18px; }
    .overlay {
        display: none;
        position: fixed; inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 199;
    }
    .overlay.show { display: block; }
}
