/* ============================================================
   SIDLEY PHARMACY STAFF PORTAL — Main Stylesheet
   ============================================================ */

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

:root {
  --brand: #0F6E56;
  --brand-light: #E1F5EE;
  --brand-mid: #9FE1CB;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
}

body {
  font-family: var(--font);
  font-size: 15px;
  color: #1a1a1a;
  background: #f5f5f5;
  min-height: 100vh;
}

/* App shell */
.app-shell {
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.top-bar {
  background: var(--brand);
  padding: 14px 16px 12px;
  flex-shrink: 0;
}
.top-bar-title { font-size: 17px; font-weight: 500; color: #fff; }
.top-bar-sub { font-size: 12px; color: var(--brand-mid); margin-top: 1px; }
.top-bar-row { display: flex; justify-content: space-between; align-items: flex-start; }
.signout-btn {
  font-size: 12px; padding: 4px 12px;
  border: 0.5px solid rgba(255,255,255,0.4);
  border-radius: 20px; color: #fff; background: transparent; cursor: pointer;
  font-family: var(--font);
}
.signout-btn:hover { background: rgba(255,255,255,0.1); }
.nav-username { font-size: 13px; color: #E1F5EE; font-weight: 500; }

/* Page body */
.page-body { flex: 1; overflow-y: auto; padding-bottom: 80px; }
.page-pad { padding: 0 16px; }

/* Bottom nav */
.bottom-nav {
  display: flex;
  border-top: 1px solid #e5e5e5;
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 4px; cursor: pointer; border: none; background: transparent;
  font-size: 10px; color: #888; font-family: var(--font);
}
.nav-item.active { color: var(--brand); }
.nav-icon { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }

/* Cards */
.card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 10px;
}

/* Section labels */
.section-label {
  font-size: 11px; font-weight: 600; color: #888;
  letter-spacing: 0.06em; text-transform: uppercase;
  margin: 16px 0 8px;
}

/* Alerts */
.alert {
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 10px; display: flex; align-items: flex-start; gap: 8px;
}
.alert-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 3px; }
.alert-warn { background: #FAEEDA; color: #633806; }
.alert-warn .alert-dot { background: #BA7517; }
.alert-danger { background: #FCEBEB; color: #791F1F; }
.alert-danger .alert-dot { background: #E24B4A; }
.alert-info { background: #E6F1FB; color: #0C447C; }
.alert-info .alert-dot { background: #185FA5; }
.alert-ok { background: #EAF3DE; color: #27500A; }
.alert-ok .alert-dot { background: #3B6D11; }

/* Badges */
.badge {
  display: inline-block; font-size: 11px; padding: 3px 10px;
  border-radius: 20px; font-weight: 500; white-space: nowrap;
}
.badge-bh { background: #E6F1FB; color: #0C447C; }
.badge-approved { background: #EAF3DE; color: #27500A; }
.badge-pending { background: #FAEEDA; color: #633806; }
.badge-declined { background: #FCEBEB; color: #791F1F; }
.badge-sick { background: #FCEBEB; color: #791F1F; }
.badge-overtime { background: #EEEDFE; color: #3C3489; }
.badge-late { background: #FAEEDA; color: #633806; }
.badge-grace { background: #E1F5EE; color: #085041; }
.badge-supervisor { background: #E1F5EE; color: #085041; }

/* Avatars */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500; flex-shrink: 0;
}
.av-purple { background: #EEEDFE; color: #3C3489; }
.av-teal { background: #E1F5EE; color: #085041; }
.av-coral { background: #FAECE7; color: #712B13; }
.av-blue { background: #E6F1FB; color: #0C447C; }
.av-pink { background: #FBEAF0; color: #72243E; }
.av-green { background: #EAF3DE; color: #27500A; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.stat-card { background: #f5f5f5; border-radius: 8px; padding: 12px 14px; }
.stat-label { font-size: 11px; color: #888; margin-bottom: 4px; }
.stat-val { font-size: 24px; font-weight: 500; }
.stat-sub { font-size: 11px; color: #888; margin-top: 2px; }

/* Allowance bar */
.allowance-card {
  background: #fff; border: 1px solid #e8e8e8;
  border-radius: 12px; padding: 16px; margin: 10px 0;
}
.allowance-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.allowance-title { font-size: 14px; font-weight: 500; }
.allowance-sub { font-size: 12px; color: #888; margin-bottom: 10px; }
.allowance-big { font-size: 22px; font-weight: 500; }
.allowance-small { font-size: 12px; color: #888; }
.bar-track { background: #f0f0f0; border-radius: 4px; height: 8px; overflow: hidden; margin-bottom: 6px; }
.bar-fill { height: 8px; border-radius: 4px; background: var(--brand); transition: width 0.4s; }
.bar-fill.warn { background: #BA7517; }
.bar-fill.danger { background: #E24B4A; }
.bar-footer { display: flex; justify-content: space-between; font-size: 12px; color: #888; }

/* Leave cards */
.leave-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.leave-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 4px; }
.leave-date { font-size: 15px; font-weight: 500; }
.leave-hours { font-size: 13px; color: #888; margin-bottom: 6px; }
.leave-note { font-size: 13px; color: #888; font-style: italic; margin-bottom: 6px; }
.leave-manager-note { background: #f5f5f5; border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #888; }
.cancel-btn {
  width: 100%; margin-top: 10px; padding: 10px;
  border-radius: 8px; border: 1px solid #FAC775;
  background: #FAEEDA; color: #854F0B;
  font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--font);
}
.cancel-btn:hover { background: #FAC775; }

/* Form elements */
input, select, textarea {
  font-family: var(--font); font-size: 14px; color: #1a1a1a;
  background: #fff; border: 1px solid #d0d0d0;
  border-radius: 8px; padding: 9px 12px; width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15,110,86,0.12);
}
input[type=checkbox], input[type=radio] { width: auto; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.form-row label { font-size: 13px; color: #666; min-width: 90px; }
.form-label-block { display: block; font-size: 11px; font-weight: 600; color: #666; margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Buttons */
button {
  font-family: var(--font); font-size: 14px; cursor: pointer;
  padding: 9px 18px; border-radius: 8px;
  border: 1px solid #d0d0d0; background: transparent; color: #1a1a1a;
  transition: background 0.15s;
}
button:hover { background: #f5f5f5; }
button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
button.primary:hover { background: #0a5a45; }
button.danger { background: #E24B4A; color: #fff; border-color: #E24B4A; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-full { width: 100%; padding: 12px; font-size: 15px; }

/* Checkbox/radio groups */
.cb-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.cb-item, .radio-item {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  background: #f5f5f5; border: 1px solid #e0e0e0;
  border-radius: 8px; padding: 5px 10px; cursor: pointer;
}

/* Strike pips */
.strike-pip {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; margin-right: 3px;
}
.pip-filled { background: #E24B4A; color: #fff; }
.pip-warn { background: #BA7517; color: #fff; }
.pip-empty { background: #eee; color: #888; }

/* RTW form */
.rtw-section { padding: 14px 16px; }
.rtw-section + .rtw-section { border-top: 1px solid #e8e8e8; }
.conf-banner {
  background: var(--brand-light); border-radius: 8px;
  padding: 8px 12px; font-size: 12px; color: #085041; margin-bottom: 12px;
}

/* Divider */
hr { border: none; border-top: 1px solid #e8e8e8; margin: 1rem 0; }

/* Loading overlay */
.loading-screen {
  position: fixed; inset: 0; background: #fff;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 12px; z-index: 9999;
}
.loading-spinner {
  width: 32px; height: 32px; border: 3px solid #e0e0e0;
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Password strength */
.pw-track { background: #e0e0e0; border-radius: 2px; height: 4px; margin-top: 4px; }
.pw-fill { height: 4px; border-radius: 2px; transition: width 0.3s, background 0.3s; }

/* Login screen */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; background: #f5f5f5; }
.login-card { background: #fff; border-radius: 16px; padding: 2rem; width: 100%; max-width: 380px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); }
.login-brand { background: var(--brand); color: #fff; border-radius: 12px; padding: 20px; margin-bottom: 24px; }
.login-brand-sub { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand-mid); margin-bottom: 4px; }
.login-brand-title { font-size: 22px; font-weight: 500; }
.login-brand-tagline { font-size: 13px; color: var(--brand-mid); margin-top: 2px; }

/* Responsive desktop */
@media (min-width: 600px) {
  .app-shell { box-shadow: 0 0 40px rgba(0,0,0,0.08); margin: 0 auto; }
  body { display: flex; justify-content: center; }
}
