/* ============================================
   WARUNG SOTO - Modern Responsive UI
   ============================================ */

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

:root {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --primary-light: #fef3c7;
    --secondary: #dc2626;
    --success: #10b981;
    --info: #3b82f6;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --white: #ffffff;
    --bg: #f5f6fa;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --sidebar-w: 260px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

/* ============================================
   APP SHELL
   ============================================ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   SIDEBAR (Desktop)
   ============================================ */
.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #fffbeb 0%, #ffffff 100%);
    border-right: 1px solid var(--gray-200);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.brand-logo {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-md);
}

.brand-text { line-height: 1.2; }
.brand-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-900);
}
.brand-sub {
    font-size: 12px;
    color: var(--gray-500);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius);
    color: var(--gray-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-item:hover {
    background: var(--gray-100);
    color: var(--gray-900);
}

.nav-item.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.35);
}

.nav-icon { font-size: 18px; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--gray-200);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.user-info { flex: 1; min-width: 0; }
.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-role {
    font-size: 11px;
    color: var(--gray-500);
}

.btn-logout {
    width: 100%;
    padding: 10px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--danger);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}
.btn-logout:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    min-width: 0;
}

.topbar-mobile { display: none; }

.topbar-desktop {
    background: white;
    padding: 24px 32px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.page-subtitle {
    color: var(--gray-500);
    font-size: 14px;
}

.topbar-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.page-body {
    padding: 24px 32px 32px;
}

/* ============================================
   BOTTOM NAVIGATION (Mobile)
   ============================================ */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    z-index: 100;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.08);
    justify-content: space-around;
    align-items: flex-end;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--gray-500);
    font-weight: 500;
    transition: all 0.2s;
    min-width: 0;
}

.bn-icon {
    font-size: 20px;
    line-height: 1;
}

.bn-label {
    font-size: 10px;
    line-height: 1;
}

.bottom-nav-item.active {
    color: var(--primary-dark);
}
.bottom-nav-item.active .bn-icon { transform: scale(1.1); }

.bottom-nav-item.bn-center {
    position: relative;
}

.bn-icon-center {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
    margin-top: -20px;
    margin-bottom: 2px;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.card-header {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

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

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

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin-bottom: 12px;
}
.stat-card.success .stat-icon { background: #d1fae5; color: var(--success); }
.stat-card.danger .stat-icon { background: #fee2e2; color: var(--danger); }
.stat-card.info .stat-icon { background: #dbeafe; color: var(--info); }

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 4px;
    font-weight: 500;
}
.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.2;
}
.stat-extra {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 6px;
}

/* Time period cards */
.waktu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.waktu-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 18px;
    border: 2px solid var(--gray-200);
    text-align: center;
    transition: all 0.2s;
}
.waktu-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.waktu-card.pagi { border-color: #fef3c7; background: linear-gradient(135deg, #fffbeb, white); }
.waktu-card.siang { border-color: #fed7aa; background: linear-gradient(135deg, #fff7ed, white); }
.waktu-card.sore { border-color: #fbcfe8; background: linear-gradient(135deg, #fdf2f8, white); }
.waktu-card.malam { border-color: #c7d2fe; background: linear-gradient(135deg, #eef2ff, white); }

.waktu-emoji {
    font-size: 32px;
    margin-bottom: 6px;
    display: block;
}
.waktu-label {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 2px;
}
.waktu-jam {
    font-size: 11px;
    color: var(--gray-500);
    margin-bottom: 10px;
}
.waktu-jumlah {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
}
.waktu-suffix {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}
.waktu-omzet {
    font-size: 12px;
    color: var(--gray-600);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--gray-200);
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-info { background: var(--info); color: white; }
.btn-info:hover { background: #2563eb; }
.btn-outline { background: white; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 24px; font-size: 15px; }
.btn-block { width: 100%; }

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}
.btn-icon:hover { background: var(--gray-200); }

/* Forms */
.form-group {
    margin-bottom: 16px;
}
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}
.form-control,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 14px;
    background: white;
    transition: all 0.2s;
    font-family: inherit;
}
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.form-help {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.form-check input { width: 18px; height: 18px; }

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info { background: #dbeafe; color: #1e40af; border-left: 4px solid var(--info); }

/* Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    background: white;
    -webkit-overflow-scrolling: touch;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.table-wrapper .table {
    min-width: 600px;
}
.table thead {
    background: var(--gray-50);
}
.table th {
    text-align: left;
    padding: 12px 14px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--gray-200);
}
.table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}
.table tbody tr:hover { background: var(--gray-50); }
.table tbody tr:last-child td { border-bottom: none; }

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-secondary { background: var(--gray-100); color: var(--gray-700); }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}
.empty-state-icon {
    font-size: 56px;
    margin-bottom: 12px;
}
.empty-state-text {
    font-size: 15px;
    margin-bottom: 4px;
    color: var(--gray-700);
    font-weight: 600;
}
.empty-state-hint {
    font-size: 13px;
    color: var(--gray-500);
}

/* Pagination */
.pagination-wrapper {
    margin-top: 20px;
    display: flex;
    justify-content: center;
}
.pagination-wrapper nav { display: flex; gap: 4px; flex-wrap: wrap; }
.pagination-wrapper a,
.pagination-wrapper span {
    padding: 8px 12px;
    border-radius: var(--radius);
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}
.pagination-wrapper a:hover { background: var(--gray-100); }
.pagination-wrapper .active span,
.pagination-wrapper [aria-current] span {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ============================================
   PRODUK GRID
   ============================================ */
.produk-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.produk-card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}
.produk-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.produk-foto {
    aspect-ratio: 4/3;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.produk-foto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.produk-foto-placeholder {
    font-size: 48px;
    opacity: 0.3;
}
.produk-info {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.produk-kategori {
    font-size: 11px;
    color: var(--primary-dark);
    background: var(--primary-light);
    padding: 2px 8px;
    border-radius: 999px;
    align-self: flex-start;
    font-weight: 600;
    margin-bottom: 6px;
}
.produk-nama {
    font-size: 15px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.produk-harga {
    font-size: 16px;
    font-weight: 800;
    color: var(--primary-dark);
    margin-top: 4px;
}
.produk-actions {
    display: flex;
    gap: 6px;
    padding: 0 14px 14px;
}
.produk-actions .btn { flex: 1; }

/* ============================================
   KASIR (POS)
   ============================================ */
.kasir-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 20px;
    height: calc(100vh - 180px);
    min-height: 500px;
}

.kasir-produk {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
}

.kasir-cart {
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.cart-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}
.cart-title {
    font-weight: 700;
    color: var(--gray-900);
    font-size: 16px;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    margin-bottom: 6px;
    background: var(--gray-50);
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cart-item-price {
    font-size: 12px;
    color: var(--gray-500);
}
.cart-qty {
    display: flex;
    align-items: center;
    gap: 6px;
}
.qty-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--gray-300);
    background: white;
    cursor: pointer;
    font-weight: 700;
    color: var(--gray-700);
}
.qty-btn:hover { background: var(--gray-100); }
.qty-num {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
}

.cart-summary {
    padding: 16px 20px;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--gray-700);
}
.summary-row.total {
    font-size: 18px;
    font-weight: 800;
    color: var(--gray-900);
    padding-top: 10px;
    border-top: 1px dashed var(--gray-300);
    margin-top: 10px;
}

.cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-400);
}

/* Kasir produk grid */
.kasir-kategori-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
}
.kategori-tab {
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--gray-100);
    border: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.kategori-tab.active {
    background: var(--primary);
    color: white;
}

.kasir-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}
.kasir-produk-card {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.kasir-produk-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.kasir-produk-card .foto-mini {
    aspect-ratio: 1;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.kasir-produk-card .foto-mini img {
    width: 100%; height: 100%; object-fit: cover;
}
.kasir-produk-card .foto-mini-placeholder { font-size: 32px; opacity: 0.4; }
.kasir-produk-card .info-mini {
    padding: 8px 8px 10px;
}
.kasir-produk-card .nama-mini {
    font-size: 12px;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kasir-produk-card .harga-mini {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary-dark);
}

/* ============================================
   AUTH (LOGIN)
   ============================================ */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 50%, #fbbf24 100%);
    position: relative;
    overflow: hidden;
}
.auth-page::before {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(220,38,38,0.15), transparent);
    border-radius: 50%;
    top: -200px; right: -200px;
}
.auth-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.4), transparent);
    border-radius: 50%;
    bottom: -150px; left: -150px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px 32px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
    position: relative;
    z-index: 1;
}
.auth-logo {
    text-align: center;
    margin-bottom: 28px;
}
.auth-logo-emoji {
    width: 70px; height: 70px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
}
.auth-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--gray-900);
    margin-bottom: 4px;
}
.auth-subtitle {
    font-size: 14px;
    color: var(--gray-500);
}
.auth-info {
    background: var(--primary-light);
    color: var(--primary-dark);
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 12px;
    margin-top: 16px;
    text-align: center;
    line-height: 1.5;
}

/* ============================================
   STRUK / RECEIPT
   ============================================ */
.struk-wrapper {
    max-width: 380px;
    margin: 0 auto;
    background: white;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 2px dashed var(--gray-300);
    font-family: 'Courier New', monospace;
}
.struk-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px dashed var(--gray-300);
}
.struk-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}
.struk-info {
    font-size: 12px;
    color: var(--gray-600);
}
.struk-row {
    display: flex;
    justify-content: space-between;
    margin: 4px 0;
    font-size: 13px;
}
.struk-divider {
    border-top: 1px dashed var(--gray-300);
    margin: 10px 0;
}
.struk-total {
    font-size: 16px;
    font-weight: 800;
}

/* ============================================
   FILTER BAR
   ============================================ */
.filter-bar {
    background: white;
    padding: 14px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    margin-bottom: 20px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: end;
}
.filter-bar .form-group { margin-bottom: 0; flex: 1; min-width: 140px; }

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 1023px) {
    .sidebar { display: none; }

    .main-content {
        margin-left: 0;
        padding-bottom: 80px;
    }

    .topbar-mobile {
        display: flex;
        position: sticky;
        top: 0;
        background: white;
        padding: 12px 16px;
        border-bottom: 1px solid var(--gray-200);
        z-index: 50;
        justify-content: space-between;
        align-items: center;
        box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    }

    .topbar-brand {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 700;
        font-size: 16px;
        color: var(--gray-900);
    }
    .brand-logo-sm {
        width: 32px; height: 32px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        border-radius: 8px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
    }

    .topbar-desktop { display: none; }

    .page-body {
        padding: 16px;
    }

    .bottom-nav { display: flex; }

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

    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; }
    .stat-icon { width: 36px; height: 36px; font-size: 18px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 11px; }

    .waktu-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .waktu-card { padding: 14px; }
    .waktu-emoji { font-size: 24px; }
    .waktu-jumlah { font-size: 22px; }

    .kasir-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .kasir-cart {
        position: fixed;
        bottom: 70px;
        left: 0; right: 0;
        z-index: 40;
        max-height: 85vh;
        transform: translateY(calc(100% - 60px));
        transition: transform 0.3s;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    }
    .kasir-cart.open {
        transform: translateY(0);
    }
    /* Cart-items harus garansi minimal 3 item terlihat (di-scroll kalau lebih) */
    .kasir-cart.open .cart-items {
        min-height: 200px;
        max-height: 35vh;
    }
    .cart-header {
        cursor: pointer;
        position: relative;
    }
    .cart-header::after {
        content: '⌃';
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 18px;
        transition: transform 0.3s;
    }
    .kasir-cart.open .cart-header::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .kasir-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
    .produk-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }

    .card { padding: 14px; }
    .page-title { font-size: 18px; }

    .filter-bar { padding: 10px; gap: 8px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .produk-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .bn-label { font-size: 9px; }
}

/* Print */
@media print {
    .sidebar, .topbar-mobile, .topbar-desktop, .bottom-nav, .no-print { display: none !important; }
    .main-content { margin-left: 0; }
    .page-body { padding: 0; }
    body { background: white; }
    .card { box-shadow: none; border: 1px solid #000; }
}

/* Utilities */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }
.text-bold { font-weight: 700; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }

.divider {
    height: 1px;
    background: var(--gray-200);
    margin: 16px 0;
    border: none;
}

/* Section titles */
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 14px;
    margin-top: 24px;
}
.section-title:first-child { margin-top: 0; }

/* ============ LAPORAN ============ */
.laporan-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.laporan-tab {
    padding: 10px 18px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: 10px;
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    transition: all .15s ease;
}
.laporan-tab:hover {
    border-color: var(--primary);
    color: var(--primary);
}
.laporan-tab.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(245, 158, 11, .35);
}

.laporan-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
@media (max-width: 768px) {
    .laporan-grid { grid-template-columns: 1fr; }
}

.laporan-header { display: none; }

.table-summary tbody tr td {
    padding: 12px 16px;
    font-size: 15px;
}
.table-summary .row-subtotal td {
    background: var(--gray-50);
    border-top: 2px solid var(--gray-300);
}
.table-summary .row-total td {
    background: #fef3c7;
    border-top: 2px solid var(--primary);
    font-size: 17px;
}

.row-total td { background: var(--gray-50); }
.row-subtotal td { background: var(--gray-50); }

.stat-sub {
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 4px;
}

.stat-card-warning { border-left-color: #f59e0b; }
.stat-card-warning .stat-value { color: #b45309; }
.stat-card-info { border-left-color: #3b82f6; }
.stat-card-info .stat-value { color: #1d4ed8; }
.stat-card-success { border-left-color: #10b981; }
.stat-card-success .stat-value { color: #047857; }
.stat-card-danger { border-left-color: #dc2626; }
.stat-card-danger .stat-value { color: #b91c1c; }
.stat-card-primary { border-left-color: var(--primary); }
.stat-card-primary .stat-value { color: var(--primary-dark); }

.text-success { color: #047857; }
.text-danger { color: #b91c1c; }
.text-right { text-align: right; }
.text-center { text-align: center; }

.badge-success { background: #d1fae5; color: #047857; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }

.empty-state {
    text-align: center;
    padding: 40px 16px;
    color: var(--gray-500);
    font-style: italic;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Print styles */
.print-only { display: none; }

@media print {
    .no-print { display: none !important; }
    .print-only { display: block !important; }
    body { background: white; }
    .sidebar, .bottom-nav, .topbar { display: none !important; }
    .main-content { margin-left: 0 !important; padding: 0 !important; }
    .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
    .laporan-header {
        display: block;
        text-align: center;
        margin-bottom: 24px;
        padding-bottom: 16px;
        border-bottom: 2px solid #333;
    }
    .laporan-header h2 { font-size: 22px; margin-bottom: 4px; }
    .laporan-header h3 { font-size: 18px; margin-bottom: 4px; color: #555; }
    .laporan-header p { font-size: 13px; color: #666; }
    .stat-card { break-inside: avoid; }
    .table { font-size: 12px; }
    .laporan-grid { grid-template-columns: 1fr 1fr !important; }
}

/* ============ FIX: Chart container & mobile overflow ============ */
.chart-container {
    position: relative;
    width: 100%;
    height: 280px;
}

@media (max-width: 1023px) {
    .chart-container { height: 220px; }
}

@media (max-width: 480px) {
    .chart-container { height: 180px; }
}

/* Fix mobile horizontal scroll yang bikin bottom-nav berantakan */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

.app-wrapper, .main-content {
    max-width: 100%;
    min-width: 0;
}

@media (max-width: 1023px) {
    .main-content { overflow-x: hidden; }
    .page-body {
        overflow-x: hidden;
        max-width: 100vw;
        min-width: 0;
    }
    .card {
        max-width: 100%;
        overflow: hidden;
        min-width: 0;
    }
    /* Default semua tabel: width 100% biar tidak meluap card */
    .table {
        width: 100%;
        table-layout: auto;
    }
    /* Hanya tabel di dalam .table-wrapper yang boleh wide & scroll horizontal */
    .table-wrapper {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .table-wrapper .table {
        min-width: 560px;
    }
}

/* Tabs laporan supaya tidak overflow */
.laporan-tabs {
    scrollbar-width: thin;
    max-width: 100%;
}
@media (max-width: 480px) {
    .laporan-tab {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* Pastikan grid laporan responsif di tablet */
@media (max-width: 1023px) {
    .laporan-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .stats-grid {
        min-width: 0;
    }
    /* Stat card di mobile boleh kecil */
    .stats-grid .stat-card {
        min-width: 0;
        overflow: hidden;
    }
    .stats-grid .stat-value {
        font-size: 16px;
        word-break: break-word;
    }
}

/* Produk yang sudah dinonaktifkan tampil lebih pudar di list */
.produk-card-nonaktif {
    opacity: 0.55;
    background: var(--gray-50);
}
.produk-card-nonaktif .produk-foto img {
    filter: grayscale(40%);
}

/* ============ info-row (key-value layout) ============ */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-100);
    font-size: 14px;
    min-width: 0;
}
.info-row:last-child { border-bottom: none; }
.info-row > span:first-child {
    color: var(--gray-500);
    flex-shrink: 0;
}
.info-row > *:last-child {
    text-align: right;
    word-break: break-word;
    min-width: 0;
}
.info-row strong {
    color: var(--gray-900);
    font-weight: 600;
}

/* Detail transaksi: 2 kolom di desktop, 1 kolom di mobile */
@media (max-width: 1023px) {
    .detail-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    /* Daftar item di mobile: tabel padat, kolom Subtotal disembunyikan
       karena info Subtotal & TOTAL sudah tersedia di info-row di bawah */
    .detail-grid .table-wrapper { overflow-x: auto; }
    .detail-grid .table {
        min-width: 0 !important;
        font-size: 13px;
    }
    .detail-grid .table th,
    .detail-grid .table td {
        padding: 8px 10px;
    }
    /* Hide kolom Subtotal di mobile (kolom ke-4) */
    .detail-grid .table th:nth-child(4),
    .detail-grid .table td:nth-child(4) {
        display: none;
    }
}

/* ============ Bottom nav: rounded corner di atas ============ */
.bottom-nav {
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}
