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

:root {
    --primary: #800020; --primary-dark: #5c0016; --primary-light: #a0122e;
    --gold: #c9a84c; --sidebar-bg: #e0f2fe; --sidebar-text: #0f172a;
    --sidebar-hover: #bae6fd; --sidebar-active: #0284c7;
    --body-bg: #f0f3f8; --card-bg: #ffffff; --text-primary: #111827;
    --text-muted: #6b7280; --border: #e5e7eb;
    --success: #059669; --warning: #d97706; --danger: #dc2626; --info: #2563eb;
    --sidebar-w: 260px; --topbar-h: 64px;
    --radius: 12px; --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: var(--body-bg); color: var(--text-primary); font-size: 14px; line-height: 1.6; }
a { text-decoration: none; color: inherit; }

/* SIDEBAR */
#sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-w); height: 100vh; background: var(--sidebar-bg); display: flex; flex-direction: column; z-index: 1000; overflow-y: auto; transition: transform .3s ease; border-right: 1px solid var(--border); }
.sidebar-brand { padding: 24px 20px 20px; border-bottom: 1px solid rgba(255,255,255,.08); display: flex; align-items: center; gap: 12px; }
.sidebar-logo { width: 42px; height: 42px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 16px; flex-shrink: 0; box-shadow: 0 4px 12px rgba(128,0,32,.4); }
.sidebar-brand-text h5 { color: #0f172a; font-size: 13.5px; font-weight: 800; line-height: 1.3; margin: 0; }
.sidebar-brand-text span { color: #0284c7; font-size: 11px; font-weight: 600; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.nav-section-label { padding: 16px 20px 6px; font-size: 10px; font-weight: 700; color: #0284c7; letter-spacing: .08em; text-transform: uppercase; }
.sidebar-nav .nav-item { margin: 2px 10px; }
.sidebar-nav .nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 8px; color: var(--sidebar-text); font-size: 13.5px; font-weight: 500; transition: all .18s ease; position: relative; }
.sidebar-nav .nav-link i { width: 20px; text-align: center; font-size: 15px; flex-shrink: 0; }
.sidebar-nav .nav-link:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-nav .nav-link.active::before { content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; background: var(--primary); border-radius: 0 3px 3px 0; }
.sidebar-footer { padding: 16px 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer .nav-link { color: #ef4444; }
.sidebar-footer .nav-link:hover { background: rgba(239,68,68,.1); color: #f87171; }

/* TOPBAR */
#topbar { position: fixed; top: 0; left: var(--sidebar-w); right: 0; height: var(--topbar-h); background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; z-index: 900; }
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.admin-badge { display: flex; align-items: center; gap: 10px; background: var(--body-bg); border: 1px solid var(--border); border-radius: 40px; padding: 6px 14px 6px 6px; }
.admin-avatar { width: 32px; height: 32px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; }
.admin-name { font-size: 13px; font-weight: 600; }

/* MAIN */
#main-content { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-height: 100vh; }
.page-body { padding: 28px 32px; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 22px; font-weight: 800; margin: 0; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* CARDS */
.card { background: var(--card-bg); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-header { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; background: transparent; border-radius: var(--radius) var(--radius) 0 0; }
.card-header h6 { font-size: 14px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 22px; }

/* STAT CARDS */
.stat-card { border-radius: var(--radius); padding: 22px 24px; color: #fff; position: relative; overflow: hidden; box-shadow: var(--shadow-lg); transition: transform .2s, box-shadow .2s; cursor: default; }
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.stat-card::after { content: ''; position: absolute; right: -20px; top: -20px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255,255,255,.1); }
.stat-card::before { content: ''; position: absolute; right: 20px; bottom: -30px; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.07); }
.stat-card.c-red { background: linear-gradient(135deg, var(--primary), #a0122e); }
.stat-card.c-green { background: linear-gradient(135deg, #059669, #10b981); }
.stat-card.c-amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.stat-card.c-blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.stat-icon { font-size: 28px; opacity: .85; margin-bottom: 12px; position: relative; z-index: 1; }
.stat-value { font-size: 26px; font-weight: 800; line-height: 1; margin-bottom: 4px; position: relative; z-index: 1; }
.stat-label { font-size: 12px; opacity: .85; font-weight: 500; position: relative; z-index: 1; }

/* BUTTONS */
.btn { font-family: 'Inter', sans-serif; font-weight: 600; font-size: 13px; border-radius: 8px; padding: 8px 18px; transition: all .18s ease; display: inline-flex; align-items: center; gap: 6px; border: none; cursor: pointer; }
.btn-primary-custom { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(128,0,32,.3); }
.btn-primary-custom:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); }
.btn-success-custom { background: var(--success); color: #fff; }
.btn-success-custom:hover { background: #047857; color: #fff; }
.btn-outline-custom { background: transparent; color: var(--primary); border: 1.5px solid var(--primary); }
.btn-outline-custom:hover { background: var(--primary); color: #fff; }
.btn-light-custom { background: var(--body-bg); color: var(--text-primary); border: 1px solid var(--border); }
.btn-danger-sm { background: #fee2e2; color: var(--danger); border: none; padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-danger-sm:hover { background: var(--danger); color: #fff; }
.btn-edit-sm { background: #dbeafe; color: var(--info); border: none; padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-edit-sm:hover { background: var(--info); color: #fff; }
.btn-view-sm { background: #d1fae5; color: var(--success); border: none; padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-view-sm:hover { background: var(--success); color: #fff; }
.btn-pay-sm { background: #fef3c7; color: #92400e; border: none; padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-pay-sm:hover { background: var(--warning); color: #fff; }

/* TABLES */
.table-wrapper { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table thead th { background: #f8fafc; color: var(--text-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table tbody tr { border-bottom: 1px solid #f1f5f9; transition: background .12s; }
.data-table tbody tr:hover { background: #fafbfc; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody td { padding: 13px 16px; vertical-align: middle; }

/* BADGES */
.status-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-primary { background: #dbeafe; color: #1e40af; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-danger { background: #fee2e2; color: #991b1b; }

/* FORMS */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-control, .form-select { width: 100%; padding: 10px 14px; font-family: 'Inter', sans-serif; font-size: 13.5px; color: var(--text-primary); background: #fff; border: 1.5px solid var(--border); border-radius: 8px; transition: border-color .15s, box-shadow .15s; outline: none; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(128,0,32,.1); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-text { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ALERTS */
.alert { border-radius: 10px; padding: 13px 16px; font-size: 13.5px; font-weight: 500; border: none; display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef3c7; color: #92400e; }
.alert-info { background: #dbeafe; color: #1e40af; }

/* LOGIN */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%); position: relative; overflow: hidden; }
.login-page::before { content: ''; position: absolute; width: 500px; height: 500px; background: radial-gradient(circle, rgba(128,0,32,.3) 0%, transparent 70%); top: -100px; right: -100px; pointer-events: none; }
.login-card { background: rgba(255,255,255,.04); backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,.1); border-radius: 20px; padding: 44px 40px; width: 100%; max-width: 420px; position: relative; z-index: 1; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.login-logo { width: 64px; height: 64px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 26px; font-weight: 900; margin: 0 auto 20px; box-shadow: 0 8px 24px rgba(128,0,32,.5); }
.login-card h4 { color: #fff; text-align: center; font-weight: 800; font-size: 20px; margin-bottom: 4px; }
.login-card .subtitle { color: rgba(255,255,255,.45); text-align: center; font-size: 13px; margin-bottom: 28px; }
.login-card .form-label { color: rgba(255,255,255,.75); }
.login-card .form-control { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.12); color: #fff; }
.login-card .form-control::placeholder { color: rgba(255,255,255,.3); }
.login-card .form-control:focus { background: rgba(255,255,255,.1); border-color: var(--primary); box-shadow: 0 0 0 3px rgba(128,0,32,.25); }
.btn-login { width: 100%; padding: 12px; background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; font-size: 15px; font-weight: 700; border: none; border-radius: 10px; cursor: pointer; transition: all .2s; box-shadow: 0 4px 16px rgba(128,0,32,.4); margin-top: 8px; font-family: 'Inter', sans-serif; }
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(128,0,32,.5); }

/* ORDER BUILDER */
.order-builder-header { display: grid; grid-template-columns: 1fr 90px 130px 36px; gap: 10px; padding: 8px 0; font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); }
.order-item-row { display: grid; grid-template-columns: 1fr 90px 130px 36px; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.item-subtotal { font-weight: 700; color: var(--primary); font-size: 13px; }
.order-total-box { background: linear-gradient(135deg, var(--primary), var(--primary-light)); color: #fff; border-radius: 10px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; margin-top: 16px; }
.order-total-box .label { font-size: 14px; font-weight: 600; }
.order-total-box .amount { font-size: 22px; font-weight: 800; }
.btn-add-item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; background: #f0f9ff; color: var(--info); border: 1.5px dashed #93c5fd; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; font-family: 'Inter', sans-serif; }
.btn-add-item:hover { background: var(--info); color: #fff; border-color: var(--info); }
.btn-remove-item { width: 30px; height: 30px; border: none; background: #fee2e2; color: var(--danger); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: all .15s; font-family: 'Inter', sans-serif; }
.btn-remove-item:hover { background: var(--danger); color: #fff; }

/* MISC */
.menu-img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.menu-img-placeholder { width: 52px; height: 52px; border-radius: 8px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 20px; border: 1px solid var(--border); }
.chart-container { position: relative; height: 280px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; opacity: .3; margin-bottom: 16px; display: block; }
.action-btns { display: flex; gap: 6px; align-items: center; }
.search-box { position: relative; }
.search-box i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }
.search-box input { padding-left: 36px; width: 240px; }
.divider { height: 1px; background: var(--border); margin: 20px 0; }
.img-preview { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 2px solid var(--border); margin-top: 8px; }
.report-kpi { border-left: 4px solid var(--primary); border-radius: 10px; padding: 16px 20px; background: #fff; box-shadow: var(--shadow); }
.report-kpi h3 { font-size: 28px; font-weight: 800; color: var(--primary); margin: 0; }
.report-kpi p { font-size: 13px; color: var(--text-muted); margin: 0; }

@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    #sidebar { transform: translateX(-260px); width: 260px; }
    #sidebar.open { transform: translateX(0); }
    #topbar { left: 0; }
    #main-content { margin-left: 0; }
    .page-body { padding: 20px 16px; }
}
@media print {
    #sidebar, #topbar, .no-print { display: none !important; }
    #main-content { margin-left: 0; padding-top: 0; }
    .page-body { padding: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
