/* ===== DESIGN TOKENS ===== */
:root {
  --pink: #e8799a;
  --pink-dark: #c85070;
  --pink-med: #d4647f;
  --pink-light: #f0a8bf;
  --pink-pale: #fce8ef;
  --pink-soft: #fff0f5;
  --maroon: #7b1c2e;
  --gold: #a07840;
  --white: #ffffff;

  --text-primary: #1a0d12;
  --text-secondary: #5c3d4a;
  --text-muted: #9c7080;

  --border-card: rgba(232,121,154,0.14);
  --border-pink: rgba(232,121,154,0.22);

  --green: #15803d;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --blue: #1d4ed8;
  --blue-bg: #eff6ff;
  --blue-border: #bfdbfe;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --orange: #c2410c;
  --orange-bg: #fff7ed;
  --orange-border: #fed7aa;
  --yellow: #d97706;

  --shadow-card: 0 2px 12px rgba(232,121,154,0.1), 0 1px 3px rgba(232,121,154,0.06);
  --shadow-pink: 0 6px 24px rgba(200,80,112,0.28);
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 28px rgba(0,0,0,0.12);

  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-full: 999px;

  --nav-h: 68px;
  --header-h: 58px;
  --t: 0.18s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--pink-pale);
  min-height: 100vh; min-height: 100dvh;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3,h4 { font-family: 'DM Serif Display', serif; }
button { font-family: 'DM Sans', sans-serif; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: 'DM Sans', sans-serif; }
a { text-decoration: none; color: inherit; }

/* ===== UTILITY ===== */
.hidden { display: none !important; }

/* ===== LOGIN ===== */
#loginScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh; min-height: 100dvh;
  padding: 24px;
  background: linear-gradient(160deg, #fce8ef 0%, #f5c0d0 55%, #fce8ef 100%);
}

.login-card {
  background: var(--white);
  border-radius: 28px;
  box-shadow: 0 16px 56px rgba(200,80,112,0.22), 0 2px 8px rgba(200,80,112,0.1);
  padding: 44px 32px 36px;
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; align-items: center;
}

.login-logo {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--pink-pale);
  box-shadow: 0 0 0 8px rgba(232,121,154,0.1);
  margin-bottom: 18px;
}

.login-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.9rem;
  color: var(--maroon);
  letter-spacing: -0.5px;
  margin-bottom: 3px;
}

.login-clinic {
  font-size: 0.88rem;
  color: var(--pink);
  font-style: italic;
  margin-bottom: 2px;
}

.login-jp {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.login-form { width: 100%; display: flex; flex-direction: column; gap: 12px; }

.login-input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid rgba(232,121,154,0.22);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  color: var(--text-primary);
  background: var(--pink-soft);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.login-input:focus {
  border-color: var(--pink);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(232,121,154,0.12);
}

.login-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: opacity var(--t), transform var(--t);
  box-shadow: var(--shadow-pink);
  margin-top: 4px;
}
.login-btn:active { transform: scale(0.98); opacity: 0.9; }

.login-error {
  font-size: 0.8rem;
  color: var(--red);
  text-align: center;
  min-height: 18px;
  margin-top: -4px;
}

/* ===== SESSION MODAL ===== */
#sessionModal {
  position: fixed; inset: 0;
  background: rgba(90,20,40,0.35);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999; padding: 24px;
  backdrop-filter: blur(6px);
}
.session-modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  max-width: 320px; width: 100%;
  box-shadow: var(--shadow-pink);
  text-align: center;
}
.session-modal-icon { font-size: 2.2rem; margin-bottom: 12px; }
.session-modal-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.session-modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 22px;
}
.session-modal-btns { display: flex; gap: 10px; }
.session-modal-btns button {
  flex: 1; padding: 11px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600;
}
.btn-cancel-session { background: var(--pink-pale); color: var(--pink-dark); }
.btn-force-login {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(200,80,112,0.25);
}

/* ===== MAIN APP ===== */
#mainApp { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

/* ===== HEADER ===== */
.app-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  display: flex; align-items: center;
  padding: 0 18px; gap: 10px;
  z-index: 100;
  box-shadow: 0 3px 20px rgba(200,80,112,0.28);
}

.header-logo {
  display: none;
}

.header-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.3rem;
  color: var(--white);
  flex: 1;
  letter-spacing: -0.2px;
}

.header-user {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.82);
  font-weight: 500;
}

.sync-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  flex-shrink: 0;
  transition: background 0.4s;
}
.sync-dot.live { background: #86efac; }
.sync-dot.offline { background: #fca5a5; }
.sync-dot.connecting { background: #fde68a; animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== APP CONTENT ===== */
.app-content {
  flex: 1;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 14px;
}

/* ===== PANELS ===== */
.panel { display: none; }
.panel.active { display: block; }
.panel-inner { padding: 14px 0 12px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1.5px solid var(--border-pink);
  display: flex; align-items: stretch;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(200,80,112,0.08);
}
.bottom-nav::-webkit-scrollbar { display: none; }

.nav-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-width: 66px; padding: 6px 4px;
  color: #c4a0ae;
  font-size: 0.62rem; font-weight: 500;
  letter-spacing: 0.2px;
  flex-shrink: 0; gap: 3px;
  transition: color var(--t);
  position: relative;
}

.nav-btn svg {
  width: 21px; height: 21px;
  stroke: currentColor; fill: none;
  stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  transition: stroke var(--t);
}

.nav-btn.active { color: var(--pink-dark); font-weight: 600; }
.nav-btn.active::before {
  content: '';
  position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--pink-dark));
  border-radius: 0 0 4px 4px;
}

/* ===== SEARCH BAR ===== */
.search-wrap { position: relative; margin-bottom: 12px; }
.search-input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  border: 1.5px solid rgba(232,121,154,0.2);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--white);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t);
}
.search-input:focus {
  border-color: var(--pink);
  box-shadow: 0 0 0 3px rgba(232,121,154,0.1);
}
.search-icon {
  position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  stroke: var(--pink-light); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  pointer-events: none;
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border-card);
  padding: 16px;
  margin-bottom: 10px;
  position: relative; overflow: hidden;
  animation: fadeUp 0.22s ease both;
  transition: box-shadow var(--t);
  box-shadow: var(--shadow-card);
}
.card:hover { box-shadow: 0 6px 24px rgba(232,121,154,0.16); }

.card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--pink-light), var(--pink), var(--pink-dark));
}

.card-name {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  line-height: 1.45;
}

.card-btns {
  display: flex; gap: 7px;
  margin-top: 12px;
}

/* ===== FORMS ===== */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border-pink);
  padding: 20px;
  margin-bottom: 14px;
  animation: fadeUp 0.22s ease both;
  box-shadow: var(--shadow-card);
}

.form-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.05rem;
  color: var(--maroon);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--pink-pale);
}

.form-row { display: flex; gap: 10px; margin-bottom: 12px; }
.form-col { flex: 1; min-width: 0; }

.form-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--pink-dark);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  margin-bottom: 5px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid rgba(232,121,154,0.2);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--pink-soft);
  outline: none;
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--pink);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(232,121,154,0.1);
}
.form-textarea { resize: vertical; min-height: 72px; line-height: 1.5; }
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23e8799a' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-color: var(--pink-soft);
  padding-right: 32px;
}

.form-divider {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--pink);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 14px 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--pink-pale);
}

.form-line {
  border: none;
  height: 1.5px;
  background: var(--pink-pale);
  margin: 12px 0 14px;
}

.form-btns { display: flex; gap: 8px; margin-top: 16px; }

.inline-other-input { margin-top: 7px; }

/* ===== BUTTONS ===== */
.btn-primary {
  flex: 1; padding: 11px 20px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 600;
  transition: opacity var(--t), transform var(--t);
  box-shadow: 0 3px 12px rgba(200,80,112,0.28);
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }

.btn-outline {
  flex: 1; padding: 11px 20px;
  background: var(--pink-soft);
  color: var(--pink-dark);
  border: 1.5px solid rgba(232,121,154,0.28);
  border-radius: var(--radius-sm);
  font-size: 0.875rem; font-weight: 500;
  transition: background var(--t);
}
.btn-outline:hover { background: var(--pink-pale); }

.btn-add {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 16px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 600;
  box-shadow: 0 2px 10px rgba(200,80,112,0.25);
  transition: opacity var(--t), transform var(--t);
  white-space: nowrap; flex-shrink: 0;
}
.btn-add:active { transform: scale(0.96); opacity: 0.9; }
.btn-add svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2.5; stroke-linecap: round; }

.btn-sm {
  padding: 5px 13px;
  border-radius: var(--radius-xs);
  font-size: 0.76rem; font-weight: 600;
  transition: opacity var(--t);
  border: 1.5px solid transparent;
}
.btn-sm:hover { opacity: 0.78; }

.btn-sm-edit {
  background: var(--pink-pale);
  color: var(--pink-dark);
  border-color: rgba(232,121,154,0.28);
}
.btn-sm-delete {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

.btn-green {
  padding: 6px 12px;
  background: var(--green-bg);
  color: var(--green);
  border: 1.5px solid var(--green-border);
  border-radius: var(--radius-xs);
  font-size: 0.76rem; font-weight: 600;
  transition: opacity var(--t);
}
.btn-green:hover { opacity: 0.8; }

.btn-approve {
  padding: 6px 12px;
  background: var(--pink-pale);
  color: var(--pink-dark);
  border: 1.5px solid rgba(232,121,154,0.28);
  border-radius: var(--radius-xs);
  font-size: 0.76rem; font-weight: 600;
  transition: background var(--t);
}
.btn-approve:hover { background: var(--pink-light); color: var(--white); }

.btn-pdf {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 14px;
  background: var(--gold);
  color: var(--white);
  border-radius: var(--radius-sm);
  font-size: 0.78rem; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
  transition: opacity var(--t);
}
.btn-pdf:hover { opacity: 0.88; }

.btn-logout {
  width: 100%; padding: 10px;
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 0.86rem; font-weight: 600;
  border: 1px solid var(--red-border);
  transition: background var(--t);
}
.btn-logout:hover { background: #fecaca; }

.btn-set-appt {
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: var(--white);
  border-radius: var(--radius-xs);
  font-size: 0.78rem; font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(200,80,112,0.2);
  transition: opacity var(--t);
}
.btn-set-appt:hover { opacity: 0.88; }

/* ===== CHIPS / BADGES ===== */
.chip {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
}
.chip-green { background: var(--green-bg); color: var(--green); }
.chip-blue { background: var(--blue-bg); color: var(--blue); }
.chip-orange { background: var(--orange-bg); color: var(--orange); }
.chip-pink { background: var(--pink-pale); color: var(--pink-dark); }
.chip-grey { background: rgba(232,121,154,0.08); color: var(--text-muted); }
.chip-gold { background: #fefce8; color: var(--gold); }
.chip-red { background: var(--red-bg); color: var(--red); }

/* ===== SUB-TABS ===== */
.sub-tabs { display: flex; gap: 6px; }
.sub-tab-btn {
  flex: 1; padding: 8px 12px;
  border-radius: var(--radius-full);
  font-size: 0.82rem; font-weight: 600;
  background: var(--white);
  color: var(--pink-dark);
  border: 1.5px solid rgba(232,121,154,0.28);
  transition: all var(--t);
}
.sub-tab-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(200,80,112,0.25);
}

/* ===== STATS ===== */
.stats-row { display: flex; gap: 10px; margin-bottom: 14px; }
.stat-card {
  flex: 1; background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 14px; text-align: center;
  box-shadow: var(--shadow-card);
}
.stat-num {
  font-family: 'DM Serif Display', serif;
  font-size: 1.7rem;
  color: var(--pink-dark);
  line-height: 1; margin-bottom: 3px;
}
.stat-label { font-size: 0.7rem; color: var(--text-muted); font-weight: 500; }

/* ===== TOP ROW ===== */
.top-row {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 12px; gap: 10px; flex-wrap: wrap;
}
.add-section-row {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 10px; flex-wrap: wrap; gap: 8px;
}

/* ===== SECTION TITLES ===== */
.section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 1.15rem; color: var(--maroon);
}

/* ===== HOME TAB ===== */
.greeting-card {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%);
  border-radius: var(--radius);
  padding: 20px 22px;
  color: var(--white);
  margin-bottom: 14px;
  box-shadow: var(--shadow-pink);
}
.greeting-text {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem; margin-bottom: 4px;
}
.greeting-date { font-size: 0.82rem; opacity: 0.8; }

.home-section {
  background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.home-section-title {
  font-size: 0.78rem; font-weight: 700;
  color: var(--pink);
  text-transform: uppercase; letter-spacing: 0.6px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--pink-pale); color: var(--pink-dark);
  font-size: 0.68rem; font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: var(--radius-full);
  padding: 0 6px;
}
.home-item {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--pink-soft);
  font-size: 0.85rem; color: var(--text-secondary);
  line-height: 1.45;
}
.home-item:last-child { border-bottom: none; }
.home-item-dot {
  width: 5px; height: 5px;
  border-radius: 50%; background: var(--pink);
  flex-shrink: 0; margin-top: 6px;
}
.home-all-clear {
  font-size: 0.85rem; color: var(--text-muted);
  padding: 6px 0; font-style: italic;
}

/* ===== INVISALIGN CARD ===== */
.inv-card .card-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 8px; margin-bottom: 5px;
}
.tray-badge {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: var(--white);
  font-size: 0.72rem; font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--radius-full);
  white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(200,80,112,0.2);
}
.tray-info {
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 8px; line-height: 1.5;
}
.treatment-chips {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px;
}
.card-appt {
  font-size: 0.78rem; color: var(--pink-dark);
  font-weight: 500; margin-bottom: 4px;
}
.card-remarks {
  font-size: 0.8rem; color: var(--text-secondary);
  font-style: italic;
  background: var(--pink-soft);
  border-radius: var(--radius-xs);
  padding: 8px 10px; margin-top: 6px; line-height: 1.5;
  border: 1px solid rgba(232,121,154,0.1);
}
.card-prepared {
  font-size: 0.78rem; color: var(--text-muted); margin-bottom: 3px;
}

/* ===== LAB CASE CARD ===== */
.lab-meta {
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.lab-meta-dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--pink-light); flex-shrink: 0;
}

/* STATUS SECTION */
.lab-status-section {
  background: var(--pink-soft);
  border: 1px solid rgba(232,121,154,0.15);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.lab-status-label {
  font-size: 0.62rem; font-weight: 700;
  color: var(--pink);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.status-pills {
  display: flex; gap: 5px; flex-wrap: wrap;
}
.status-pill {
  padding: 5px 13px;
  border-radius: var(--radius-full);
  font-size: 0.72rem; font-weight: 600;
  border: 1.5px solid rgba(232,121,154,0.18);
  background: var(--white);
  color: var(--text-muted);
  transition: all var(--t);
  cursor: pointer;
}
.status-pill:hover { opacity: 0.8; }
.status-pill.pill-sent { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.status-pill.pill-arrived { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.status-pill.pill-appt { background: var(--pink-pale); color: var(--pink-dark); border-color: rgba(232,121,154,0.3); }
.status-pill.pill-finish { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }

.lab-section-heading {
  font-size: 0.68rem; font-weight: 700;
  color: var(--pink);
  text-transform: uppercase; letter-spacing: 1px;
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--pink-pale);
}

/* APPT INLINE PICKER */
.appt-inline {
  display: flex; align-items: center; gap: 8px;
  margin: 6px 0 4px;
  padding: 8px 10px;
  background: var(--pink-pale);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(232,121,154,0.2);
}
.appt-inline input[type=date] {
  border: 1.5px solid rgba(232,121,154,0.25);
  border-radius: var(--radius-xs);
  padding: 6px 10px;
  font-size: 0.83rem;
  color: var(--text-primary);
  background: var(--white);
  flex: 1; outline: none;
  font-family: 'DM Sans', sans-serif;
}

/* ===== STOCK CARD ===== */
.qty-row {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 6px;
}
.qty-display {
  font-family: 'DM Serif Display', serif;
  font-size: 2rem; color: var(--text-primary);
  min-width: 36px; text-align: center;
  transition: color var(--t);
}
.qty-display.low { color: var(--red); }
.qty-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--pink-pale);
  color: var(--pink-dark);
  font-size: 1.1rem; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t), transform var(--t);
  border: none; cursor: pointer;
}
.qty-btn:hover { background: var(--pink); color: var(--white); }
.qty-btn:active { transform: scale(0.88); }

.low-stock-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--red-bg); color: var(--red);
  font-size: 0.65rem; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
  text-transform: uppercase; letter-spacing: 0.3px;
  border: 1px solid var(--red-border);
}
.order-placed-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-bg); color: var(--green);
  font-size: 0.72rem; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--green-border);
}

/* ===== OVERTIME ===== */
.ot-summary-grid { display: flex; gap: 10px; margin-bottom: 14px; }
.ot-summary-card {
  flex: 1; background: var(--white);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  box-shadow: var(--shadow-card);
}
.ot-summary-name { font-size: 0.78rem; font-weight: 600; color: var(--pink); margin-bottom: 4px; }
.ot-summary-hours {
  font-family: 'DM Serif Display', serif;
  font-size: 1.4rem; color: var(--text-primary);
}
.ot-period-label {
  font-size: 0.78rem; color: var(--text-muted);
  margin-bottom: 12px; text-align: center; font-style: italic;
}
.ot-staff-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
.staff-toggle-btn {
  flex: 1; padding: 9px;
  border-radius: var(--radius-sm);
  font-size: 0.86rem; font-weight: 600;
  background: var(--pink-soft); color: var(--pink-dark);
  border: 1.5px solid rgba(232,121,154,0.25);
  transition: all var(--t); cursor: pointer;
}
.staff-toggle-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(200,80,112,0.2);
}
.approved-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--green-bg); color: var(--green);
  font-size: 0.72rem; font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-full);
  border: 1px solid var(--green-border);
}

/* ===== LOCUM ===== */
.locum-section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 0.95rem; color: var(--maroon);
  margin: 14px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--pink-pale);
}
.locum-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--pink-light), var(--pink));
  color: var(--white);
  font-size: 0.72rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.locum-card .card-top {
  display: flex; align-items: center; gap: 10px; margin-bottom: 5px;
}
.locum-phone-link {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--green); font-size: 0.83rem; font-weight: 500;
}
.locum-phone-link:hover { text-decoration: underline; }

/* ===== SWIPE DELETE ===== */
.swipe-wrapper {
  position: relative; overflow: hidden;
  border-radius: var(--radius);
  margin-bottom: 10px;
}
.swipe-wrapper .card { margin-bottom: 0; border-radius: var(--radius); transition: transform 0.15s ease; will-change: transform; }
.swipe-delete-btn {
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 80px; background: var(--red); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 600;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer; border: none;
}

/* ===== TOAST ===== */
#toastContainer {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  left: 14px; right: 14px;
  z-index: 9000;
  display: flex; flex-direction: column; gap: 7px;
  pointer-events: none;
}
.toast {
  background: var(--maroon);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: slideDown 0.28s ease both;
}
.toast-msg { flex: 1; line-height: 1.4; }
.toast-undo {
  background: var(--pink-light); color: var(--white);
  border: none; border-radius: 4px;
  padding: 4px 11px; font-size: 0.78rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.toast.success { background: #14532d; }
.toast.error { background: var(--red); }

/* ===== SKELETON ===== */
.skeleton-card {
  background: var(--white); border: 1px solid var(--border-card);
  border-radius: var(--radius); padding: 16px; margin-bottom: 10px;
  box-shadow: var(--shadow-card);
}
.skeleton-line {
  height: 13px;
  background: linear-gradient(90deg, var(--pink-soft) 25%, var(--pink-pale) 50%, var(--pink-soft) 75%);
  background-size: 200% 100%;
  border-radius: 6px; margin-bottom: 9px;
  animation: shimmer 1.4s infinite;
}
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-80 { width: 80%; }
.skeleton-line.h-20 { height: 18px; }

/* ===== SAKURA ===== */
#sakuraContainer {
  position: fixed; top: 0; left: 0; right: 0; height: 100vh;
  pointer-events: none; z-index: 8000; overflow: hidden;
}
.sakura-petal {
  position: absolute; top: -30px;
  pointer-events: none; opacity: 0.9;
}

/* ===== PTR ===== */
#ptrIndicator {
  position: fixed;
  top: var(--header-h);
  left: 50%; transform: translateX(-50%) translateY(-60px);
  background: var(--white);
  border-radius: 50%; width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-pink); font-size: 1.2rem;
  z-index: 200; transition: transform 0.3s ease; pointer-events: none;
  border: 2px solid var(--pink-pale);
}
#ptrIndicator.visible { transform: translateX(-50%) translateY(10px); }

/* ===== SETTINGS ===== */
#settingsBtn {
  position: fixed;
  bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom));
  right: 14px;
  width: 40px; height: 40px;
  border-radius: 50%; background: var(--white);
  box-shadow: var(--shadow-pink);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; z-index: 200;
  border: 1.5px solid rgba(232,121,154,0.2); cursor: pointer;
  transition: transform var(--t), box-shadow var(--t);
}
#settingsBtn:hover { transform: rotate(20deg); box-shadow: 0 4px 20px rgba(200,80,112,0.3); }

#settingsPanel {
  position: fixed;
  bottom: calc(var(--nav-h) + 58px + env(safe-area-inset-bottom));
  right: 14px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pink);
  padding: 14px;
  min-width: 170px; z-index: 200;
  border: 1px solid rgba(232,121,154,0.15);
  animation: fadeUp 0.18s ease both;
}
.settings-section-label {
  font-size: 0.62rem; font-weight: 700;
  color: var(--pink);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-bottom: 7px;
}
.lang-btns { display: flex; gap: 6px; margin-bottom: 12px; }
.lang-btn {
  flex: 1; padding: 7px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem; font-weight: 600;
  background: var(--pink-soft); color: var(--pink-dark);
  border: 1.5px solid rgba(232,121,154,0.25);
  transition: all var(--t); cursor: pointer; text-align: center;
}
.lang-btn.active {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(200,80,112,0.2);
}

/* ===== PDF BANNER ===== */
.pdf-banner {
  background: linear-gradient(135deg, #fefce8, #fef9c3);
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.pdf-banner-text { font-size: 0.8rem; color: var(--gold); font-weight: 500; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 28px 16px;
  color: var(--text-muted); font-size: 0.875rem;
}
.empty-state-icon { font-size: 2rem; margin-bottom: 6px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position:  200% 0; }
}
@keyframes petalFall {
  0%   { transform: translateY(0) rotate(0deg) translateX(0); opacity: 1; }
  50%  { transform: translateY(50vh) rotate(360deg) translateX(15px); opacity: 0.85; }
  100% { transform: translateY(105vh) rotate(720deg) translateX(-10px); opacity: 0; }
}

/* ===== SAFE AREA ===== */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .app-content {
    padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 8px);
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--pink-light); border-radius: 2px; }

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .container { padding: 0 20px; }
  .login-card { padding: 48px 40px 40px; }
  .nav-btn { min-width: 74px; }
}

/* ===== MISC ===== */
.period-badge {
  display: inline-block;
  background: var(--pink-pale); color: var(--pink-dark);
  font-size: 0.75rem; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-full);
  margin-bottom: 10px;
}
