/* style.css — Horry County Election Observer Program */

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

:root {
  --teal:      #085041;
  --teal-med:  #0F6E56;
  --teal-lt:   #E1F5EE;
  --teal-bdr:  #3B9E82;
  --blue:      #0C447C;
  --blue-med:  #185FA5;
  --blue-lt:   #E6F1FB;
  --blue-bdr:  #85B7EB;
  --purple:    #4527A0;
  --purple-lt: #EDE7F6;
  --purple-bdr:#9575CD;
  --amber:     #633806;
  --amber-lt:  #FAEEDA;
  --amber-bdr: #EF9F27;
  --red:       #791F1F;
  --red-lt:    #FCEBEB;
  --red-bdr:   #E24B4A;
  --green:     #27500A;
  --green-lt:  #EAF3DE;
  --dark:      #1A1A1A;
  --gray:      #444441;
  --gray-mid:  #888780;
  --gray-lt:   #F4F3F0;
  --white:     #FFFFFF;
  --radius:    8px;
  --shadow:    0 1px 4px rgba(0,0,0,0.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--dark);
  background: #F8F7F4;
  min-height: 100vh;
}

/* ── Layout ── */
.page-header {
  background: var(--teal);
  color: white;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.page-header h1 { font-size: 17px; font-weight: 600; }
.page-header .sub { font-size: 12px; opacity: 0.75; margin-top: 2px; }

.container { max-width: 860px; margin: 0 auto; padding: 24px 16px; }
.container-wide { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid #E0DED9;
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 12px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #D0CEC9;
  background: var(--white);
  color: var(--dark);
  transition: background 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--gray-lt); }
.btn-primary { background: var(--teal); color: white; border-color: var(--teal); }
.btn-primary:hover { background: var(--teal-med); }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: var(--red-lt); color: var(--red); border-color: var(--red-bdr); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Forms ── */
.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray);
  margin-bottom: 5px;
}
.form-label .required { color: var(--red); margin-left: 2px; }
input[type=text], input[type=tel], input[type=email],
input[type=password], select, textarea {
  width: 100%;
  font-size: 14px;
  font-family: inherit;
  padding: 9px 12px;
  border: 1px solid #D0CEC9;
  border-radius: var(--radius);
  background: var(--white);
  color: var(--dark);
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--teal-bdr);
  box-shadow: 0 0 0 3px rgba(59,158,130,0.15);
}
textarea { resize: vertical; min-height: 80px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* ── Alerts / Info boxes ── */
.alert {
  padding: 11px 15px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 14px;
  border: 1px solid;
}
.alert-success { background: var(--teal-lt);   color: var(--teal);  border-color: var(--teal-bdr); }
.alert-error   { background: var(--red-lt);    color: var(--red);   border-color: var(--red-bdr); }
.alert-info    { background: var(--blue-lt);   color: var(--blue);  border-color: var(--blue-bdr); }
.alert-ev      { background: var(--purple-lt); color: var(--purple);border-color: var(--purple-bdr); }
.alert-warning { background: var(--amber-lt);  color: var(--amber); border-color: var(--amber-bdr); }
.alert-title   { font-weight: 600; margin-bottom: 4px; }

/* ── Badges ── */
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.badge-teal   { background: var(--teal-lt);   color: var(--teal); }
.badge-blue   { background: var(--blue-lt);   color: var(--blue); }
.badge-green  { background: var(--green-lt);  color: var(--green); }
.badge-amber  { background: var(--amber-lt);  color: var(--amber); }
.badge-red    { background: var(--red-lt);    color: var(--red); }
.badge-gray   { background: var(--gray-lt);   color: var(--gray); }
.badge-purple { background: var(--purple-lt); color: var(--purple); }

/* ── Step indicators ── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--teal);
  color: white;
  font-size: 13px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-circle.inactive { background: #D0CEC9; color: var(--gray-mid); }
.step-circle.done     { background: var(--green); }
.step-title { font-size: 15px; font-weight: 600; }
.step-sub   { font-size: 12px; color: var(--gray-mid); margin-top: 1px; }
.step-body  { padding-left: 38px; }
.step-body.hidden { display: none; }

/* ── Date / Slot / Zip grids ── */
.date-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.zip-grid  { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
@media (max-width: 560px) {
  .date-grid { grid-template-columns: repeat(2,1fr); }
  .zip-grid  { grid-template-columns: 1fr; }
}

.grid-opt {
  border: 1.5px solid #D0CEC9;
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.12s;
  user-select: none;
  background: var(--white);
}
.grid-opt:hover { border-color: var(--teal-bdr); background: var(--teal-lt); }
.grid-opt.selected { border-color: var(--teal); background: var(--teal-lt); }
.grid-opt.eday { border-color: var(--teal); }
.grid-opt.has-ev { border-left: 3px solid var(--purple-bdr); }
.grid-opt.has-ev.selected { border-left-color: var(--teal); }
.grid-opt input { display: none; }
.grid-opt .opt-main { font-size: 13px; font-weight: 600; }
.grid-opt .opt-sub  { font-size: 11px; color: var(--gray-mid); margin-top: 3px; }
.grid-opt.selected .opt-main { color: var(--teal); }
.grid-opt.selected .opt-sub  { color: var(--teal-med); }

/* ── Slot items (pending list) ── */
.slot-items { margin-top: 10px; }
.slot-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: var(--gray-lt);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 13px;
  gap: 8px;
}
.slot-item .tags { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  background: var(--teal-lt);
  color: var(--teal);
}
.tag-blue   { background: var(--blue-lt);   color: var(--blue); }
.tag-purple { background: var(--purple-lt); color: var(--purple); }

/* ── Progress bars ── */
.prow {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #ECEAE6;
  font-size: 12px;
}
.prow:last-child { border-bottom: none; }
.prow-label { min-width: 220px; }
.prow-label .pname { font-weight: 600; }
.prow-label .paddr { color: var(--gray-mid); font-size: 11px; }
.pbar { flex: 1; height: 6px; background: #E5E3DF; border-radius: 3px; }
.pfill { height: 100%; border-radius: 3px; transition: width 0.3s; }
.pcount { min-width: 45px; text-align: right; font-weight: 600; }

/* ── Dashboard tabs ── */
.tab-bar {
  display: flex; gap: 2px;
  border-bottom: 2px solid #E0DED9;
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--gray-mid);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  white-space: nowrap;
  transition: color 0.12s;
}
.tab-btn:hover { color: var(--dark); }
.tab-btn.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Dashboard stats ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 10px;
  margin-bottom: 20px;
}
@media (max-width: 700px) { .stats-grid { grid-template-columns: repeat(3,1fr); } }
.stat-card {
  background: var(--white);
  border: 1px solid #E0DED9;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}
.stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 11px; color: var(--gray-mid); margin-top: 4px; }

/* ── Table ── */
.tbl-wrap { overflow-x: auto; }
table.data-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-tbl th {
  text-align: left;
  padding: 8px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-mid);
  border-bottom: 2px solid #E0DED9;
  white-space: nowrap;
  background: var(--gray-lt);
}
.data-tbl td {
  padding: 8px 10px;
  border-bottom: 1px solid #ECEAE6;
  vertical-align: middle;
}
.data-tbl tr:last-child td { border-bottom: none; }
.data-tbl tr:hover td { background: #FAFAF8; }
.mini-select {
  width: 100%; font-size: 11px; padding: 3px 5px;
  border: 1px solid #D0CEC9; border-radius: 4px;
  background: var(--white); font-family: inherit;
}
.mini-input {
  width: 100%; font-size: 11px; padding: 3px 5px;
  border: 1px solid #D0CEC9; border-radius: 4px;
  margin-top: 4px; font-family: inherit;
}

/* ── Filter row ── */
.filter-row {
  display: flex; gap: 8px; flex-wrap: wrap;
  align-items: center; margin-bottom: 14px;
}
.filter-row select, .filter-row input[type=text] {
  width: auto; font-size: 13px; padding: 6px 10px; flex: none;
}
.filter-row input[type=text] { min-width: 160px; }

/* ── Login page ── */
.login-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--teal);
  padding: 20px;
}
.login-card {
  background: var(--white);
  border-radius: 12px;
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
.login-logo { text-align: center; margin-bottom: 24px; }
.login-logo h2 { font-size: 20px; color: var(--teal); font-weight: 700; }
.login-logo p  { font-size: 13px; color: var(--gray-mid); margin-top: 4px; }

/* ── Misc ── */
.empty-state { text-align: center; padding: 32px; color: var(--gray-mid); font-size: 14px; }
.text-muted { color: var(--gray-mid); }
.text-sm    { font-size: 12px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.fw-600 { font-weight: 600; }
hr.divider { border: none; border-top: 1px solid #E0DED9; margin: 16px 0; }
.print-only { display: none; }
@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }
  body { background: white; font-size: 12px; }
}
