/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f4f6f9; color: #1e293b; display: flex; min-height: 100vh; }

a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Sidebar ===== */
.sidebar { width: 220px; background: #1e293b; color: #cbd5e1; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-brand { padding: 1.2rem 1rem; border-bottom: 1px solid #334155; }
.sidebar-brand h2 { color: #fff; font-size: 1.3rem; }
.sidebar-nav { list-style: none; flex: 1; padding: 0.5rem 0; overflow-y: auto; }
.sidebar-nav li a { display: block; padding: 0.6rem 1.2rem; color: #94a3b8; font-size: 0.9rem; transition: background 0.15s; }
.sidebar-nav li a:hover, .sidebar-nav li a.active { background: #334155; color: #fff; text-decoration: none; }
.sidebar-footer { padding: 0.8rem 1rem; border-top: 1px solid #334155; font-size: 0.8rem; display: flex; justify-content: space-between; align-items: center; }
.sidebar-footer a { color: #f87171; }

/* ===== Main ===== */
main { flex: 1; }
main.with-sidebar { margin-left: 220px; }
.content { padding: 1.5rem 2rem; max-width: 1200px; }

/* ===== Header ===== */
.top-header { display: flex; justify-content: space-between; align-items: center; padding: 0.8rem 2rem; background: #fff; border-bottom: 1px solid #e2e8f0; }
.top-header h1 { font-size: 1.2rem; font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 1rem; }
.header-user { font-size: 0.85rem; color: #64748b; }
.header-user small { margin-left: 0.3rem; }
.btn-manual { background: #7c3aed; color: #fff; font-size: 0.8rem; }
.btn-manual:hover { background: #6d28d9; text-decoration: none; color: #fff; }

/* ===== Cards ===== */
.card { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); padding: 1.2rem; margin-bottom: 1rem; }
.card h3 { font-size: 1rem; margin-bottom: 0.5rem; color: #334155; }
.card p { font-size: 0.9rem; color: #64748b; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }

/* ===== Tables ===== */
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); margin-bottom: 1rem; }
th, td { text-align: left; padding: 0.6rem 0.8rem; font-size: 0.88rem; }
th { background: #f1f5f9; color: #475569; font-weight: 600; border-bottom: 2px solid #e2e8f0; }
tr:not(:last-child) td { border-bottom: 1px solid #f1f5f9; }
tr:hover td { background: #f8fafc; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; font-weight: 600; color: #475569; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 0.5rem 0.7rem; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 0.9rem; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }

/* ===== Buttons ===== */
.btn { display: inline-block; padding: 0.5rem 1.2rem; border: none; border-radius: 6px; font-size: 0.88rem; font-weight: 500; cursor: pointer; transition: background 0.15s; }
.btn-primary { background: #2563eb; color: #fff; }
.btn-primary:hover { background: #1d4ed8; text-decoration: none; }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #d97706; color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-secondary { background: #64748b; color: #fff; }
.btn-secondary:hover { background: #475569; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }

/* ===== Alerts ===== */
.alert { padding: 0.7rem 1rem; border-radius: 6px; margin-bottom: 1rem; font-size: 0.88rem; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ===== Badges ===== */
.badge { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 600; }
.badge-active { background: #dcfce7; color: #166534; }
.badge-inactive { background: #f1f5f9; color: #64748b; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fef2f2; color: #991b1b; }

/* ===== Auth pages ===== */
.auth-container { display: flex; align-items: center; justify-content: center; min-height: 100vh; width: 100%; }
.auth-form { background: #fff; padding: 2rem; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); width: 100%; max-width: 400px; }
.auth-form h2 { text-align: center; margin-bottom: 1.5rem; color: #1e293b; }

/* ===== Error page ===== */
.error-page { text-align: center; padding: 3rem 1rem; }
.error-page h2 { font-size: 1.5rem; margin-bottom: 0.5rem; }
.error-page p { color: #64748b; margin-bottom: 1rem; }

/* ===== Toolbar ===== */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }

/* ===== Stat card ===== */
.stat-value { font-size: 2rem; font-weight: 700; color: #1e293b; }
.stat-label { font-size: 0.8rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; }

.manual-panel { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.manual-panel h3 { margin-bottom: 0.5rem; color: #9a3412; }
.manual-panel ul { padding-left: 1.2rem; color: #7c2d12; }
.manual-panel li { margin-bottom: 0.35rem; }

.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; }

@media (max-width: 900px) {
	.form-row,
	.toolbar { flex-direction: column; align-items: stretch; }
	.content { padding: 1rem; }
}
