/* ============================================================
   RIVVEN PORTAL — TITAN SHELL
   Shared design system for all portal sub-apps.
   Inspired by CSUF (Cal State Fullerton) my.fullerton.edu portal.
   ============================================================ */

:root{
  --titan-blue:#00244E;
  --titan-blue-tint:#1A3A66;
  --titan-blue-deep:#001A3A;
  --titan-orange:#FF7900;
  --titan-orange-hover:#E66D00;
  --medium-blue:#0F3F8C;
  --sky-blue:#EBFBFF;
  --light-gray:#F5F5F5;
  --beige:#F8F7F3;
  --border:#E2E5E9;
  --border-strong:#C7CCD2;
  --text:#222222;
  --text-mid:#4A4A4A;
  --text-dim:#6B7280;
  --surface:#FFFFFF;
  --error:#C8102E;
  --warning:#EDA941;
  --success:#2E7D32;
  --info:#0F3F8C;
}
*{margin:0;padding:0;box-sizing:border-box}
html,body{height:100%}
body{
  font-family:'Source Sans 3','Source Sans Pro',-apple-system,BlinkMacSystemFont,'Segoe UI',Helvetica,Arial,sans-serif;
  background:var(--beige);
  color:var(--text);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
  display:flex;
  flex-direction:column;
  min-height:100vh;
}

/* ===== UTILITY BAR ===== */
.util-bar{
  background:var(--titan-blue-deep);
  color:#fff;
  font-size:13px;
  padding:6px 24px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.util-bar-links{display:flex;gap:20px}
.util-bar a{color:#fff;text-decoration:none;opacity:0.85}
.util-bar a:hover{opacity:1;text-decoration:underline}
.util-meta{font-size:12px;opacity:0.7}

/* ===== MAIN HEADER ===== */
.app-header{
  background:var(--titan-blue);
  color:#fff;
  border-bottom:4px solid var(--titan-orange);
  padding:14px 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  position:sticky;top:0;z-index:50;
  gap:24px;
}
.wordmark{
  display:flex;align-items:center;gap:14px;
  text-decoration:none;color:#fff;
  flex-shrink:0;
}
.wordmark-icon{
  width:42px;height:42px;border-radius:6px;
  background:#fff;
  display:flex;align-items:center;justify-content:center;
  color:var(--titan-orange);
  font-weight:900;font-size:25px;line-height:1;
}
.wordmark-text{display:flex;flex-direction:column;line-height:1.1}
.wordmark-name{font-size:18px;font-weight:700;letter-spacing:-0.3px}
.wordmark-sub{font-size:11px;font-weight:600;opacity:0.85;text-transform:uppercase;letter-spacing:1.5px;margin-top:2px}

/* Back/breadcrumb in header */
.header-back{
  display:flex;align-items:center;gap:8px;
  color:#fff;text-decoration:none;
  font-size:14px;font-weight:600;
  padding:6px 12px;
  border-radius:4px;
  background:rgba(255,255,255,0.1);
  transition:background 0.15s;
}
.header-back:hover{background:rgba(255,255,255,0.2)}
.header-back svg{width:16px;height:16px;fill:currentColor}
.header-title{
  flex:1;
  font-size:18px;font-weight:700;
  letter-spacing:-0.2px;
  text-align:center;
}
.header-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}
.icon-btn{
  background:transparent;border:none;color:#fff;
  width:38px;height:38px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  cursor:pointer;transition:background 0.15s;
  position:relative;
}
.icon-btn:hover{background:rgba(255,255,255,0.1)}
.icon-btn svg{width:18px;height:18px;fill:currentColor}
.icon-btn .badge{
  position:absolute;top:4px;right:4px;
  background:var(--titan-orange);
  color:#fff;
  font-size:10px;font-weight:700;
  border-radius:100px;
  padding:1px 5px;line-height:1;
  border:2px solid var(--titan-blue);
}
.profile-btn{
  display:flex;align-items:center;gap:8px;
  background:rgba(255,255,255,0.1);
  color:#fff;border:none;
  padding:5px 10px 5px 5px;border-radius:100px;
  cursor:pointer;font-family:inherit;font-size:13px;font-weight:600;
  transition:background 0.15s;
}
.profile-btn:hover{background:rgba(255,255,255,0.2)}
.avatar{
  width:30px;height:30px;border-radius:50%;
  background:var(--titan-orange);
  color:#fff;font-weight:700;font-size:13px;
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}

/* ===== SUB-NAV (tabs band under header) ===== */
.subnav{
  background:#fff;
  border-bottom:1px solid var(--border);
  padding:0 24px;
  position:sticky;top:64px;z-index:40;
  overflow-x:auto;
}
.subnav-inner{
  max-width:1200px;margin:0 auto;
  display:flex;gap:4px;
  align-items:center;
}
.subnav a{
  padding:14px 18px;
  color:var(--text-mid);
  text-decoration:none;
  font-size:14px;font-weight:600;
  border-bottom:3px solid transparent;
  margin-bottom:-1px;
  transition:color 0.15s, border-color 0.15s;
  white-space:nowrap;
}
.subnav a:hover{color:var(--titan-blue)}
.subnav a.active{
  color:var(--titan-blue);
  border-bottom-color:var(--titan-orange);
}
.subnav-meta{margin-left:auto;font-size:13px;color:var(--text-dim)}

/* ===== PAGE HERO ===== */
.page-hero{
  background:linear-gradient(135deg,var(--titan-blue) 0%,var(--titan-blue-tint) 100%);
  color:#fff;
  padding:32px 24px 36px;
}
.hero-inner{max-width:1200px;margin:0 auto}
.hero-eyebrow{
  font-size:12px;font-weight:700;
  text-transform:uppercase;letter-spacing:2px;
  opacity:0.85;margin-bottom:6px;
  color:var(--titan-orange);
}
.hero-title{
  font-size:30px;font-weight:700;letter-spacing:-0.5px;
  margin-bottom:6px;
}
.hero-sub{font-size:15px;opacity:0.85;max-width:720px}
.hero-stats{
  display:flex;gap:32px;
  margin-top:20px;flex-wrap:wrap;
}
.hero-stat-label{
  font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:1.5px;
  opacity:0.8;color:var(--titan-orange);
  margin-bottom:4px;
}
.hero-stat-value{font-size:24px;font-weight:700;line-height:1}

/* ===== MAIN CONTENT ===== */
.app-main{
  flex:1;
  max-width:1200px;
  margin:0 auto;
  padding:32px 24px 48px;
  width:100%;
}

.section-head{
  display:flex;justify-content:space-between;align-items:flex-end;
  margin-bottom:16px;
  padding-bottom:8px;
  border-bottom:1px solid var(--border);
  flex-wrap:wrap;gap:8px;
}
.section-title{
  font-size:20px;font-weight:700;color:var(--titan-blue);
  letter-spacing:-0.2px;
}
.section-actions{display:flex;gap:8px;align-items:center}

/* ===== BUTTONS ===== */
.btn{
  padding:10px 18px;
  border-radius:4px;border:none;
  font-family:inherit;font-size:14px;font-weight:700;
  cursor:pointer;text-decoration:none;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  line-height:1;
  transition:background 0.15s, transform 0.05s, box-shadow 0.15s;
}
.btn-primary{background:var(--titan-orange);color:#fff}
.btn-primary:hover{background:var(--titan-orange-hover)}
.btn-secondary{background:transparent;color:var(--titan-blue);border:2px solid var(--titan-blue)}
.btn-secondary:hover{background:var(--titan-blue);color:#fff}
.btn-ghost{
  background:transparent;color:var(--medium-blue);
  font-size:13px;padding:8px 12px;font-weight:600;
}
.btn-ghost:hover{background:var(--sky-blue);text-decoration:underline}
.btn-sm{font-size:12px;padding:7px 12px}

/* ===== PANELS ===== */
.panel{
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
  margin-bottom:16px;
}
.panel-head{
  background:var(--light-gray);
  padding:14px 20px;
  border-bottom:1px solid var(--border);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;flex-wrap:wrap;
}
.panel-title{font-size:15px;font-weight:700;color:var(--titan-blue)}
.panel-body{padding:20px}
.panel-body.flush{padding:0 20px}

/* ===== GRIDS ===== */
.grid-2{display:grid;grid-template-columns:2fr 1fr;gap:16px;margin-bottom:16px}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:16px}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:16px}

/* ===== TILES ===== */
.tile{
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  overflow:hidden;
  cursor:pointer;
  text-decoration:none;
  color:inherit;
  transition:transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  display:flex;
  flex-direction:column;
}
.tile:hover{
  transform:translateY(-2px);
  box-shadow:0 8px 20px rgba(0,36,78,0.12);
  border-color:var(--titan-blue);
}
.tile-cap{
  background:var(--titan-blue);
  color:#fff;
  height:80px;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
}
.tile-cap svg{width:34px;height:34px;fill:#fff}
.tile-badge{
  position:absolute;top:8px;right:8px;
  background:var(--titan-orange);
  color:#fff;
  font-size:11px;font-weight:700;
  border-radius:100px;
  padding:3px 9px;line-height:1.2;
  min-width:24px;text-align:center;
  box-shadow:0 2px 4px rgba(0,0,0,0.15);
}
.tile-badge.alert{background:var(--error)}
.tile-body{
  padding:14px 16px;
  background:#fff;
  flex:1;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:6px;
}
.tile-label{
  font-size:15px;font-weight:700;color:var(--titan-blue);line-height:1.2;
}
.tile-meta{font-size:12px;color:var(--text-dim);line-height:1.4}

/* ===== LIST ROWS ===== */
.list-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 0;
  border-bottom:1px solid var(--border);
  gap:16px;
}
.list-row:last-child{border-bottom:none}
.list-row-left{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.list-icon{
  width:38px;height:38px;border-radius:6px;
  background:var(--sky-blue);color:var(--medium-blue);
  display:flex;align-items:center;justify-content:center;
  flex-shrink:0;
}
.list-icon svg{width:18px;height:18px;fill:currentColor}
.list-icon.warn{background:#FFF1D9;color:#8C5A00}
.list-icon.error{background:#FFE4E8;color:var(--error)}
.list-icon.success{background:#DCFCE7;color:var(--success)}
.list-icon.info{background:var(--sky-blue);color:var(--medium-blue)}
.list-info{min-width:0;flex:1}
.list-title{font-size:14px;font-weight:600;color:var(--text);margin-bottom:2px}
.list-meta{font-size:12px;color:var(--text-dim)}
.list-action{
  color:var(--medium-blue);text-decoration:none;
  font-size:13px;font-weight:600;
  padding:6px 12px;border-radius:4px;flex-shrink:0;
}
.list-action:hover{background:var(--sky-blue);text-decoration:underline}

/* ===== PILLS ===== */
.pill{
  display:inline-block;
  padding:3px 9px;border-radius:100px;
  font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:0.8px;
  white-space:nowrap;
}
.pill.live,.pill.paid-success{background:#DCFCE7;color:var(--success)}
.pill.due,.pill.warning{background:#FFF1D9;color:#8C5A00}
.pill.alert,.pill.overdue{background:#FFE4E8;color:var(--error)}
.pill.paid,.pill.info{background:var(--sky-blue);color:var(--medium-blue)}
.pill.draft{background:var(--light-gray);color:var(--text-dim)}

/* ===== ANNOUNCEMENT CARD ===== */
.ann-card{
  padding:14px 18px;
  background:var(--sky-blue);
  border-left:4px solid var(--medium-blue);
  border-radius:0 4px 4px 0;
  margin-bottom:10px;
}
.ann-card:last-child{margin-bottom:0}
.ann-card.warn{background:#FFF8E6;border-left-color:var(--warning)}
.ann-card.alert{background:#FFE4E8;border-left-color:var(--error)}
.ann-date{
  font-size:11px;font-weight:700;
  color:var(--medium-blue);
  text-transform:uppercase;letter-spacing:1.2px;
  margin-bottom:4px;
}
.ann-title{font-size:14px;font-weight:700;color:var(--titan-blue);margin-bottom:4px}
.ann-body{font-size:13px;color:var(--text-mid);line-height:1.5}

/* ===== STAT CARDS ===== */
.stat-card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:8px;
  padding:18px 20px;
  border-top:4px solid var(--titan-blue);
}
.stat-eyebrow{
  font-size:11px;font-weight:700;
  text-transform:uppercase;letter-spacing:1.5px;
  color:var(--text-dim);
  margin-bottom:6px;
}
.stat-value{
  font-size:30px;font-weight:700;
  color:var(--titan-blue);
  line-height:1;letter-spacing:-0.5px;
}
.stat-delta{font-size:13px;margin-top:6px;color:var(--text-dim)}
.stat-delta.up{color:var(--success)}
.stat-delta.down{color:var(--error)}

/* ===== TABLES ===== */
.tbl{
  width:100%;
  border-collapse:collapse;
  font-size:14px;
}
.tbl th{
  text-align:left;
  font-size:11px;font-weight:700;
  color:var(--text-dim);
  text-transform:uppercase;letter-spacing:1.5px;
  padding:10px 16px;
  background:var(--light-gray);
  border-bottom:1px solid var(--border);
}
.tbl td{
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  color:var(--text);
}
.tbl tr:hover td{background:var(--beige)}
.tbl tr:last-child td{border-bottom:none}

/* ===== FORM FIELDS ===== */
.field{margin-bottom:16px}
.field label{
  display:block;font-size:13px;font-weight:600;
  color:var(--text);margin-bottom:6px;
}
.field input,.field textarea,.field select{
  width:100%;padding:11px 14px;
  border:1px solid var(--border);
  border-radius:4px;
  font-size:14px;font-family:inherit;
  color:var(--text);background:#fff;
  transition:border-color 0.15s, box-shadow 0.15s;
}
.field input:focus,.field textarea:focus,.field select:focus{
  outline:none;
  border-color:var(--medium-blue);
  box-shadow:0 0 0 3px rgba(15,63,140,0.15);
}
.field textarea{min-height:100px;resize:vertical;line-height:1.5}

/* ===== ALERT BANNERS ===== */
.alert-banner{
  padding:14px 18px;
  border-radius:6px;border-left:4px solid;
  margin-bottom:16px;
  display:flex;align-items:flex-start;gap:12px;
  font-size:14px;
}
.alert-banner.info{background:var(--sky-blue);border-left-color:var(--medium-blue);color:var(--titan-blue)}
.alert-banner.warn{background:#FFF8E6;border-left-color:var(--warning);color:#8C5A00}
.alert-banner.error{background:#FFE4E8;border-left-color:var(--error);color:#7F0A1D}
.alert-banner.success{background:#DCFCE7;border-left-color:var(--success);color:#155A1F}
.alert-banner svg{width:20px;height:20px;flex-shrink:0;margin-top:2px;fill:currentColor}
.alert-banner-title{font-weight:700;margin-bottom:2px}

/* ===== FOOTER ===== */
.app-footer{
  background:var(--titan-blue);
  color:rgba(255,255,255,0.85);
  padding:32px 24px 20px;
  margin-top:auto;
}
.footer-grid{
  max-width:1200px;margin:0 auto;
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:32px;
  padding-bottom:24px;
  border-bottom:1px solid rgba(255,255,255,0.1);
}
.footer-col h3{
  font-size:13px;font-weight:700;color:#fff;
  text-transform:uppercase;letter-spacing:1.5px;
  margin-bottom:12px;
}
.footer-col ul{list-style:none;font-size:13px;line-height:2}
.footer-col a{color:rgba(255,255,255,0.85);text-decoration:none}
.footer-col a:hover{color:var(--titan-orange);text-decoration:underline}
.footer-bar{
  max-width:1200px;margin:18px auto 0;
  display:flex;justify-content:space-between;align-items:center;
  font-size:12px;color:rgba(255,255,255,0.7);
  flex-wrap:wrap;gap:8px;
}
.footer-bar a{color:rgba(255,255,255,0.85);text-decoration:none;margin:0 8px}
.footer-bar a:hover{color:var(--titan-orange)}

/* ===== ACCESSIBILITY ===== */
a:focus-visible,button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{
  outline:3px solid var(--titan-orange);
  outline-offset:2px;
}
.skip-link{
  position:absolute;left:-9999px;top:0;
  background:var(--titan-orange);color:#fff;
  padding:8px 16px;text-decoration:none;font-weight:700;
  border-radius:0 0 4px 0;z-index:1000;
}
.skip-link:focus{left:0}

/* ===== RESPONSIVE ===== */
@media (max-width:1024px){
  .grid-4{grid-template-columns:repeat(2,1fr)}
  .grid-3{grid-template-columns:repeat(2,1fr)}
  .grid-2{grid-template-columns:1fr}
}
@media (max-width:720px){
  .util-bar{display:none}
  .app-header{padding:12px 14px;gap:8px}
  .wordmark-icon{width:36px;height:36px;font-size:21px}
  .wordmark-name{font-size:16px}
  .wordmark-sub{display:none}
  .header-title{display:none}
  .subnav{padding:0 12px;top:60px}
  .page-hero{padding:24px 16px 28px}
  .hero-title{font-size:24px}
  .app-main{padding:24px 16px 32px}
  .grid-4,.grid-3{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:1fr 1fr;gap:20px}
  .footer-bar{flex-direction:column;text-align:center}
}

/* ===== SHARED FOOTER MARKUP HOOK ===== */
.footer-template{display:none}
