/* =========================================================================
   UDM Booking System — theme based on the UDM Student Portal
   Dark green top bar · cream sidebar · green/gold tables · teal & orange headings
   ========================================================================= */

:root {
  --green-950: #0f2417;
  --green-900: #163020;   /* portal top bar & active menu */
  --green-800: #003300;   /* announcement table cells */
  --green-600: #1f6b3a;
  --green-50:  #e8f3ec;
  --gold:      #f2d64b;   /* text on dark green */
  --gold-logo: #d4a52a;
  --cream:     #ffffe6;   /* portal sidebar */
  --cream-2:   #f7f4c8;
  --cream-line:#e9e5b4;
  --teal:      #13a089;   /* "ANNOUNCEMENTS" */
  --orange:    #f39c12;   /* "FIRST SEMESTER" */
  --link:      #1c4fa0;   /* portal sidebar & detail links */
  --page:      #eeeeee;
  --panel:     #f8f8f8;
  --card:      #ffffff;
  --line:      #dadada;
  --text:      #1f2421;
  --muted:     #5f6661;
  --danger:    #b3261e;
  --radius:    6px;
  --shadow:    0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  font-size: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
}

a { color: var(--link); }
a:hover { color: var(--green-600); }
img { max-width: 100%; }
p { margin: 0 0 .6em; }

.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.lead { font-size: 15px; margin: 0; }
.hint { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  height: 52px; padding: 0 16px;
  background: var(--green-900); color: #fff;
  border-bottom: 3px solid var(--gold-logo);
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-seal {
  display: grid; place-items: center;
  width: 44px; height: 36px; border-radius: 6px; padding: 2px 3px;
  background: #fff; overflow: hidden; box-shadow: 0 0 0 2px rgba(242,214,75,.55);
}
.brand-seal img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { font-size: 17px; font-weight: 600; letter-spacing: .2px; }
.brand-sub { margin-left: auto; font-size: 12.5px; color: rgba(255,255,255,.75); letter-spacing: .3px; }
.menu-btn { display: none; color: #fff; cursor: pointer; padding: 6px; border-radius: 4px; }
.menu-btn .icon { width: 22px; height: 22px; }
.menu-btn:hover { background: rgba(255,255,255,.1); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - 52px); }

.sidebar {
  background: var(--cream);
  border-right: 1px solid var(--cream-line);
  padding: 12px 0;
}
.sidebar a, .nav-form button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 18px; border: 0; background: none;
  color: var(--link); font: inherit; font-size: 14px; text-align: left;
  text-decoration: none; cursor: pointer;
}
.sidebar a:hover, .nav-form button:hover { background: var(--cream-2); color: var(--green-900); }
.sidebar a.active { background: var(--green-900); color: #fff; font-weight: 600; }
.sidebar a.active .icon { color: var(--gold); }
.nav-form { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--cream-line); }

.main { padding: 10px 12px 0; min-width: 0; }

/* ---------- Profile card (portal header) ---------- */
.profile-card {
  display: flex; align-items: center; gap: 22px;
  background: var(--panel); border: 1px solid var(--line);
  padding: 10px 22px;
}
.seal-box {
  display: grid; place-items: center; flex-shrink: 0;
  width: 66px; height: 66px; background: #fff;
  border: 1px solid #3a3a3a; padding: 3px;
}
.seal-box img { width: 100%; height: 100%; object-fit: contain; }
.seal-lg { width: 92px; height: 92px; }
.profile-details { margin: 0; font-size: 13px; line-height: 1.55; }
.profile-details div { display: flex; flex-wrap: wrap; gap: 4px; }
.profile-details dt { font-weight: 700; color: #111; }
.profile-details dd { margin: 0; color: var(--link); }
.role-chip {
  margin-left: auto; align-self: flex-start;
  padding: 3px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
}
.role-student { background: #fff4c2; color: #6b5200; border: 1px solid #ecd68a; }
.role-faculty { background: var(--green-800); color: var(--gold); }

/* ---------- Panel ---------- */
.panel { margin-top: 8px; background: var(--panel); border: 1px solid var(--line); }
.panel-title {
  margin: 0; padding: 10px 16px;
  font-size: 16px; font-weight: 600;
  border-bottom: 1px solid #e3e3e3; background: #f4f4f4;
}
.panel-body { padding: 20px; }

.footer { padding: 18px 4px 22px; font-size: 12px; color: #555; }
.footer p { margin: 0 0 4px; }
.footer strong { color: #111; }
.footer span { color: #8a6d00; }
.footer-small { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border: 1px solid transparent; border-radius: 4px;
  font: inherit; font-weight: 600; font-size: 14px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--green-900); color: #fff; }
.btn-primary:hover { background: var(--green-950); color: var(--gold); }
.btn-ghost { background: #fff; color: var(--green-900); border-color: #c4c4c4; }
.btn-ghost:hover { background: var(--cream); border-color: var(--green-900); color: var(--green-900); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #8f1d17; color: #fff; }
.btn-link-danger { background: none; color: var(--danger); padding-left: 6px; padding-right: 6px; }
.btn-link-danger:hover { color: #8f1d17; text-decoration: underline; }
.btn-sm { padding: 5px 11px; font-size: 13px; }
.btn-block { width: 100%; padding: 11px; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 2px;
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.actions-cell { white-space: nowrap; text-align: right; }

/* ---------- Alerts & badges ---------- */
.alert { padding: 11px 14px; margin-bottom: 16px; border-radius: 4px; border-left: 4px solid; background: #fff; }
.alert p { margin: 0 0 8px; }
.alert-ok   { background: #e7f5ec; border-color: #1f7a45; color: #134d2c; }
.alert-err  { background: #fdecea; border-color: var(--danger); color: #7a1a14; }
.alert-warn { background: #fff8e1; border-color: var(--orange); color: #5c3d00; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent;
}
.badge-pending   { background: #fff4d6; color: #7a5000; border-color: #f0d28a; }
.badge-approved  { background: #e3f4ea; color: #14532d; border-color: #b6dfc5; }
.badge-rejected  { background: #fde8e8; color: #9b1c1c; border-color: #f3c0c0; }
.badge-cancelled { background: #ececec; color: #555;    border-color: #d6d6d6; }
.badge-faculty   { background: var(--green-800); color: var(--gold); }
.badge-open      { background: var(--green-50); color: var(--green-600); border-color: #c8e2d2; }

/* ---------- Home ---------- */
.welcome {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--gold-logo);
  padding: 18px 20px; border-radius: var(--radius);
}
.eyebrow { margin: 0; font-size: 12px; font-weight: 700; color: var(--teal); text-transform: uppercase; letter-spacing: 1px; }
.welcome-name { margin: 0 0 2px; font-size: 24px; color: var(--green-900); }
.welcome .muted { margin: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 14px 0 6px; }
.stat {
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--green-800);
  padding: 13px 16px; border-radius: 4px;
}
.stat-value { font-size: 28px; font-weight: 700; color: var(--green-900); line-height: 1.1; }
.stat-label { font-weight: 600; font-size: 13px; margin-top: 4px; }
.stat-hint { font-size: 12px; color: var(--muted); }

.announce { text-align: center; padding: 26px 0 8px; }
.announce-title {
  margin: 0; color: var(--teal);
  font-size: clamp(28px, 4.4vw, 42px); font-weight: 800; font-style: italic;
  text-transform: uppercase; letter-spacing: 1.5px;
}
.announce-sub {
  margin: 18px 0 2px; color: var(--orange);
  font-size: clamp(20px, 3vw, 27px); font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
}
.announce-range { margin: 0 0 18px; color: var(--teal); font-size: 13px; font-weight: 700; letter-spacing: .5px; }

.announce .table-wrap { border: 0; background: none; }
.udm-table { margin: 0 auto; border-collapse: separate; border-spacing: 2px; background: #fff; border: 1px solid #cfcfcf; }
.udm-table th {
  background: var(--green-800); color: var(--gold);
  padding: 10px 18px; min-width: 270px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .2px; text-align: center;
}
.udm-table td {
  background: var(--panel); border: 1px solid #d9d9d9;
  padding: 10px 18px; min-width: 270px;
  font-size: 12px; text-transform: uppercase; text-align: center; color: #333;
}

.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 30px 0 12px; padding-bottom: 6px;
  font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--green-900);
  border-bottom: 2px solid var(--gold-logo);
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: var(--green-900); color: #fff; text-align: left;
  padding: 10px 12px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; white-space: nowrap;
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid #e6e6e6; vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fffff2; }
.data-table .num { text-align: right; white-space: nowrap; }
.data-table .purpose { max-width: 260px; }
.code { font-weight: 700; color: var(--green-900); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-sub { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }

.empty {
  display: grid; justify-items: center; gap: 6px;
  padding: 28px 16px; text-align: center; color: var(--muted);
  background: #fff; border: 1px dashed #c9c9c9; border-radius: var(--radius);
}
.empty .icon { width: 30px; height: 30px; color: #9aa59e; }
.empty p { margin: 0; }

/* ---------- Booking ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.choice-card {
  display: flex; flex-direction: column; gap: 3px;
  padding: 14px 16px; background: #fff; color: inherit; text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.choice-card:hover { border-color: var(--green-900); box-shadow: var(--shadow); color: inherit; transform: translateY(-1px); }
.choice-code {
  align-self: flex-start; padding: 2px 8px; border-radius: 3px;
  background: var(--green-800); color: var(--gold); font-size: 12px; font-weight: 700; letter-spacing: .3px;
}
.choice-name { font-weight: 700; font-size: 15px; margin-top: 4px; }
.choice-meta { font-size: 12.5px; color: var(--muted); }

.split { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(250px, 1fr); gap: 18px; align-items: start; margin-top: 12px; }
.booking-form, .side-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.picked {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--cream); border: 1px solid var(--cream-line); border-radius: 4px;
  padding: 10px 12px; margin-bottom: 16px;
}
.picked strong { margin-left: 8px; }

.form label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.form input, .form select, .form textarea, .date-form input {
  width: 100%; padding: 9px 10px;
  border: 1px solid #bdbdbd; border-radius: 4px; background: #fff;
  font: inherit; color: var(--text);
}
.form textarea { resize: vertical; min-height: 76px; }
.field { margin-bottom: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.side-card h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; color: var(--green-900); }
.side-date { margin: 2px 0 12px; color: var(--muted); font-size: 13px; }
.check { padding: 8px 10px; border-radius: 4px; font-weight: 600; font-size: 13px; }
.check-ok { background: #e7f5ec; color: #134d2c; }
.check-bad { background: #fdecea; color: #7a1a14; }
.slot-list { list-style: none; margin: 0 0 12px; padding: 0; }
.slot-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px dashed #dcdcdc; font-size: 13px;
}
.slot-list li span:last-child { color: var(--green-800); font-weight: 600; }

/* ---------- Availability ---------- */
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.tabs { display: inline-flex; border: 1px solid #c4c4c4; border-radius: 4px; overflow: hidden; background: #fff; }
.tab { padding: 7px 16px; color: var(--green-900); text-decoration: none; font-weight: 600; }
.tab + .tab { border-left: 1px solid #c4c4c4; }
.tab.active { background: var(--green-900); color: #fff; }
.date-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.date-form input { width: auto; padding: 5px 8px; }
.day-heading { margin: 0 0 10px; font-size: 15px; color: var(--green-900); }

.schedule { border-collapse: separate; border-spacing: 2px; font-size: 12px; min-width: 100%; }
.schedule thead th { background: var(--green-900); color: #fff; padding: 8px 6px; min-width: 62px; font-weight: 600; white-space: nowrap; }
.schedule .sticky { position: sticky; left: 0; z-index: 1; text-align: left; min-width: 170px; }
.schedule thead .sticky { background: var(--green-950); }
.schedule tbody th { background: #fff; padding: 6px 10px; border: 1px solid #e3e3e3; font-weight: 400; }
.schedule td { height: 44px; padding: 0; text-align: center; border: 1px solid transparent; }
.schedule td a, .schedule td span { display: grid; place-items: center; height: 100%; min-height: 42px; text-decoration: none; color: inherit; }
.schedule td.free { background: #fff; border-color: #d3e7d9; color: var(--green-600); }
.schedule td.free a:hover { background: var(--green-50); font-weight: 700; }
.schedule td.partial { background: #fff4d6; border-color: #f0d28a; color: #7a5000; }
.schedule td.partial a:hover { background: #ffe9b0; }
.schedule td.booked { background: var(--green-800); color: var(--gold); font-weight: 600; }
.schedule td.past { opacity: .4; }

.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid #ccc; }
.sw.free { background: #fff; border-color: #b9d8c3; }
.sw.partial { background: #fff4d6; border-color: #f0d28a; }
.sw.booked { background: var(--green-800); border-color: var(--green-800); }
.sw.past { background: #ddd; }

/* ---------- Booking slip (like the Registration Form) ---------- */
.slip-stage { background: #7b7b7b; padding: 26px 16px; border-radius: 2px; }
.slip {
  max-width: 760px; margin: 0 auto; background: #fff; padding: 30px 36px;
  font-family: "Times New Roman", Times, serif; color: #000; box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.slip-head { display: flex; justify-content: center; align-items: center; gap: 14px; text-align: center; }
.slip-head img { width: 70px; height: 70px; object-fit: contain; }
.slip-school { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: .5px; }
.slip-small { margin: 0; font-size: 12px; }
.slip-title { margin: 6px 0 0; font-size: 14px; font-weight: 700; letter-spacing: 1px; color: var(--green-800); }
.slip-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding: 6px 10px; border: 1px solid #000; font-size: 13px; }
.slip-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.slip-table caption {
  text-align: left; padding: 4px 8px; background: var(--green-900); color: #fff;
  font-family: "Segoe UI", system-ui, sans-serif; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
}
.slip-table th, .slip-table td { border: 1px solid #333; padding: 6px 9px; text-align: left; vertical-align: top; }
.slip-table th { width: 32%; background: #f3f3f3; font-weight: 700; }
.slip-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-top: 44px; text-align: center; font-size: 12px; }
.slip-sign .line { display: block; border-top: 1px solid #000; margin-bottom: 4px; }
.slip-foot { margin: 26px 0 0; text-align: center; font-size: 11px; color: #444; }

/* ---------- Sign-in page ---------- */
.bare-main { max-width: 600px; margin: 0 auto; padding: 36px 16px 0; }
.login-card {
  background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--green-900);
  border-radius: var(--radius); padding: 26px 26px 22px; box-shadow: var(--shadow);
}
.login-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.login-school { margin: 0; color: var(--teal); font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.2px; }
.login-title { margin: 2px 0 4px; color: var(--green-900); font-size: 23px; line-height: 1.2; }
.login-card .muted { margin: 0; }
.login-card .form input { margin-bottom: 14px; padding: 11px 12px; font-size: 15px; }
.demo-accounts { margin-top: 18px; }
.demo-accounts summary { cursor: pointer; font-weight: 600; color: var(--link); margin-bottom: 10px; }
.demo-accounts form { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; border-right: 0; border-bottom: 1px solid var(--cream-line); }
  .nav-toggle:checked ~ .shell .sidebar { display: block; }
  .menu-btn { display: inline-flex; }
  .brand-sub { display: none; }
  .split { grid-template-columns: 1fr; }
  .udm-table th, .udm-table td { min-width: 0; padding: 9px 10px; }
}
@media (max-width: 560px) {
  .main { padding: 8px 8px 0; }
  .panel-body { padding: 16px; }
  .profile-card { flex-wrap: wrap; gap: 12px; padding: 10px 14px; }
  .seal-box { width: 54px; height: 54px; }
  .field-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat-value { font-size: 24px; }
  .brand-text { font-size: 15px; }
  .login-head { flex-direction: column; text-align: center; }
  .slip { padding: 20px 16px; }
  .slip-head { flex-direction: column; }
  .slip-sign { gap: 20px; }
}

/* ---------- Print ---------- */
@media print {
  body { background: #fff; }
  .topbar, .sidebar, .profile-card, .footer, .no-print, .panel-title, .alert { display: none !important; }
  .shell { display: block; }
  .main, .panel-body { padding: 0; }
  .panel { border: 0; background: #fff; margin: 0; }
  .slip-stage { background: #fff; padding: 0; }
  .slip { box-shadow: none; max-width: none; padding: 0; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
