:root {
    --bg: #f6f8fb;
    --card: #ffffff;
    --line: #dfe5ee;
    --text: #1f2937;
    --muted: #667085;
    --primary: #155eef;
    --success-bg: #ecfdf3;
    --success-text: #067647;
    --success-line: #abefc6;
    --error-bg: #fef3f2;
    --error-text: #b42318;
    --error-line: #fecdca;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Arial, Helvetica, sans-serif; }
a { color: var(--primary); text-decoration: none; }
.layout { display: grid; grid-template-columns: 270px 1fr; min-height: 100vh; }
.sidebar { background: #0f172a; color: #fff; padding: 22px; }
.sidebar h2 { margin: 0 0 6px; font-size: 20px; }
.sidebar .subtitle { color: #cbd5e1; font-size: 13px; margin-bottom: 16px; line-height: 1.5; }
.sidebar a { display: block; color: #dbeafe; padding: 10px 12px; border-radius: 10px; margin-bottom: 6px; }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,.08); }
.content { padding: 24px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; }
.card h1, .card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.stats { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0,1fr)); }
.stat { background: linear-gradient(180deg, #ffffff, #eef4ff); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.stat .number { display: block; font-size: 28px; font-weight: 700; margin-top: 8px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.btn { display: inline-block; border: 0; background: var(--primary); color: #fff; padding: 10px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; }
.btn:hover { opacity: .95; }
.btn-secondary { background: #475467; }
.btn-light { background: #e5e7eb; color: #111827; }
.btn-danger { background: #b42318; }
table { width: 100%; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; vertical-align: top; }
th { background: #f8fafc; }
input, select, textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font-size: 14px; }
textarea { min-height: 100px; resize: vertical; }
.label { display: block; font-weight: 600; margin-bottom: 6px; }
.muted { color: var(--muted); }
.flash { border-radius: 10px; padding: 12px; margin-bottom: 16px; border: 1px solid; }
.flash-success { background: var(--success-bg); color: var(--success-text); border-color: var(--success-line); }
.flash-error { background: var(--error-bg); color: var(--error-text); border-color: var(--error-line); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-size: 12px; }
.badge-green { background: #ecfdf3; color: #067647; }
.badge-red { background: #fef3f2; color: #b42318; }
.right { text-align: right; }
.center { text-align: center; }
.print-page { max-width: 920px; margin: 0 auto; background: #fff; padding: 40px; }
.signature-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 24px; margin-top: 36px; }
.qr-card { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: center; }
.qr-box img { width: 220px; height: 220px; object-fit: contain; border: 1px solid var(--line); padding: 8px; border-radius: 12px; background: #fff; }
.login-page { min-height: 100vh; display: flex; justify-content: center; align-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.inline-form { display: inline; }
.alert-box { padding: 16px; border-radius: 12px; background: #fffaeb; border: 1px solid #fedf89; color: #b54708; }
.small { font-size: 12px; }
@media (max-width: 980px) {
    .layout { grid-template-columns: 1fr; }
    .stats, .grid-2, .grid-3, .qr-card, .signature-grid { grid-template-columns: 1fr; }
}
@media print {
    body { background: #fff; }
    .sidebar, .toolbar, .no-print { display: none !important; }
    .content { padding: 0; }
    .card, .print-page { border: 0; border-radius: 0; box-shadow: none; padding: 0; margin: 0; }
}
