/* ══════════════════════════════════════════════════════════
   PackageDesk v3 — The REMY Apartments (A LIVEBe Community)
   Light Theme — Gold / Blue / Maroon
   (c) AXG Systems — All Rights Reserved
   ══════════════════════════════════════════════════════════ */

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

:root {
  /* ── AXG Signature Gold ── */
  --gold:         #c9a84c;
  --gold-light:   #dfc36e;
  --gold-dark:    #a08630;
  --gold-bg:      rgba(201,168,76,0.08);
  --gold-border:  rgba(201,168,76,0.25);
  --gold-glow:    rgba(201,168,76,0.12);

  /* ── Blue ── */
  --blue:         #1e5fb3;
  --blue-light:   #3b82f6;
  --blue-bg:      rgba(30,95,179,0.06);
  --blue-border:  rgba(30,95,179,0.18);

  /* ── Maroon ── */
  --maroon:       #7c2d3d;
  --maroon-light: #a0374c;
  --maroon-bg:    rgba(124,45,61,0.06);
  --maroon-border:rgba(124,45,61,0.18);

  /* ── Success / Warning / Danger ── */
  --success:      #16a34a;
  --success-bg:   rgba(22,163,74,0.08);
  --warning:      #d97706;
  --warning-bg:   rgba(217,119,6,0.08);
  --danger:       #dc2626;
  --danger-bg:    rgba(220,38,38,0.08);

  /* ── Base Surfaces (Light) ── */
  --bg:           #f4f2ed;
  --bg-warm:      #faf8f4;
  --white:        #ffffff;
  --glass:        rgba(255,255,255,0.72);
  --glass-heavy:  rgba(255,255,255,0.85);
  --glass-border: rgba(0,0,0,0.06);
  --glass-hover:  rgba(255,255,255,0.9);

  /* ── Text ── */
  --text:         #1a1a2e;
  --text-secondary:#4a4a5a;
  --text-muted:   #8a8a9a;
  --text-dim:     #b0b0bc;

  /* ── Spacing & Radius ── */
  --r:    16px;
  --r-sm: 10px;
  --r-xs: 6px;
  --touch-min: 48px;

  /* ── Shadow ── */
  --shadow:    0 2px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.04);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.10);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 10% 20%, rgba(201,168,76,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 90% 80%, rgba(124,45,61,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(30,95,179,0.04) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

.app-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ══════════════════════════════════════════════
   LICENSE GATE
   ══════════════════════════════════════════════ */

.license-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.license-gate.hidden { display: none; }

.license-card {
  background: var(--glass-heavy);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  box-shadow: var(--shadow-xl);
  padding: 2.5rem;
  max-width: 460px;
  width: 100%;
  text-align: center;
}

.license-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.license-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  color: var(--text);
}

.license-body h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.license-body p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.license-body input {
  width: 100%;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.license-error {
  color: var(--danger) !important;
  font-size: 0.82rem !important;
  min-height: 1.2em;
  margin-top: 0.5rem !important;
  margin-bottom: 0 !important;
}

.license-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--gold-border);
}

/* ══════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════ */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem 0 0;
  background: rgba(255,255,255,0.78);
  backdrop-filter: blur(30px) saturate(1.5);
  -webkit-backdrop-filter: blur(30px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.6);
  border-top: 1.5px solid rgba(255,255,255,0.85);
  border-bottom: 2px solid var(--gold-border);
  border-radius: var(--r);
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-mark {
  width: 46px;
  height: 46px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 16px rgba(201,168,76,0.35);
}

.brand-text h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.brand-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-sub strong { color: var(--maroon); font-weight: 700; }

/* ── ConciURGE Logo ── */
.header-logo-img {
  height: 140px;
  width: auto;
  object-fit: contain;
  margin: -30px 0 -30px -8px;
}

.header-property {
  white-space: nowrap;
}

.conciurge-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  font-style: italic;
  color: var(--maroon);
  letter-spacing: 0.02em;
  line-height: 1;
}
.conciurge-title span {
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pending-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--warning-bg);
  border: 1px solid rgba(217,119,6,0.2);
  color: var(--warning);
  padding: 0.5rem 1rem;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  min-height: var(--touch-min);
}

.pending-dot {
  width: 8px; height: 8px;
  background: var(--warning);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

.clock {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ══════════════════════════════════════════════
   TAB NAVIGATION
   ══════════════════════════════════════════════ */

.tab-nav {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 2px;
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  min-height: var(--touch-min);
  border: 1px solid rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-muted);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  flex: 1;
  justify-content: center;
  font-family: inherit;
}

.tab-btn:hover {
  background: var(--glass-hover);
  color: var(--text-secondary);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.5);
}
.tab-btn:active { transform: translateY(0) scale(0.97); transition-duration: 0.08s; }

/* ── Per-tab colors (idle tint + active glow) ── */
.tab-btn[data-tab="log"]        { background: rgba(201,168,76,0.08); border-color: rgba(201,168,76,0.15); color: var(--gold-dark); }
.tab-btn[data-tab="pickup"]     { background: rgba(22,163,74,0.07);  border-color: rgba(22,163,74,0.12);  color: #15803d; }
.tab-btn[data-tab="dashboard"]  { background: rgba(30,95,179,0.07);  border-color: rgba(30,95,179,0.12);  color: var(--blue); }
.tab-btn[data-tab="shiftnotes"] { background: rgba(124,45,61,0.07);  border-color: rgba(124,45,61,0.12);  color: var(--maroon); }
.tab-btn[data-tab="stats"]      { background: rgba(109,40,217,0.07); border-color: rgba(109,40,217,0.12); color: #6d28d9; }
.tab-btn[data-tab="carriers"]   { background: rgba(6,182,212,0.07);  border-color: rgba(6,182,212,0.12);  color: #0891b2; }
.tab-btn[data-tab="residents"]  { background: rgba(234,88,12,0.07);  border-color: rgba(234,88,12,0.12);  color: #c2410c; }

.tab-btn.active[data-tab="log"]        { background: rgba(201,168,76,0.18); border-color: rgba(201,168,76,0.35); box-shadow: 0 4px 20px rgba(201,168,76,0.15), inset 0 1px 0 rgba(255,255,255,0.5); }
.tab-btn.active[data-tab="pickup"]     { background: rgba(22,163,74,0.15);  border-color: rgba(22,163,74,0.30);  box-shadow: 0 4px 20px rgba(22,163,74,0.12), inset 0 1px 0 rgba(255,255,255,0.5); }
.tab-btn.active[data-tab="dashboard"]  { background: rgba(30,95,179,0.15);  border-color: rgba(30,95,179,0.30);  box-shadow: 0 4px 20px rgba(30,95,179,0.12), inset 0 1px 0 rgba(255,255,255,0.5); }
.tab-btn.active[data-tab="shiftnotes"] { background: rgba(124,45,61,0.15);  border-color: rgba(124,45,61,0.30);  box-shadow: 0 4px 20px rgba(124,45,61,0.12), inset 0 1px 0 rgba(255,255,255,0.5); }
.tab-btn.active[data-tab="stats"]      { background: rgba(109,40,217,0.15); border-color: rgba(109,40,217,0.30); box-shadow: 0 4px 20px rgba(109,40,217,0.12), inset 0 1px 0 rgba(255,255,255,0.5); }
.tab-btn.active[data-tab="carriers"]   { background: rgba(6,182,212,0.15);  border-color: rgba(6,182,212,0.30);  box-shadow: 0 4px 20px rgba(6,182,212,0.12), inset 0 1px 0 rgba(255,255,255,0.5); }
.tab-btn.active[data-tab="residents"]  { background: rgba(234,88,12,0.15);  border-color: rgba(234,88,12,0.30);  box-shadow: 0 4px 20px rgba(234,88,12,0.12), inset 0 1px 0 rgba(255,255,255,0.5); }

/* ══════════════════════════════════════════════
   TAB CONTENT & PANELS
   ══════════════════════════════════════════════ */

.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-content { flex: 1; }

/* panel-card styles in GLASSMORPHIC OVERHAUL section below */

.panel-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.panel-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
}

/* ══════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════ */

.form-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.form-group { flex: 1; display: flex; flex-direction: column; }
.form-group.full { flex: 1 1 100%; }

.form-group label, .field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.optional { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: 0.5; }

input[type="text"],
input[type="email"],
input[type="tel"],
select {
  padding: 0.75rem 1rem;
  min-height: var(--touch-min);
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.select-lg { font-size: 1.1rem; padding: 0.85rem 1rem; min-height: 56px; }

/* ══════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.25rem;
  min-height: var(--touch-min);
  border: none;
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(201,168,76,0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: 0 10px 32px rgba(201,168,76,0.45);
  transform: translateY(-4px) scale(1.02);
}
.btn-gold:active { transform: translateY(-1px) scale(0.98); transition-duration: 0.08s; }

.btn-blue {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: white;
}

.btn-maroon {
  background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-light) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(124,45,61,0.2);
}
.btn-maroon:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(124,45,61,0.3); }

.btn-outline {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.12);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--bg-warm); }

.btn-danger-sm {
  background: var(--danger-bg);
  border: 1px solid rgba(220,38,38,0.15);
  color: var(--danger);
  min-height: 38px;
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-dim);
  font-size: 0.75rem;
  padding: 0.35rem 0.75rem;
  min-height: auto;
}

.btn-lg { padding: 0.85rem 1.5rem; font-size: 1rem; min-height: 54px; }
.btn-xl { padding: 1rem 2rem; font-size: 1.1rem; min-height: 58px; width: 100%; border-radius: var(--r); }

/* ── Form Progress Steps ── */
.form-progress {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
}

.progress-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(0,0,0,0.02);
  border-radius: var(--r-xs);
  transition: all 0.3s;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.progress-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: all 0.3s;
}

.progress-step.active {
  color: var(--maroon);
  background: var(--maroon-bg);
}

.progress-step.active .progress-num {
  background: var(--maroon);
  color: white;
}

.progress-step.done {
  color: var(--success);
  background: var(--success-bg);
}

.progress-step.done .progress-num {
  background: var(--success);
  color: white;
}

/* ── Table Pagination ── */
.pagination-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
}
.pagination-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}
.pagination-btn {
  min-height: 36px !important;
  padding: 0.3rem 0.8rem !important;
  font-size: 0.8rem !important;
}
.pagination-btn:disabled { opacity: 0.3; }

/* logSubmit:disabled styles in METALLIC MAROON section */

/* ══════════════════════════════════════════════
   LOG PACKAGE — Carrier Grid + Size Toggle
   ══════════════════════════════════════════════ */

.log-apt-display {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-sm);
  margin-bottom: 1.25rem;
}

.log-apt-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.log-apt-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--gold-dark);
}

.apt-clear {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.5rem;
  line-height: 1;
}

/* ── Searchable Resident Dropdown ── */
.resident-search-wrap {
  position: relative;
  margin-bottom: 0.75rem;
}

.resident-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.1);
  border-top: none;
  border-radius: 0 0 var(--r-sm) var(--r-sm);
  max-height: 240px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: var(--shadow-lg);
}

.resident-dropdown.open { display: block; }

.resident-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  min-height: var(--touch-min);
  cursor: pointer;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  transition: background 0.1s;
}

.resident-option:hover, .resident-option:active { background: var(--gold-bg); }

.resident-option-name { font-weight: 600; color: var(--text); }
.resident-option-apt { font-size: 0.82rem; color: var(--text-muted); }
.resident-option-badge {
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}

.resident-option-freq {
  background: var(--gold-bg);
  border: 1px solid var(--gold-border);
  color: var(--gold-dark);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  margin-left: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.carrier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 2.5rem;
  padding-bottom: 0.5rem;
}

.carrier-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.9rem 0.5rem;
  min-height: 90px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 2px solid rgba(0,0,0,0.05);
  border-radius: var(--r);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s, border-color 0.2s, background 0.2s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03), inset 0 1px 0 rgba(255,255,255,0.5);
}

.carrier-btn:hover {
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 14px 36px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.6);
}

.carrier-btn:active {
  transform: translateY(-2px) scale(0.98);
  transition-duration: 0.08s;
}

.carrier-logo-img {
  width: 80px;
  height: 52px;
  object-fit: contain;
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.carrier-logo-img.ups-logo {
  height: 58px;
}

.carrier-btn:hover .carrier-logo-img {
  transform: scale(1.2);
}

/* ── Carrier tooltip on hover ── */
.carrier-btn {
  position: relative;
}

.carrier-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: -32px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--text);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
}

.carrier-btn:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ══════════════════════════════════════════════
   METALLIC MAROON BUTTON + ANIMATED SHEEN
   ══════════════════════════════════════════════ */

.btn-metallic-maroon {
  background: rgba(124,45,61,0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--maroon);
  border: 2px solid rgba(124,45,61,0.25);
  box-shadow: 0 4px 16px rgba(124,45,61,0.08), inset 0 1px 0 rgba(255,255,255,0.4);
  font-weight: 800;
  letter-spacing: 0.03em;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.btn-metallic-maroon:hover {
  background: rgba(124,45,61,0.18);
  border-color: rgba(124,45,61,0.4);
  color: #5a1a28;
  transform: translateY(-5px) scale(1.03);
  box-shadow: 0 14px 40px rgba(124,45,61,0.18), inset 0 1px 0 rgba(255,255,255,0.5);
}

.btn-metallic-maroon:active {
  transform: translateY(3px) scale(0.96);
  box-shadow: 0 1px 4px rgba(124,45,61,0.15), inset 0 2px 6px rgba(124,45,61,0.12);
  background: rgba(124,45,61,0.22);
  transition-duration: 0.06s;
}

#logSubmit:disabled {
  background: rgba(0,0,0,0.04) !important;
  color: var(--text-dim) !important;
  border-color: rgba(0,0,0,0.06) !important;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

/* Enabled state — make it POP */
#logSubmit:not(:disabled) {
  animation: readyPulse 2s ease-in-out infinite;
}

@keyframes readyPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(124,45,61,0.08), inset 0 1px 0 rgba(255,255,255,0.4); }
  50% { box-shadow: 0 4px 24px rgba(124,45,61,0.2), 0 0 12px rgba(124,45,61,0.08), inset 0 1px 0 rgba(255,255,255,0.4); }
}

/* ── PLFR 1: Submit button loading state ── */
.btn-loading {
  pointer-events: none;
  position: relative;
  color: transparent !important;
}
.btn-loading::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border: 3px solid rgba(124,45,61,0.2);
  border-top-color: var(--maroon);
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
@keyframes btnSpin { to { transform: rotate(360deg); } }

/* Submit progress hint */
.submit-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  transition: all 0.3s;
  padding: 0.4rem;
  border-radius: var(--r-xs);
}
.submit-hint.ready {
  color: var(--success);
  font-weight: 700;
  background: var(--success-bg);
}

/* ── PLFR 2: Notification drawer animation ── */
.notif-drawer {
  display: block !important;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.notif-drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.notif-bell:hover {
  color: var(--maroon) !important;
  transform: scale(1.15) !important;
}

.notif-bell svg {
  transition: transform 0.2s;
}
.notif-bell:hover svg {
  transform: rotate(-15deg);
}

/* Empty state in drawer */
.notif-empty {
  padding: 1.25rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ── PLFR 3: Visual consistency ── */

/* Consistent tab active indicator bar */
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 3px;
  border-radius: 3px;
  background: currentColor;
  opacity: 0.4;
}
.tab-btn { position: relative; }

/* Smooth content transitions */
.panel-card, .chart-tile, .stat-card, .kpi-tile, .gauge-flip-tile {
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease, opacity 0.3s ease;
}

/* Better form input focus glow */
input:focus, select:focus, textarea:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px var(--gold-glow), 0 2px 8px rgba(201,168,76,0.1) !important;
}

/* Table row hover is more visible */
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: rgba(201,168,76,0.06) !important; }

/* Consistent border radius on all interactive elements */
.chip, .staff-btn, .size-btn, .carrier-btn {
  border-radius: var(--r-sm) !important;
}

/* Better disabled state for all buttons */
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* sheen removed */

.carrier-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}

.carrier-icon { font-size: 1.4rem; }

.carrier-btn:active { transform: scale(0.96); }

/* ── Carrier brand colors (idle tint + selected full) ── */

/* Amazon — Orange #FF9900 */
.carrier-btn[data-carrier="Amazon"]  { background: rgba(255,153,0,0.06); border-color: rgba(255,153,0,0.12); color: #b36b00; }
.carrier-btn[data-carrier="Amazon"].selected  { background: rgba(255,153,0,0.15); border-color: #ff9900; color: #cc7a00; box-shadow: 0 4px 20px rgba(255,153,0,0.18), inset 0 1px 0 rgba(255,255,255,0.4); }

/* USPS — Blue #004B87 + Red stripe */
.carrier-btn[data-carrier="USPS"]   { background: rgba(0,75,135,0.05); border-color: rgba(0,75,135,0.10); color: #004b87; }
.carrier-btn[data-carrier="USPS"].selected   { background: linear-gradient(180deg, rgba(0,75,135,0.12) 0%, rgba(227,24,55,0.06) 100%); border-color: #004b87; color: #004b87; box-shadow: 0 4px 20px rgba(0,75,135,0.15), inset 0 1px 0 rgba(255,255,255,0.4); }

/* UPS — Brown #351C15 + Gold */
.carrier-btn[data-carrier="UPS"]    { background: rgba(53,28,21,0.05); border-color: rgba(53,28,21,0.10); color: #351c15; }
.carrier-btn[data-carrier="UPS"].selected    { background: linear-gradient(180deg, rgba(255,181,0,0.12) 0%, rgba(53,28,21,0.08) 100%); border-color: #351c15; color: #351c15; box-shadow: 0 4px 20px rgba(53,28,21,0.12), inset 0 1px 0 rgba(255,255,255,0.4); }

/* FedEx — Purple #4D148C + Orange #FF6600 */
.carrier-btn[data-carrier="FedEx"]  { background: rgba(77,20,140,0.05); border-color: rgba(77,20,140,0.10); color: #4d148c; }
.carrier-btn[data-carrier="FedEx"].selected  { background: linear-gradient(135deg, rgba(77,20,140,0.12) 0%, rgba(255,102,0,0.08) 100%); border-color: #4d148c; color: #4d148c; box-shadow: 0 4px 20px rgba(77,20,140,0.15), inset 0 1px 0 rgba(255,255,255,0.4); }

/* DHL — Yellow #FFCC00 + Red #D40511 */
.carrier-btn[data-carrier="DHL"]    { background: rgba(212,5,17,0.04); border-color: rgba(212,5,17,0.08); color: #d40511; }
.carrier-btn[data-carrier="DHL"].selected    { background: linear-gradient(180deg, rgba(255,204,0,0.18) 0%, rgba(212,5,17,0.08) 100%); border-color: #d40511; color: #d40511; box-shadow: 0 4px 20px rgba(212,5,17,0.12), inset 0 1px 0 rgba(255,255,255,0.4); }

/* Other — Neutral gray */
.carrier-btn[data-carrier="Other"]  { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.06); color: var(--text-muted); }
.carrier-btn[data-carrier="Other"].selected  { background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.15); color: var(--text-secondary); box-shadow: 0 4px 16px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.4); }

/* Generic selected fallback removed — each carrier has its own */

.size-toggle {
  display: flex;
  gap: 0;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-bottom: 1.25rem;
}

.size-btn {
  flex: 1;
  padding: 0.7rem 0.5rem;
  min-height: var(--touch-min);
  background: var(--white);
  border: none;
  border-right: 1px solid rgba(0,0,0,0.06);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.size-btn:last-child { border-right: none; }
.size-btn:hover { background: rgba(0,0,0,0.03); transform: translateY(-2px); }
.size-btn:active { background: var(--bg); transform: translateY(0); }

.size-btn.selected {
  background: var(--maroon-bg);
  color: var(--maroon);
}

/* ── Note Chips ── */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.chip {
  padding: 0.45rem 0.85rem;
  min-height: 38px;
  background: var(--white);
  border: 1.5px solid rgba(0,0,0,0.08);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  -webkit-tap-highlight-color: transparent;
}

.chip:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 6px 18px rgba(0,0,0,0.08); }
.chip:active { transform: scale(0.93); }

.chip.selected {
  background: var(--maroon-bg);
  border-color: var(--maroon);
  color: var(--maroon);
  box-shadow: 0 0 0 2px var(--maroon-bg);
}

.custom-note-input {
  width: 100%;
  margin-bottom: 1rem;
  min-height: 40px;
  font-size: 0.88rem;
}

/* ── Tracking Row ── */
.tracking-row {
  margin-bottom: 1rem;
}

.tracking-row input {
  width: 100%;
}

/* ── Staff Grid ── */
.staff-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.staff-btn {
  padding: 0.55rem 1rem;
  min-height: 44px;
  background: var(--white);
  border: 2px solid rgba(0,0,0,0.06);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.staff-btn:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 22px rgba(0,0,0,0.08); }
.staff-btn:active { transform: scale(0.95); }

.staff-btn.selected {
  background: var(--blue-bg);
  border-color: var(--blue);
  color: var(--blue);
}

/* ── Undo Bar ── */
.undo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--text);
  color: var(--white);
  border-radius: var(--r-sm);
  margin-top: 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  animation: slideUp 0.3s ease;
}

.undo-btn {
  color: var(--gold-light) !important;
  border-color: rgba(201,168,76,0.3) !important;
  font-weight: 700 !important;
}

@keyframes slideUp {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ── Void Button (in table) ── */
.void-btn {
  background: none;
  border: 1px solid rgba(220,38,38,0.2);
  color: var(--danger);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  min-height: 28px;
}
.void-btn:hover { background: var(--danger-bg); }

/* ── Resident Search Row ── */
.res-search-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ── Size Icons ── */
.size-icon { display: block; font-size: 1rem; line-height: 1; }

/* ── Version Stamp ── */
.version-stamp {
  font-size: 0.65rem;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════
   7-RUN PLFR — Card Flips, Focus, Transitions
   ══════════════════════════════════════════════ */

/* ── KPI tiles — clickable, open detail modal ── */
.kpi-tile {
  cursor: pointer;
}

/* ── Run 3: Focus rings (accessibility) ── */
.tab-btn:focus-visible,
.carrier-btn:focus-visible,
.chip:focus-visible,
.staff-btn:focus-visible,
.size-btn:focus-visible,
.btn:focus-visible,
.pkg-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ── Run 6: Tab panel fade transition ── */
.tab-panel {
  animation: none;
}

.tab-panel.active {
  animation: tabFadeIn 0.3s ease;
}

@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Run 5: Sync status indicator ── */
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 0.35rem;
  vertical-align: middle;
}
.sync-dot.online { background: var(--success); }
.sync-dot.offline { background: var(--danger); }

/* ── Run 5: Onboarding overlay ── */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,15,25,0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 996;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.onboarding-card {
  background: var(--glass-heavy);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--r);
  padding: 2.5rem;
  max-width: 520px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.onboarding-card h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.onboarding-steps {
  text-align: left;
  margin: 1.25rem 0;
}

.onboarding-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.onboarding-num {
  width: 28px;
  height: 28px;
  min-width: 28px;
  background: var(--maroon);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

/* ── Run 7: Sellability — copyright bar, about link ── */
.copyright-bar {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.62rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

.help-link {
  color: var(--maroon);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.72rem;
  cursor: pointer;
}
.help-link:hover { text-decoration: underline; }

/* ── Run 4: Mobile minimum font floor ── */
@media (max-width: 767px) {
  .chip { font-size: 0.82rem; min-height: 40px; }
  .carrier-label { font-size: 0.72rem; }
  .chart-subtitle { font-size: 0.78rem; }
  .kpi-value { font-size: 1.4rem; }
  .stats-kpi-6 { grid-template-columns: repeat(3, 1fr); }
  .stats-chart-3 { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════
   10-LEVEL PLFR — Scorched Earth
   ══════════════════════════════════════════════ */

/* ── L3: Gradient border shimmer on panel cards ── */
.panel-card { position: relative; }
.panel-card::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: calc(var(--r) + 1px);
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(124,45,61,0.1), rgba(30,95,179,0.1), rgba(201,168,76,0.15));
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
}
.panel-card:hover::before { opacity: 1; }

/* ── L3: Pulsing glow on pending badge ── */
.pending-badge {
  animation: pendingGlow 2.5s ease-in-out infinite;
}
@keyframes pendingGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217,119,6,0); }
  50% { box-shadow: 0 0 16px 4px rgba(217,119,6,0.15); }
}

/* ── L3: Animated counter (KPI values) ── */
.kpi-value { transition: transform 0.3s; }
.kpi-tile:hover .kpi-value { transform: scale(1.08); }

/* ══════════════════════════════════════════════
   DYNAMIC STAT TILES — Float, Hover, Flip
   ══════════════════════════════════════════════ */

/* ── Idle floating animation (staggered) ── */
@keyframes tileFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Float animation ONLY on KPI tiles — NOT chart tiles (breaks canvas rendering) */
.kpi-tile {
  animation: tileFloat 4s ease-in-out infinite;
}

.kpi-tile:nth-child(1) { animation-delay: 0s; }
.kpi-tile:nth-child(2) { animation-delay: 0.5s; }
.kpi-tile:nth-child(3) { animation-delay: 1s; }
.kpi-tile:nth-child(4) { animation-delay: 1.5s; }
.kpi-tile:nth-child(5) { animation-delay: 2s; }
.kpi-tile:nth-child(6) { animation-delay: 2.5s; }

.kpi-tile:hover { animation-play-state: paused; }

/* Chart tiles get NO float animation (canvas compositing conflict) */
.chart-tile { animation: none !important; }

/* ── Super responsive hover ── */
.chart-tile {
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
}

.chart-tile:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 16px 48px rgba(0,0,0,0.10),
    inset 0 1px 0 rgba(255,255,255,0.7);
}

.chart-tile:active {
  transform: translateY(-2px) scale(0.99);
  transition-duration: 0.08s;
}

/* ── Chart tiles are clickable ── */
.chart-tile[data-chart] { cursor: pointer; }

/* Back overlay divs no longer needed in tiles — hidden */
.chart-back-overlay { display: none; }

/* ── Tile Detail Modal ── */
.tile-detail-card {
  max-width: 560px;
  width: 95%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 1.75rem;
}

.tile-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--gold-border);
}

.tile-detail-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  color: var(--maroon);
}

.chart-back-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--maroon);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.chart-back-section {
  margin-bottom: 0.75rem;
}

.chart-back-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.chart-back-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  border-bottom: 1px dotted rgba(0,0,0,0.05);
}

.chart-back-metric:last-child { border-bottom: none; }
.chart-back-metric span:first-child { color: var(--text-secondary); }
.chart-back-metric strong { color: var(--text); font-weight: 700; }

.chart-back-insight {
  margin-top: auto;
  padding: 0.6rem 0.8rem;
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.chart-flip-hint {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.6rem;
  color: var(--text-dim);
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
  pointer-events: none;
}

.chart-tile:hover .chart-flip-hint { opacity: 1; }

/* Full-width feedback tiles don't float */
.feedback-tile { animation: none !important; cursor: default !important; }
.feedback-tile:hover { transform: translateY(-4px) !important; }

/* ── Gauge flip tiles ── */
.gauge-flip-tile {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--r);
  padding: 1.25rem;
  box-shadow: 0 6px 28px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.4);
  perspective: 1000px;
  cursor: pointer;
  position: relative;
  animation: tileFloat 4s ease-in-out infinite;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.3s ease;
}
.gauge-flip-tile:nth-child(1) { animation-delay: 0s; }
.gauge-flip-tile:nth-child(2) { animation-delay: 0.6s; }
.gauge-flip-tile:nth-child(3) { animation-delay: 1.2s; }
.gauge-flip-tile:nth-child(4) { animation-delay: 1.8s; }

.gauge-flip-tile:hover {
  animation-play-state: paused;
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.7);
}
.gauge-flip-tile:hover .chart-flip-hint { opacity: 1; }

.gauge-flip-tile .chart-tile-inner {
  position: relative;
  width: 100%;
  transition: transform 0.65s cubic-bezier(0.34,1.56,0.64,1);
  transform-style: preserve-3d;
}
.gauge-flip-tile.flipped .chart-tile-inner { transform: rotateY(180deg); }

.gauge-flip-tile .chart-front,
.gauge-flip-tile .chart-back {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.gauge-flip-tile .chart-front {
  position: relative;
  z-index: 1;
}

.gauge-canvas {
  display: block;
  width: 100%;
  height: 140px;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.gauge-flip-tile .chart-front {
  min-height: 180px;
}

.gauge-flip-tile .chart-tile-inner {
  min-height: 180px;
}

.gauge-flip-tile .chart-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  padding: 0.75rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* ── Aging follow-up list ── */
.aging-list { display: flex; flex-direction: column; gap: 0.4rem; }

.aging-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.8rem;
  background: var(--white);
  border-radius: var(--r-xs);
  border-left: 3px solid var(--warning);
  font-size: 0.82rem;
}

.aging-item.overdue { border-left-color: var(--danger); background: rgba(220,38,38,0.03); }

.aging-item-name { font-weight: 600; color: var(--text); }
.aging-item-time { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); }
.aging-item-time.overdue { color: var(--danger); }

/* ── L4: Ripple effect on buttons ── */
.btn { position: relative; overflow: hidden; }
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: rippleAnim 0.5s ease-out;
  pointer-events: none;
}
@keyframes rippleAnim {
  to { transform: scale(4); opacity: 0; }
}

/* ── L4: Shake on error ── */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}
.shake { animation: shake 0.4s ease; }

/* ── L5: Trend arrows ── */
.kpi-trend {
  font-size: 0.7rem;
  font-weight: 700;
  margin-top: 0.15rem;
}
.kpi-trend.up { color: var(--success); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.flat { color: var(--text-dim); }

/* ── L8: Notification bell ── */
.notif-bell {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.3rem;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
  min-height: var(--touch-min);
  min-width: var(--touch-min);
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-bell:hover { color: var(--maroon); transform: scale(1.1); }
.notif-bell-count {
  position: absolute;
  top: 2px;
  right: 0;
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.notif-bell-count:empty { display: none; }

.notif-drawer {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--glass-heavy);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-xl);
  z-index: 100;
  display: none;
  padding: 0.5rem 0;
}
.notif-drawer.open { display: block; }

.notif-item {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.notif-item:last-child { border-bottom: none; }
.notif-item strong { color: var(--text); }
.notif-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.15rem; }

/* ── L9: Print watermark ── */
@media print {
  body::after {
    content: 'CONFIDENTIAL — ConciURGE™ by AXG Systems';
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 8pt;
    color: #999;
  }
}

/* ── L10: Backup/export modal ── */
.backup-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* ══════════════════════════════════════════════
   TRACKING LOOKUP
   ══════════════════════════════════════════════ */

.tracking-lookup-input {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tracking-result { min-height: 100px; }

.tracking-timeline {
  position: relative;
  padding-left: 1.5rem;
}

.tracking-event {
  position: relative;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 2px solid rgba(0,0,0,0.08);
  margin-left: 0;
  font-size: 0.85rem;
}

.tracking-event:first-child { border-color: var(--success); }

.tracking-event::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 0.7rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--glass-border);
  border: 2px solid var(--white);
}

.tracking-event:first-child::before {
  background: var(--success);
  box-shadow: 0 0 6px rgba(22,163,74,0.3);
}

.tracking-event-status {
  font-weight: 700;
  color: var(--text);
}

.tracking-event-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.tracking-event-time {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.tracking-status-badge {
  display: inline-block;
  padding: 0.3rem 0.75rem;
  border-radius: 14px;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.tracking-status-delivered { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.15); }
.tracking-status-transit { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(30,95,179,0.15); }
.tracking-status-exception { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220,38,38,0.15); }
.tracking-status-pending { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217,119,6,0.15); }

.track-link {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
}
.track-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════
   SETTINGS + COMPLIANCE
   ══════════════════════════════════════════════ */

.settings-section {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
}
.settings-section:last-of-type { border-bottom: none; }
.settings-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  margin-bottom: 0.15rem;
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
}
.toggle-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--maroon);
}

/* Waiver box in pickup flow */
.waiver-box {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  background: var(--bg-warm);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--maroon);
  border-radius: var(--r-xs);
}
.waiver-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.6rem;
}
.waiver-check {
  font-size: 0.82rem;
}

/* Settings tab color */
.tab-btn[data-tab="settings"] { background: rgba(100,100,100,0.06); border-color: rgba(100,100,100,0.1); color: #666; }
.tab-btn.active[data-tab="settings"] { background: rgba(100,100,100,0.12); border-color: rgba(100,100,100,0.25); box-shadow: 0 4px 20px rgba(100,100,100,0.1), inset 0 1px 0 rgba(255,255,255,0.5); }

/* ══════════════════════════════════════════════
   V2 FEATURES — Scanner, Camera, Kiosk, SMS
   ══════════════════════════════════════════════ */

/* ── Barcode Scanner ── */
.tracking-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.scan-btn {
  min-width: var(--touch-min);
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scanner-view {
  position: relative;
  border-radius: var(--r-sm);
  overflow: hidden;
  margin-top: 0.75rem;
  background: #000;
}

.scanner-view video {
  width: 100%;
  display: block;
  border-radius: var(--r-sm);
}

.scanner-overlay {
  position: absolute;
  inset: 0;
  border: 2px solid var(--gold);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.4);
  pointer-events: none;
}

.scanner-overlay::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 50%;
  height: 2px;
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
  animation: scanLine 2s ease-in-out infinite;
}

@keyframes scanLine {
  0%, 100% { transform: translateY(-40px); }
  50% { transform: translateY(40px); }
}

.scanner-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 5;
  background: rgba(0,0,0,0.6) !important;
  color: #fff !important;
  border: none !important;
  min-height: 36px;
  font-size: 0.8rem;
}

/* ── Photo Capture ── */
.photo-row {
  margin-bottom: 1rem;
}

.photo-btn {
  width: 100%;
  justify-content: center;
}

.photo-preview {
  position: relative;
  margin-top: 0.5rem;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid var(--gold-border);
}

.photo-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  display: block;
}

.photo-remove {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-snap {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  min-width: 140px;
}

/* ── Kiosk Mode ── */
.kiosk-panel {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.kiosk-header {
  margin-bottom: 1.5rem;
}

.kiosk-header h2 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.kiosk-search {
  font-size: 1.2rem !important;
  min-height: 60px !important;
  text-align: center;
}

.kiosk-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--glass-border);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Kiosk tab gets special color */
.tab-btn[data-tab="kiosk"] { background: rgba(201,168,76,0.08); border-color: rgba(201,168,76,0.15); color: var(--gold-dark); }
.tab-btn.active[data-tab="kiosk"] { background: rgba(201,168,76,0.18); border-color: rgba(201,168,76,0.35); box-shadow: 0 4px 20px rgba(201,168,76,0.15), inset 0 1px 0 rgba(255,255,255,0.5); }

/* ══════════════════════════════════════════════
   SUPER GLASSMORPHIC PANEL OVERHAUL
   ══════════════════════════════════════════════ */

.panel-card {
  background: rgba(255,255,255,0.68);
  backdrop-filter: blur(28px) saturate(1.4);
  -webkit-backdrop-filter: blur(28px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.55);
  border-top: 1.5px solid rgba(255,255,255,0.75);
  border-radius: var(--r);
  padding: 1.5rem;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.06),
    0 2px 8px rgba(0,0,0,0.03),
    inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease;
}

.panel-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 60px rgba(0,0,0,0.10),
    0 6px 16px rgba(0,0,0,0.05),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

/* Stat cards get deeper glass */
.stat-card {
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--r-sm);
  padding: 0.85rem;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05), inset 0 1px 0 rgba(255,255,255,0.6);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease;
}
.stat-card:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 16px 44px rgba(0,0,0,0.12), inset 0 1px 0 rgba(255,255,255,0.8); }

/* ══════════════════════════════════════════════
   STATS DASHBOARD — KPI Tiles (colorful, upper)
   ══════════════════════════════════════════════ */

.stats-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.stats-kpi-6 { grid-template-columns: repeat(6, 1fr); }

.stats-gauge-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.chart-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: -0.5rem;
  margin-bottom: 0.75rem;
}

.kpi-purple {
  background: linear-gradient(135deg, rgba(109,40,217,0.15) 0%, rgba(109,40,217,0.04) 100%);
  border-color: rgba(109,40,217,0.2);
}
.kpi-purple .kpi-value { color: #6d28d9; }

.kpi-orange {
  background: linear-gradient(135deg, rgba(234,88,12,0.12) 0%, rgba(234,88,12,0.03) 100%);
  border-color: rgba(234,88,12,0.18);
}
.kpi-orange .kpi-value { color: #c2410c; }

.kpi-tile {
  position: relative;
  padding: 1.25rem;
  border-radius: var(--r);
  text-align: center;
  overflow: hidden;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.3);
  box-shadow:
    0 8px 32px rgba(0,0,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease;
}

.kpi-tile:hover {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 24px 60px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,0.6);
}

.kpi-gold {
  background: linear-gradient(135deg, rgba(201,168,76,0.18) 0%, rgba(201,168,76,0.06) 100%);
  border-color: rgba(201,168,76,0.25);
}
.kpi-gold .kpi-value { color: var(--gold-dark); }

.kpi-blue {
  background: linear-gradient(135deg, rgba(30,95,179,0.15) 0%, rgba(30,95,179,0.04) 100%);
  border-color: rgba(30,95,179,0.2);
}
.kpi-blue .kpi-value { color: var(--blue); }

.kpi-maroon {
  background: linear-gradient(135deg, rgba(124,45,61,0.15) 0%, rgba(124,45,61,0.04) 100%);
  border-color: rgba(124,45,61,0.2);
}
.kpi-maroon .kpi-value { color: var(--maroon); }

.kpi-green {
  background: linear-gradient(135deg, rgba(22,163,74,0.12) 0%, rgba(22,163,74,0.03) 100%);
  border-color: rgba(22,163,74,0.18);
}
.kpi-green .kpi-value { color: var(--success); }

.kpi-value { font-size: 2.2rem; font-weight: 800; line-height: 1.1; }
.kpi-label { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-top: 0.2rem; }
.kpi-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ══════════════════════════════════════════════
   CHART TILES (lower, deeper shading)
   ══════════════════════════════════════════════ */

.stats-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.chart-tile {
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--r);
  padding: 1.25rem;
  box-shadow:
    0 6px 28px rgba(0,0,0,0.06),
    0 2px 8px rgba(0,0,0,0.03),
    inset 0 -2px 8px rgba(0,0,0,0.02),
    inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease;
}

.chart-tile:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 18px 50px rgba(0,0,0,0.11), inset 0 1px 0 rgba(255,255,255,0.6);
}

.chart-tile-wide { grid-column: span 1; }

.chart-tile h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin-top: 0.75rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   FEEDBACK
   ══════════════════════════════════════════════ */

.feedback-tile {
  grid-column: 1 / -1;
}

.stats-actions-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0.5rem;
}

/* ── Report Modal ── */
.report-modal {
  max-width: 800px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--gold-border);
}

.report-actions-top { display: flex; gap: 0.5rem; }

.report-body h4 {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: var(--maroon);
  margin: 1.5rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--glass-border);
}

.report-body h4:first-child { margin-top: 0; }

.report-metric {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.9rem;
  border-bottom: 1px dotted rgba(0,0,0,0.06);
}

.report-metric-label { color: var(--text-secondary); }
.report-metric-value { font-weight: 700; color: var(--text); }

.report-suggestion {
  padding: 0.75rem 1rem;
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--r-xs) var(--r-xs) 0;
  margin: 0.5rem 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.report-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px solid var(--gold-border);
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dim);
}

@media print {
  .report-modal { max-width: 100%; max-height: none; box-shadow: none; border: none; }
  .report-actions-top, .stats-actions-row { display: none !important; }
}

.feedback-modal-card { text-align: center; }

.star-rating {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.star {
  font-size: 2.5rem;
  background: none;
  border: none;
  color: rgba(0,0,0,0.1);
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
  padding: 0;
  line-height: 1;
}

.star:hover, .star.active { color: var(--gold); transform: scale(1.15); }

.feedback-list { display: flex; flex-direction: column; gap: 0.5rem; }

.feedback-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 0.85rem 1rem;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.04);
  border-radius: var(--r-sm);
}

.feedback-stars { color: var(--gold); font-size: 0.9rem; white-space: nowrap; }
.feedback-body { flex: 1; }
.feedback-body-name { font-weight: 700; font-size: 0.85rem; }
.feedback-body-text { font-size: 0.88rem; color: var(--text-secondary); margin-top: 0.15rem; }
.feedback-body-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.2rem; }

.expand-panel {
  padding: 1rem;
  background: var(--bg-warm);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-sm);
  margin-bottom: 1rem;
}

/* ══════════════════════════════════════════════
   ANALYTICS
   ══════════════════════════════════════════════ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}

/* stat-card base styles in GLASSMORPHIC OVERHAUL section above */

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gold-dark);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.15rem;
}

.stat-warning .stat-value { color: var(--warning); }
.stat-danger .stat-value  { color: var(--danger); }
.stat-blue .stat-value    { color: var(--blue); font-size: 1.1rem; }

/* ══════════════════════════════════════════════
   DASHBOARD / TABLES
   ══════════════════════════════════════════════ */

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dashboard-actions { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.search-input { width: 180px; }

.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }

thead th {
  text-align: left;
  padding: 0.65rem 0.75rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-dark);
  border-bottom: 2px solid var(--gold-border);
  white-space: nowrap;
  background: var(--bg-warm);
}

tbody td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  vertical-align: middle;
}

tbody tr:hover { background: rgba(201,168,76,0.04); }

.status-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.status-pending  { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(217,119,6,0.15); }
.status-picked-up { background: var(--success-bg); color: var(--success); border: 1px solid rgba(22,163,74,0.15); }
.status-overdue  { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(220,38,38,0.15); }

/* ══════════════════════════════════════════════
   PICKUP TAB
   ══════════════════════════════════════════════ */

.pending-packages-list { margin: 1rem 0; }

.pkg-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  min-height: 60px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: var(--r-sm);
  margin-bottom: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
}

.pkg-item:hover { transform: translateY(-4px) scale(1.01); box-shadow: 0 12px 32px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.5); }
.pkg-item:active { transform: translateY(-1px) scale(0.99); }

.pkg-item.selected {
  border-color: var(--gold);
  background: var(--gold-bg);
}

.pkg-item-info { display: flex; gap: 1.25rem; font-size: 0.88rem; flex-wrap: wrap; }
.pkg-item-info span { color: var(--text-muted); }
.pkg-item-info strong { color: var(--text); }

.pkg-item input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--gold); }

/* Signature */
.signature-section { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--glass-border); }

.signature-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.sig-toggle {
  display: flex;
  gap: 0;
  margin: 0.75rem 0;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-sm);
  overflow: hidden;
  width: fit-content;
}

.sig-toggle-btn {
  padding: 0.6rem 1.25rem;
  min-height: var(--touch-min);
  background: var(--white);
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.sig-toggle-btn + .sig-toggle-btn { border-left: 1px solid rgba(0,0,0,0.06); }

.sig-toggle-btn.active { background: var(--gold-bg); color: var(--gold-dark); }

.signature-pad-wrapper {
  background: var(--white);
  border-radius: var(--r-sm);
  overflow: hidden;
  margin: 0.75rem 0;
  border: 2px solid var(--gold-border);
}

.signature-pad-wrapper canvas { display: block; width: 100%; cursor: crosshair; touch-action: none; }

.typed-sig-input {
  width: 100%;
  padding: 1rem;
  font-size: 1.5rem;
  font-family: 'Brush Script MT', 'Segoe Script', cursive;
  font-style: italic;
  background: var(--white);
  border: 2px solid var(--gold-border);
  border-radius: var(--r-sm);
  color: var(--text);
  margin: 0.75rem 0;
  min-height: 60px;
}

.typed-sig-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }

.sig-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* ══════════════════════════════════════════════
   RESIDENTS — CSV Import
   ══════════════════════════════════════════════ */

.residents-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.residents-actions { display: flex; gap: 0.5rem; flex-shrink: 0; }

.csv-preview {
  background: var(--bg-warm);
  border: 2px solid var(--maroon-border);
  border-radius: var(--r-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.csv-preview-header { margin-bottom: 0.75rem; }
.csv-preview-header h3 { font-size: 1rem; font-weight: 700; color: var(--maroon); }

.csv-preview-actions { display: flex; gap: 0.5rem; margin-top: 1rem; justify-content: flex-end; }

/* ══════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════ */

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 2.5rem;
  font-size: 0.9rem;
}

/* ══════════════════════════════════════════════
   FOOTER — AXG Systems
   ══════════════════════════════════════════════ */

.app-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  margin-top: 0.75rem;
  border-top: 2px solid var(--gold-border);
}

.footer-powered { display: flex; flex-direction: column; gap: 0.1rem; }

.footer-label {
  font-size: 0.62rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.footer-brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 40%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 6px rgba(201,168,76,0.3));
}

.footer-right { display: flex; align-items: center; gap: 1rem; }

.license-info { font-size: 0.7rem; color: var(--text-dim); }

/* ══════════════════════════════════════════════
   TOAST
   ══════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 0.85rem 1.25rem;
  border-radius: var(--r-sm);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 3.5s forwards;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  background: var(--white);
}

.toast-success { border-color: rgba(22,163,74,0.25); color: var(--success); }
.toast-info    { border-color: rgba(30,95,179,0.25); color: var(--blue); }
.toast-warning { border-color: rgba(217,119,6,0.25); color: var(--warning); }
.toast-error   { border-color: rgba(220,38,38,0.25); color: var(--danger); }

@keyframes toastIn  { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ══════════════════════════════════════════════
   SUCCESS OVERLAY
   ══════════════════════════════════════════════ */

.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(244,242,237,0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.success-overlay.show { opacity: 1; pointer-events: auto; }

.success-content { text-align: center; animation: popIn 0.4s ease; }

.success-check {
  width: 96px; height: 96px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 8px 40px rgba(201,168,76,0.4);
  color: white;
}

.success-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.success-content p { color: var(--text-secondary); font-size: 0.95rem; }

@keyframes popIn {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

/* ══════════════════════════════════════════════
   PICKUP CELEBRATION
   ══════════════════════════════════════════════ */

.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15,15,25,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

.celebration-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

#confettiCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.celebration-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 3.5rem 3rem;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(40px) saturate(1.5);
  -webkit-backdrop-filter: blur(40px) saturate(1.5);
  border: 1px solid rgba(255,255,255,0.5);
  border-top: 2px solid rgba(255,255,255,0.8);
  border-radius: 32px;
  box-shadow:
    0 32px 100px rgba(0,0,0,0.15),
    0 0 80px rgba(201,168,76,0.08),
    inset 0 1px 0 rgba(255,255,255,0.6);
  max-width: 620px;
  width: 70vw;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.celebration-emoji {
  font-size: 5.5rem;
  line-height: 1;
  margin-bottom: 1.25rem;
  animation: celebBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes celebBounce {
  0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
  50%  { transform: scale(1.35) rotate(6deg); }
  70%  { transform: scale(0.92) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.celebration-greeting {
  font-family: 'Playfair Display', serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.2;
  animation: celebFade 0.5s ease 0.15s both;
}

.celebration-sub {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 0.75rem;
  animation: celebFade 0.5s ease 0.3s both;
}

.celebration-time {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  animation: celebFade 0.5s ease 0.45s both;
}

@keyframes celebFade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
  .celebration-content {
    width: 92vw;
    max-width: none;
    min-height: 40vh;
    padding: 2.5rem 1.5rem;
    border-radius: 24px;
  }
  .celebration-greeting { font-size: 2rem; }
  .celebration-emoji { font-size: 4.5rem; }
}

/* ══════════════════════════════════════════════
   TEXTAREA
   ══════════════════════════════════════════════ */

textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  min-height: 80px;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: var(--r-sm);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.2s, box-shadow 0.2s;
}
textarea:focus { outline:none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }

/* ══════════════════════════════════════════════
   SHIFT NOTES
   ══════════════════════════════════════════════ */

.staff-grid-sm { gap: 0.3rem; }
.staff-grid-sm .staff-btn { padding: 0.4rem 0.7rem; min-height: 38px; font-size: 0.8rem; }

.shift-notes-list { margin-top: 1.25rem; }

.shift-note {
  padding: 1rem 1.25rem;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.45);
  border-left: 4px solid var(--maroon);
  border-radius: var(--r-sm);
  margin-bottom: 0.6rem;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.shift-note:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.07); }

.shift-note:hover { box-shadow: var(--shadow); }

.shift-note.pinned {
  border-left-color: var(--gold);
  background: var(--gold-bg);
}

.shift-note-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.shift-note-from {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--maroon);
}

.shift-note-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.shift-note-body {
  font-size: 0.92rem;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.shift-note-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.note-action-btn {
  background: none;
  border: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  font-family: inherit;
}
.note-action-btn:hover { color: var(--maroon); }

/* ══════════════════════════════════════════════
   CARRIER DIRECTORY
   ══════════════════════════════════════════════ */

.carrier-directory {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.carrier-card {
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.5);
  border-top: 1.5px solid rgba(255,255,255,0.7);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 6px 28px rgba(0,0,0,0.06), inset 0 1px 0 rgba(255,255,255,0.5);
  transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.25s ease;
}

.carrier-card:hover { transform: translateY(-6px) scale(1.015); box-shadow: 0 18px 50px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.6); }

.carrier-card-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.15rem;
  background: var(--bg-warm);
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.carrier-card-icon { font-size: 1.4rem; }
.carrier-card-header h3 { font-size: 1rem; font-weight: 800; color: var(--text); }

.carrier-dir-logo {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.carrier-card-body { padding: 0.5rem 0; }

.carrier-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.55rem 1.15rem;
  border-bottom: 1px solid rgba(0,0,0,0.03);
  min-height: 44px;
}

.carrier-line:last-child { border-bottom: none; }

.carrier-line-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.carrier-phone {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
}

.carrier-phone:hover { text-decoration: underline; }

.carrier-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--maroon);
  text-decoration: none;
}
.carrier-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════
   LOST PACKAGE MODAL
   ══════════════════════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,15,25,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.modal-card {
  background: var(--glass-heavy);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid var(--glass-border);
  border-radius: var(--r);
  padding: 2rem;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-xl);
}

.modal-card h3 { font-family: 'Playfair Display',serif; font-size: 1.2rem; margin-bottom: 0.25rem; }

/* ── Lost status badge ── */
.status-lost { background: rgba(139,69,19,0.08); color: #8b4513; border: 1px solid rgba(139,69,19,0.15); }
.stat-lost .stat-value { color: #8b4513; }

/* ══════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════ */

@media (min-width: 768px) and (max-width: 1024px) {
  .app-container { padding: 1rem; }
  .carrier-grid { gap: 0.75rem; }
  .carrier-btn { min-height: 80px; }
}

@media (min-width: 1024px) {
  .carrier-grid { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 767px) {
  .app-header { flex-direction: column; gap: 0.75rem; padding: 1rem; text-align: center; }
  .header-brand { flex-direction: column; gap: 0.5rem; }
  .app-title-block { border-left: none; padding-left: 0; }
  .conciurge-title { font-size: 1.4rem; }
  .carrier-directory { grid-template-columns: 1fr; }
  .stats-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .stats-kpi-6 { grid-template-columns: repeat(3, 1fr); }
  .stats-gauge-row { grid-template-columns: repeat(2, 1fr); }
  .stats-chart-row { grid-template-columns: 1fr; }
  .chart-tile-wide { grid-column: span 1; }
  .kpi-value { font-size: 1.6rem; }
  .header-status { justify-content: center; flex-wrap: wrap; }

  .tab-btn { flex: none; padding: 0.65rem 0.85rem; font-size: 0.8rem; }
  .tab-btn svg { width: 16px; height: 16px; }

  .form-row { flex-direction: column; gap: 0.75rem; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }

  .dashboard-header { flex-direction: column; align-items: stretch; }
  .dashboard-actions { flex-direction: column; }
  .search-input { width: 100%; }

  .pkg-item { flex-direction: column; gap: 0.75rem; align-items: stretch; }
  .pkg-item-info { gap: 0.75rem; }

  .carrier-grid { grid-template-columns: repeat(3, 1fr); }
  .residents-header { flex-direction: column; }
  .app-footer { flex-direction: column; gap: 0.75rem; text-align: center; }
  .footer-right { justify-content: center; }
}

/* ══════════════════════════════════════════════
   PRINT
   ══════════════════════════════════════════════ */

@media print {
  .license-gate, .tab-nav, .toast-container, .btn, .dashboard-actions,
  .signature-section, form, .success-overlay, .stats-row,
  #resetDemoBtn, .footer-right, .csv-preview { display: none !important; }
  body { background: white; }
  .app-header { box-shadow: none; border: none; backdrop-filter: none; }
  .panel-card { background: white; box-shadow: none; backdrop-filter: none; border: 1px solid #ddd; }
  .tab-panel { display: block !important; }
  #tab-dashboard { display: block !important; }
  #tab-log, #tab-pickup, #tab-residents { display: none !important; }
  table { font-size: 9pt; }
  thead th { color: #333; border-bottom: 2px solid #333; background: #f5f5f5; }
}
