@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #0a0a0a;
    --bg-elevated: #121212;
    --bg-card: #171717;
    --bg-hover: #1f1f1f;
    --border: #262626;
    --border-light: #333;
    --text: #ededed;
    --text-dim: #9a9a9a;
    --text-muted: #6b6b6b;
    --accent: #E50914;
    --accent-hover: #ff1a25;
    --accent-soft: rgba(229, 9, 20, 0.12);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.12);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.12);
    --info: #3b82f6;
    --info-soft: rgba(59, 130, 246, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

html, body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* ═══════════════════════════════════════════════════════════════
   TOP NAVBAR (Desktop) + DRAWER (Mobile)
   ═══════════════════════════════════════════════════════════════ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: 64px;
    background: #121212;           /* ✅ solid — tak cipta containing block */
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.logo {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), #b8070f);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
    flex-shrink: 0;
}

.logo-text {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: 0.3px;
    color: #fff;
    white-space: nowrap;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 8px;
    line-height: 1;
    transition: background 0.15s ease;
}
.menu-toggle:hover { background: var(--bg-hover); }

.app-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.app-nav::-webkit-scrollbar { display: none; }

.app-nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 500;
    font-size: 13.5px;
    border-radius: 8px;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.app-nav a:hover {
    background: var(--bg-hover);
    color: #fff;
}

.app-nav a.active {
    color: #fff;
    background: var(--accent-soft);
    font-weight: 600;
}

.app-nav a.logout-link {
    color: var(--danger);
    margin-left: auto;
}
.app-nav a.logout-link:hover { background: var(--danger-soft); }

.drawer-close {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    align-self: flex-end;
    margin-bottom: 8px;
}
.drawer-close:hover { background: var(--bg-hover); }

.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
    z-index: 99;                   /* ✅ bawah header (100) → drawer tetap nampak */
    opacity: 0;
    transition: opacity 0.3s ease;
}
.drawer-overlay.active {
    display: block;
    opacity: 1;
}

.content {
    padding: 28px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE — DRAWER
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
    .menu-toggle { display: block; }

    .app-header { padding: 0 16px; gap: 12px; }

    .app-nav {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        max-width: 85vw;
        background: var(--bg-elevated);
        flex-direction: column;
        align-items: stretch;
        padding: 16px 14px;
        gap: 4px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 300;
        overflow-y: auto;
        border-right: 1px solid var(--border);
        box-shadow: 20px 0 60px rgba(0, 0, 0, 0.5);
    }

    .app-nav.open { transform: translateX(0); }

    .app-nav a {
        padding: 12px 16px;
        font-size: 14px;
        border-left: 3px solid transparent;
        border-radius: 8px;
    }

    .app-nav a.active { border-left-color: var(--accent); }

    .app-nav a.logout-link {
        margin-left: 0;
        margin-top: auto;
        border-top: 1px solid var(--border);
        padding-top: 16px;
    }

    .drawer-close { display: block; }

    .content { padding: 20px 16px; }
}

@media (max-width: 480px) {
    .logo-text { font-size: 13px; }
    .app-header { height: 58px; padding: 0 12px; gap: 8px; }
    .logo { width: 34px; height: 34px; font-size: 18px; }
    h1 { font-size: 18px; }
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { width: 34px; height: 34px; font-size: 16px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 10px; }
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */
h1 {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    letter-spacing: -0.3px;
}

h2 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

h3 { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 10px; }

/* ═══════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

/* ═══════════════════════════════════════════════════════════════
   STAT GRID
   ═══════════════════════════════════════════════════════════════ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-light);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 3px; height: 100%;
    background: var(--accent);
}

.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-info::before    { background: var(--info); }
.stat-card.stat-danger::before  { background: var(--danger); }

.stat-icon {
    width: 46px; height: 46px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    background: var(--bg-hover);
    flex-shrink: 0;
}

.stat-info { flex: 1; min-width: 0; }

.stat-label {
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.stat-trend {
    font-size: 11px;
    font-weight: 600;
    margin-top: 4px;
    color: var(--text-dim);
}

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR
   ═══════════════════════════════════════════════════════════════ */
.progress-section { margin-bottom: 22px; }
.progress-section:last-child { margin-bottom: 0; }

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
}

.progress-header .progress-value { color: #fff; font-weight: 700; }

.progress-bar {
    height: 10px;
    background: var(--bg-hover);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent), #ff3040);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
}

.progress-fill.fill-success {
    background: linear-gradient(90deg, var(--success), #4ade80);
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}
.progress-fill.fill-warning {
    background: linear-gradient(90deg, var(--warning), #fbbf24);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}
.progress-fill.fill-info {
    background: linear-gradient(90deg, var(--info), #60a5fa);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.progress-legend {
    display: flex;
    gap: 16px;
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.progress-legend span { display: flex; align-items: center; gap: 6px; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-active   { background: var(--success); }
.dot-inactive { background: var(--danger); }
.dot-sold     { background: var(--warning); }

/* ═══════════════════════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════════════════════ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger  { background: var(--danger-soft);  color: var(--danger); }
.badge-info    { background: var(--info-soft);    color: var(--info); }
.badge-muted   { background: var(--bg-hover);     color: var(--text-dim); }

.country-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 3px 8px;
    background: var(--bg-hover);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }

label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-dim);
    font-size: 12.5px;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background: var(--bg-elevated);
    color: #fff;
    font-size: 13.5px;
    transition: all 0.15s ease;
    font-family: inherit;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
    height: 120px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    resize: vertical;
    line-height: 1.5;
}

select { cursor: pointer; }

input[type="file"] {
    width: 100%;
    padding: 10px;
    background: var(--bg-elevated);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
}

input[type="file"]::file-selector-button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 10px;
    font-family: inherit;
}

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════ */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    font-size: 13.5px;
    transition: all 0.15s ease;
    font-family: inherit;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4); }

.btn-success { background: var(--success); }
.btn-success:hover { background: #16a34a; }

.btn-warning { background: var(--warning); color: #000; }
.btn-warning:hover { background: #d97706; }

.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }

.btn-info { background: var(--info); }
.btn-info:hover { background: #2563eb; }

.btn-ghost {
    background: var(--bg-hover);
    color: var(--text);
    border: 1px solid var(--border-light);
}
.btn-ghost:hover { background: var(--border); }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }

/* ═══════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════ */
.table-responsive { overflow-x: auto; border-radius: var(--radius-sm); }

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}

th, td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    vertical-align: middle;
}

th {
    background: var(--bg-elevated);
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-light);
}

tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--bg-hover); }
tbody tr:last-child td { border-bottom: none; }

td code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    background: var(--bg-hover);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--info);
}

/* ═══════════════════════════════════════════════════════════════
   ALERTS
   ═══════════════════════════════════════════════════════════════ */
.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 13.5px;
    border-left: 4px solid;
    background: var(--success-soft);
    color: var(--success);
    border-color: var(--success);
}

.alert-error   { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }

/* ═══════════════════════════════════════════════════════════════
   LOGIN
   ═══════════════════════════════════════════════════════════════ */
.container.login-box {
    max-width: 420px;
    margin: 80px auto;
    padding: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state .title { font-size: 15px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.empty-state .desc { font-size: 13px; }

/* ═══════════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════════ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 280px;
    animation: slideInRight 0.3s ease;
    word-wrap: break-word;
}

.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--warning); }
.toast.toast-info    { border-left-color: var(--info); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-message { flex: 1; line-height: 1.4; }
.toast-close {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 20px; padding: 0; margin-left: 6px; line-height: 1;
}
.toast-close:hover { color: #fff; }
.toast.toast-out { animation: slideOutRight 0.3s ease forwards; }

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(100%); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(100%); }
}

/* ═══════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

.modal-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow-lg);
    animation: scaleIn 0.25s ease;
    overflow: hidden;
}

.modal-header {
    padding: 20px 22px 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 14px 22px 22px;
    color: var(--text-dim);
    font-size: 13.5px;
    line-height: 1.6;
}

.modal-footer {
    padding: 0 22px 22px;
    display: flex;
    gap: 10px;
}

.modal-footer button {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 700;
    cursor: pointer;
    font-size: 13.5px;
    transition: opacity 0.15s;
    font-family: inherit;
}

.modal-footer button:hover { opacity: 0.85; }
.modal-btn-cancel { background: var(--bg-hover); color: #fff; border: 1px solid var(--border-light); }
.modal-btn-confirm { background: var(--accent); color: #fff; }
.modal-btn-confirm.modal-btn-success { background: var(--success); }
.modal-btn-confirm.modal-btn-danger { background: var(--danger); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

/* ═══════════════════════════════════════════════════════════════
   SECTION ACTIONS
   ═══════════════════════════════════════════════════════════════ */
.section-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.product-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
