:root {
  --navy: #12294D;
  --navy-deep: #0B1B33;
  --navy-soft: #1E3A63;
  --gold: #C79A3D;
  --gold-soft: #F1E4C4;
  --cream: #F7F4EE;
  --ink: #1C2230;
  --slate: #5B6472;
  --line: #E4E1D8;
  --ok: #2F7D5B;
  --warn: #B4531F;
  --danger: #B23A3A;
  --radius: 10px;
}

* { box-sizing: border-box; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--cream);
  color: var(--ink);
  margin: 0;
}
h1, h2, h3, h4, .lh-serif { font-family: 'Fraunces', Georgia, serif; }

/* ---------------- Topbar ---------------- */
.lh-topbar {
  height: 64px;
  background: var(--navy-deep);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 3px solid var(--gold);
}
.lh-burger {
  background: none; border: none; color: #fff; font-size: 1.4rem; padding: 4px 8px;
}
.lh-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #fff; margin-right: auto; }
.lh-brand-mark {
  width: 38px; height: 38px; border-radius: 8px; background: #fff;
  object-fit: contain; padding: 3px; flex-shrink: 0;
}
.lh-brand-text { font-family: 'Fraunces', serif; font-weight: 600; font-size: 1.05rem; line-height: 1.1; }
.lh-brand-text small { display: block; font-family: 'Inter', sans-serif; font-weight: 400; font-size: 0.65rem; color: #C9D2E0; letter-spacing: .02em; }
.lh-topbar-right { display: flex; align-items: center; gap: 10px; }
.lh-icon-btn { position: relative; background: rgba(255,255,255,.08); border: none; color: #fff; width: 40px; height: 40px; border-radius: 50%; }
.lh-icon-btn:hover { background: rgba(255,255,255,.16); }
.lh-badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff; font-size: .65rem; padding: 1px 5px; border-radius: 10px; }
.lh-user-chip { background: rgba(255,255,255,.08); border: none; color: #fff; border-radius: 30px; padding: 6px 12px; display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.lh-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: var(--navy-deep); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.lh-notif-panel { width: 320px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lh-notif-head { padding: 12px 16px; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--cream); }
.lh-notif-item { display: flex; flex-direction: column; padding: 10px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.lh-notif-item span { color: var(--slate); font-size: .82rem; }
.lh-notif-item.unread { background: #FBF8EF; }
.lh-notif-empty { padding: 20px 16px; text-align: center; color: var(--slate); font-size: .9rem; }
.lh-notif-viewall { display: block; text-align: center; padding: 10px; font-size: .85rem; color: var(--navy); text-decoration: none; font-weight: 600; }

/* ---------------- Shell / Sidebar ---------------- */
.lh-shell { display: flex; min-height: calc(100vh - 64px); }
.lh-sidebar {
  width: 250px; flex-shrink: 0; background: var(--navy); color: #EDEFF3;
  padding: 18px 12px; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
}
.lh-nav-group-label { text-transform: uppercase; font-size: .68rem; letter-spacing: .06em; color: #93A2BC; margin: 18px 10px 8px; }
.lh-nav-group-label:first-child { margin-top: 4px; }
.lh-nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: #DCE2ED; text-decoration: none; font-size: .92rem; margin-bottom: 2px; }
.lh-nav-link i { font-size: 1.05rem; width: 20px; text-align: center; }
.lh-nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.lh-nav-link.active { background: var(--gold); color: var(--navy-deep); font-weight: 600; }
.lh-main { flex: 1; padding: 26px; max-width: 100%; }
.lh-overlay { display: none; }

/* ---------------- Cards / widgets ---------------- */
.lh-page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.lh-page-head h1 { font-size: 1.6rem; margin: 0; color: var(--navy-deep); }
.lh-page-head p { color: var(--slate); margin: 4px 0 0; }
.lh-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 20px; }
.lh-card h2, .lh-card h3 { color: var(--navy-deep); }
.lh-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.lh-stat {
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--gold);
  border-radius: var(--radius); padding: 16px 18px;
}
.lh-stat .val { font-family: 'Fraunces', serif; font-size: 1.9rem; color: var(--navy-deep); font-weight: 600; }
.lh-stat .lbl { color: var(--slate); font-size: .82rem; }
.lh-stat.accent-ok { border-left-color: var(--ok); }
.lh-stat.accent-warn { border-left-color: var(--warn); }

.lh-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--navy); color: #fff; border: none; padding: 10px 18px; border-radius: 8px; font-weight: 600; font-size: .92rem; text-decoration: none; }
.lh-btn:hover { background: var(--navy-soft); color: #fff; }
.lh-btn.gold { background: var(--gold); color: var(--navy-deep); }
.lh-btn.gold:hover { background: #B98C2F; }
.lh-btn.outline { background: transparent; border: 1.5px solid var(--navy); color: var(--navy); }
.lh-btn.sm { padding: 6px 12px; font-size: .82rem; }

.lh-badge-pill { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: .74rem; font-weight: 600; }
.badge-open { background: #E4F3EA; color: var(--ok); }
.badge-closed { background: #F5E7E2; color: var(--danger); }
.badge-draft { background: #EFEFEF; color: var(--slate); }
.badge-submitted { background: var(--gold-soft); color: #8A6A1F; }
.badge-approved { background: #E4F3EA; color: var(--ok); }

table.lh-table { width: 100%; border-collapse: collapse; font-size: .9rem; }

/* Per-class weekly entry rows — each is its own <form>, so this uses a
   grid layout rather than a real <table> (a <form> can't legally wrap
   <tr>/<td> content). */
.class-entry-list { width: 100%; font-size: .9rem; }
.class-entry-row {
  display: grid; grid-template-columns: 1fr 110px 60px; gap: 10px;
  align-items: center; padding: 8px 4px; border-bottom: 1px solid var(--line); margin: 0;
}
.class-entry-header { font-weight: 600; color: var(--navy-deep); background: var(--cream); border-radius: 6px 6px 0 0; }
.class-entry-footer { border-bottom: none; border-top: 2px solid var(--line); margin-top: 4px; }
.class-form:hover { background: #FBFAF7; }
table.lh-table th { text-align: left; background: var(--cream); padding: 10px 12px; border-bottom: 2px solid var(--line); color: var(--navy-deep); }
table.lh-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); }
table.lh-table tr:hover td { background: #FBFAF7; }

.lh-form-label { font-weight: 600; font-size: .88rem; color: var(--navy-deep); }
.form-control, .form-select { border-radius: 8px; border: 1px solid #D6D2C6; }
.form-control:focus, .form-select:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(199,154,61,.18); }

.lh-empty { text-align: center; padding: 50px 20px; color: var(--slate); }
.lh-empty i { font-size: 2.4rem; color: var(--gold); margin-bottom: 10px; display: block; }

.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(160deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-soft) 100%);
}
.login-center {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 20px 10px;
}
.login-card { background: #fff; border-radius: 14px; padding: 40px 36px; width: 100%; max-width: 400px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.login-mark {
  width: 76px; height: 76px; border-radius: 14px; background: #fff;
  object-fit: contain; padding: 6px; margin: 0 auto 14px; display: block;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}

.lh-footer {
  text-align: center; padding: 18px 20px; color: var(--slate); font-size: .82rem;
  border-top: 1px solid var(--line); margin-top: 30px;
}
.lh-footer div:last-child { margin-top: 3px; font-size: .78rem; }
.lh-footer strong { color: var(--gold-soft); background: var(--navy-deep); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.login-footer {
  text-align: center; padding: 22px 20px 26px;
  border-top: 1px solid rgba(255,255,255,.12);
}
.login-footer .lf-line1 { color: #C9D2E0; font-size: .78rem; letter-spacing: .01em; }
.login-footer .lf-line2 { color: #8798B5; font-size: .74rem; margin-top: 4px; }
.login-footer strong { color: var(--gold); font-weight: 600; }
@media (max-width: 991px) {
  .lh-sidebar {
    position: fixed; left: -270px; top: 64px; height: calc(100vh - 64px); z-index: 50;
    transition: left .22s ease; box-shadow: 4px 0 20px rgba(0,0,0,.2);
  }
  .lh-sidebar.open { left: 0; }
  .lh-overlay.show { display: block; position: fixed; inset: 64px 0 0 0; background: rgba(0,0,0,.35); z-index: 45; }
  .lh-main { padding: 18px; }
}
@media (max-width: 576px) {
  .lh-brand-text { font-size: .92rem; }
  .lh-stat .val { font-size: 1.5rem; }
}
