:root {
    --sidebar-bg: #3b2314;
    --sidebar-width: 230px;
    --orange: #e67e22;
    --orange-dark: #d35400;
    --brown-dark: #4a2c17;
    --brown-light: #f5f0eb;
    --text-muted: #8c8c8c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-card: 0 2px 8px rgba(0,0,0,.07);
    --radius: 12px;

    --body-bg: #f4f1ed;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-heading: #1a1a1a;
    --text-secondary: #333333;
    --border-soft: #f0ebe6;
    --border-med: #e8e5e0;
    --border-strong: #e0dbd5;
    --input-bg: #ffffff;
    --input-color: #333333;
    --table-head-bg: #faf8f5;
    --table-hover-bg: #fdfcfa;
    --soft-bg: #f8f6f3;
    --hover-soft: #f0ebe6;
    --hover-soft2: #e0d8d0;
    --icon-bg: #f5f0eb;
    --badge-bg: #f0ebe6;
    --badge-color: #7a6652;
    --accent-red: #e53935;
}

body.dark-mode {
    --body-bg: #17120d;
    --card-bg: #262019;
    --text-primary: #f0e9e2;
    --text-heading: #f5f0ea;
    --text-secondary: #d5ccc3;
    --text-muted: #9c948b;
    --border-soft: #332c24;
    --border-med: #3d352c;
    --border-strong: #4a4137;
    --input-bg: #2f2820;
    --input-color: #e5dcd3;
    --table-head-bg: #241f19;
    --table-hover-bg: #2c251e;
    --soft-bg: #2c251e;
    --hover-soft: #3a3229;
    --hover-soft2: #4a4137;
    --icon-bg: #3a3229;
    --badge-bg: #3a3229;
    --badge-color: #d5ccc3;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.35);
    --shadow-card: 0 2px 8px rgba(0,0,0,.4);
}

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

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--body-bg);
    color: var(--text-secondary);
    overflow-x: hidden;
    transition: background .25s ease, color .25s ease;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #3b2314 0%, #2a1a0e 100%);
    display: flex; flex-direction: column;
    z-index: 1000;
    transition: transform .3s ease;
}

.sidebar-brand {
    text-align: center; padding: 24px 16px 20px;
}

.sidebar-brand .logo-icon {
    width: 56px; height: 56px; margin: 0 auto 8px;
}

.sidebar-brand h1 {
    font-size: 24px; font-weight: 800; color: #fff;
    line-height: 1.1; margin-bottom: 2px;
}

.sidebar-brand h1 span { color: var(--orange); }

.sidebar-brand p {
    font-size: 11.5px; color: rgba(255,255,255,.55);
    letter-spacing: .3px;
}

.sidebar-nav {
    flex: 1; padding: 8px 12px; overflow-y: auto;
}

.nav-item {
    margin-bottom: 2px;
}

.nav-item a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; border-radius: 10px;
    color: rgba(255,255,255,.72); text-decoration: none;
    font-size: 15px; font-weight: 500;
    transition: all .2s ease;
}

.nav-item a i {
    font-size: 19px; width: 20px; text-align: center;
}

.nav-item a:hover {
    background: rgba(255,255,255,.08); color: #fff;
}

.nav-item a.active {
    background: var(--orange); color: #fff; font-weight: 600;
    box-shadow: 0 2px 8px rgba(230,126,34,.35);
}

.sidebar-footer {
    padding: 16px; border-top: 1px solid rgba(255,255,255,.1);
}

.sidebar-user {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px;
}

.sidebar-user .avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), #c0392b);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0;
}

.sidebar-user .user-info { line-height: 1.3; }

.sidebar-user .user-name {
    font-size: 14px; font-weight: 600; color: #fff;
}

.sidebar-user .user-role {
    font-size: 12px; color: rgba(255,255,255,.5);
}

.sidebar-logout {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 8px;
    color: rgba(255,255,255,.6); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: all .2s ease;
}

.sidebar-logout:hover {
    background: rgba(255,255,255,.08); color: #fff;
}

.sidebar-logout i { font-size: 17px; }

/* ===== MAIN AREA ===== */
.main-area {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ===== TOP BAR ===== */
.topbar {
    background: var(--card-bg); padding: 12px 28px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border-soft);
    position: sticky; top: 0; z-index: 100;
    transition: background .25s ease;
}

.topbar-left {
    display: flex; align-items: center; gap: 14px;
}

.topbar-left .hamburger {
    display: none; background: none; border: none;
    font-size: 23px; color: var(--text-secondary); cursor: pointer; padding: 4px;
}

.topbar-appname {
    font-size: 18px; font-weight: 800; color: var(--text-heading);
    margin: 0;
}

.appname-accent { color: var(--orange); }

.topbar-right {
    display: flex; align-items: center; gap: 18px;
}

/* ===== USER DROPDOWN ===== */
.user-dropdown {
    position: relative;
}

.user-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--soft-bg); border: 1px solid var(--border-med);
    color: var(--text-secondary); font-size: 23px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s ease;
}

.user-btn:hover,
.user-btn.active {
    background: var(--orange); border-color: var(--orange); color: #fff;
}

.dropdown-backdrop {
    position: fixed; inset: 0; z-index: 990; background: transparent;
}

.dropdown-menu-custom {
    position: absolute; right: 0; top: calc(100% + 10px);
    min-width: 220px; background: var(--card-bg);
    border: 1px solid var(--border-soft);
    border-radius: 12px; box-shadow: var(--shadow-card);
    z-index: 1000; padding: 8px;
    animation: fadeInUp .2s ease;
}

.dropdown-header {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-bottom: 6px;
    border-bottom: 1px solid var(--border-soft);
}

.dropdown-header .avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: linear-gradient(135deg, var(--orange), #c0392b);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 15px; flex-shrink: 0;
}

.dropdown-user-name {
    font-size: 14.5px; font-weight: 600; color: var(--text-primary);
}

.dropdown-user-role {
    font-size: 12.5px; color: var(--text-muted);
}

.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 12px; border: none; border-radius: 8px;
    background: transparent; font-size: 14.5px; font-weight: 500;
    color: var(--text-secondary); cursor: pointer;
    text-decoration: none; text-align: left; font-family: inherit;
    transition: background .15s ease, color .15s ease;
}

.dropdown-item:hover { background: var(--table-hover-bg); color: var(--orange); }

.dropdown-item i { font-size: 17px; }

.dropdown-item.dropdown-logout { color: var(--accent-red); }
.dropdown-item.dropdown-logout:hover { background: #fce4ec; color: #c62828; }

body.dark-mode .dropdown-item.dropdown-logout:hover { background: #3a1c1c; color: #ef5350; }

.dropdown-divider {
    height: 1px; background: var(--border-soft); margin: 6px 0;
}

/* ===== CONTENT ===== */
.content { padding: 24px 28px 40px; }

/* ===== BANNER ===== */
.banner {
    background: url('imgs/header.jpg') center/cover no-repeat;
    border-radius: var(--radius); padding: 36px 40px;
    display: flex; align-items: center; justify-content: space-between;
    position: relative; overflow: hidden; min-height: 220px;
    margin-bottom: 28px;
}

.banner::before {
    content: ''; position: absolute; top: 0; right: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(255,246,238,.92) 0%, rgba(255,246,238,.45) 45%, rgba(255,246,238,.05) 100%);
}

.banner-content { position: relative; z-index: 2; max-width: 55%; }

.banner-brand {
    display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}

.banner-logo {
    width: 50px; height: 50px; background: var(--brown-dark);
    border-radius: 12px; display: flex; align-items: center;
    justify-content: center; flex-shrink: 0;
}

.banner-logo img {
    width: 100%; height: 100%; object-fit: cover; border-radius: 12px; display: block;
}

.banner-brand-text h2 {
    font-size: 28px; font-weight: 800; color: #2d1b0e;
}

.banner-brand-text h2 span { color: var(--orange); }

.banner-brand-text p {
    font-size: 13.5px; color: #7a6652; font-weight: 500;
}

.banner-tagline {
    font-size: 21px; font-weight: 700; color: #2d1b0e; line-height: 1.4;
}

.banner-illustration {
    position: relative; z-index: 2; flex-shrink: 0;
}

.banner-illustration .seller-figure {
    width: 280px; height: 200px; position: relative;
}

.seller-figure .stall {
    position: absolute; bottom: 0; right: 0;
    width: 200px; height: 160px;
    background: linear-gradient(180deg, #5d4037 0%, #4e342e 100%);
    border-radius: 12px 12px 0 0;
}

.seller-figure .stall::before {
    content: ''; position: absolute; top: -20px; left: -20px;
    right: -20px; height: 24px;
    background: linear-gradient(180deg, #795548, #6d4c41);
    border-radius: 8px 8px 0 0;
}

.seller-figure .person {
    position: absolute; bottom: 10px; left: 30px;
    width: 100px; height: 150px;
}

.seller-figure .person-head {
    width: 50px; height: 50px; background: #f5cba7;
    border-radius: 50%; margin: 0 auto 4px; position: relative;
}

.seller-figure .person-head::before {
    content: ''; position: absolute; top: -8px; left: 5px; right: 5px;
    height: 30px; background: #3e2723; border-radius: 50% 50% 0 0;
}

.seller-figure .person-body {
    width: 70px; height: 80px; background: var(--orange);
    border-radius: 12px; margin: 0 auto;
}

.banner-kopi-enak {
    position: absolute; top: 16px; right: 24px;
    z-index: 3; text-align: right;
}

.banner-kopi-enak p {
    font-size: 14px; font-weight: 700; color: #2d1b0e;
}

.banner-kopi-enak .arrow {
    font-size: 25px; color: var(--orange);
    transform: rotate(-30deg); display: inline-block;
}

.banner-ss-badge {
    position: absolute; bottom: 20px; right: 60px; z-index: 3;
    width: 48px; height: 48px; background: var(--brown-dark);
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; border: 3px solid #fff;
}

.banner-ss-badge span {
    color: #fff; font-weight: 800; font-size: 15px;
}

/* ===== STAT CARDS ===== */
.stats-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 18px; margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 20px;
    box-shadow: var(--shadow-card); border: 1px solid var(--border-soft);
    transition: background .25s ease;
}

.stat-card-body {
    display: flex; align-items: flex-start; gap: 14px;
}

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

.stat-icon {
    width: 44px; height: 44px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; flex-shrink: 0;
}

.stat-icon.green { background: #e8f5e9; color: #43a047; }
.stat-icon.blue { background: #e3f2fd; color: #1e88e5; }
.stat-icon.purple { background: #ede7f6; color: #7e57c2; }
.stat-icon.orange { background: #fff3e0; color: var(--orange); }

body.dark-mode .stat-icon.green { background: rgba(67,160,71,.2); color: #81c784; }
body.dark-mode .stat-icon.blue { background: rgba(30,136,229,.2); color: #64b5f6; }
body.dark-mode .stat-icon.purple { background: rgba(126,87,194,.2); color: #9575cd; }
body.dark-mode .stat-icon.orange { background: rgba(230,126,34,.2); color: #ffb74d; }

.stat-card .stat-label {
    font-size: 13.5px; color: var(--text-muted);
}

.stat-card .stat-value {
    font-size: 25px;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: -6px;
}

.stat-card .stat-link {
    font-size: 13.5px; color: var(--orange); font-weight: 600;
    text-decoration: none; display: inline-flex;
    align-items: center; gap: 4px; 
    transition: gap .2s ease;
}

.stat-card .stat-link:hover { gap: 8px; }

.stat-progress {
    margin-top: 10px;
}

.stat-progress .progress-label {
    display: flex; justify-content: space-between;
    font-size: 12.5px; color: var(--text-muted); margin-bottom: 5px;
}

.stat-progress .progress-bar-wrap {
    height: 7px; background: var(--border-med); border-radius: 10px; overflow: hidden;
}

.stat-progress .progress-fill {
    height: 100%; background: linear-gradient(90deg, #43a047, #66bb6a);
    border-radius: 10px; transition: width .6s ease;
}

/* ===== QUICK MENU ===== */
.section-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h5 {
    font-size: 18px; font-weight: 700; color: var(--text-primary);
}

.section-header a {
    font-size: 14px; color: var(--orange); font-weight: 600;
    text-decoration: none; display: inline-flex;
    align-items: center; gap: 4px;
}

.section-header a:hover { gap: 8px; }

.quick-menu {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px; margin-bottom: 32px;
}

.quick-menu-item {
    background: var(--card-bg); border-radius: var(--radius); padding: 24px 16px;
    text-align: center; border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm); cursor: pointer;
    transition: all .25s ease; text-decoration: none;
}

.quick-menu-item:hover {
    transform: translateY(-3px); box-shadow: var(--shadow-card);
    border-color: var(--orange);
}

.quick-menu-icon {
    width: 52px; height: 52px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 25px; margin: 0 auto 12px;
}

.quick-menu-icon.bg-orange { background: #fff3e0; color: var(--orange); }
.quick-menu-icon.bg-blue { background: #e3f2fd; color: #1e88e5; }
.quick-menu-icon.bg-indigo { background: #e8eaf6; color: #3f51b5; }
.quick-menu-icon.bg-green { background: #e8f5e9; color: #43a047; }

body.dark-mode .quick-menu-icon.bg-orange { background: rgba(230,126,34,.2); color: #ffb74d; }
body.dark-mode .quick-menu-icon.bg-blue { background: rgba(30,136,229,.2); color: #64b5f6; }
body.dark-mode .quick-menu-icon.bg-indigo { background: rgba(63,81,181,.2); color: #7986cb; }
body.dark-mode .quick-menu-icon.bg-green { background: rgba(67,160,71,.2); color: #81c784; }

.quick-menu-item span {
    font-size: 14.5px; font-weight: 600; color: var(--text-secondary);
}

/* ===== BEST SELLERS ===== */
.bestsellers-row {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.product-card {
    background: var(--card-bg); border-radius: var(--radius); padding: 14px;
    display: flex; align-items: center; gap: 14px;
    border: 1px solid var(--border-soft); box-shadow: var(--shadow-sm);
    transition: all .25s ease; cursor: pointer;
}

.product-card:hover {
    transform: translateY(-2px); box-shadow: var(--shadow-card);
}

.product-img {
    width: 64px; height: 64px; border-radius: 12px; flex-shrink: 0;
    overflow: hidden; background: var(--icon-bg);
}

.product-img img {
    width: 100%; height: 100%; object-fit: cover;
}

.product-img .placeholder-img {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 29px; background: linear-gradient(135deg, #d7ccc8, #bcaaa4);
}

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

.product-info h6 {
    font-size: 14.5px; font-weight: 700; color: var(--text-heading);
    margin-bottom: 3px; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}

.product-info .price {
    font-size: 15px; font-weight: 700; color: var(--orange);
}

.product-info .sold {
    font-size: 12.5px; color: var(--text-muted); margin-top: 2px;
}

/* ===== MOBILE OVERLAY ===== */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 999;
}

.sidebar-overlay.active { display: block; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1200px) {
    .stats-row, .quick-menu, .bestsellers-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open { transform: translateX(0); }

    .main-area { margin-left: 0; }

    .topbar-left .hamburger { display: block; }

    .stats-row, .quick-menu, .bestsellers-row {
        grid-template-columns: 1fr;
    }

    .banner { flex-direction: column; padding: 24px; }

    .banner-content { max-width: 100%; }

    .banner-illustration { display: none; }

    .content { padding: 16px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c4b5a8; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a89888; }

body.dark-mode ::-webkit-scrollbar-thumb { background: #4a4137; }
body.dark-mode ::-webkit-scrollbar-thumb:hover { background: #5a5046; }

/* ===== ANIMATION ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp .45s ease forwards;
    opacity: 0;
}

.animate-in:nth-child(1) { animation-delay: .05s; }
.animate-in:nth-child(2) { animation-delay: .1s; }
.animate-in:nth-child(3) { animation-delay: .15s; }
.animate-in:nth-child(4) { animation-delay: .2s; }

/* ===== PAGE HEADER ===== */
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px;
}

.page-title {
    font-size: 21px; font-weight: 700; color: var(--text-primary); margin: 0;
}

.page-subtitle {
    font-size: 14px; color: var(--text-muted); margin: 2px 0 0;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 10px; font-size: 14.5px;
    font-weight: 600; border: none; cursor: pointer;
    text-decoration: none; transition: all .2s ease;
}

.btn-add {
    background: var(--orange); color: #fff;
}

.btn-add:hover { background: var(--orange-dark); color: #fff; }

.btn-back {
    background: var(--hover-soft); color: var(--text-secondary);
}

.btn-back:hover { background: var(--hover-soft2); color: var(--text-primary); }

.btn-save {
    background: var(--orange); color: #fff;
}

.btn-save:hover { background: var(--orange-dark); color: #fff; }

.btn-cancel {
    background: var(--hover-soft); color: var(--text-secondary);
}

.btn-cancel:hover { background: var(--hover-soft2); color: var(--text-primary); }

/* ===== FILTER BAR ===== */
.filter-bar {
    display: flex; gap: 12px; margin-bottom: 20px;
}

.search-box {
    flex: 1; display: flex; align-items: center; gap: 10px;
    background: var(--card-bg); border: 1px solid var(--border-med); border-radius: 10px;
    padding: 0 14px; transition: border-color .2s;
    color: var(--text-secondary);
}

.search-box:focus-within { border-color: var(--orange); }

.search-box i { color: var(--text-muted); font-size: 17px; }

.search-box input {
    flex: 1; border: none; outline: none; padding: 11px 0;
    font-size: 14.5px; background: transparent; color: var(--input-color);
}

.search-box input::placeholder { color: var(--text-muted); opacity: .6; }

.filter-select {
    padding: 10px 14px; border: 1px solid var(--border-med); border-radius: 10px;
    font-size: 14.5px; color: var(--text-secondary); background: var(--card-bg);
    outline: none; cursor: pointer; min-width: 160px;
}

.filter-select:focus { border-color: var(--orange); }

/* ===== PRODUK STATS ===== */
.produk-stats {
    display: flex; gap: 16px; margin-bottom: 20px;
}

.produk-stat-item {
    background: var(--card-bg); border: 1px solid var(--border-soft); border-radius: 10px;
    padding: 14px 20px; display: flex; flex-direction: column;
    min-width: 130px;
}

.stat-num {
    font-size: 23px; font-weight: 800; color: var(--text-primary);
}

.stat-txt {
    font-size: 13px; color: var(--text-muted); font-weight: 500;
}

/* ===== TABLE CARD ===== */
.table-card {
    background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card); overflow: hidden;
    transition: background .25s ease;
}

.data-table {
    width: 100%; border-collapse: collapse;
}

.data-table thead {
    background: var(--table-head-bg);
}

.data-table th {
    padding: 13px 18px; font-size: 13px; font-weight: 600;
    color: var(--text-muted); text-align: left;
    text-transform: uppercase; letter-spacing: .3px;
    border-bottom: 1px solid var(--border-soft);
}

.data-table td {
    padding: 14px 18px; font-size: 14.5px; color: var(--text-secondary);
    border-bottom: 1px solid var(--border-soft);
    vertical-align: middle;
}

.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: var(--table-hover-bg); }
.data-table tbody tr:last-child td { border-bottom: none; }

.product-cell {
    display: flex; align-items: center; gap: 12px;
}

.product-cell-icon {
    width: 42px; height: 42px; border-radius: 10px;
    background: linear-gradient(135deg, #d7ccc8, #bcaaa4);
    display: flex; align-items: center; justify-content: center;
    font-size: 21px; flex-shrink: 0;
}

.product-cell-name {
    font-weight: 600; color: var(--text-heading); font-size: 14.5px;
}

.product-cell-desc {
    font-size: 12.5px; color: var(--text-muted); margin-top: 1px;
}

.badge-cat {
    display: inline-block; padding: 4px 10px; border-radius: 6px;
    font-size: 12.5px; font-weight: 600; background: var(--badge-bg); color: var(--badge-color);
}

.price-cell {
    font-weight: 700; color: var(--orange); font-size: 14.5px;
}

.stock-pill {
    display: inline-block; padding: 3px 10px; border-radius: 6px;
    font-size: 13px; font-weight: 600; background: #e8f5e9; color: #2e7d32;
}

.stock-pill.low {
    background: #fce4ec; color: #c62828;
}

body.dark-mode .stock-pill { background: rgba(46,125,50,.22); color: #81c784; }
body.dark-mode .stock-pill.low { background: rgba(198,40,40,.22); color: #ef9a9a; }

.status-pill {
    display: inline-block; padding: 4px 12px; border-radius: 20px;
    font-size: 12.5px; font-weight: 600;
}

.status-pill.active { background: #e8f5e9; color: #2e7d32; }
.status-pill.inactive { background: #f5f5f5; color: #999; }

body.dark-mode .status-pill.active { background: rgba(46,125,50,.22); color: #81c784; }
body.dark-mode .status-pill.inactive { background: var(--hover-soft); color: var(--text-muted); }

.text-center { text-align: center; }

.token-cell {
    word-break: break-all;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    max-width: 420px;
}

.action-btns {
    display: flex; gap: 6px; 
    /*justify-content: center;*/
}

.btn-icon {
    width: 34px; height: 34px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    border: none; cursor: pointer; font-size: 15px;
    transition: all .2s ease; text-decoration: none;
}

.btn-edit {
    background: #e3f2fd; color: #1e88e5;
}

.btn-edit:hover { background: #bbdefb; }

.btn-delete {
    background: #fce4ec; color: #e53935;
}

.btn-delete:hover { background: #f8bbd0; }

.btn-reset {
    background: #37474f; color: #eceff1;
}

.btn-reset:hover { background: #263238; color: #ffffff; }

body.dark-mode .btn-reset { background: rgba(55,71,79,.6); color: #eceff1; }
body.dark-mode .btn-reset:hover { background: #37474f; color: #ffffff; }

body.dark-mode .btn-edit { background: rgba(30,136,229,.2); color: #64b5f6; }
body.dark-mode .btn-edit:hover { background: rgba(30,136,229,.3); }
body.dark-mode .btn-delete { background: rgba(229,57,53,.2); color: #ef5350; }
body.dark-mode .btn-delete:hover { background: rgba(229,57,53,.3); }

.empty-state {
    padding: 60px 20px; text-align: center; color: var(--text-muted);
}

.empty-state i { font-size: 49px; margin-bottom: 12px; display: block; opacity: .4; }
.empty-state p { font-size: 15px; }

/* ===== FORM CARD ===== */
.form-card {
    background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border-soft);
    box-shadow: var(--shadow-card); padding: 28px;
    transition: background .25s ease;
}

.form-grid {
    display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 32px;
}

.form-section-title {
    font-size: 15px; font-weight: 700; color: var(--text-primary);
    margin-bottom: 18px; padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block; font-size: 13.5px; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
}

.required { color: #e53935; }

.form-control-custom {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border-strong);
    border-radius: 8px; font-size: 14.5px; color: var(--input-color);
    background: var(--input-bg); outline: none; transition: border-color .2s;
    font-family: inherit;
}

.form-control-custom:focus { border-color: var(--orange); }

.form-control-custom.textarea {
    resize: vertical; min-height: 80px;
}

.form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}

.form-hint {
    font-size: 12.5px; color: var(--text-muted); margin-top: 4px; display: block;
}

/* ===== TOGGLE ===== */
.toggle-row {
    display: flex; align-items: center; gap: 12px;
}

.toggle-label {
    font-size: 14.5px; font-weight: 600; color: var(--text-secondary);
}

.toggle-switch {
    position: relative; width: 44px; height: 24px; cursor: pointer;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute; inset: 0; background: var(--border-med);
    border-radius: 24px; transition: background .25s;
}

.toggle-slider::before {
    content: ''; position: absolute; top: 3px; left: 3px;
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--card-bg); transition: transform .25s;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.toggle-switch input:checked + .toggle-slider { background: var(--orange); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ===== ICON PICKER ===== */
.icon-picker {
    display: flex; gap: 8px; flex-wrap: wrap;
}

.icon-option {
    width: 42px; height: 42px; border-radius: 10px;
    border: 2px solid var(--border-med); background: var(--card-bg);
    font-size: 21px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .2s;
}

.icon-option:hover { border-color: var(--orange); }

.icon-option.selected {
    border-color: var(--orange); background: #fff3e0;
    box-shadow: 0 0 0 3px rgba(230,126,34,.15);
}

body.dark-mode .icon-option.selected { background: rgba(230,126,34,.2); }

/* ===== PREVIEW ===== */
.preview-box { margin-top: 24px; }

.preview-card {
    background: linear-gradient(135deg, #f6e6d0, #e8cba0);
    border-radius: 14px; padding: 24px; text-align: center;
}

.preview-icon {
    font-size: 41px; margin-bottom: 8px;
}

.preview-name {
    font-size: 17px; font-weight: 700; color: #2d1b0e;
    margin-bottom: 4px;
}

.preview-price {
    font-size: 19px; font-weight: 800; color: var(--orange);
    margin-bottom: 4px;
}

.preview-cat {
    font-size: 12.5px; color: #7a6652; font-weight: 500;
}

/* ===== FORM ACTIONS ===== */
.form-actions {
    display: flex; justify-content: flex-end; gap: 10px;
    margin-top: 28px; padding-top: 20px;
    border-top: 1px solid var(--border-soft);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }

    .filter-bar { flex-direction: column; }

    .filter-select { min-width: 100%; }

    .produk-stats { flex-wrap: wrap; }

    .data-table { font-size: 13px; }

    .data-table th, .data-table td { padding: 10px 12px; }

    .form-grid { grid-template-columns: 1fr; }

    .form-row { grid-template-columns: 1fr; }

    .form-actions { flex-direction: column; }

    .form-actions .btn { justify-content: center; }
}

@media (max-width: 768px) {
    .dropdown-menu-custom { min-width: 200px; }
}

/* ===== LOGIN ===== */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    position: relative; overflow-x: hidden; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: linear-gradient(135deg, #2a1a0e 0%, #3b2314 55%, #5a3820 100%);
}

.login-shapes { position: absolute; inset: 0; pointer-events: none; }

.shape {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle, rgba(230,126,34,.28), transparent 65%);
}

.shape-1 { width: 420px; height: 420px; top: -120px; left: -120px; }
.shape-2 { width: 520px; height: 520px; bottom: -180px; right: -160px;
    background: radial-gradient(circle, rgba(230,126,34,.18), transparent 65%); }
.shape-3 { width: 220px; height: 220px; bottom: 40px; left: 8%;
    background: radial-gradient(circle, rgba(255,255,255,.10), transparent 65%); }

.login-card {
    position: relative; z-index: 2;
    margin: auto;
    width: 100%; max-width: 420px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 40px 36px 32px;
    box-shadow: 0 24px 70px rgba(0,0,0,.45);
    animation: loginCardIn .5s ease;
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-brand { text-align: center; margin-bottom: 28px; }

.login-logo {
    width: 64px; height: 64px; margin: 0 auto 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 31px;
    box-shadow: 0 8px 20px rgba(230,126,34,.35);
}

.login-brand-title {
    font-size: 32px; font-weight: 800; color: var(--text-primary);
}

.login-brand-title span { color: var(--orange); }

.login-brand-tagline {
    font-size: 14px; color: var(--text-muted); margin-top: 4px;
}

.login-title {
    font-size: 21px; font-weight: 700; color: var(--text-primary);
    text-align: center;
}

.login-subtitle {
    font-size: 14px; color: var(--text-muted);
    text-align: center; margin: 4px 0 22px;
}

.alert-login {
    display: flex; align-items: center; gap: 8px;
    background: rgba(229,57,53,.10);
    border: 1px solid rgba(229,57,53,.35);
    color: var(--accent-red);
    padding: 10px 14px; border-radius: 10px;
    font-size: 14px; font-weight: 500; margin-bottom: 18px;
}

.form-group { margin-bottom: 18px; }

.form-group label {
    display: flex; align-items: center; gap: 6px;
    font-size: 14px; font-weight: 600; color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group label i { color: var(--orange); }

.form-control-login {
    width: 100%;
    background: var(--input-bg);
    color: var(--input-color);
    border: 1.5px solid var(--border-med);
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.password-input { position: relative; }

.password-input input {
    width: 100%;
    background: var(--input-bg);
    color: var(--input-color);
    border: 1.5px solid var(--border-med);
    border-radius: 12px;
    padding: 12px 44px 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-control-login:focus,
.password-input input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(230,126,34,.18);
}

.form-control-login::placeholder,
.password-input input::placeholder { color: var(--text-muted); }

.btn-toggle-pass {
    position: absolute; top: 50%; right: 10px; transform: translateY(-50%);
    background: none; border: none; color: var(--text-muted);
    font-size: 17px; padding: 4px; cursor: pointer;
}

.btn-toggle-pass:hover { color: var(--orange); }

.btn-login {
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    border: none; border-radius: 12px;
    padding: 13px 16px;
    font-size: 16px; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(230,126,34,.35);
    transition: filter .2s, transform .15s;
}

.btn-login:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }

.btn-login:disabled { opacity: .7; cursor: not-allowed; }

.login-remember {
    margin: 12px 0;
    display: flex; align-items: center;
}

.checkbox-label {
    display: flex; align-items: center; gap: 8px;
    font-size: 14.5px; color: var(--text-muted);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 17px; height: 17px;
    accent-color: #e67e22;
    cursor: pointer;
}

.checkbox-label span { font-weight: 500; }

.login-demo {
    margin-top: 20px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-size: 13.5px; color: var(--text-muted);
    background: var(--soft-bg);
    border: 1px dashed var(--border-med);
    border-radius: 10px;
    padding: 9px 12px;
}

.login-demo code {
    background: var(--badge-bg);
    color: var(--badge-color);
    padding: 2px 7px; border-radius: 6px;
    font-size: 13px; font-weight: 700;
}

/* ===== APP LOADING ===== */
.app-loading {
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #2a1a0e 0%, #3b2314 55%, #5a3820 100%);
}

.app-loading-inner { text-align: center; }

.app-loading-logo {
    width: 220px; height: 220px; margin: 0 auto 26px;
    border-radius: 32px;
    background: linear-gradient(135deg, #e67e22, #d35400);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 20px rgba(230,126,34,.35);
    animation: appLoadingPulse 1.2s ease-in-out infinite;
}

.app-loading-logo img {
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 18px;
}

@keyframes appLoadingPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: .75; }
}

.app-loading-bar {
    width: 90px; height: 4px; margin: 0 auto;
    background: rgba(255,255,255,.15);
    border-radius: 4px; overflow: hidden;
}

.app-loading-bar span {
    display: block; height: 100%; width: 40%;
    border-radius: 4px;
    background: linear-gradient(90deg, #e67e22, #f5a623);
    animation: appLoadingSlide 1s ease-in-out infinite;
}

@keyframes appLoadingSlide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}