/* =========================================================
 *  OAU MBA — BASE v2  (LBS-standard polish)
 *  ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink-700);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ──────────────────────────────────── */
h1,h2,h3,h4,h5 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--navy-900);
  line-height: 1.15;
  margin: 0 0 var(--sp-3);
}
h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-2xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-md); font-family: var(--font-body); font-weight: 600; }
h5 { font-size: var(--text-base); font-family: var(--font-body); font-weight: 600; }

p { margin: 0 0 var(--sp-3); color: var(--ink-500); }
a { color: var(--navy-700); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--gold-500); }
small, .text-sm { font-size: var(--text-sm); }
.text-xs { font-size: var(--text-xs); }
.mono { font-family: var(--font-mono); letter-spacing: 0.01em; }
.label-overline {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--gold-500);
  margin-bottom: var(--sp-2);
}

/* ── Focus ring ──────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--gold-400);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ── Layout helpers ──────────────────────────────── */
.container {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
.container-narrow {
  max-width: var(--max-w-narrow);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
.content-pad { padding: var(--sp-8) var(--sp-6); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--ink-400); }
.text-gold { color: var(--gold-500); }
.text-navy { color: var(--navy-900); }
.text-white { color: var(--white); }
.hidden { display: none !important; }
.mb-0 { margin-bottom: 0; }
.mt-0 { margin-top: 0; }

/* ── Grid ────────────────────────────────────────── */
.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) {
  .grid-4, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: var(--sp-6); }
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6);
  border-bottom: 1px solid var(--ink-100);
}
.card-header h2, .card-header h3 { margin: 0; }
.card-body { padding: var(--sp-6); }
.card-footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--ink-100);
  background: var(--ink-50);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition:
  background var(--dur-fast) var(--ease),
  border-color var(--dur-fast) var(--ease),
  color var(--dur-fast) var(--ease),
  box-shadow var(--dur-fast) var(--ease),
  transform var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.btn-primary:hover { background: var(--navy-700); border-color: var(--navy-700); color: var(--white); }

.btn-gold { background: var(--gold-500); color: var(--white); border-color: var(--gold-500); box-shadow: var(--shadow-gold); }
.btn-gold:hover { background: var(--gold-600); border-color: var(--gold-600); color: var(--white); }

.btn-outline-light { background: transparent; border-color: rgba(255,255,255,0.55); color: var(--white); }
.btn-outline-light:hover { background: rgba(255,255,255,0.12); border-color: rgba(255,255,255,0.85); color: var(--white); }

.btn-outline { background: transparent; border-color: var(--navy-700); color: var(--navy-700); }
.btn-outline:hover { background: var(--navy-50); color: var(--navy-700); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-500); }
.btn-ghost:hover { background: var(--ink-50); color: var(--ink-700); }

.btn-danger { background: var(--danger-600); color: var(--white); border-color: var(--danger-600); }
.btn-danger:hover { background: #8e1e17; }

.btn-sm { padding: 0.4rem 0.85rem; font-size: var(--text-xs); }
.btn-lg { padding: 0.85rem 2rem; font-size: var(--text-base); letter-spacing: 0.02em; }
.btn-xl { padding: 1.05rem 2.5rem; font-size: var(--text-md); }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--ink-100);
  background: var(--white);
  color: var(--ink-500);
  cursor: pointer;
  transition: background var(--dur-fast), border-color var(--dur-fast), color var(--dur-fast);
  text-decoration: none;
}
.icon-btn:hover { background: var(--ink-50); border-color: var(--ink-200); color: var(--ink-700); }

/* ── Forms ───────────────────────────────────────── */
.field { margin-bottom: var(--sp-5); }
.field label {
  display: block; font-size: var(--text-sm); font-weight: 600;
  color: var(--navy-900); margin-bottom: var(--sp-2);
}
.field .hint { font-size: var(--text-xs); color: var(--ink-400); margin-top: var(--sp-1); }
.field .error-msg { font-size: var(--text-xs); color: var(--danger-600); margin-top: var(--sp-1); }

input[type="text"], input[type="email"], input[type="password"],
input[type="tel"], input[type="number"], input[type="date"],
input[type="search"], select, textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--ink-900);
  background: var(--white);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
  appearance: none;
}
input:hover, select:hover, textarea:hover { border-color: var(--ink-300); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--navy-700);
  box-shadow: 0 0 0 3px rgba(21,64,128,0.12);
}
.field.has-error input, .field.has-error select { border-color: var(--danger-600); }
textarea { resize: vertical; min-height: 110px; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%236b7385' d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.5rem;
}

.input-icon-wrap { position: relative; }
.input-icon-wrap input { padding-left: 2.6rem; }
.input-icon-wrap .i-icon {
  position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-300); display: flex; pointer-events: none;
}

.checkbox-row { display: flex; align-items: flex-start; gap: var(--sp-3); }
.checkbox-row input[type="checkbox"] {
  width: 17px; height: 17px; margin-top: 2px;
  accent-color: var(--navy-700); flex-shrink: 0;
  border-radius: var(--radius-xs);
}
.checkbox-row label { font-weight: 400; font-size: var(--text-sm); color: var(--ink-500); margin: 0; }

fieldset { border: 1.5px solid var(--ink-100); border-radius: var(--radius-md); padding: var(--sp-5); margin: 0 0 var(--sp-5); }
fieldset legend { font-family: var(--font-display); font-size: var(--text-md); font-weight: 600; color: var(--navy-900); padding: 0 var(--sp-2); }

/* ── Badges ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 0.28rem 0.65rem;
  border-radius: var(--radius-full); white-space: nowrap;
}
.badge::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0;
}
.badge-success { background: var(--success-100); color: var(--success-700); }
.badge-warning { background: var(--warning-100); color: var(--warning-600); }
.badge-danger  { background: var(--danger-100);  color: var(--danger-600); }
.badge-info    { background: var(--navy-100);     color: var(--navy-700); }
.badge-gold    { background: var(--gold-100);     color: var(--gold-700); }
.badge-neutral { background: var(--ink-100);      color: var(--ink-500); }

/* ── Alerts ──────────────────────────────────────── */
.alert {
  display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: var(--sp-4) var(--sp-5); border-radius: var(--radius-md);
  border: 1px solid transparent; font-size: var(--text-sm);
  margin-bottom: var(--sp-5);
}
.alert-icon { flex-shrink: 0; margin-top: 1px; }
.alert-title { font-weight: 700; display: block; margin-bottom: 2px; }
.alert-success { background: var(--success-100); border-color: #b8dfc8; color: #145537; }
.alert-warning { background: var(--warning-100); border-color: #f2d890; color: #7a5009; }
.alert-danger  { background: var(--danger-100);  border-color: #f0b8b5; color: #8c1c16; }
.alert-info    { background: var(--navy-100);    border-color: #b5cae8; color: var(--navy-800); }

/* ── Tables ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; background: var(--white); }
table.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }

.data-table thead th {
  text-align: left; font-size: var(--text-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--white); background: var(--navy-900);
  padding: 0.9rem 1rem; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
  border-right: 1px solid rgba(255,255,255,0.07);
  cursor: default;
}
.data-table thead th[data-sort-key] { cursor: pointer; }
.data-table thead th:last-child { border-right: none; }

.data-table tbody td {
  padding: 0.875rem 1rem; border-bottom: 1px solid var(--ink-100);
  color: var(--ink-500); vertical-align: middle;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--navy-50); }
.data-table .cell-strong { color: var(--ink-900); font-weight: 600; }
.data-table .cell-mono { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-400); }

.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); flex-wrap: wrap;
  background: var(--white); border: 1px solid var(--ink-100);
  border-bottom: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.table-search { position: relative; flex: 1; max-width: 300px; }
.table-search input { padding-left: 2.4rem; }
.table-search .ts-icon {
  position: absolute; left: 0.8rem; top: 50%; transform: translateY(-50%);
  color: var(--ink-300); display: flex; pointer-events: none;
}
.table-toolbar + .table-wrap { border: 1px solid var(--ink-100); border-top: none; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-4) var(--sp-5); font-size: var(--text-sm); color: var(--ink-400);
  flex-wrap: wrap; gap: var(--sp-3); border-top: 1px solid var(--ink-100);
  background: var(--white);
}
.page-controls { display: flex; gap: var(--sp-2); }
.page-btn {
  border: 1px solid var(--ink-100); background: var(--white);
  border-radius: var(--radius-sm); min-width: 32px; height: 32px;
  cursor: pointer; color: var(--ink-500); font-size: var(--text-sm);
  display: flex; align-items: center; justify-content: center; padding: 0 var(--sp-2);
  transition: background var(--dur-fast), border-color var(--dur-fast);
}
.page-btn.active { background: var(--navy-900); color: var(--white); border-color: var(--navy-900); }
.page-btn:hover:not(.active) { background: var(--ink-50); border-color: var(--ink-200); }

/* ── Progress bar ────────────────────────────────── */
.progress-track { height: 6px; background: var(--ink-100); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--navy-700), var(--gold-400)); border-radius: var(--radius-full); transition: width var(--dur-slow) var(--ease); }

/* ── User cell ───────────────────────────────────── */
.user-cell { display: flex; align-items: center; gap: var(--sp-3); }
.user-cell .who strong { display: block; color: var(--ink-900); font-size: var(--text-sm); font-weight: 600; }
.user-cell .who span { display: block; font-size: var(--text-xs); color: var(--ink-400); }

.avatar {
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; font-weight: 700; flex-shrink: 0;
  font-family: var(--font-body); line-height: 1;
}
.avatar-lg { width: 56px; height: 56px; font-size: var(--text-lg); }
.avatar-md { width: 40px; height: 40px; font-size: var(--text-base); }
.avatar-sm { width: 32px; height: 32px; font-size: var(--text-xs); }
.av-navy { background: var(--navy-100); color: var(--navy-700); }
.av-gold { background: var(--gold-100); color: var(--gold-700); }

/* ── Dropdown ────────────────────────────────────── */
.dropdown { position: relative; display: inline-block; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--white); border: 1px solid var(--ink-100);
  border-radius: var(--radius-md); box-shadow: var(--shadow-3);
  min-width: 175px; padding: var(--sp-2); z-index: 500;
  display: none;
}
.dropdown-menu.show { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 0.5rem 0.7rem; border-radius: var(--radius-sm);
  font-size: var(--text-sm); color: var(--ink-700);
  width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; text-decoration: none;
  transition: background var(--dur-fast);
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--ink-50); color: var(--ink-900); }
.dropdown-menu .danger-item { color: var(--danger-600); }
.dropdown-menu .danger-item:hover { background: var(--danger-100); }
.dropdown-menu hr { border: none; border-top: 1px solid var(--ink-100); margin: var(--sp-2) 0; }

/* ── Modal ───────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(11,37,69,0.55);
  display: none; align-items: center; justify-content: center;
  padding: var(--sp-4); z-index: 200; backdrop-filter: blur(2px);
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: var(--white); border-radius: var(--radius-xl);
  max-width: 500px; width: 100%; max-height: 90vh;
  overflow-y: auto; box-shadow: var(--shadow-3);
  animation: modal-in var(--dur-slow) var(--ease);
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--ink-100);
}
.modal-head h3 { margin: 0; font-size: var(--text-lg); }
.modal-body { padding: var(--sp-6); }
.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-6); border-top: 1px solid var(--ink-100);
  background: var(--ink-50); border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

/* ── Toast ───────────────────────────────────────── */
.toast-stack { position: fixed; top: var(--sp-5); right: var(--sp-5); z-index: 300; display: flex; flex-direction: column; gap: var(--sp-3); }
.toast {
  background: var(--white); border: 1px solid var(--ink-100);
  border-left: 4px solid var(--navy-700); border-radius: var(--radius-md);
  box-shadow: var(--shadow-2); padding: var(--sp-3) var(--sp-4);
  display: flex; align-items: flex-start; gap: var(--sp-3);
  min-width: 280px; max-width: 360px;
  animation: toast-in var(--dur-slow) var(--ease);
}
.toast-success { border-left-color: var(--success-600); }
.toast-danger  { border-left-color: var(--danger-600); }
.toast-title   { font-weight: 700; font-size: var(--text-sm); color: var(--ink-900); display: block; }
.toast-msg     { font-size: var(--text-xs); color: var(--ink-400); display: block; margin-top: 2px; }
.toast-close   { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--ink-300); font-size: 1rem; line-height: 1; }
@keyframes toast-in { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* ── Stat card ───────────────────────────────────── */
.stat-card {
  background: var(--white); border: 1px solid var(--ink-100);
  border-radius: var(--radius-lg); padding: var(--sp-5);
  position: relative; overflow: hidden;
}
.stat-card::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px; background: var(--navy-700); border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.stat-card.ac-gold::after  { background: var(--gold-500); }
.stat-card.ac-green::after { background: var(--success-600); }
.stat-card.ac-red::after   { background: var(--danger-600); }

.stat-label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--ink-400); margin-bottom: var(--sp-2); display: block; }
.stat-value { font-family: var(--font-display); font-size: 2.25rem; font-weight: 700; color: var(--navy-900); line-height: 1; margin-bottom: var(--sp-2); }
.stat-delta { font-size: var(--text-xs); font-weight: 600; display: inline-flex; align-items: center; gap: 3px; }
.delta-up   { color: var(--success-600); }
.delta-down { color: var(--danger-600); }

/* ── Skip link ───────────────────────────────────── */
.skip-link {
  position: absolute; left: -999px; top: var(--sp-3);
  background: var(--navy-900); color: var(--white);
  padding: var(--sp-2) var(--sp-4); z-index: 9999;
  border-radius: var(--radius-md); text-decoration: none;
  font-weight: 600; font-size: var(--text-sm);
}
.skip-link:focus { left: var(--sp-3); }

/* ── Divider ─────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--ink-100); margin: var(--sp-5) 0; }
.divider-gold { border-top-color: var(--gold-300); }

/* ── Section stripes ─────────────────────────────── */
.section-white { background: var(--white); }
.section-tint  { background: var(--ink-50); }
.section-navy  { background: var(--navy-900); }
.section-dark  { background: var(--navy-950); }

@media (max-width: 640px) {
  .content-pad { padding: var(--sp-6) var(--sp-4); }
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
}
