/* ============================================================
   CU Malawi Timetable — Shared Styles
   Mobile-first, works on all screen sizes
   ============================================================ */

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

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: 'DM Sans', sans-serif; background: #F8F7F4; color: #1a2744; line-height: 1.5; }

/* ── App shell ── */
.app-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; padding-bottom: 76px; }

/* ── Header ── */
.app-header {
  background: #1a2744;
  padding: 16px 20px 13px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.18);
}
.app-header .eyebrow { color: #E8A020; font-size: 9px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; margin-bottom: 2px; }
.app-header h1 { color: #fff; font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.app-header .meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.app-header .sign-out { padding: 7px 13px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,0.2); background: transparent; color: #94a3b8; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; text-decoration: none; display: inline-block; }

/* ── Badge ── */
.badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 10px; border-radius: 20px; }
.badge-gold  { background: #E8A020; color: #1a2744; }
.badge-red   { background: #ef4444; color: #fff; }
.badge-green { background: #22c55e; color: #fff; }

/* ── Bottom nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid #eee;
  display: flex; z-index: 200;
}
.nav-btn {
  flex: 1; padding: 9px 0 7px; border: none; background: transparent;
  cursor: pointer; display: flex; flex-direction: column;
  align-items: center; gap: 2px; font-family: inherit;
  text-decoration: none; color: #aaa;
}
.nav-btn span.icon { font-size: 20px; }
.nav-btn span.label { font-size: 10px; font-weight: 700; letter-spacing: 0.3px; }
.nav-btn.active span.label { color: #1a2744; }
.nav-btn .active-bar { width: 22px; height: 2.5px; background: #E8A020; border-radius: 2px; }

/* ── Day tabs ── */
.day-tabs { background: #fff; border-bottom: 1px solid #eee; padding: 10px 16px; overflow-x: auto; display: flex; gap: 7px; scrollbar-width: none; }
.day-tabs::-webkit-scrollbar { display: none; }
.day-chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 20px; border: none;
  cursor: pointer; font-family: inherit; font-weight: 700; font-size: 12px;
  background: #F0EEE9; color: #777; position: relative; transition: all 0.12s;
  text-decoration: none; display: inline-block;
}
.day-chip.active { color: #fff; }
.day-chip .dot { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: 9px; font-weight: 800; width: 14px; height: 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* ── Card ── */
.entry-card {
  background: #fff; border-radius: 14px; padding: 14px 15px;
  box-shadow: 0 1px 5px rgba(0,0,0,0.07);
  border-left: 4px solid #1a2744;
  margin-bottom: 10px;
  animation: fadeUp 0.18s ease both;
}
.entry-card.issue { }

/* ── Filters bar ── */
.filters { padding: 10px 16px; display: flex; gap: 7px; }
.filters select, .filters input {
  flex: 1; padding: 8px 8px; border-radius: 9px;
  border: 1.5px solid #E5E3DE; background: #fff;
  font-size: 11px; color: #1a2744; font-family: inherit;
}

/* ── Forms ── */
.form-group { margin-bottom: 13px; }
.form-label { display: block; font-size: 11px; font-weight: 700; color: #555; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.6px; }
.form-input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid #E5E3DE; font-size: 14px; color: #1a2744;
  font-family: inherit; background: #F8F7F4; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus { border-color: #1a2744; box-shadow: 0 0 0 3px rgba(26,39,68,0.09); }
.form-input.error { border-color: #dc2626; }
.form-error { color: #dc2626; font-size: 11px; margin-top: 3px; display: block; }
.form-card { background: #fff; border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.06); }
.form-card h2 { font-family: 'Playfair Display', serif; font-size: 16px; color: #1a2744; margin-bottom: 4px; font-weight: 700; }
.form-card .sub { font-size: 12px; color: #888; margin-bottom: 18px; }

/* ── Buttons ── */
.btn { padding: 11px 16px; border-radius: 10px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: opacity 0.12s, transform 0.1s; border: none; }
.btn:active { transform: scale(0.96); }
.btn-dark { background: #1a2744; color: #fff; }
.btn-dark:hover { opacity: 0.88; }
.btn-ghost { background: #fff; color: #444; border: 1.5px solid #ddd; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-amber { background: #f59e0b; color: #fff; }
.btn-green { background: #22c55e; color: #fff; }
.btn-indigo { background: transparent; color: #6366f1; border: 1.5px solid #6366f1; }
.btn-outline-dark { background: transparent; color: #1a2744; border: 1.5px solid #1a2744; }
.btn-outline-red { background: transparent; color: #dc2626; border: 1.5px solid #dc2626; }
.btn-outline-amber { background: transparent; color: #E8A020; border: 1.5px solid #E8A020; }
.btn-full { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 9px; }

/* ── Page content wrapper ── */
.page-content { padding: 0 16px 24px; }
.section-header { padding: 10px 16px 6px; }
.section-header p { font-size: 12px; color: #888; font-weight: 500; }

/* ── Sheet overlay (modal) ── */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.52); z-index: 300; display: flex; align-items: flex-end; animation: fadeIn 0.18s; }
.overlay.center { align-items: center; justify-content: center; padding: 20px; }
.sheet {
  background: #fff; width: 100%; max-width: 480px; margin: 0 auto;
  border-radius: 22px 22px 0 0; padding: 24px 20px 32px;
  max-height: 90vh; overflow-y: auto;
  animation: slideUp 0.24s ease;
}
.sheet-handle { width: 36px; height: 3.5px; background: #ddd; border-radius: 2px; margin: 0 auto 20px; }
.dialog { background: #fff; border-radius: 16px; padding: 24px; width: 100%; max-width: 320px; }

/* ── Status option buttons ── */
.status-opt {
  width: 100%; padding: 13px; border-radius: 12px;
  border: 2px solid #E5E3DE; background: #fff;
  cursor: pointer; font-family: inherit; margin-bottom: 8px;
  display: flex; align-items: center; gap: 12px; text-align: left;
  transition: all 0.12s;
}
.status-opt.selected { }

/* ── Log entry ── */
.log-entry { border-radius: 12px; padding: 14px; margin-bottom: 10px; border-left: 3px solid; }
.log-entry.session { background: #FFFDF5; }
.log-entry.edit    { background: #F5F3FF; border-left-color: #6366f1; }

/* ── Stats grid ── */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 1px 5px rgba(0,0,0,0.06); }
.stat-card .icon { font-size: 22px; margin-bottom: 8px; }
.stat-card .val { font-size: 26px; font-weight: 800; }
.stat-card .lbl { font-size: 12px; color: #888; font-weight: 600; margin-top: 2px; }

/* ── Semester card ── */
.semester-card {
  background: linear-gradient(135deg,#1a2744,#2d4a8a);
  border-radius: 16px; padding: 18px 20px; margin-bottom: 14px;
  color: #fff; position: relative; overflow: hidden;
}
.semester-card .bubble { position: absolute; right: -20px; top: -20px; width: 120px; height: 120px; border-radius: 50%; background: rgba(232,160,32,0.15); }

/* ── Day bar chart (lecturer) ── */
.day-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.day-bar-row .day-lbl { font-size: 11px; font-weight: 700; color: #888; width: 32px; }
.day-bar-track { flex: 1; height: 10px; background: #F0EEE9; border-radius: 5px; overflow: hidden; }
.day-bar-fill { height: 100%; border-radius: 5px; }
.day-bar-row .cnt { font-size: 12px; font-weight: 700; color: #1a2744; width: 16px; text-align: right; }

/* ── Toast ── */
.toast {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%);
  background: #1a2744; color: #fff; padding: 10px 22px; border-radius: 22px;
  font-size: 13px; font-weight: 600; z-index: 400; white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25); animation: toastIn 0.25s ease;
  pointer-events: none;
}
.toast.err { background: #dc2626; }

/* ── Search input ── */
.search-wrap { position: relative; margin-bottom: 14px; padding: 0 16px; }
.search-wrap .icon { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); font-size: 15px; pointer-events: none; }
.search-wrap input { width: 100%; padding: 10px 12px 10px 38px; border-radius: 12px; border: 1.5px solid #E5E3DE; background: #fff; font-size: 14px; font-family: inherit; color: #1a2744; outline: none; }
.search-wrap input:focus { border-color: #1a2744; }

/* ── Days summary strip ── */
.days-strip { display: grid; grid-template-columns: repeat(5,1fr); gap: 7px; margin-bottom: 14px; }
.days-strip-cell { background: #fff; border-radius: 10px; padding: 10px 4px; text-align: center; border-top: 3px solid; }
.days-strip-cell .num { font-size: 15px; font-weight: 700; color: #1a2744; }
.days-strip-cell .day { font-size: 9px; color: #888; font-weight: 700; }

/* ── Replacement banner ── */
.replacement-banner { background: #FEF3C7; border-radius: 8px; padding: 6px 10px; margin-top: 6px; font-size: 11px; color: #92400E; }

/* ── Animations ── */
@keyframes fadeUp  { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes toastIn { from { transform: translateX(-50%) translateY(16px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
@keyframes spin    { to { transform: rotate(360deg); } }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* ── Utilities ── */
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center  { display: flex; align-items: center; }
.gap-6  { gap: 6px; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-10  { margin-top: 10px; }
.mt-12  { margin-top: 12px; }
.mb-0   { margin-bottom: 0; }
.mb-4   { margin-bottom: 4px; }
.fw-700 { font-weight: 700; }
.fs-11  { font-size: 11px; }
.fs-12  { font-size: 12px; }
.fs-13  { font-size: 13px; }
.fs-14  { font-size: 14px; }
.text-muted { color: #888; }
.text-center { text-align: center; }
.empty-state { text-align: center; padding: 56px 0; color: #aaa; }
.empty-state .emoji { font-size: 44px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; font-weight: 600; }
.strikethrough { text-decoration: line-through; }
