/* ============================================================
   OSAS ATU – Global Design System
   Palette: Deep Navy + Electric Teal + Slate
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── CSS Custom Properties ──────────────────────────────────── */
:root {
  --navy:        #0F1B2D;
  --navy-mid:    #162236;
  --slate:       #1E2D3D;
  --slate-light: #263D52;
  --teal:        #00BFA6;
  --teal-dark:   #009E89;
  --teal-glow:   rgba(0, 191, 166, 0.18);
  --teal-soft:   rgba(0, 191, 166, 0.08);
  --bg:          #F0F4F8;
  --bg-card:     #FFFFFF;
  --text-main:   #0F1B2D;
  --text-muted:  #6B7E91;
  --text-light:  #8899AA;
  --border:      #E2E8F0;
  --danger:      #E53E3E;
  --warning:     #F6AD55;
  --success:     #48BB78;
  --info:        #4299E1;

  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  --shadow-sm:   0 1px 3px rgba(15,27,45,.08), 0 1px 2px rgba(15,27,45,.04);
  --shadow-md:   0 4px 16px rgba(15,27,45,.10), 0 2px 6px rgba(15,27,45,.06);
  --shadow-lg:   0 10px 40px rgba(15,27,45,.14), 0 4px 12px rgba(15,27,45,.08);

  --sidebar-w:   260px;
  --topbar-h:    64px;

  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; }

/* ── Sidebar Layout ─────────────────────────────────────────── */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--navy);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform .3s ease;
}

.sidebar-brand {
  padding: 24px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand .brand-icon {
  width: 40px; height: 40px;
  background: var(--teal);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 0 20px var(--teal-glow);
}
.sidebar-brand .brand-icon svg { color: var(--navy); }
.sidebar-brand .brand-name {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal);
}
.sidebar-brand .brand-sub {
  font-size: .72rem;
  color: rgba(255,255,255,.4);
  margin-top: 2px;
}

.sidebar-section {
  padding: 20px 12px 8px;
}
.sidebar-section-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(255,255,255,.25);
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: rgba(255,255,255,.55);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .18s ease;
  position: relative;
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
}
.nav-item.active {
  background: var(--teal-soft);
  color: var(--teal);
  border-left: 3px solid var(--teal);
  padding-left: 9px;
}
.nav-item.active svg { color: var(--teal); }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--teal);
  color: var(--navy);
  font-size: .65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background .18s;
}
.sidebar-user:hover { background: rgba(255,255,255,.06); }
.sidebar-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--navy);
  flex-shrink: 0;
}
.sidebar-user-info .u-name {
  font-size: .82rem;
  font-weight: 600;
  color: rgba(255,255,255,.85);
}
.sidebar-user-info .u-role {
  font-size: .7rem;
  color: rgba(255,255,255,.35);
}

/* ── Main content area ───────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Top bar ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
}
.topbar-left h1 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
}
.topbar-left p {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-btn {
  width: 36px; height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all .18s;
  position: relative;
}
.topbar-btn:hover { background: var(--bg); color: var(--text-main); }
.topbar-notif-dot {
  width: 8px; height: 8px;
  background: var(--teal);
  border-radius: 50%;
  position: absolute;
  top: 6px; right: 6px;
  border: 2px solid white;
}

/* ── Page content ────────────────────────────────────────────── */
.page-content {
  padding: 28px;
  flex: 1;
}

/* ── Year badge ─────────────────────────────────────────────── */
.year-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal-soft);
  border: 1px solid rgba(0,191,166,.25);
  color: var(--teal-dark);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
}

/* ── Stat cards ──────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow .2s, transform .2s;
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon.teal    { background: var(--teal-soft);            color: var(--teal); }
.stat-icon.blue    { background: rgba(66,153,225,.1);         color: var(--info); }
.stat-icon.green   { background: rgba(72,187,120,.1);         color: var(--success); }
.stat-icon.orange  { background: rgba(246,173,85,.1);         color: var(--warning); }
.stat-icon.red     { background: rgba(229,62,62,.1);          color: var(--danger); }
.stat-value {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}
.stat-label {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-main);
}
.card-body { padding: 24px; }
.card-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .855rem;
}
.data-table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.data-table tbody tr:last-child { border-bottom: none; }
.data-table tbody tr:hover { background: rgba(0,191,166,.03); }
.data-table tbody td {
  padding: 13px 16px;
  color: var(--text-main);
  vertical-align: middle;
}

/* ── Badges / Status pills ───────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 600;
}
.badge-success { background: rgba(72,187,120,.12); color: #276749; }
.badge-warning { background: rgba(246,173,85,.15); color: #92400E; }
.badge-danger  { background: rgba(229,62,62,.1);   color: #9B2C2C; }
.badge-info    { background: rgba(66,153,225,.1);  color: #2B6CB0; }
.badge-teal    { background: var(--teal-soft);      color: var(--teal-dark); }
.badge-muted   { background: var(--bg);             color: var(--text-muted); border: 1px solid var(--border); }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: .855rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .18s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--teal);
  color: var(--navy);
}
.btn-primary:hover {
  background: var(--teal-dark);
  box-shadow: 0 4px 14px rgba(0,191,166,.35);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }
.btn-danger {
  background: rgba(229,62,62,.1);
  color: var(--danger);
  border: 1px solid rgba(229,62,62,.2);
}
.btn-danger:hover { background: var(--danger); color: white; }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-icon { padding: 8px; border-radius: var(--radius-md); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: .875rem;
  color: var(--text-main);
  background: white;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}
.form-control:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(0,191,166,.12);
}
.form-control::placeholder { color: var(--text-light); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: .75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: .75rem; color: var(--danger); margin-top: 4px; }

/* ── Alerts / Flash ──────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: .855rem;
  margin-bottom: 20px;
}
.alert-success { background: rgba(72,187,120,.1);  color: #276749; border-left: 4px solid var(--success); }
.alert-danger  { background: rgba(229,62,62,.08);  color: #9B2C2C; border-left: 4px solid var(--danger); }
.alert-warning { background: rgba(246,173,85,.12); color: #92400E; border-left: 4px solid var(--warning); }
.alert-info    { background: rgba(66,153,225,.1);  color: #2B6CB0; border-left: 4px solid var(--info); }

/* ── Score bar ───────────────────────────────────────────────── */
.score-bar-wrap { display: flex; align-items: center; gap: 10px; }
.score-bar {
  flex: 1; height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: var(--teal);
  border-radius: 99px;
  transition: width .6s ease;
}
.score-val { font-size: .78rem; font-weight: 700; color: var(--teal-dark); min-width: 36px; }

/* ── Progress steps ─────────────────────────────────────────── */
.thesis-steps { display: flex; gap: 6px; }
.thesis-step {
  flex: 1;
  height: 5px;
  border-radius: 99px;
  background: var(--border);
}
.thesis-step.approved    { background: var(--success); }
.thesis-step.submitted   { background: var(--teal); }
.thesis-step.in_progress { background: var(--warning); }

/* ── Loader ──────────────────────────────────────────────────── */
.spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--teal-glow);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-state svg { color: var(--text-light); margin: 0 auto 16px; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text-main); }
.empty-state p  { font-size: .855rem; color: var(--text-muted); margin-top: 6px; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .page-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .topbar { padding: 0 16px; }
}
