/* Graduate Tracer System - theme */
:root {
  --navy-900: #0b1b43;
  --navy-800: #11275e;
  --navy-700: #1b3a8a;
  --brand: #2f5bea;
  --brand-soft: #e8eefe;
  --ink: #1f2a44;
  --muted: #6b7694;
  --line: #e5e9f2;
  --bg: #f4f6fb;
  --ok: #12a874;
  --warn: #f59e0b;
  --bad: #e5484d;
  --radius: 14px;
  --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --bs-body-color: var(--ink);
  --bs-offcanvas-width: 285px;
}

body { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; }
.min-w-0 { min-width: 0; }

/* ---------- App shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1030;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem; color: #fff;
  background: linear-gradient(90deg, var(--navy-900), var(--navy-700));
  box-shadow: 0 2px 10px rgba(11, 27, 67, .25);
}
.sidebar { display: flex; flex-direction: column; }
.sidebar-panel { background: var(--navy-900); color: #fff; }
.sidebar .offcanvas-header { border-bottom: 1px solid rgba(255, 255, 255, .1); }
.brand { display: flex; align-items: center; gap: .75rem; font-weight: 700; font-size: 1.1rem; color: #fff; }
.brand i { font-size: 1.8rem; color: #8fb0ff; }
.brand small { display: block; font-weight: 400; font-size: .72rem; color: #9fb0d8; }
.sidebar .brand.d-lg-flex { padding: 1.4rem 1.25rem 1.1rem; }

.side-nav { padding: .5rem .75rem; gap: .15rem; }
.side-nav .nav-link {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .9rem; border-radius: 10px;
  color: #b8c5e6; font-weight: 500; font-size: .95rem;
  transition: background .15s, color .15s;
}
.side-nav .nav-link i { font-size: 1.15rem; }
.side-nav .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.side-nav .nav-link.active { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(47, 91, 234, .35); }

.side-user {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.1rem; margin: .75rem;
  background: rgba(255, 255, 255, .06); border-radius: 12px;
}
.side-user .name { font-weight: 600; font-size: .9rem; }
.side-user small { color: #9fb0d8; font-size: .75rem; }
.avatar {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem;
  background: linear-gradient(135deg, #5b84ff, #2f5bea); color: #fff;
}

@media (min-width: 992px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; background: var(--navy-900); z-index: 1020; }
  .content { margin-left: 270px; }
}
.content-inner { padding: 1.5rem 1.25rem 3rem; max-width: 1400px; }
@media (min-width: 992px) { .content-inner { padding: 2rem 2.25rem 3rem; } }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-head h1 { font-size: 1.55rem; font-weight: 700; margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--muted); }

/* ---------- Cards / panels ---------- */
.panel { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(20, 35, 80, .04); }
.panel-title {
  display: flex; align-items: center; gap: .55rem;
  padding: 1rem 1.25rem .25rem; font-weight: 600; font-size: 1rem;
}
.panel-title i { color: var(--brand); }
.panel .card-body { padding: 1.1rem 1.25rem 1.25rem; }

.stat-card { display: flex; align-items: center; gap: 1rem; padding: 1.15rem 1.25rem; height: 100%; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; flex: 0 0 auto; }
.stat-card .value { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat-card .label { color: var(--muted); font-size: .85rem; }
.tone-brand { background: var(--brand-soft); color: var(--brand); }
.tone-ok { background: #def7ec; color: var(--ok); }
.tone-warn { background: #fef3d8; color: #c27803; }
.tone-bad { background: #fde8e8; color: var(--bad); }

.announce { padding: .9rem 0; border-bottom: 1px solid var(--line); }
.announce:last-child { border-bottom: 0; padding-bottom: 0; }
.announce p { color: #3c486a; font-size: .93rem; }

.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty i { font-size: 2.2rem; opacity: .6; }

/* ---------- Forms ---------- */
.form-label { font-weight: 500; font-size: .87rem; margin-bottom: .3rem; }
.form-control, .form-select { border-radius: 10px; border-color: #d6dcec; padding: .6rem .8rem; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 .22rem rgba(47, 91, 234, .15); }
.btn { border-radius: 10px; font-weight: 500; }
.btn-primary { background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { background: #2349c4; border-color: #2349c4; }
.form-section { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: .5rem 0 .75rem; padding-bottom: .4rem; border-bottom: 1px solid var(--line); }

/* ---------- Tables ---------- */
.table-modern { margin: 0; }
.table-modern thead th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); background: #f8f9fd; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-modern td { vertical-align: middle; font-size: .92rem; }
.badge-soft { padding: .35em .65em; border-radius: 999px; font-weight: 600; font-size: .75rem; }
.badge-employed { background: #def7ec; color: #0b7a55; }
.badge-self { background: #fef3d8; color: #a15c07; }
.badge-unemployed { background: #fde8e8; color: #b42318; }
.badge-role { background: var(--brand-soft); color: var(--brand); }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: flex; }
.auth-hero {
  flex: 1 1 45%; display: none; position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1200px 600px at 10% 10%, #2f5bea 0%, transparent 60%), linear-gradient(160deg, var(--navy-900), var(--navy-700));
  padding: 3rem;
}
.auth-hero::after { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -180px; background: rgba(255, 255, 255, .06); }
.auth-hero h2 { font-weight: 700; font-size: 2.1rem; line-height: 1.2; }
.auth-hero .feature { display: flex; gap: .8rem; margin-top: 1.25rem; color: #cdd8f6; }
.auth-hero .feature i { font-size: 1.3rem; color: #8fb0ff; }
.auth-form { flex: 1 1 55%; display: flex; align-items: center; justify-content: center; padding: 1.5rem; }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 760px; }
@media (min-width: 992px) { .auth-hero { display: flex; flex-direction: column; justify-content: center; } }
.auth-logo { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--navy-800); font-size: 1.15rem; margin-bottom: 1.5rem; }
.auth-logo i { font-size: 1.9rem; color: var(--brand); }

/* ---------- Chat ---------- */
.chat-shell { display: flex; height: calc(100vh - 190px); min-height: 440px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-list { width: 330px; flex: 0 0 330px; border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.chat-list-head { padding: .9rem; border-bottom: 1px solid var(--line); }
.chat-contacts { overflow-y: auto; flex: 1; }
.contact { display: flex; gap: .75rem; align-items: center; padding: .8rem 1rem; cursor: pointer; border-bottom: 1px solid #f0f2f8; }
.contact:hover { background: #f7f9ff; }
.contact.active { background: var(--brand-soft); }
.contact .meta { min-width: 0; flex: 1; }
.contact .who { font-weight: 600; font-size: .92rem; }
.contact .last { color: var(--muted); font-size: .8rem; }
.chat-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-thread-head { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-bottom: 1px solid var(--line); background: #fff; }
.chat-body { flex: 1; overflow-y: auto; padding: 1rem; background: #f7f8fc; display: flex; flex-direction: column; gap: .5rem; }
.bubble { max-width: 78%; padding: .55rem .85rem; border-radius: 16px; font-size: .93rem; word-wrap: break-word; overflow-wrap: anywhere; box-shadow: 0 1px 1px rgba(20, 35, 80, .05); }
.bubble small { display: block; font-size: .68rem; opacity: .7; margin-top: .15rem; }
.bubble.in { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.chat-compose { display: flex; gap: .6rem; padding: .75rem; border-top: 1px solid var(--line); background: #fff; }
.chat-compose textarea { resize: none; }
.chat-placeholder { margin: auto; text-align: center; color: var(--muted); }
.chat-placeholder i { font-size: 3rem; opacity: .5; }

@media (max-width: 767.98px) {
  .chat-shell { height: calc(100vh - 150px); }
  .chat-list { width: 100%; flex-basis: 100%; border-right: 0; }
  .chat-thread { display: none; width: 100%; }
  .chat-shell.show-thread .chat-list { display: none; }
  .chat-shell.show-thread .chat-thread { display: flex; }
  .bubble { max-width: 88%; }
}

/* Reports */
.chart-box { position: relative; height: 300px; }
.rate-bar { height: 8px; border-radius: 999px; background: #e9edf7; overflow: hidden; min-width: 70px; }
.rate-bar span { display: block; height: 100%; background: var(--ok); }

.nav-unread-badge { font-size: .65rem; }
.topbar .nav-unread-badge { position: absolute; top: -6px; right: -10px; }

@media print {
  .sidebar, .topbar, .page-actions, .no-print { display: none !important; }
  .content { margin: 0 !important; }
  body { background: #fff; }
}

.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
