/* --- Base reset-ish --- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  color: #0f172a; /* slate-900 */
  background: #f8fafc; /* slate-50 */
}

/* --- Layout --- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.header-grid {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px;
}
.main-grid {
  display: grid; grid-template-columns: 260px 1fr; gap: 20px; padding: 24px 0;
}
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
}

.site-header { background: white; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; z-index: 10; }
.site-footer { border-top: 1px solid #e2e8f0; padding: 18px 0; margin-top: 40px; background: white; }

.brand {
  font-weight: 800; font-size: 20px; color: #0f172a; text-decoration: none;
  letter-spacing: .2px;
}
.nav a { margin-left: 14px; color: #334155; text-decoration: none; }
.nav a:hover { color: #0f172a; }
.inline { display: inline; }

/* --- Cards / sections --- */
section.content > * + * { margin-top: 22px; }
.card {
  background: white; border: 1px solid #e2e8f0; border-radius: 12px; padding: 16px;
  box-shadow: 0 1px 1px rgba(0,0,0,.02);
}
h2, h3 { margin: 0 0 10px; letter-spacing: .2px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; color: #0f172a; }

/* --- Flash / toasts --- */
.flash-stack { display: grid; gap: 10px; }
.flash {
  border-radius: 10px; padding: 10px 12px; background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe;
}
.flash-error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.flash-success { background: #ecfdf5; color: #065f46; border-color: #bbf7d0; }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: #0ea5e9; color: white; border: 1px solid #0284c7;
  padding: 9px 14px; border-radius: 10px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: #0284c7; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: transparent; color: #334155; border-color: #cbd5e1; }
.btn-ghost:hover { background: #f1f5f9; }
.btn-small { padding: 7px 10px; font-size: 14px; }
.primary { background: #22c55e; border-color: #16a34a; }
.primary:hover { background: #16a34a; }

/* --- Forms --- */
label { display: inline-block; margin: 6px 10px 6px 0; }
input[type="text"], input[type="email"], input[type="number"], input[type="datetime-local"], textarea, select {
  background: white; border: 1px solid #cbd5e1; border-radius: 10px; padding: 9px 10px;
  outline: none; min-width: 220px;
}
textarea { min-height: 120px; }
input:focus, textarea:focus, select:focus { border-color: #0ea5e9; box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.helper { color: #64748b; font-size: 13px; margin-top: 4px; }

/* --- Tables --- */
table {
  width: 100%; border-collapse: separate; border-spacing: 0; background: white;
  border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden;
}
th, td { padding: 10px 12px; text-align: left; vertical-align: middle; }
th {
  position: sticky; top: 0; background: #f1f5f9; font-weight: 600; color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
}
tr:nth-child(even) td { background: #f8fafc; }
td.num { text-align: right; }
.muted { color: #64748b; }

/* --- Utility --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }
.pad { padding: 12px; }
.space-top { margin-top: 12px; }
.badge { padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 1px solid #cbd5e1; color: #334155; background: #f8fafc; }
