:root {
  --blue: #1a56db;
  --blue-dark: #1e429f;
  --green: #057a55;
  --red: #c81e1e;
  --gray: #6b7280;
  --light: #f9fafb;
  --border: #e5e7eb;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--light);
  color: #111827;
  min-height: 100vh;
}

.page-header {
  background: var(--blue);
  color: white;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.page-header h1 { font-size: 1.25rem; font-weight: 700; }
.page-header .subtitle { font-size: 0.85rem; opacity: 0.85; }
.page-header .logo {
  height: 96px;
  width: auto;
  max-width: 62vw;
  background: white;
  padding: 8px 12px;
  border-radius: 8px;
  flex-shrink: 0;
}
/* Language switch always visible, tappable */
.lang-switch { margin-left: auto; font-size: 1rem; white-space: nowrap; }
.lang-switch a { color: white; padding: 0.15rem 0.35rem; text-decoration: none; }
.lang-switch a.on { font-weight: 800; text-decoration: underline; }
.lang-switch a.off { opacity: 0.75; }

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  background: white;
  appearance: none;
  -webkit-appearance: none;
}

textarea { min-height: 140px; resize: vertical; }

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--blue);
  outline-offset: 1px;
}

.field { margin-bottom: 1.1rem; }

/* Searchable name dropdown (combo box) */
.combo { position: relative; }
.combo-list {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 4px);
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12);
  max-height: 260px;
  overflow-y: auto;
  z-index: 50;
}
.combo-item {
  padding: 0.8rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  border-bottom: 1px solid #f3f4f6;
}
.combo-item:last-child { border-bottom: none; }
.combo-item:hover, .combo-item.active { background: #eff6ff; }
.combo-empty { padding: 0.8rem 1rem; color: var(--gray); font-size: 0.9rem; }

/* Clickable name → contact info on dashboard */
.contact summary {
  cursor: pointer;
  list-style: none;
  color: var(--blue);
}
.contact summary::-webkit-details-marker { display: none; }
.contact summary::after {
  content: " ▾";
  font-size: 0.7rem;
  color: var(--gray);
}
.contact[open] summary::after { content: " ▴"; }
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f9fafb;
  border-radius: 8px;
}
.contact-info a {
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}
.contact-info a:hover { text-decoration: underline; }
.contact-info .no-contact { color: var(--gray); font-size: 0.85rem; }

/* Time-off calendar */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.cal-head .month { font-size: 1.35rem; font-weight: 800; }
.cal-nav { display: inline-block; padding: 0.5rem 1.1rem; border-radius: 8px; border: 1px solid var(--border); background: white; text-decoration: none; color: var(--blue); font-weight: 700; font-size: 1.3rem; line-height: 1; }
.cal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-grid th { background: transparent; color: var(--gray); font-size: 0.9rem; padding: 0.5rem 0.2rem; text-align: center; }
.cal-grid td {
  border: 1px solid var(--border);
  vertical-align: top;
  height: 120px;
  padding: 5px;
  overflow: hidden;
}
.cal-day-num { font-size: 0.95rem; color: var(--gray); font-weight: 700; }
.cal-cell.outside { background: #fafafa; }
.cal-cell.outside .cal-day-num { color: #d1d5db; }
.cal-cell.today { background: #eff6ff; }
.cal-cell.today .cal-day-num { color: var(--blue); }
.cal-entry {
  display: block;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 5px;
  padding: 2px 6px;
  margin-top: 3px;
  font-size: 0.82rem;
  line-height: 1.3;
  color: #92400e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-entry.auto {
  background: #dbeafe;
  border-color: #bfdbfe;
  color: #1e429f;
}
.cal-entry form { display: inline; }
.cal-entry button {
  background: none; border: none; color: #b45309; cursor: pointer;
  font-size: 0.82rem; padding: 0; margin-left: 3px;
}
@media (max-width: 560px) {
  .cal-grid td { height: 84px; }
  .cal-entry { font-size: 0.72rem; }
}

.btn {
  display: block;
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: 0.88; }
.btn-primary { background: var(--blue); color: white; }
.btn-green  { background: var(--green); color: white; }
.btn-red    { background: var(--red); color: white; }
.btn-outline {
  background: white;
  color: var(--blue);
  border: 2px solid var(--blue);
}
.btn-sm {
  display: inline-block;
  width: auto;
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
}

.jha-box {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  line-height: 1.6;
  min-height: 60px;
}

.ack-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  margin-bottom: 1rem;
  cursor: pointer;
}
.ack-row input[type="checkbox"] {
  width: 24px; height: 24px; flex-shrink: 0;
  accent-color: var(--green);
}
.ack-row span { font-size: 0.95rem; font-weight: 600; }

/* Inline radio choices on the safety report forms */
.radio-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
  margin-bottom: 0;
  cursor: pointer;
}
.radio-inline input[type="radio"] { width: 20px; height: 20px; accent-color: var(--red); }

/* Messaging */
.msg-recipient {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: 6px;
  font-weight: 500;
  margin-bottom: 0;
  cursor: pointer;
}
.msg-recipient:hover { background: #f0f9ff; }
.msg-recipient input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--blue); }
.msg-bubble {
  max-width: 85%;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  margin: 0.35rem 0;
  font-size: 0.92rem;
}
.msg-bubble.out { background: #dbeafe; margin-left: auto; border-bottom-right-radius: 3px; }
.msg-bubble.in  { background: #f3f4f6; margin-right: auto; border-bottom-left-radius: 3px; }
.msg-meta { font-size: 0.72rem; color: var(--gray); margin-top: 0.2rem; }

/* Segmented on-site / everyone toggle */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-btn {
  border: none; background: white; color: var(--gray);
  padding: 0.5rem 0.9rem; font-size: 0.85rem; font-weight: 600; cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.active { background: var(--blue); color: white; }

/* Dashboard */
.nav-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.nav-tab {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: white;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  color: var(--gray);
}
.nav-tab.active { background: var(--blue); color: white; border-color: var(--blue); }

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-green { background: #dcfce7; color: var(--green); }
.badge-blue  { background: #dbeafe; color: var(--blue-dark); }
.badge-gray  { background: #f3f4f6; color: var(--gray); }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th { text-align: left; padding: 0.6rem 0.75rem; background: #f3f4f6; font-weight: 700; color: var(--gray); }
td { padding: 0.6rem 0.75rem; border-top: 1px solid var(--border); }
tr:hover td { background: #f9fafb; }

.stat-row { display: flex; gap: 0.75rem; margin-bottom: 1rem; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 100px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  text-align: center;
}
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--blue); }
.stat-card .lbl { font-size: 0.75rem; color: var(--gray); margin-top: 0.15rem; }

.confirmed-icon { font-size: 4rem; text-align: center; margin: 1.5rem 0 0.5rem; }
.confirmed-title { font-size: 1.4rem; font-weight: 800; text-align: center; margin-bottom: 0.5rem; }
.confirmed-sub { text-align: center; color: var(--gray); margin-bottom: 1.5rem; }

.filter-row { display: flex; gap: 0.5rem; align-items: flex-end; margin-bottom: 1rem; flex-wrap: wrap; }
.filter-row input { flex: 1; min-width: 140px; }

@media (max-width: 480px) {
  .page-header h1 { font-size: 1.1rem; }
  .page-header .logo { height: 56px; max-width: 70vw; }
  .lang-switch { font-size: 1.05rem; }
  table { font-size: 0.8rem; }
  th, td { padding: 0.5rem; }
}
