/* ============================================================
   BrightSpots Staff App Styles
   ============================================================ */

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

:root {
  --teal: #1D9E75;
  --teal-light: #E1F5EE;
  --teal-dark: #085041;
  --text: #1a1a1a;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: rgba(0,0,0,0.12);
  --bg: #f9fafb;
  --surface: #ffffff;
  --radius: 12px;
  --radius-sm: 8px;
  --danger: #dc2626;
  --danger-bg: #FCEBEB;
  --success-bg: #EAF3DE;
  --success-text: #27500A;
  --warn-bg: #FAEEDA;
  --warn-text: #633806;
}

html, body {
  height: 100%;
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

/* ── PAGES ── */
.page { display: none; flex-direction: column; flex: 1; min-height: 100vh; }
.page.active { display: flex; }

/* ── LOGIN / SETUP ── */
.login-wrap, .setup-wrap {
  padding: 48px 24px 32px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.login-logo { text-align: center; margin-bottom: 40px; }
.logo-icon {
  width: 64px; height: 64px;
  background: var(--teal-light);
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.logo-icon i { font-size: 32px; color: var(--teal); }
.login-logo h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.login-logo p { font-size: 14px; color: var(--text-secondary); }

.field { margin-bottom: 16px; }
.field label { font-size: 13px; font-weight: 500; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  background: var(--surface);
  color: var(--text);
  -webkit-appearance: none;
  display: block;
}
.field input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,158,117,0.12); }

.btn-primary {
  width: 100%; padding: 14px;
  background: var(--teal); color: white;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  cursor: pointer; margin-top: 8px;
  -webkit-appearance: none;
}
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.err-msg {
  font-size: 13px; color: var(--danger);
  background: var(--danger-bg);
  border-radius: var(--radius-sm);
  padding: 8px 12px; margin-top: 10px; display: none;
}
.err-msg.show { display: block; }
.login-hint { font-size: 12px; color: var(--text-tertiary); text-align: center; margin-top: 14px; }

/* ── TOP BAR ── */
.top-bar {
  padding: 52px 20px 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.top-bar h2 { font-size: 18px; font-weight: 600; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--teal-light);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; color: var(--teal-dark);
}

.refresh-bar {
  text-align: center; padding: 5px;
  font-size: 11px; color: var(--text-tertiary);
  background: var(--bg); border-bottom: 1px solid var(--border);
}

/* ── PAGE BODY ── */
.page-body { padding: 20px 20px 100px; flex: 1; overflow-y: auto; }

.greeting { font-size: 22px; font-weight: 600; margin-bottom: 2px; }
.greeting-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }

.section-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.05em; }

.btn-new {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 13px; background: var(--teal); color: white;
  border: none; border-radius: 99px; font-size: 13px; font-weight: 500; cursor: pointer;
}

/* ── CARDS ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-title { font-size: 15px; font-weight: 600; }
.card-sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.card-review { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; border-top: 1px solid var(--border); padding-top: 6px; font-style: italic; }

/* ── PILLS ── */
.pill { font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pill-pending { background: var(--warn-bg); color: var(--warn-text); }
.pill-approved { background: var(--success-bg); color: var(--success-text); }
.pill-denied { background: var(--danger-bg); color: var(--danger); }

/* ── EMPTY STATE ── */
.empty { text-align: center; padding: 48px 16px; color: var(--text-tertiary); }
.empty i { font-size: 36px; display: block; margin-bottom: 10px; }

/* ── FORM ── */
.form-wrap { padding: 20px 20px 100px; flex: 1; overflow-y: auto; }
.back-btn {
  display: flex; align-items: center; gap: 6px;
  background: none; border: none; color: var(--text-secondary);
  font-size: 14px; cursor: pointer; padding: 0; margin-bottom: 20px; font-family: inherit;
}
.form-title { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.form-sub { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; }
.form-field { margin-bottom: 18px; }
.form-field label { font-size: 13px; font-weight: 500; color: var(--text-secondary); display: block; margin-bottom: 6px; }
.form-field input, .form-field textarea {
  width: 100%; padding: 13px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 16px; background: var(--surface); color: var(--text);
  -webkit-appearance: none; font-family: inherit; display: block;
}
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--teal); }
.form-field textarea { resize: none; height: 80px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin-bottom: 18px;
}
.toggle-label { font-size: 15px; font-weight: 500; }
.toggle-desc { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.toggle {
  width: 44px; height: 26px; background: #d1d5db;
  border-radius: 13px; cursor: pointer; position: relative;
  transition: background 0.2s; border: none; flex-shrink: 0;
}
.toggle.on { background: var(--teal); }
.toggle::after {
  content: ''; position: absolute;
  width: 20px; height: 20px; background: white;
  border-radius: 50%; top: 3px; left: 3px;
  transition: left 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on::after { left: 21px; }

.form-actions { display: flex; gap: 10px; margin-top: 4px; }
.btn-cancel {
  flex: 1; padding: 13px; background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 15px; color: var(--text-secondary); cursor: pointer; font-family: inherit;
}
.btn-submit {
  flex: 2; padding: 13px; background: var(--teal); color: white;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.form-err { font-size: 13px; color: var(--danger); margin-top: 10px; min-height: 18px; }

/* ── SUCCESS ── */
.success-wrap {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; flex: 1; padding: 40px 24px; text-align: center;
}
.success-icon {
  width: 72px; height: 72px; background: var(--teal-light);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.success-icon i { font-size: 36px; color: var(--teal); }
.success-wrap h2 { font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.success-wrap p { font-size: 15px; color: var(--text-secondary); margin-bottom: 28px; line-height: 1.5; }
.btn-back {
  padding: 13px 28px; background: var(--teal); color: white;
  border: none; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
}

/* ── HOURS ── */
.summary-bar {
  background: var(--teal-light); border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.summary-label { font-size: 13px; color: var(--teal-dark); }
.summary-hours { font-size: 20px; font-weight: 700; color: var(--teal); }
.punch-pair {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 8px;
}
.punch-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.punch-type-in { font-size: 12px; font-weight: 700; width: 32px; color: var(--teal); }
.punch-type-out { font-size: 12px; font-weight: 700; width: 32px; color: var(--text-secondary); }
.punch-time { font-size: 14px; font-weight: 500; }
.punch-still { font-size: 13px; color: var(--text-tertiary); font-style: italic; }
.day-header {
  font-size: 12px; font-weight: 600; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 16px 0 8px; display: flex; justify-content: space-between;
}
.day-hrs { font-size: 12px; color: var(--teal); font-weight: 500; }

/* ── BOTTOM NAV ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 430px;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; padding: 8px 0 20px; z-index: 100;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--text-tertiary); font-size: 10px; font-family: inherit; padding: 4px;
}
.nav-btn i { font-size: 20px; }
.nav-btn.active { color: var(--teal); }

/* ── LOADING ── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,0.8);
  display: none; align-items: center; justify-content: center; z-index: 200;
}
.loading-overlay.show { display: flex; }
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--teal-light); border-top-color: var(--teal);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
