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

:root {
  --bg:       #0f1923;
  --surface:  #162030;
  --card:     #1c2a3a;
  --border:   #243447;
  --accent:   #c9a84c;
  --accent2:  #e8c96d;
  --text:     #e8dfd0;
  --muted:    #8a9bb0;
  --success:  #4caf7d;
  --radius:   10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── NAV ── */
nav {
  background: var(--surface);
  border-bottom: 2px solid var(--accent);
  padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.nav-brand {
  display: flex; align-items: center; gap: .6rem;
  font-family: 'Playfair Display', serif;
  color: var(--accent); font-size: 1rem; font-weight: 700;
  text-decoration: none; white-space: nowrap;
}
.nav-brand small { font-size: .72rem; color: var(--muted); display: block; font-family: 'DM Sans', sans-serif; font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: .15rem; }
.nav-links a {
  color: var(--muted); text-decoration: none; padding: .4rem .8rem;
  border-radius: 6px; font-size: .87rem; font-weight: 500; transition: all .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--accent); background: rgba(201,168,76,.1); }
.nav-right { display: flex; align-items: center; }
.btn-portal {
  padding: .38rem 1rem; border: 1px solid var(--accent);
  border-radius: 6px; color: var(--accent); text-decoration: none;
  font-size: .87rem; font-weight: 500; transition: all .2s; white-space: nowrap;
}
.btn-portal:hover { background: rgba(201,168,76,.15); color: var(--accent2); }

/* ── MAIN ── */
main { flex: 1; max-width: 1280px; margin: 0 auto; width: 100%; padding: 2rem 1.5rem; }

/* ── HERO ── */
.hero {
  background: linear-gradient(135deg, var(--card) 0%, #162516 100%);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin-bottom: 2rem;
  position: relative; overflow: hidden;
}
.hero::after {
  content: '🎓';
  position: absolute; right: 2rem; top: 50%; transform: translateY(-50%);
  font-size: 6rem; opacity: .06; pointer-events: none;
}
.hero .breadcrumb { font-size: .8rem; color: var(--muted); margin-bottom: .7rem; }
.hero .breadcrumb a { color: var(--accent); text-decoration: none; }
.hero h1 { font-family: 'Playfair Display', serif; color: var(--accent); font-size: 1.85rem; margin-bottom: .4rem; }
.hero p { color: var(--muted); font-size: .93rem; max-width: 680px; line-height: 1.6; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.3rem 1.5rem;
  display: flex; align-items: center; gap: .9rem;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat-icon { font-size: 1.9rem; }
.stat-num { font-size: 1.9rem; font-weight: 700; color: var(--accent); line-height: 1; }
.stat-label { color: var(--muted); font-size: .8rem; margin-top: .2rem; }

/* ── SECTION TITLE ── */
.section-title {
  font-family: 'Playfair Display', serif;
  color: var(--accent); font-size: 1.15rem;
  margin-bottom: 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}

/* ── CARD ── */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}

/* ── TWO COLUMNS ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }

/* ── BAR LIST ── */
.bar-list { display: flex; flex-direction: column; gap: .6rem; }
.bar-item { display: flex; align-items: center; gap: .75rem; }
.bar-label { color: var(--muted); font-size: .8rem; width: 220px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; background: var(--border); border-radius: 4px; height: 16px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width .7s cubic-bezier(.4,0,.2,1); }
.bar-fill-gold { background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.bar-fill-green { background: linear-gradient(90deg, #4caf7d, #7ecba1); }
.bar-fill-purple { background: linear-gradient(90deg, #7b5ea7, #a07fcc); }
.bar-count { color: var(--accent); font-size: .8rem; font-weight: 600; width: 36px; text-align: right; flex-shrink: 0; }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
thead th {
  background: #0d1a28; color: var(--accent); font-weight: 600;
  padding: .75rem 1rem; text-align: left;
  border-bottom: 2px solid var(--accent); white-space: nowrap;
  position: sticky; top: 0;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: rgba(201,168,76,.05); }
tbody td { padding: .6rem 1rem; color: var(--text); vertical-align: middle; }
tbody td a { color: var(--accent); text-decoration: none; }
tbody td a:hover { text-decoration: underline; }
.badge {
  display: inline-block; padding: .15rem .5rem;
  background: rgba(201,168,76,.15); color: var(--accent);
  border-radius: 4px; font-size: .77rem; font-weight: 600; font-family: monospace;
}

/* ── FORMS ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.form-group { display: flex; flex-direction: column; gap: .3rem; }
label { font-size: .8rem; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
input[type=text] {
  background: #0f1923; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: .55rem .85rem;
  font-size: .9rem; font-family: 'DM Sans', sans-serif;
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
input[type=text]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(201,168,76,.15); }
input::placeholder { color: var(--muted); opacity: .7; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.2rem; border-radius: 6px;
  font-size: .88rem; font-weight: 600; cursor: pointer;
  border: none; text-decoration: none; transition: all .2s;
  font-family: 'DM Sans', sans-serif; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #0f1923; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-outline:hover { background: rgba(201,168,76,.1); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }

/* ── PAGINATION ── */
.pagination { display: flex; align-items: center; gap: .4rem; justify-content: center; margin-top: 1.5rem; flex-wrap: wrap; }
.page-btn {
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: .38rem .75rem; border-radius: 6px;
  cursor: pointer; font-size: .85rem; transition: all .2s;
  font-family: 'DM Sans', sans-serif;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-btn.active { background: var(--accent); color: #0f1923; border-color: var(--accent); font-weight: 700; }
.page-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.page-info { color: var(--muted); font-size: .85rem; }
.page-ellipsis { color: var(--muted); padding: 0 .2rem; }

/* ── ALERT ── */
.alert-empty {
  background: rgba(138,155,176,.07); border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--muted);
  text-align: center; padding: 2.5rem; font-size: .93rem;
}

/* ── AUTOCOMPLETE ── */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 200;
  background: var(--surface); border: 1px solid var(--accent);
  border-top: none; border-radius: 0 0 8px 8px;
  max-height: 230px; overflow-y: auto; display: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.ac-item {
  padding: .55rem 1rem; cursor: pointer;
  font-size: .87rem; display: flex; justify-content: space-between; gap: .5rem;
  border-bottom: 1px solid var(--border);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover { background: rgba(201,168,76,.1); color: var(--accent); }
.ac-count { color: var(--muted); font-size: .77rem; flex-shrink: 0; }

/* ── DETAIL ── */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.detail-field { background: #0f1923; border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.detail-field .key { color: var(--muted); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .4rem; }
.detail-field .val { color: var(--text); font-size: .95rem; line-height: 1.5; }
.detail-field.full { grid-column: 1 / -1; }

/* ── MODAL ── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.7); z-index: 300;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 2rem;
  max-width: 700px; width: 90%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: modalIn .25s ease;
}
@keyframes modalIn { from { transform: scale(.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; }
.modal-title { font-family: 'Playfair Display', serif; color: var(--accent); font-size: 1.2rem; line-height: 1.3; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 1.4rem; cursor: pointer; line-height: 1; transition: color .2s; }
.modal-close:hover { color: var(--accent); }

/* ── FOOTER ── */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 1rem 1.5rem; text-align: center;
  color: var(--muted); font-size: .8rem;
}

/* ── LOADER ── */
.loader { text-align: center; padding: 2rem; color: var(--muted); }

/* ── FADE IN ── */
.fade-in { animation: fadeIn .35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-field.full { grid-column: 1; }
  nav { gap: .5rem; }
  .nav-links a { padding: .4rem .5rem; font-size: .8rem; }
  main { padding: 1rem .75rem; }
  .hero { padding: 1.5rem; }
  .hero h1 { font-size: 1.4rem; }
  .bar-label { width: 120px; }
}
