/* ============================================================
   Operação SEO — design system
   ============================================================ */

:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --border: #e6e8ec;
  --border-strong: #d5d9e0;

  --ink: #111827;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --ink-4: #9ca3af;

  --brand: #0f766e;
  --brand-dark: #115e59;
  --brand-light: #ccfbf1;

  --blue: #2563eb;
  --blue-bg: #dbeafe;
  --amber: #b45309;
  --amber-bg: #fef3c7;
  --violet: #6d28d9;
  --violet-bg: #ede9fe;
  --cyan: #0e7490;
  --cyan-bg: #cffafe;
  --green: #15803d;
  --green-bg: #dcfce7;
  --rose: #be123c;
  --rose-bg: #ffe4e6;
  --slate: #475569;
  --slate-bg: #e2e8f0;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.1), 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px -8px rgba(16, 24, 40, 0.18);

  --sidebar-w: 250px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }

[hidden] { display: none !important; }

.muted { color: var(--ink-3); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ============================ LOGIN ============================ */

.login-screen {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  min-height: 100vh;
}

.login-visual {
  background: linear-gradient(155deg, #0f172a 0%, #134e4a 60%, #0f766e 100%);
  color: #fff;
  padding: 56px;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.login-visual::after {
  content: '';
  position: absolute;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.22), transparent 65%);
  right: -160px;
  bottom: -160px;
}

.login-visual-inner { position: relative; z-index: 1; max-width: 460px; }

.login-visual h1 {
  font-size: 38px;
  line-height: 1.18;
  margin: 28px 0 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.login-visual p { color: rgba(255, 255, 255, 0.72); font-size: 15px; line-height: 1.6; }

.login-features {
  list-style: none;
  padding: 0;
  margin: 40px 0 0;
  display: grid;
  gap: 14px;
}

.login-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.85);
}

.login-features span {
  font-family: var(--mono);
  font-size: 11px;
  color: #5eead4;
  border: 1px solid rgba(94, 234, 212, 0.35);
  border-radius: 6px;
  padding: 2px 7px;
}

.login-form-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--surface);
}

.login-form { width: 100%; max-width: 360px; }
.login-form h2 { font-size: 24px; margin-bottom: 6px; }
.login-form .muted { margin-bottom: 28px; }

.login-hint {
  margin-top: 24px;
  font-size: 12px;
  color: var(--ink-4);
  line-height: 1.6;
}

.login-hint code {
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--ink-2);
}

/* ============================ BRAND ============================ */

.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: #fff;
}

.brand-mark.small { font-size: 16px; color: var(--ink); }

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 0 4px rgba(45, 212, 191, 0.18);
}

.brand-mark.small .brand-dot { background: var(--brand); box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12); }
.brand-accent { color: rgba(255, 255, 255, 0.5); font-weight: 400; }
.brand-mark.small .brand-accent { color: var(--ink-4); }

/* ============================ SHELL ============================ */

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
}

.sidebar-head {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border);
}

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background 0.12s, color 0.12s;
  position: relative;
}

.nav-item svg { width: 17px; height: 17px; opacity: 0.75; }

.nav-item:hover { background: var(--surface-2); color: var(--ink); }

.nav-item.active {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
}

.nav-item.active svg { opacity: 1; }

.nav-sep {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-4);
  font-weight: 600;
  padding: 18px 11px 6px;
}

.nav-badge {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  background: var(--slate-bg);
  color: var(--slate);
  border-radius: 20px;
  padding: 1px 7px;
  min-width: 20px;
  text-align: center;
}

.nav-badge.amber { background: var(--amber-bg); color: var(--amber); }

.sidebar-foot { border-top: 1px solid var(--border); padding: 12px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.user-chip:hover { background: var(--surface-2); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #0d9488);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

.user-chip-text { display: flex; flex-direction: column; min-width: 0; }
.user-chip-text strong {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-chip-text em { font-style: normal; font-size: 11px; color: var(--ink-4); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 68px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-title h2 { font-size: 16.5px; }
.topbar-title p { font-size: 12.5px; color: var(--ink-4); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.view { padding: 26px; flex: 1; }

/* ============================ BUTTONS ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-2); border-color: var(--ink-4); color: var(--ink); }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }

.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border); }

.btn-danger { color: var(--rose); border-color: #fecdd3; }
.btn-danger:hover { background: var(--rose-bg); border-color: #fda4af; color: var(--rose); }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 0.12s;
}

.icon-btn:hover { background: var(--surface-2); border-color: var(--border); }

/* ============================ FORMS ============================ */

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 12.5px; font-weight: 500; color: var(--ink-2); }
.field > span .req { color: var(--rose); }

input[type='text'],
input[type='email'],
input[type='password'],
input[type='number'],
input[type='date'],
input[type='url'],
input[type='search'],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  transition: border-color 0.12s, box-shadow 0.12s;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12);
}

input::placeholder, textarea::placeholder { color: var(--ink-4); }

textarea { resize: vertical; min-height: 76px; line-height: 1.55; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%236b7280'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  background-size: 18px;
  padding-right: 30px;
}

.form-error {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid #fecdd3;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: -4px 0 14px;
}

.link-cell a {
  color: var(--brand);
  text-decoration: none;
  word-break: break-all;
}

.link-cell a:hover {
  text-decoration: underline;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* ============================ CARDS ============================ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.card-head h3 { font-size: 13.5px; font-weight: 600; }
.card-head .card-sub { font-size: 12px; color: var(--ink-4); }
.card-head-actions { margin-left: auto; display: flex; gap: 7px; }
.card-body { padding: 18px; }

/* ============================ STAT CARDS ============================ */

.grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-4);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stat-value {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.stat-value.small { font-size: 21px; }
.stat-foot { font-size: 12px; color: var(--ink-4); margin-top: 6px; }
.stat-foot .up { color: var(--green); font-weight: 500; }

/* ============================ TABLES ============================ */

.table-wrap { overflow-x: auto; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.data thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-4);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

table.data tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

table.data tbody tr { transition: background 0.1s; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }

table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.table-empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--ink-4);
  font-size: 13px;
}

/* ============================ BADGES / PILLS ============================ */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.pill-blue { background: var(--blue-bg); color: var(--blue); }
.pill-amber { background: var(--amber-bg); color: var(--amber); }
.pill-violet { background: var(--violet-bg); color: var(--violet); }
.pill-cyan { background: var(--cyan-bg); color: var(--cyan); }
.pill-green { background: var(--green-bg); color: var(--green); }
.pill-rose { background: var(--rose-bg); color: var(--rose); }
.pill-slate { background: var(--slate-bg); color: var(--slate); }
.pill-gray { background: var(--surface-2); color: var(--ink-3); border-color: var(--border); }

/* ============================ TOOLBAR ============================ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.toolbar .search {
  position: relative;
  flex: 1;
  min-width: 190px;
  max-width: 340px;
}

.toolbar .search input { padding-left: 33px; }

.toolbar .search svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--ink-4);
}

.toolbar select { width: auto; min-width: 130px; }
.toolbar .spacer { flex: 1; }

/* ============================ CHIPS ============================ */

.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }

.chip {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  padding: 5px 13px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip:hover { border-color: var(--ink-4); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .n {
  font-size: 11px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
}
.chip.active .n { background: rgba(255, 255, 255, 0.22); }

/* ============================ KANBAN ============================ */

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(258px, 1fr);
  gap: 13px;
  overflow-x: auto;
  padding-bottom: 12px;
  align-items: start;
}

.board-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 210px);
}

.board-col-head {
  padding: 11px 13px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 2;
}

.board-col-head .count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0 7px;
}

.board-list {
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 70px;
}

.board-list.drag-over { background: var(--brand-light); }

.board-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  cursor: grab;
  transition: box-shadow 0.12s, border-color 0.12s, transform 0.12s;
  box-shadow: var(--shadow-sm);
}

.board-card:hover { box-shadow: var(--shadow); border-color: var(--border-strong); }
.board-card.dragging { opacity: 0.45; cursor: grabbing; }

.board-card .bc-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.board-card .bc-code {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
}

.board-card .bc-brand { font-size: 10.5px; color: var(--ink-3); margin-left: auto; font-weight: 500; }

.board-card .bc-title {
  font-size: 12.5px;
  line-height: 1.42;
  color: var(--ink);
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.board-card .bc-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-4);
}

.board-card .bc-meta .late { color: var(--rose); font-weight: 600; }
.board-card .bc-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--slate-bg);
  color: var(--slate);
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  flex-shrink: 0;
}

/* ============================ DRAWER ============================ */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.42);
  backdrop-filter: blur(2px);
  z-index: 60;
  animation: fadeIn 0.15s ease;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 100vw);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  z-index: 61;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.drawer-head h3 { font-size: 15.5px; line-height: 1.35; }
.drawer-head .dh-sub { font-size: 12px; color: var(--ink-4); margin-top: 3px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  background: var(--surface-2);
}

@keyframes slideIn { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* detail list */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-bottom: 20px; }
.detail { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.detail-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-4); font-weight: 600; }
.detail-value { font-size: 13px; color: var(--ink); word-break: break-word; }
.detail-value a { color: var(--blue); }
.detail-value a:hover { text-decoration: underline; }
.detail.full { grid-column: 1 / -1; }

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-4);
  font-weight: 600;
  margin: 22px 0 12px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.section-title:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }

.tl-item { display: flex; gap: 12px; padding-bottom: 16px; position: relative; }
.tl-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 15px;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.tl-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border-strong);
  background: var(--ink-4);
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}

.tl-dot.green { background: var(--green); }
.tl-dot.blue { background: var(--blue); }
.tl-dot.amber { background: var(--amber); }

.tl-body { min-width: 0; }
.tl-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.tl-text strong { color: var(--ink); font-weight: 600; }
.tl-meta { font-size: 11px; color: var(--ink-4); margin-top: 2px; }

/* ============================ MODAL ============================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(2px);
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.15s ease;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  animation: modalIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.wide { max-width: 720px; }

@keyframes modalIn { from { transform: translateY(10px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-head { padding: 20px 22px 0; }
.modal-head h3 { font-size: 16px; }
.modal-head p { font-size: 12.5px; color: var(--ink-4); margin-top: 4px; }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 9px;
  justify-content: flex-end;
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================ TOAST ============================ */

.toast-root {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 9px;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toastIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 380px;
  pointer-events: auto;
}

.toast.error { background: #9f1239; }
.toast.success { background: #115e59; }

@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================ EMPTY / LOADING ============================ */

.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--ink-4);
}

.empty svg { width: 34px; height: 34px; opacity: 0.35; margin-bottom: 12px; }
.empty h4 { font-size: 14px; color: var(--ink-2); margin-bottom: 5px; }
.empty p { font-size: 12.5px; max-width: 340px; margin: 0 auto; line-height: 1.6; }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, #eef0f3 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  border-radius: 6px;
  height: 14px;
}

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================ PROGRESS / BAR ============================ */

.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: var(--brand); }

.mini-bars { display: flex; align-items: flex-end; gap: 4px; height: 62px; }
.mini-bars > div {
  flex: 1;
  background: var(--brand-light);
  border-radius: 3px 3px 0 0;
  min-height: 3px;
  position: relative;
  transition: background 0.15s;
}
.mini-bars > div:hover { background: var(--brand); }

/* chart */
.chart { width: 100%; display: block; }

/* ============================ UTILITIES ============================ */

.row { display: flex; align-items: center; gap: 9px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gap-sm { gap: 6px; }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.fw-600 { font-weight: 600; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.link { color: var(--blue); cursor: pointer; }
.link:hover { text-decoration: underline; }

.only-mobile { display: none; }

/* ============================ RESPONSIVE ============================ */

@media (max-width: 1080px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .only-mobile { display: inline-flex; }
  .view { padding: 16px; }
  .topbar { padding: 0 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid-stats { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 22px; }
  .toolbar .search { max-width: none; }
  .drawer { width: 100vw; }
  .login-form-wrap { padding: 24px; }
}
