* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  color-scheme: light;
  --ink: #102033;
  --muted: #64748b;
  --line: #d8e0ea;
  --panel: #ffffff;
  --bg: #f4f7fb;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --accent: #b45309;
  --soft: #eef7f6;
  --warn: #fff7ed;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Tahoma, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  object-fit: contain;
  background: #ffffff;
}

.userbar {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 28px;
  color: #ffffff;
  background: #143044;
  border-radius: 8px;
}

.hero h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.25;
}

.hero p {
  margin: 10px 0 0;
  max-width: 760px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.7;
}

.eyebrow {
  margin: 0 0 6px !important;
  color: #99f6e4 !important;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 120px);
  gap: 12px;
}

.hero-stats div {
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.hero-stats strong,
.hero-stats span {
  display: block;
}

.hero-stats strong {
  font-size: 28px;
}

.hero-stats span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.login-view {
  display: grid;
  min-height: calc(100vh - 150px);
  place-items: center;
  padding: 28px 0;
}

.login-card {
  display: grid;
  gap: 14px;
  width: min(560px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 34px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.08);
}

.login-card h1,
.login-card p {
  margin: 0;
}

.login-card h1 {
  font-size: 28px;
  line-height: 1.3;
}

.login-card p {
  color: var(--muted);
  line-height: 1.75;
}

.login-card .button {
  width: fit-content;
}

.dashboard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 20px;
  background: #ffffff;
}

.dashboard-actions h2,
.dashboard-actions p {
  margin: 0;
}

.dashboard-actions h2 {
  font-size: 20px;
}

.dashboard-actions p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.6;
}

.dashboard-panel {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.dashboard-tabs {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}

.dashboard-tab {
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 10px 16px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.dashboard-tab:hover,
.dashboard-tab.active {
  color: var(--primary-dark);
  background: #ffffff;
  border-color: var(--line);
}

.dashboard-panel.faculty-mode > .dashboard-grid,
.dashboard-panel.faculty-mode > .notice-list {
  display: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #ffffff;
}

.metric-card span,
.metric-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.metric-card strong {
  font-size: 22px;
  line-height: 1.25;
}

.notice-list {
  display: grid;
  gap: 10px;
}

.notice-item {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 14px;
  color: #1e3a8a;
  background: #eff6ff;
  font-size: 14px;
  line-height: 1.55;
}

.faculty-latest-panel {
  margin-top: 0;
}

.faculty-chart-summary {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 20px 20px 0;
}

.pie-chart {
  width: 156px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #e2e8f0;
  box-shadow: inset 0 0 0 22px #ffffff;
}

.pie-legend {
  display: grid;
  gap: 10px;
}

.pie-legend div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--muted);
}

.legend-dot.submitted {
  background: var(--primary);
}

.legend-dot.pending {
  background: #f59e0b;
}

.legend-dot.overdue {
  background: #dc2626;
}

.progress-wrap {
  display: grid;
  gap: 8px;
  padding: 16px 20px 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.progress-label strong {
  color: var(--ink);
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width 180ms ease;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.layout.dashboard-only {
  grid-template-columns: 1fr;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  font-size: 18px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 13px;
}

.panel-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.assignment-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.assignment-card {
  display: grid;
  gap: 6px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
}

.assignment-card:hover,
.assignment-card.active {
  border-color: var(--primary);
  background: var(--soft);
}

.assignment-card strong {
  font-size: 15px;
}

.assignment-card span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.report-form {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.report-modal-open {
  overflow: hidden;
}

.report-modal-open::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.48);
}

.report-panel {
  position: fixed;
  inset: 24px;
  z-index: 40;
  width: min(1040px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  margin: auto;
  overflow: auto;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
}

fieldset {
  display: grid;
  gap: 14px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

legend {
  padding: 0 8px;
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 14px;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--ink);
  background: #ffffff;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(15, 118, 110, 0.14);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.guide-grid label {
  grid-template-columns: auto 1fr;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #f8fafc;
}

.guide-grid input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}

.issue-list {
  display: grid;
  gap: 12px;
}

.issue-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.issue-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: #f8fafc;
}

.issue-head h3,
.issue-head p {
  margin: 0;
}

.issue-head h3 {
  font-size: 16px;
}

.issue-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.issue-detail {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 14px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
}

.button.primary {
  border-color: var(--primary);
  color: #ffffff;
  background: var(--primary);
}

.button.primary:hover {
  background: var(--primary-dark);
}

.button.ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.button.small-button {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 13px;
}

.button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.alert {
  margin-top: 16px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 12px 14px;
  color: #7c2d12;
  background: var(--warn);
}

.report-modal-open .alert:not([hidden]) {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 60;
  width: min(960px, calc(100vw - 32px));
  margin-top: 0;
  transform: translateX(-50%);
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.2);
}

.history-panel {
  margin-top: 18px;
}

.admin-options-panel {
  margin-top: 18px;
}

.report-page .admin-options-panel {
  display: none !important;
}

.admin-hero {
  margin-bottom: 18px;
}

.notification-panel {
  margin-bottom: 18px;
}

.notification-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto;
  gap: 14px;
  align-items: end;
  padding: 20px;
}

.notification-status {
  display: grid;
  gap: 4px;
  margin: 0 20px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fafc;
}

.notification-status strong {
  font-size: 14px;
}

.notification-status span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.admin-tab {
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  padding: 10px 16px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.admin-tab:hover,
.admin-tab.active {
  color: var(--primary-dark);
  background: #ffffff;
  border-color: var(--line);
}

.admin-tab-panel {
  margin-top: 0;
}

.admin-options-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
}

.admin-options-form .wide-field {
  grid-column: 1 / -1;
}

.round-admin {
  border-top: 1px solid var(--line);
  padding: 20px;
}

.round-admin.no-border {
  border-top: 0;
}

.room-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 20px;
}

.room-form .wide-field,
.room-form .form-actions {
  grid-column: 1 / -1;
}

.muted {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.subsection-heading {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
}

.subsection-heading h3,
.subsection-heading p {
  margin: 0;
}

.subsection-heading h3 {
  font-size: 17px;
}

.subsection-heading p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.round-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.round-form .wide-field,
.round-form .form-actions {
  grid-column: 1 / -1;
}

.compact-table {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

th {
  color: #475569;
  background: #f8fafc;
}

.status {
  display: inline-flex;
  min-width: 86px;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--primary-dark);
  background: var(--soft);
  font-size: 12px;
  font-weight: 700;
}

.status.draft {
  color: var(--accent);
  background: #fffbeb;
}

.status.danger {
  color: #991b1b;
  background: #fee2e2;
}

@media (max-width: 980px) {
  .hero,
  .dashboard-grid,
  .faculty-chart-summary,
  .layout {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .topbar,
  .panel-heading,
  .dashboard-actions,
  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .shell {
    width: min(100% - 20px, 1240px);
    padding-top: 16px;
  }

  .hero {
    padding: 20px;
  }

  .hero h1 {
    font-size: 24px;
  }

  .login-card {
    padding: 24px;
  }

  .grid.two,
  .grid.three,
  .notification-form,
  .admin-options-form,
  .round-form,
  .room-form,
  .guide-grid,
  .issue-head {
    grid-template-columns: 1fr;
  }

  .admin-tabs {
    overflow-x: auto;
  }
}
