:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --line: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --primary: #111827;
    --success: #166534;
    --warning: #92400e;
    --danger: #991b1b;
    --info: #1d4ed8;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
body.login-body { min-height: 100vh; display: grid; place-items: center; background: #ffffff; }

.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: #ffffff; border-right: 1px solid var(--line); padding: 24px 18px; }
.brand { margin-bottom: 24px; }
.brand-name { font-size: 22px; font-weight: 700; }
.brand-subtitle { font-size: 12px; color: var(--muted); margin-top: 4px; }
.nav { display: grid; gap: 8px; }
.nav-link { display: block; padding: 12px 14px; border-radius: 10px; border: 1px solid transparent; color: var(--text); }
.nav-link:hover { background: #f9fafb; border-color: var(--line); }
.nav-link.active { background: #111827; color: #ffffff; }

.content { padding: 24px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.page-heading { margin: 0; font-size: 28px; }
.page-description { margin: 6px 0 0; color: var(--muted); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-box { display: grid; gap: 4px; text-align: right; }
.user-box span { color: var(--muted); font-size: 13px; text-transform: capitalize; }

.grid { display: grid; gap: 16px; }
.grid.cards-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.card h2, .card h3 { margin-top: 0; }
.metric-label { font-size: 13px; color: var(--muted); }
.metric-value { font-size: 28px; font-weight: 700; margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--panel); }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; font-size: 14px; vertical-align: top; }
th { background: #f9fafb; font-size: 13px; color: var(--muted); font-weight: 700; }

.button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--primary); background: var(--primary); color: #ffffff; cursor: pointer; font-size: 14px; }
.button.secondary { background: #ffffff; color: var(--text); border-color: var(--line); }
.button.link { background: transparent; color: var(--text); border-color: var(--line); }
.button.success { background: #166534; border-color: #166534; }
.button.warning { background: #92400e; border-color: #92400e; }
.button.danger { background: #991b1b; border-color: #991b1b; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

.badge { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #e5e7eb; color: #374151; font-size: 12px; }
.badge.success { background: #dcfce7; color: var(--success); }
.badge.warning { background: #fef3c7; color: var(--warning); }
.badge.danger { background: #fee2e2; color: var(--danger); }
.badge.info { background: #dbeafe; color: var(--info); }

.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; border: 1px solid var(--line); background: #ffffff; }
.alert.error { border-color: #fecaca; background: #fef2f2; color: #991b1b; }
.alert.success { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.alert.warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }

.login-card { width: 100%; max-width: 420px; background: #ffffff; border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.login-card h1 { margin-top: 0; margin-bottom: 6px; }
.login-card p { margin-top: 0; color: var(--muted); }
.form-group { margin-bottom: 16px; }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
label { display: block; margin-bottom: 6px; font-weight: 700; font-size: 14px; }
input, select, textarea { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 14px; background: #ffffff; }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"] { width: auto; }
.checkbox-row { display: flex; align-items: center; gap: 8px; margin-top: 30px; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.helper { color: var(--muted); font-size: 13px; margin-top: 8px; }

.section-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.section-header h2 { margin: 0; }
.list-clean { margin: 0; padding-left: 18px; }
.list-clean li { margin-bottom: 10px; }
.quick-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.quick-link { display: block; background: #ffffff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.quick-link strong { display: block; margin-bottom: 6px; }
.footer { margin-top: 24px; color: var(--muted); font-size: 13px; }
.kpi { display: flex; justify-content: space-between; gap: 12px; }
.kitchen-order { border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.kitchen-items { margin-top: 12px; }
.kitchen-item { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; border-top: 1px solid var(--line); padding: 10px 0; align-items: center; }
.kitchen-item:first-child { border-top: 0; padding-top: 0; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #f3f4f6; font-size: 12px; }
.inline-form { display: inline; }
.note-box { background: #f9fafb; border: 1px dashed var(--line); padding: 10px 12px; border-radius: 10px; }

@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
    .grid.cards-4, .grid.cards-3, .grid.cards-2, .quick-links, .form-grid, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; }
    .topbar-right { width: 100%; justify-content: space-between; }
    .kitchen-item { grid-template-columns: 1fr; }
}
