/* ============================================================
   Cambridge Institute of Technology - Grievance System
   Design: Deep Navy + Crimson | Refined Academic Aesthetic
   ============================================================ */

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

:root {
  --navy:       #0f1f3d;
  --navy-mid:   #162847;
  --navy-light: #1e3a5f;
  --crimson:    #c0392b;
  --crimson-lt: #e74c3c;
  --gold:       #d4a843;
  --gold-lt:    #f0c060;
  --white:      #ffffff;
  --off-white:  #f7f8fc;
  --gray-50:    #f0f2f7;
  --gray-100:   #e4e8f0;
  --gray-300:   #a0aec0;
  --gray-500:   #64748b;
  --gray-700:   #334155;
  --green:      #1a9e5c;
  --green-lt:   #e6f7f0;
  --orange:     #d97706;
  --orange-lt:  #fef3c7;
  --blue:       #2563eb;
  --blue-lt:    #eff6ff;
  --red-lt:     #fef2f2;
  --purple:     #7c3aed;
  --purple-lt:  #f5f3ff;

  --shadow-sm:  0 1px 3px rgba(15,31,61,.08), 0 1px 2px rgba(15,31,61,.04);
  --shadow-md:  0 4px 16px rgba(15,31,61,.10), 0 2px 6px rgba(15,31,61,.06);
  --shadow-lg:  0 10px 40px rgba(15,31,61,.15), 0 4px 12px rgba(15,31,61,.08);
  --radius:     12px;
  --radius-sm:  8px;
  --radius-lg:  18px;
  --transition: all .22s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--off-white);
  color: var(--gray-700);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ---- LAYOUT ---- */
.app-layout { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: linear-gradient(170deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-light) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 100;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  padding: 28px 24px 22px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  text-decoration: none;
}
.brand-logo {
  width: 46px; height: 46px;
  background: linear-gradient(135deg, var(--gold), var(--crimson));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700;
  color: white;
  margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(192,57,43,.4);
}
.brand-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.3;
}
.brand-sub {
  font-size: 11px;
  color: rgba(255,255,255,.45);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-top: 3px;
}

.sidebar-nav { flex: 1; padding: 18px 14px; overflow-y: auto; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,.3);
  padding: 14px 10px 6px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.68);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: var(--white); }
.nav-link.active {
  background: linear-gradient(135deg, var(--crimson), #9b2335);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(192,57,43,.4);
}
.nav-link .icon { font-size: 17px; width: 22px; text-align: center; }
.nav-link .badge-pill {
  margin-left: auto;
  background: var(--crimson);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}
.nav-link.active .badge-pill { background: rgba(255,255,255,.25); }

.sidebar-footer {
  padding: 16px 14px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.user-card {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.06);
}
.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--gold), var(--crimson));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.user-info { min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: 11px; color: rgba(255,255,255,.45); text-transform: capitalize; }
.logout-btn {
  margin-left: auto;
  background: none; border: none;
  color: rgba(255,255,255,.4);
  cursor: pointer; font-size: 16px;
  transition: var(--transition);
  padding: 4px;
  border-radius: 4px;
}
.logout-btn:hover { color: var(--crimson-lt); background: rgba(255,255,255,.06); }

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- TOP BAR ---- */
.topbar {
  background: var(--white);
  padding: 0 32px;
  height: 68px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
  position: sticky; top: 0; z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar-title { font-family: 'Playfair Display', serif; font-size: 20px; font-weight: 700; color: var(--navy); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.notif-btn {
  position: relative;
  width: 40px; height: 40px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
  text-decoration: none;
  color: var(--gray-500);
}
.notif-btn:hover { background: var(--gray-100); color: var(--navy); }
.notif-dot {
  position: absolute;
  top: 7px; right: 8px;
  width: 8px; height: 8px;
  background: var(--crimson);
  border-radius: 50%;
  border: 2px solid white;
}

/* ---- PAGE CONTENT ---- */
.page-content { padding: 32px; flex: 1; }
.page-header { margin-bottom: 28px; }
.page-header h1 { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; color: var(--navy); }
.page-header p { color: var(--gray-500); margin-top: 5px; font-size: 14px; }
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-300); margin-bottom: 8px; }
.breadcrumb a { color: var(--crimson); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---- STAT CARDS ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  display: flex; align-items: flex-start; gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 4px; height: 100%;
}
.stat-card.navy::before  { background: var(--navy); }
.stat-card.crimson::before { background: var(--crimson); }
.stat-card.green::before  { background: var(--green); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.purple::before { background: var(--purple); }
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.stat-card.navy   .stat-icon { background: #e8ecf5; }
.stat-card.crimson .stat-icon { background: var(--red-lt); }
.stat-card.green  .stat-icon { background: var(--green-lt); }
.stat-card.orange .stat-icon { background: var(--orange-lt); }
.stat-card.purple .stat-icon { background: var(--purple-lt); }
.stat-num { font-size: 28px; font-weight: 700; color: var(--navy); font-family: 'Playfair Display', serif; line-height: 1; }
.stat-label { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* ---- CARDS ---- */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-weight: 600; font-size: 15px; color: var(--navy); }
.card-body { padding: 24px; }

/* ---- TABLE ---- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--gray-500);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  white-space: nowrap;
}
tbody td {
  padding: 14px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--off-white); }
.ticket-num { font-family: monospace; font-size: 13px; color: var(--navy); font-weight: 600; }

/* ---- BADGES ---- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.badge-pending   { background: var(--orange-lt); color: var(--orange); }
.badge-pending::before { background: var(--orange); }
.badge-review    { background: var(--blue-lt); color: var(--blue); }
.badge-review::before { background: var(--blue); }
.badge-progress  { background: var(--purple-lt); color: var(--purple); }
.badge-progress::before { background: var(--purple); }
.badge-resolved  { background: var(--green-lt); color: var(--green); }
.badge-resolved::before { background: var(--green); }
.badge-rejected  { background: var(--red-lt); color: var(--crimson); }
.badge-rejected::before { background: var(--crimson); }
.badge-escalated { background: #fff4e5; color: #c05a00; }
.badge-escalated::before { background: #c05a00; }

.priority-high   { background: var(--red-lt); color: var(--crimson); font-size: 12px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.priority-medium { background: var(--orange-lt); color: var(--orange); font-size: 12px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }
.priority-low    { background: var(--green-lt); color: var(--green); font-size: 12px; padding: 2px 8px; border-radius: 20px; font-weight: 600; }

/* ---- BUTTONS ---- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 600;
  border: none; cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--crimson), #9b2335);
  color: white;
  box-shadow: 0 4px 14px rgba(192,57,43,.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(192,57,43,.45); }
.btn-navy {
  background: var(--navy);
  color: white;
}
.btn-navy:hover { background: var(--navy-light); }
.btn-outline {
  background: transparent;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-200);
}
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-icon { padding: 8px; }

/* ---- FORMS ---- */
.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 7px; }
.form-label span { color: var(--crimson); }
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: var(--gray-700);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(15,31,61,.08); }
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 12px; color: var(--gray-300); margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ---- ALERT ---- */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 20px;
  display: flex; align-items: flex-start; gap: 10px;
}
.alert-success { background: var(--green-lt); color: #0f5132; border-left: 4px solid var(--green); }
.alert-error   { background: var(--red-lt); color: #842029; border-left: 4px solid var(--crimson); }
.alert-info    { background: var(--blue-lt); color: #084298; border-left: 4px solid var(--blue); }

/* ---- TIMELINE ---- */
.timeline { list-style: none; position: relative; padding-left: 28px; }
.timeline::before {
  content: '';
  position: absolute; left: 8px; top: 0; bottom: 0;
  width: 2px; background: var(--gray-100);
}
.timeline-item { position: relative; padding-bottom: 22px; }
.timeline-dot {
  position: absolute; left: -24px; top: 5px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--navy);
}
.timeline-dot.resolved { background: var(--green); box-shadow: 0 0 0 2px var(--green); }
.timeline-dot.rejected { background: var(--crimson); box-shadow: 0 0 0 2px var(--crimson); }
.timeline-dot.student  { background: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.timeline-body {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.timeline-meta { font-size: 12px; color: var(--gray-300); margin-bottom: 7px; display: flex; align-items: center; gap: 8px; }
.timeline-author { font-weight: 600; color: var(--navy); }
.timeline-body p { font-size: 14px; color: var(--gray-700); }

/* ---- MODAL ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  opacity: 0; pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: white;
  border-radius: var(--radius-lg);
  max-width: 540px; width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(.97);
  transition: var(--transition);
}
.modal-overlay.open .modal { transform: none; }
.modal-header {
  padding: 22px 26px 18px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 700; color: var(--navy); }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--gray-300); transition: var(--transition); }
.modal-close:hover { color: var(--navy); }
.modal-body { padding: 22px 26px; }
.modal-footer { padding: 16px 26px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

/* ---- LOGIN PAGE ---- */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-light) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(192,57,43,.15) 0%, transparent 70%);
  top: -200px; right: -100px;
}
.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,168,67,.1) 0%, transparent 70%);
  bottom: -150px; left: -50px;
}
.login-box {
  background: white;
  border-radius: var(--radius-lg);
  padding: 44px 42px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg);
  position: relative; z-index: 1;
}
.login-logo {
  text-align: center;
  margin-bottom: 30px;
}
.login-logo-icon {
  width: 64px; height: 64px;
  background: linear-gradient(135deg, var(--gold), var(--crimson));
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 30px; font-weight: 700; color: white;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(192,57,43,.4);
}
.login-logo h1 { font-family: 'Playfair Display', serif; font-size: 18px; color: var(--navy); line-height: 1.3; }
.login-logo p { font-size: 12px; color: var(--gray-300); margin-top: 4px; letter-spacing: .5px; }
.login-subtitle { font-size: 16px; font-weight: 600; color: var(--navy); margin-bottom: 24px; text-align: center; }
.role-tabs { display: flex; gap: 8px; margin-bottom: 24px; }
.role-tab {
  flex: 1; padding: 9px 8px;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  text-align: center; font-size: 13px; font-weight: 600;
  color: var(--gray-500); cursor: pointer;
  transition: var(--transition); background: var(--gray-50);
}
.role-tab.active { border-color: var(--navy); background: var(--navy); color: white; }
.login-footer { text-align: center; margin-top: 20px; font-size: 13px; color: var(--gray-300); }
.login-footer strong { color: var(--navy); }

/* ---- GRIEVANCE DETAIL ---- */
.detail-grid { display: grid; grid-template-columns: 1fr 340px; gap: 22px; }
.detail-main .card { margin-bottom: 20px; }
.detail-sidebar .card { margin-bottom: 18px; }
.meta-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--gray-100); font-size: 14px; }
.meta-item:last-child { border-bottom: none; }
.meta-label { color: var(--gray-500); font-size: 13px; }
.meta-value { font-weight: 600; color: var(--navy); text-align: right; }

/* ---- EMPTY STATE ---- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-300);
}
.empty-state .icon { font-size: 48px; margin-bottom: 14px; }
.empty-state h3 { font-size: 16px; font-weight: 600; color: var(--gray-500); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ---- SEARCH & FILTERS ---- */
.filters-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search-box { position: relative; flex: 1; min-width: 200px; }
.search-box input {
  padding-left: 38px;
  width: 100%;
}
.search-box::before { content: '🔍'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.filter-select { padding: 10px 14px; border: 1.5px solid var(--gray-100); border-radius: var(--radius-sm); font-family: 'DM Sans', sans-serif; font-size: 14px; color: var(--gray-700); background: var(--white); cursor: pointer; outline: none; transition: var(--transition); }
.filter-select:focus { border-color: var(--navy); }

/* ---- NOTIFICATION ---- */
.notif-item {
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; gap: 12px; align-items: flex-start;
  transition: var(--transition);
}
.notif-item:hover { background: var(--gray-50); }
.notif-item.unread { background: var(--blue-lt); }
.notif-dot-indicator {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  margin-top: 6px; flex-shrink: 0;
}
.notif-item.read .notif-dot-indicator { background: transparent; }
.notif-text { font-size: 14px; color: var(--gray-700); line-height: 1.5; }
.notif-time { font-size: 12px; color: var(--gray-300); margin-top: 3px; }

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; }
  .main-content { margin-left: 0; }
  .page-content { padding: 20px 16px; }
  .form-row { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 16px; }
  .menu-toggle { display: block !important; }
}

.menu-toggle {
  display: none;
  background: none; border: none;
  font-size: 22px; cursor: pointer;
  color: var(--navy); padding: 4px;
}

/* ---- ANIMATIONS ---- */
@keyframes fadeIn { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:none; } }
.page-content { animation: fadeIn .3s ease; }

/* ---- MISC ---- */
.text-muted { color: var(--gray-300); font-size: 13px; }
.text-sm { font-size: 13px; }
.fw-600 { font-weight: 600; }
.flex { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.w-100 { width: 100%; }
