:root{
  --bg:#eef3fb;
  --bg-soft:#f7f9fd;
  --panel:#ffffff;
  --panel-2:#f9fbff;
  --text:#142033;
  --muted:#6b778c;
  --primary:#2563eb;
  --primary-2:#1d4ed8;
  --primary-3:#0f3ea8;
  --primary-soft:#dbeafe;
  --success:#16a34a;
  --success-soft:#dcfce7;
  --danger:#dc2626;
  --danger-soft:#fee2e2;
  --warning:#d97706;
  --warning-soft:#fef3c7;
  --border:#dce5f2;
  --shadow:0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg:0 20px 40px rgba(15, 23, 42, 0.12);
  --radius:22px;
  --radius-sm:14px;
  --sidebar:#0a1639;
  --sidebar-2:#12214d;
}

*{
  box-sizing:border-box;
}

html,body{
  margin:0;
  padding:0;
  font-family:'Inter',sans-serif;
  background:linear-gradient(180deg,#f4f7fc 0%, #edf2fa 100%);
  color:var(--text);
}

body{
  min-height:100vh;
}

a{
  color:inherit;
  text-decoration:none;
}

img{
  max-width:100%;
  display:block;
}

button,
input,
select,
textarea{
  font:inherit;
}

.container{
  width:min(1240px, calc(100% - 32px));
  margin:0 auto;
}

.shell{
  display:grid;
  grid-template-columns:300px 1fr;
  min-height:100vh;
  transition:grid-template-columns .2s ease;
}

.sidebar{
  background:
    radial-gradient(circle at top left, rgba(59,130,246,.18), transparent 28%),
    linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
  color:#fff;
  padding:22px 20px;
  position:sticky;
  top:0;
  min-height:100vh;
  border-right:1px solid rgba(255,255,255,.06);
  box-shadow:inset -1px 0 0 rgba(255,255,255,.04);
}

.sidebar a{
  display:flex;
  align-items:center;
  min-height:54px;
  padding:0 16px;
  border-radius:16px;
  margin-bottom:10px;
  color:rgba(255,255,255,.88);
  transition:.22s ease;
  font-weight:600;
  font-size:1.02rem;
}

.sidebar a:hover{
  background:rgba(255,255,255,.08);
  color:#fff;
  transform:translateX(2px);
}

.sidebar a.active{
  background:linear-gradient(135deg, #2f6ef0 0%, #2a5fe0 100%);
  color:#fff;
  box-shadow:0 14px 28px rgba(37,99,235,.32);
}

.content{
  padding:26px 30px 34px;
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:22px;
  flex-wrap:wrap;
}

.logo-wrap{
  display:flex;
  align-items:center;
  gap:14px;
}

.logo-wrap img{
  width:58px;
  height:58px;
  object-fit:cover;
  border-radius:16px;
  background:#fff;
  padding:4px;
  box-shadow:0 10px 24px rgba(15,23,42,.15);
}

.brand-title{
  font-size:1.35rem;
  font-weight:800;
  letter-spacing:-.03em;
  color:#fff;
}

.brand-sub{
  color:var(--muted);
  font-size:1rem;
  margin-top:4px;
}

.brand-sub.light{
  color:rgba(255,255,255,.78);
}

.page-title{
  font-size:2rem;
  font-weight:800;
  line-height:1.1;
  letter-spacing:-.04em;
  margin:0 0 4px;
  color:#132238;
}

.page-subtitle{
  margin:0;
  font-size:1.05rem;
  color:#617086;
}

.panel{
  background:rgba(255,255,255,.96);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:24px;
  box-shadow:var(--shadow);
  backdrop-filter:blur(6px);
}

.panel h3{
  margin-top:0;
  margin-bottom:16px;
  font-size:1.12rem;
  font-weight:800;
  color:#172554;
}

.stats{
  display:grid;
  grid-template-columns:repeat(4, 1fr);
  gap:18px;
  margin-bottom:22px;
}

.stat{
  min-height:138px;
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  border-radius:24px;
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
}

.stat::after{
  content:"";
  position:absolute;
  right:-20px;
  bottom:-24px;
  width:110px;
  height:110px;
  background:radial-gradient(circle, rgba(37,99,235,.10) 0%, transparent 70%);
  border-radius:50%;
}

.stat span{
  color:#6b7280;
  font-weight:700;
  font-size:1rem;
}

.stat strong{
  font-size:2.3rem;
  font-weight:800;
  letter-spacing:-.05em;
  color:#0f172a;
}

.stat small{
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:#2563eb;
  font-weight:700;
  background:#eff6ff;
  width:max-content;
  padding:8px 12px;
  border-radius:999px;
}

.grid-2{
  display:grid;
  grid-template-columns:1.15fr .95fr;
  gap:20px;
  margin-bottom:22px;
}

.cards-3{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:20px;
  margin-bottom:22px;
}

.list{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.list-item{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:16px 18px;
  border:1px solid var(--border);
  background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);
  border-radius:18px;
  transition:.18s ease;
}

.list-item:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(15,23,42,.06);
}

.list-item span{
  color:#0f172a;
  font-size:1rem;
}

.field{
  margin-bottom:16px;
}

.field label{
  display:block;
  margin-bottom:8px;
  font-weight:700;
  color:#334155;
}

.field input,
.field select,
.field textarea{
  width:100%;
  border:1px solid var(--border);
  background:#fff;
  border-radius:14px;
  padding:13px 15px;
  outline:none;
  transition:.2s ease;
  color:#0f172a;
}

.field textarea{
  resize:vertical;
  min-height:110px;
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color:#93c5fd;
  box-shadow:0 0 0 5px rgba(37,99,235,.10);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  border:none;
  border-radius:14px;
  padding:13px 20px;
  font-weight:800;
  cursor:pointer;
  transition:.18s ease;
}

.btn:hover{
  transform:translateY(-1px);
}

.btn-primary{
  background:linear-gradient(135deg,var(--primary) 0%, var(--primary-2) 100%);
  color:#fff;
  box-shadow:0 14px 26px rgba(37,99,235,.24);
}

.btn-secondary{
  background:#f5f9ff;
  color:#1e40af;
  border:1px solid #cfe0ff;
}

.btn-danger{
  background:linear-gradient(135deg,#dc2626 0%, #ef4444 100%);
  color:#fff;
  box-shadow:0 10px 20px rgba(220,38,38,.18);
}

.link-btn{
  display:inline-flex;
  align-items:center;
  color:var(--primary);
  font-weight:700;
  cursor:pointer;
}

.alert{
  border-radius:16px;
  padding:15px 17px;
  margin-bottom:18px;
  font-weight:700;
  border:1px solid transparent;
}

.alert-success{
  background:var(--success-soft);
  color:#166534;
  border-color:#bbf7d0;
}

.alert-error{
  background:var(--danger-soft);
  color:#991b1b;
  border-color:#fecaca;
}

.badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:8px 12px;
  border-radius:999px;
  font-size:.83rem;
  font-weight:800;
  line-height:1;
}

.ok{
  background:var(--success-soft);
  color:#166534;
}

.danger-bg{
  background:var(--danger-soft);
  color:#991b1b;
}

.warning-bg{
  background:var(--warning-soft);
  color:#92400e;
}

.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

.table thead th{
  text-align:left;
  padding:14px 14px;
  font-size:.92rem;
  color:#475569;
  border-bottom:1px solid var(--border);
  background:#f8fbff;
  font-weight:800;
}

.table thead th:first-child{
  border-top-left-radius:14px;
}

.table thead th:last-child{
  border-top-right-radius:14px;
}

.table tbody td{
  padding:16px 14px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
  background:#fff;
}

.table tbody tr:hover td{
  background:#fbfdff;
}

.login-shell{
  min-height:100vh;
  display:grid;
  grid-template-columns:1.08fr .92fr;
  background:
    radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 34%),
    radial-gradient(circle at bottom right, rgba(59,130,246,.12), transparent 30%),
    #eef3fb;
}

.login-visual{
  padding:48px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.visual-inner{
  width:min(560px, 100%);
}

.brand-lockup{
  display:flex;
  flex-direction:column;
  gap:24px;
}

.logo-card{
  width:96px;
  height:96px;
  background:#fff;
  border-radius:26px;
  box-shadow:var(--shadow-lg);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:10px;
}

.hero-title{
  margin:0;
  font-size:2.6rem;
  line-height:1.08;
  letter-spacing:-.05em;
  font-weight:800;
  color:#0f172a;
}

.hero-copy{
  margin:14px 0 0;
  font-size:1.05rem;
  line-height:1.8;
  color:#475569;
  max-width:540px;
}

.hero-meta{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:18px;
}

.hero-pill{
  display:inline-flex;
  align-items:center;
  padding:10px 14px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:999px;
  color:#334155;
  font-weight:700;
  box-shadow:0 6px 16px rgba(15,23,42,.04);
}

.login-panel-wrap{
  display:flex;
  align-items:center;
  justify-content:center;
  padding:36px;
}

.login-panel{
  width:min(470px, 100%);
  background:#fff;
  border-radius:28px;
  box-shadow:0 24px 54px rgba(15,23,42,.12);
  border:1px solid var(--border);
  padding:32px;
}

.role-switch{
  display:flex;
  background:#eff3f8;
  padding:6px;
  border-radius:16px;
  gap:6px;
  margin-bottom:24px;
}

.role-switch a{
  flex:1;
  text-align:center;
  padding:12px 12px;
  border-radius:12px;
  font-weight:800;
  color:#475569;
}

.role-switch a.active{
  background:#fff;
  color:#0f172a;
  box-shadow:0 6px 14px rgba(15,23,42,.06);
}

.panel-title{
  font-size:.9rem;
  font-weight:800;
  color:var(--primary);
  text-transform:uppercase;
  letter-spacing:.08em;
  margin-bottom:8px;
}

.panel-heading{
  margin:0;
  font-size:2rem;
  line-height:1.08;
  letter-spacing:-.04em;
  font-weight:800;
  color:#0f172a;
}

.panel-sub{
  color:#64748b;
  margin:10px 0 22px;
  line-height:1.7;
}

.form-actions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin-top:18px;
}

.exam-grid{
  display:grid;
  grid-template-columns:1.35fr .65fr;
  gap:22px;
  align-items:start;
}

.option{
  display:block;
  padding:15px 16px;
  border:1px solid var(--border);
  border-radius:16px;
  margin-bottom:10px;
  background:#fff;
  transition:.2s ease;
}

.option:hover{
  border-color:#bfdbfe;
  background:#f8fbff;
}

.option input{
  margin-right:10px;
}

.auth-view{
  width:100%;
}

input[readonly]{
  background:#f8fafc;
  color:#334155;
  font-weight:700;
}

.quick-open{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:88px;
  padding:10px 14px;
  border-radius:12px;
  background:#eef4ff;
  color:#1d4ed8;
  font-weight:800;
  border:1px solid #cfe0ff;
}

.status-pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  border-radius:999px;
  font-size:.82rem;
  font-weight:800;
}

.status-open{
  background:#dcfce7;
  color:#166534;
}

.status-scheduled{
  background:#e0ecff;
  color:#1d4ed8;
}

.status-closed{
  background:#f1f5f9;
  color:#475569;
}

.icon-bubble{
  width:42px;
  height:42px;
  border-radius:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eff6ff;
  color:#2563eb;
  font-size:1.1rem;
  font-weight:800;
}

.section-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:16px;
}

.kpi-row{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}

.empty-state{
  padding:28px;
  border:1px dashed #cbd5e1;
  border-radius:18px;
  background:#f8fbff;
  color:#64748b;
  text-align:center;
  font-weight:600;
}

select[multiple]{
  min-height:260px;
}

/* ===== Sidebar / Toggle / Modal / CRUD Utility Styles ===== */

.sidebar-top{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin-bottom:26px;
}

.sidebar-brand{
  align-items:center;
}

.sidebar-brand-text{
  transition:.2s ease;
}

.sidebar .logo-wrap img{
  width:60px;
  height:60px;
  border-radius:16px;
  object-fit:cover;
  padding:4px;
  background:#fff;
  box-shadow:0 10px 24px rgba(15,23,42,.15);
}

.sidebar-toggle{
  width:38px;
  height:38px;
  border:none;
  border-radius:10px;
  background:rgba(255,255,255,.12);
  color:#fff;
  font-size:1rem;
  line-height:1;
  font-weight:800;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:.18s ease;
}

.sidebar-toggle:hover{
  background:rgba(255,255,255,.18);
}

.shell.sidebar-collapsed{
  grid-template-columns:92px 1fr;
}

.shell.sidebar-collapsed .sidebar .brand-title,
.shell.sidebar-collapsed .sidebar .brand-sub,
.shell.sidebar-collapsed .sidebar a span,
.shell.sidebar-collapsed .sidebar-brand-text{
  display:none;
}

.shell.sidebar-collapsed .sidebar a{
  justify-content:center;
  padding:0;
}

.shell.sidebar-collapsed .sidebar .logo-wrap{
  justify-content:center;
}

.shell.sidebar-collapsed .sidebar .logo-wrap img{
  width:42px;
  height:42px;
  padding:3px;
}

.shell.sidebar-collapsed .sidebar-toggle{
  margin:0 auto 8px;
}

.menu-icon{
  display:inline-flex;
  width:22px;
  min-width:22px;
  margin-right:12px;
  justify-content:center;
  align-items:center;
  font-weight:800;
}

.shell.sidebar-collapsed .sidebar a .menu-icon{
  margin-right:0;
}

.page-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:18px;
  flex-wrap:wrap;
}

.modal-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.42);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:20px;
}

.modal-overlay.show{
  display:flex;
}

.modal-card{
  width:min(720px, 100%);
  max-height:90vh;
  overflow:auto;
  background:#fff;
  border-radius:24px;
  border:1px solid var(--border);
  box-shadow:0 30px 60px rgba(15,23,42,.18);
  padding:24px;
}

.modal-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  margin-bottom:18px;
}

.modal-close{
  width:40px;
  height:40px;
  border:none;
  border-radius:12px;
  background:#eff4fb;
  color:#0f172a;
  font-size:1.2rem;
  cursor:pointer;
}

.modal-close:hover{
  background:#dfe9f7;
}

.action-row{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.action-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:76px;
  padding:9px 12px;
  border-radius:12px;
  font-weight:800;
  font-size:.9rem;
  border:none;
  cursor:pointer;
}

.action-edit{
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #cfe0ff;
}

.action-delete{
  background:#fef2f2;
  color:#b91c1c;
  border:1px solid #fecaca;
}

.full-width-panel{
  width:100%;
}

@media (max-width: 1180px){
  .stats{
    grid-template-columns:repeat(2, 1fr);
  }

  .grid-2,
  .exam-grid,
  .login-shell{
    grid-template-columns:1fr;
  }

  .cards-3{
    grid-template-columns:1fr;
  }

  .shell{
    grid-template-columns:1fr;
  }

  .sidebar{
    position:relative;
    min-height:auto;
  }

  .shell.sidebar-collapsed{
    grid-template-columns:1fr;
  }
}

@media (max-width: 720px){
  .content,
  .login-visual,
  .login-panel-wrap{
    padding:18px;
  }

  .panel{
    padding:18px;
  }

  .stats{
    grid-template-columns:1fr;
  }

  .hero-title{
    font-size:1.9rem;
  }

  .panel-heading{
    font-size:1.65rem;
  }

  .page-title{
    font-size:1.55rem;
  }

  .table{
    display:block;
    overflow-x:auto;
    white-space:nowrap;
  }
}
.field-grid-2,
.field-grid-3{
  display:grid;
  gap:16px;
}

.field-grid-2{ grid-template-columns:repeat(2, 1fr); }
.field-grid-3{ grid-template-columns:repeat(3, 1fr); }

.table-subtext{
  color:#64748b;
  font-size:.88rem;
}

.notice-card{
  padding:16px 18px;
  border:1px solid #dbeafe;
  background:#f8fbff;
  border-radius:18px;
}

.metric-number{
  font-size:2.2rem;
  font-weight:800;
  letter-spacing:-.05em;
  color:#0f172a;
  margin:6px 0 8px;
}

.timer-box{
  padding:18px;
  border-radius:18px;
  background:linear-gradient(135deg,#0f3ea8 0%,#2563eb 100%);
  color:#fff;
  text-align:center;
  font-size:2rem;
  font-weight:800;
  letter-spacing:.06em;
  box-shadow:0 18px 34px rgba(37,99,235,.22);
}

.sticky-panel{
  position:sticky;
  top:20px;
}

.question-card{
  padding:0 0 22px;
  border-bottom:1px solid var(--border);
  margin-bottom:22px;
}

.question-card:last-of-type{
  border-bottom:none;
}

.question-topline{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}

.mini-meta{
  color:#64748b;
  font-size:.92rem;
  font-weight:700;
}

.question-nav-grid{
  display:grid;
  grid-template-columns:repeat(5, 1fr);
  gap:10px;
}

.question-nav-chip{
  display:flex;
  align-items:center;
  justify-content:center;
  height:42px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  font-weight:800;
}

.question-nav-chip.done{
  background:#ecfdf3;
  border-color:#bbf7d0;
  color:#166534;
}

.question-nav-chip.flagged{
  box-shadow:inset 0 0 0 2px #f59e0b;
}

.inline-form{ display:inline; }
.compact-list .list-item{ padding:14px 16px; }

@media (max-width: 860px){
  .field-grid-2,
  .field-grid-3,
  .question-nav-grid{
    grid-template-columns:1fr;
  }

  .sticky-panel{
    position:static;
  }
}

.filter-grid{
  display:grid;
  grid-template-columns:repeat(3, 1fr);
  gap:16px;
  align-items:end;
}

.filter-actions{
  display:flex;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
}

.table thead th a{
  color:inherit;
}

.table thead th a:hover{
  color:#1d4ed8;
}

@media (max-width: 860px){
  .filter-grid{
    grid-template-columns:1fr;
  }
}
