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

:root {
    --bg: #1a1a18;
    --surface: #242422;
    --surface2: #2e2e2a;
    --border: #3a3a36;
    --text: #e8e8d8;
    --text-dim: #9a9a90;
    --green: #9fd321;
    --green-dark: #7ba818;
    --orange: #f0661c;
    --orange-dark: #c44e12;
    --red: #e14b45;
    --lime: #c9f23c;
    --ink: #2b2a22;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container { max-width: 1100px; margin: 0 auto; padding: 24px 16px; flex: 1; width: 100%; }

/* Navbar */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-brand { display: flex; align-items: center; gap: 12px; }
.logo {
    background: var(--ink);
    color: var(--lime);
    width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    font-weight: 700; font-size: 18px;
    border: 2px solid #4a4a46;
}
.logo-large {
    width: 56px; height: 56px;
    font-size: 28px;
    border-radius: 12px;
}
.brand-text { font-weight: 700; font-size: 16px; }
.nav-links { display: flex; gap: 4px; }
.nav-link {
    color: var(--text-dim);
    text-decoration: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }
.nav-logout:hover { color: var(--red); background: rgba(225, 75, 69, 0.1); }

/* Page header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.page-header h2 { font-size: 24px; font-weight: 700; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
    max-width: 540px;
}

/* Stats */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}
.stat-number { font-size: 36px; font-weight: 800; color: var(--green); }
.stat-total .stat-number { color: var(--orange); }
.stat-label {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Category sections */
.category-section { margin-bottom: 28px; }
.category-title {
    font-size: 18px; font-weight: 700;
    margin-bottom: 12px; color: var(--lime);
    display: flex; align-items: center; gap: 8px;
}
.category-title::before {
    content: '';
    display: inline-block;
    width: 4px; height: 20px;
    background: var(--green);
    border-radius: 2px;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
}
.table { width: 100%; border-collapse: collapse; }
.table th {
    background: var(--surface);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    border-bottom: 1px solid var(--border);
}
.table td {
    padding: 10px 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(255, 255, 255, 0.03); }
.name-cell { font-weight: 600; color: var(--text); }
.inline-form { display: inline; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label {
    display: block;
    font-size: 13px; font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.15s;
}
.form-group input:focus,
.form-group select:focus { border-color: var(--green); }
.form-group input:disabled { opacity: 0.5; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}
.btn-primary { background: var(--green); color: var(--ink); }
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); }
.btn-danger {
    background: rgba(225, 75, 69, 0.15);
    color: var(--red);
    border: 1px solid rgba(225, 75, 69, 0.3);
}
.btn-danger:hover { background: var(--red); color: white; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-full { width: 100%; }

/* Alerts */
.alert {
    padding: 12px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.alert-error { background: rgba(225, 75, 69, 0.12); color: var(--red); border: 1px solid rgba(225, 75, 69, 0.25); }
.alert-success { background: rgba(159, 211, 33, 0.12); color: var(--green); border: 1px solid rgba(159, 211, 33, 0.25); }

/* Upload */
.upload-form { max-width: 600px; }
.file-drop {
    position: relative;
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}
.file-drop:hover { border-color: var(--green); background: rgba(159, 211, 33, 0.04); }
.file-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-icon { font-size: 36px; margin-bottom: 8px; }
.file-drop-text p { color: var(--text-dim); font-size: 14px; }
.file-hint { font-size: 12px !important; margin-top: 4px; }
.file-list { margin-top: 12px; }
.file-item {
    padding: 8px 12px;
    background: rgba(159, 211, 33, 0.08);
    border-radius: 8px;
    font-size: 13px;
    color: var(--green);
    margin-bottom: 4px;
}

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { color: var(--text-dim); margin-bottom: 20px; font-size: 16px; }

/* API info */
.api-info {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px;
    margin-top: 32px;
}
.api-info h3 { font-size: 16px; margin-bottom: 16px; color: var(--text-dim); }
.endpoint {
    display: flex; align-items: center; gap: 16px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.endpoint:last-child { border-bottom: none; }
.endpoint code {
    background: rgba(159, 211, 33, 0.1);
    color: var(--green);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px; font-weight: 600;
    white-space: nowrap;
}
.endpoint span { color: var(--text-dim); font-size: 13px; }

/* Login page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a1a18 0%, #252520 100%);
}
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo { margin: 0 auto 16px; }
.login-logo h1 { font-size: 28px; font-weight: 800; }
.login-logo .subtitle { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.login-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 28px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
    .nav-links { flex-wrap: wrap; justify-content: center; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 16px; }
}

/* Admin UI compatibility and layout refresh */
:root { color-scheme: dark; --bg:#151714; --surface:#20231e; --surface2:#292e26; --border:#363d32; --text:#edf0e8; --text-dim:#a6afa0; }
body { line-height:1.5; }
.container { max-width:1440px; padding:32px clamp(16px,4vw,48px); }
.navbar { min-height:68px; height:auto; padding:12px clamp(16px,4vw,48px); gap:16px; }
.nav-links { flex-wrap:wrap; }
.nav-links a { color:var(--text-dim); text-decoration:none; padding:9px 14px; border-radius:7px; font-size:14px; font-weight:600; }
.nav-links a:hover,.nav-links a.active { background:var(--surface2); color:var(--lime); }
.nav-links .nav-logout:hover { color:var(--red); }
.stats { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:16px; margin-bottom:24px; }
.stat-card { text-align:left; padding:22px; border-radius:10px; }
.stat-value { font-size:36px; font-weight:750; line-height:1.2; color:var(--lime); font-variant-numeric:tabular-nums; }
.card { width:100%; max-width:720px; padding:24px; border-radius:12px; margin-bottom:20px; }
.stats + .card { max-width:none; }
.card-title { font-size:22px; margin-bottom:24px; }
.form-control { min-width:0; width:100%; background:var(--bg); color:var(--text); border:1px solid var(--border); border-radius:7px; padding:10px 12px; font:inherit; }
.form-control:focus { outline:2px solid var(--green); outline-offset:2px; }
.stats + .card > form { flex-wrap:wrap; align-items:center; }
.stats + .card > form input { flex:1 1 220px; width:auto; }
.stats + .card > form select { flex:1 1 150px; }
.btn { white-space:nowrap; border-radius:7px; }
.btn-orange { background:var(--surface2); color:var(--text); border:1px solid var(--border); }
.btn-orange:hover { border-color:var(--green); color:var(--lime); }
.table-wrap table { width:100%; border-collapse:collapse; min-width:680px; }
.table-wrap th,.table-wrap td { padding:14px 16px; text-align:left; border-bottom:1px solid var(--border); font-size:14px; }
.table-wrap th { background:var(--surface2); color:var(--text-dim); font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
.table-wrap tr:last-child td { border-bottom:0; }
.table-wrap tbody tr:hover { background:rgba(255,255,255,.025); }
.badge { display:inline-block; padding:4px 9px; border-radius:5px; background:var(--surface2); color:var(--lime); font-size:12px; }
.badge-kicks { color:#ffab75; } .badge-toms { color:#8acaff; }
.upload-area { border:2px dashed var(--border); border-radius:10px; padding:36px 16px; text-align:center; cursor:pointer; background:var(--bg); }
.upload-area:hover,.upload-area.dragover { border-color:var(--green); background:var(--surface2); }
.upload-icon { font-size:32px; } .upload-text { color:var(--text-dim); }
.file-input { margin-top:12px; max-width:100%; }
.login-wrap { min-height:70vh; display:grid; place-items:center; }
.login-card { width:100%; max-width:440px; background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:32px; }
.login-logo p { color:var(--text-dim); font-size:14px; }
.footer { margin-top:auto; }
@media(max-width:768px) { .stats { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; } .navbar { position:static; } .nav-links a { padding:7px 9px; } .card { padding:16px; } .stat-card { padding:16px; } .stat-value { font-size:28px; } .stats + .card > div:first-child { flex-wrap:wrap; gap:12px; } }
@media(max-width:360px) { .stats { grid-template-columns:1fr; } }
:root{--lime:#a6d923}html[data-theme=light]{color-scheme:light;--bg:#f4f6f2;--surface:#fff;--surface2:#e9eee5;--border:#d4dcd0;--text:#20281e;--text-dim:#52604d;--green:#537b12;--lime:#537b12} @media(prefers-color-scheme:light){html[data-theme=system]{color-scheme:light;--bg:#f4f6f2;--surface:#fff;--surface2:#e9eee5;--border:#d4dcd0;--text:#20281e;--text-dim:#52604d;--green:#537b12;--lime:#537b12}}
.sidebar{position:fixed;inset:0 auto 0 0;width:230px;background:var(--surface);border-right:1px solid var(--border);padding:22px 16px;z-index:10;display:flex;flex-direction:column;gap:10px}.sidebar small{color:var(--text-dim);margin-top:24px}.sidebar a{padding:12px;color:var(--text);text-decoration:none;border-radius:8px}.sidebar a.active,.sidebar a:hover{background:var(--surface2);color:var(--green)}.signed-in{padding-left:230px}.probar{display:flex;align-items:center;gap:16px;padding:16px 24px;background:var(--surface);border-bottom:1px solid var(--border)}.probar select{width:120px;margin-left:auto}.sidebar-toggle{padding-left:0}.sidebar-toggle .sidebar{display:none}.container{width:100%;max-width:1500px}.container>.card{max-width:none}.profile-avatar{width:88px;height:88px;object-fit:cover;border-radius:50%;background:var(--surface2)}a{color:var(--green)}@media(max-width:760px){.signed-in{padding-left:0}.sidebar{display:none}.sidebar-toggle .sidebar{display:flex;top:65px}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
