:root{
  --brand:#17285c;      /* Outright logo/navy */
  --bg:#e6f5ff;         /* Page background */
  --card:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --border:#d7e7f3;
  --danger:#ef4444;
  --ok:#16a34a;
}

body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background:var(--bg);
  color:var(--text);
}

.topbar{
  background:var(--brand);
  color:#fff;
  padding:14px 18px;
  font-weight:800;
  letter-spacing:.2px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.topbar .sub{
  font-weight:600;
  opacity:.95;
  font-size:13px;
}

.topbar a{
  color:#fff;
  text-decoration:none;
  font-weight:700;
  opacity:.95;
}
.topbar a:hover{opacity:1; text-decoration:underline;}

.wrap{max-width:980px; margin:18px auto; padding:0 14px;}
.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:16px;
  box-shadow:0 2px 10px rgba(15,23,42,.06);
}

h1,h2,h3{margin:0 0 10px;}
h2{font-size:20px}
small{color:var(--muted)}

.row{display:flex; gap:12px; flex-wrap:wrap;}
.col{flex:1; min-width:220px;}

label{font-size:13px; color:var(--muted); display:block; margin-bottom:6px;}
input,select,textarea{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  font-size:14px;
  background:#fff;
}

textarea{min-height:90px; resize:vertical;}

.btn{
  display:inline-block;
  padding:10px 14px;
  border-radius:10px;
  border:1px solid transparent;
  background:var(--brand);
  color:#fff;
  font-weight:800;
  cursor:pointer;
  text-decoration:none;
  text-align:center;
}
.btn:hover{filter:brightness(.95)}
.btn.secondary{
  background:#fff;
  color:var(--brand);
  border-color:var(--brand);
}
.btn.gray{
  background:#475569;
}
.btn.danger{
  background:var(--danger);
}
.btn.ok{
  background:var(--ok);
}

.msg{
  padding:10px 12px;
  border-radius:10px;
  margin:12px 0;
}
.msg.ok{background:#ecfdf5; border:1px solid #86efac; color:#166534;}
.msg.err{background:#fef2f2; border:1px solid #fca5a5; color:#991b1b;}

.table{
  width:100%;
  border-collapse:collapse;
  margin-top:10px;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:12px;
}
.table th,.table td{
  border-bottom:1px solid var(--border);
  padding:10px;
  text-align:left;
  font-size:14px;
  vertical-align:top;
}
.table th{font-size:12px; color:var(--muted); font-weight:800; background:#fbfdff;}

.pill{
  display:inline-block;
  padding:4px 10px;
  border-radius:999px;
  background:#eff6ff;
  color:var(--brand);
  font-weight:800;
  font-size:12px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(12, 1fr);
  gap:12px;
}
.g4{grid-column:span 4}
.g6{grid-column:span 6}
.g12{grid-column:span 12}

@media (max-width: 900px){
  .g4,.g6{grid-column:span 12}
}
/* ===== compatibility for new portal pages ===== */

.brand-title{
  font-weight:900;
  letter-spacing:.2px;
}
.brand-sub{
  font-weight:600;
  opacity:.95;
  font-size:13px;
}

.topbar-links{
  display:flex;
  gap:14px;
  align-items:center;
}

.alert{
  padding:10px 12px;
  border-radius:10px;
  margin:12px 0;
  border:1px solid transparent;
}
.alert.success{
  background:#ecfdf5;
  border-color:#86efac;
  color:#166534;
}
.alert.danger{
  background:#fef2f2;
  border-color:#fca5a5;
  color:#991b1b;
}
.alert.secondary{
  background:#f8fafc;
  border-color:#e2e8f0;
  color:#334155;
}

/* map btn.primary to brand */
.btn.primary{
  background:var(--brand);
  color:#fff;
}

/* alias old + new names */
.btn.success{ background:var(--ok); }
.btn.ok{ background:var(--ok); }

.table-wrap{ overflow:auto; }
/* ===== OUTRIGHT PORTAL BRAND THEME (matches website) ===== */
:root{
  --pagebg: #e6f5ff;     /* Background all */
  --brand:  #17285c;     /* Outright text/logo + header */
  --text:   #0f1b3d;
  --muted:  rgba(0,0,0,.6);
  --card:   #ffffff;
  --border: rgba(23,40,92,.12);
}

/* Full page background */
html, body{
  height:100%;
}
body{
  background: var(--pagebg) !important;
  color: var(--text);
  margin:0;
  min-height:100vh;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Header */
.topbar{
  background: var(--brand) !important;
  color:#fff !important;
  padding:14px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}

.brand-title{
  font-weight:1000;
  letter-spacing:.2px;
  line-height:1.1;
}

.brand-sub{
  font-size:12px;
  opacity:.9;
}

/* Menu */
.topmenu{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}

.topmenu a{
  color:#fff;
  text-decoration:none;
  font-weight:800;
  font-size:13px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
}

.topmenu a:hover{
  background: rgba(255,255,255,.14);
}

.topmenu a.active{
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.35);
}

/* Cards */
.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0,0,0,.06);
}

/* Buttons (keep your existing classes working) */
.btn.primary{ background: var(--brand) !important; }
.btn.ok{ background: var(--brand) !important; }
.pill{
  border:1px solid var(--brand) !important;
  color: var(--brand) !important;
} 
:root{
  --pagebg:#e6f5ff;
  --brand:#17285c;
  --text:#0f1b3d;
  --border:rgba(23,40,92,.12);
}

html, body{height:100%;}
body{
  background: var(--pagebg) !important;
  color: var(--text);
  margin:0;
  min-height:100vh;
}

.topbar{
  background: var(--brand) !important;
  color:#fff !important;
  padding:14px 18px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
}

.brand-title{font-weight:1000; letter-spacing:.2px; line-height:1.1;}
.brand-sub{font-size:12px; opacity:.9;}

.topmenu{display:flex; flex-wrap:wrap; gap:8px; align-items:center;}
.topmenu a{
  color:#fff;
  text-decoration:none;
  font-weight:800;
  font-size:13px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.06);
}
.topmenu a:hover{background: rgba(255,255,255,.14);}
.topmenu a.active{
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.35);
}

/* Cards slightly nicer */
.card{
  background:#fff;
  border:1px solid var(--border);
  border-radius:16px;
  box-shadow:0 10px 28px rgba(0,0,0,.06);
}
/* =========================
   PHASE 10 — Mobile UI Polish
========================= */

/* Safer tap targets */
.btn, button, .action {
  min-height: 44px;
}

/* Page padding on mobile */
.wrap, .page-wrap {
  padding-left: 12px !important;
  padding-right: 12px !important;
}

/* Tables: scroll instead of breaking layout */
.table-wrap, .table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
}

/* Make all tables behave well */
table {
  width: 100%;
}

/* Buttons inside table cells wrap nicely */
td .btn, td button {
  white-space: nowrap;
}

@media (max-width: 820px) {

  /* Cards tighter */
  .card {
    padding: 12px !important;
  }

  /* Reduce heading size a bit */
  h2 { font-size: 20px; }
  h3 { font-size: 16px; }

  /* Filter/search rows wrap */
  .filters, .actions {
    flex-wrap: wrap !important;
  }

  /* Reduce table min-width (still scrollable if needed) */
  table {
    min-width: 720px;
  }
}
/* ===== Mobile Form + Table Improvements ===== */
@media (max-width: 820px){
  .wrap{ padding: 12px !important; }
  .card{ padding: 14px !important; border-radius: 16px !important; }

  label{ font-size: 14px; font-weight: 800; }
  input, select, textarea{
    width: 100% !important;
    font-size: 16px !important; /* prevents iOS zoom */
    padding: 12px 12px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
  }

  textarea{ min-height: 120px; }

  button, .btn, input[type="submit"]{
    width: 100%;
    padding: 14px 14px !important;
    border-radius: 14px !important;
    font-size: 16px !important;
    font-weight: 900 !important;
  }

  /* Tables: allow swipe scroll */
  table{
    display:block;
    width:100%;
    overflow-x:auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
  th, td{ padding: 10px 10px !important; }

  /* Signature canvas container if you use one */
  .signature, .sig-wrap, #signature-pad, canvas{
    max-width: 100% !important;
  }
}
/* ===== iPhone fix: stop Note being pushed right ===== */
@media (max-width: 900px){

  /* allow the table to stay readable without breaking */
  .avail-table{ display:block; width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }

  /* hide the original Note header + Note column */
  .avail-table th:nth-child(6),
  .avail-table td:nth-child(6){
    display:none !important;
  }

  /* add spacing so the remaining columns don’t feel cramped */
  .avail-table th, .avail-table td{ white-space:nowrap; }

  /* NEW “note row” we will add under each day */
  .note-row{
    display:block;
    margin:10px 0 0;
    padding:10px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#fff;
  }
  .note-row label{
    display:block;
    font-weight:900;
    font-size:12px;
    color:var(--muted);
    margin-bottom:6px;
    text-transform:uppercase;
    letter-spacing:.35px;
  }
  .note-row input{
    width:100%;
    box-sizing:border-box;
  }
}
@media (max-width: 900px){

  /* Hide original Note column */
  .avail-table th:nth-child(6),
  .avail-table td:nth-child(6){
    display:none !important;
  }

  /* Show mobile note row */
  .note-row-mobile{
    display:table-row !important;
  }

  .note-row{
    margin:10px 0 0;
    padding:10px;
    border:1px solid var(--border);
    border-radius:12px;
    background:#fff;
  }

  .note-row label{
    display:block;
    font-weight:900;
    font-size:12px;
    color:var(--muted);
    margin-bottom:6px;
  }

  .note-row input{
    width:100%;
    box-sizing:border-box;
  }
}