:root {
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 6px;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* --- Navbar --- */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 2rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.25rem; color: var(--primary); text-decoration: none; }
.nav-links { display: flex; align-items: center; gap: 1rem; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.nav-links a:hover { color: var(--primary); }
.nav-user { color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

/* --- Container --- */
.container { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }

/* --- Flash messages --- */
.flash {
    position: fixed; top: 4rem; right: 1rem;
    padding: 0.75rem 1.25rem; border-radius: var(--radius);
    color: #fff; font-size: 0.9rem; z-index: 100;
    transition: opacity 0.3s;
}
.flash.success { background: var(--success); }
.flash.error { background: var(--danger); }

/* --- Tables --- */
table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); }
th { background: var(--bg); font-size: 0.8rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.05em; }
td { font-size: 0.9rem; }

/* --- Buttons --- */
.btn {
    display: inline-block; padding: 0.5rem 1rem;
    border: none; border-radius: var(--radius);
    font-size: 0.85rem; cursor: pointer;
    text-decoration: none; color: #fff;
    transition: background 0.2s;
}
.btn-primary { background: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.8rem; }

.actions { display: flex; gap: 0.5rem; }

/* --- Toolbar (above tables) --- */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.toolbar h2 { font-size: 1.3rem; }

/* --- Forms --- */
.form-card {
    max-width: 480px; margin: 0 auto;
    background: var(--surface); padding: 2rem;
    border-radius: var(--radius); border: 1px solid var(--border);
}
.form-card h2 { margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.form-group input,
.form-group select {
    width: 100%; padding: 0.5rem 0.75rem;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 0.9rem;
}
.form-group input:focus,
.form-group select:focus { outline: none; border-color: var(--primary); }
.form-actions { margin-top: 1.5rem; display: flex; gap: 0.75rem; }

/* --- Empty state --- */
.empty { text-align: center; padding: 3rem; color: var(--text-muted); }

/* --- Tags --- */
.tag {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: #e0e7ff;
    color: #3730a3;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    margin: 0.1rem;
}

/* --- Order cards --- */
.order-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}
.order-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

/* --- Muted text helper --- */
.text-muted { color: var(--text-muted); font-size: 0.85rem; }

/* --- Table footer --- */
tfoot td { border-top: 2px solid var(--border); border-bottom: none; }
