/* ==========================================================
   RUMAH AIRMAN - DARK THEME DESIGN SYSTEM (GLASSMORPHISM)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;700&display=swap');

:root {
  --bg-main: #0a0e17;
  --bg-card: rgba(18, 24, 38, 0.85);
  --bg-card-hover: rgba(24, 32, 50, 0.95);
  --bg-input: #101622;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-active: rgba(245, 158, 11, 0.4);
  
  --primary: #f59e0b; /* Industrial Amber */
  --primary-glow: rgba(245, 158, 11, 0.25);
  --primary-hover: #d97706;
  
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-blue: #3b82f6;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 0 1px 1px rgba(255, 255, 255, 0.05);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(6, 182, 212, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================
   FULL SCREEN LOCATION SELECTION OVERLAY
   ========================================================== */
.location-select-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 12, 20, 0.92);
  backdrop-filter: blur(24px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s ease;
}

.location-select-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.location-select-card {
  background: #111726;
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 2rem;
  width: 100%;
  max-width: 620px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.8), 0 0 40px rgba(245, 158, 11, 0.1);
  text-align: center;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.location-select-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.location-select-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f59e0b, #9a3412);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
}

.location-select-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.location-select-subtitle {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.location-prompt-box {
  margin-bottom: 1.75rem;
}

.location-prompt-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
}

.location-prompt-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.location-cards-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .location-cards-choice-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

.location-choice-card {
  background: #172033;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.25rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.location-choice-card:hover {
  background: #1f2b44;
  border-color: var(--primary);
  transform: translateY(-4px);
  box-shadow: 0 12px 25px -5px rgba(245, 158, 11, 0.25);
}

.loc-card-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(245, 158, 11, 0.15);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.loc-card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.loc-card-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
}

.loc-card-detail {
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
  flex: 1;
}

.loc-card-arrow {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
}

.location-select-footer {
  font-size: 0.78rem;
  color: var(--text-dim);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 1rem;
}

/* App Container */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 1rem 5rem 1rem;
}

/* ==========================================================
   HEADER & LOCATION SELECTOR
   ========================================================== */
.app-header {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #f59e0b, #b45309);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* Location Switcher */
.location-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #0f1522;
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.location-tab {
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.location-tab.active {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.location-tab.active .loc-dot {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary);
}

.loc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.2s;
}

/* ==========================================================
   LIVE SHIFT BANNER
   ========================================================== */
.shift-banner {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.6), rgba(15, 23, 42, 0.8));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
}

.shift-info-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.shift-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.shift-badge.locked {
  background: rgba(244, 63, 94, 0.15);
  color: var(--accent-rose);
  border-color: rgba(244, 63, 94, 0.3);
}

.shift-date-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}

.shift-time-range {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.shift-countdown-box {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  min-width: 145px;
}

.countdown-content {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  width: 100%;
}

.countdown-main {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.countdown-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.countdown-time {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.countdown-time.urgent {
  color: var(--accent-rose);
  text-shadow: 0 0 10px rgba(244, 63, 94, 0.6);
  animation: blinkUrgent 1s infinite;
}

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

.countdown-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.2;
}

.countdown-subtext {
  font-size: 0.62rem;
  color: var(--text-dim);
  line-height: 1.2;
}

/* ==========================================================
   FORM GLOBAL (OPERATOR & SUHU RUANGAN)
   ========================================================== */
.global-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input[readonly] {
  background: rgba(15, 23, 42, 0.4);
  color: var(--text-muted);
  cursor: not-allowed;
}

textarea.form-input {
  resize: vertical;
  min-height: 76px;
  line-height: 1.45;
  font-family: var(--font-sans);
}

/* Room Temperature Photo Box */
.room-temp-photo-wrapper {
  width: 100%;
  min-height: 120px;
  position: relative;
}

.room-temp-empty-box {
  width: 100%;
  min-height: 120px;
  border: 2px dashed rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: rgba(16, 22, 34, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.room-temp-empty-box:hover {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.15);
}

.room-temp-empty-icon {
  font-size: 1.75rem;
  margin-bottom: 0.2rem;
}

.room-temp-empty-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
}

.room-temp-empty-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

.room-temp-filled-box {
  width: 100%;
  height: 140px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(245, 158, 11, 0.3);
  background: #090d15;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.room-temp-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.room-temp-filled-box:hover .room-temp-img {
  transform: scale(1.04);
}

.room-temp-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(16, 185, 129, 0.9);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* ==========================================================
   UNIT AIRMAN SECTION & CARDS
   ========================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-count {
  background: var(--primary);
  color: #000;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
}

.unit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
  position: relative;
  transition: all 0.25s ease;
}

.unit-card:hover {
  border-color: rgba(245, 158, 11, 0.25);
}

.unit-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.unit-title-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.unit-prefix-tag {
  background: rgba(245, 158, 11, 0.15);
  color: var(--primary);
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.unit-number-input {
  width: 90px;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
}

.btn-remove-unit {
  background: rgba(244, 63, 94, 0.12);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 1.05rem;
}

.btn-remove-unit:hover {
  background: rgba(244, 63, 94, 0.25);
  border-color: var(--accent-rose);
  transform: scale(1.08);
  box-shadow: 0 2px 10px rgba(244, 63, 94, 0.3);
}

/* HM Grid */
.hm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 580px) {
  .hm-grid {
    grid-template-columns: 1fr;
  }
}

.hm-box {
  background: #0d121c;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.hm-box.total-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(180, 83, 9, 0.05));
  border-color: rgba(245, 158, 11, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hm-total-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
}

/* Percentage Step Buttons Grid */
.liquids-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  width: 100%;
}

@media (min-width: 820px) {
  .liquids-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.liquid-item {
  background: #0d131f;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  min-width: 0; /* Mencegah overflow pada CSS Grid */
  overflow: hidden;
  box-sizing: border-box;
}

.liquid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.liquid-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.liquid-val-badge {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--primary);
  background: rgba(245, 158, 11, 0.15);
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

/* 11 Pills Stepper Buttons (0% - 100%) */
.stepper-pills {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 3px;
  width: 100%;
  box-sizing: border-box;
}

.pill-btn {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0;
  background: #161e2e;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  color: #7e8ea6;
  font-size: 0.62rem;
  font-weight: 700;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.pill-btn:hover {
  background: #25334c;
  color: var(--text-main);
  border-color: rgba(245, 158, 11, 0.4);
}

.pill-btn.active {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 800;
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* ==========================================================
   PHOTO UPLOAD SLOTS INSIDE UNIT CARD
   ========================================================== */
.photos-section {
  background: #0d121c;
  border-radius: var(--radius-md);
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

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

.photos-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-add-photo {
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s;
}

.btn-add-photo:hover {
  background: var(--accent-cyan);
  color: #000;
}

.photo-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.photo-item-card {
  background: #141c2c;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
  display: flex;
  flex-direction: column;
}

.photo-preview-box {
  width: 100%;
  height: 140px;
  background: #090d15;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.photo-preview-img:hover {
  transform: scale(1.05);
}

.photo-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.3);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.95rem;
  z-index: 10;
}

.photo-delete-btn:hover {
  background: var(--accent-rose);
  color: #fff;
  border-color: var(--accent-rose);
  box-shadow: 0 0 14px rgba(244, 63, 94, 0.6);
  transform: scale(1.08);
}

.delete-photo-preview-box {
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.25rem;
  background: #090d15;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.delete-photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.btn-danger {
  background: linear-gradient(135deg, #f43f5e, #be123c);
  color: #fff;
  box-shadow: 0 4px 15px rgba(244, 63, 94, 0.35);
}

.btn-danger:hover {
  background: #e11d48;
  box-shadow: 0 6px 20px rgba(244, 63, 94, 0.55);
  transform: translateY(-1px);
}

.photo-caption-input {
  padding: 0.5rem 0.65rem;
  background: transparent;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 0.8rem;
  outline: none;
}

.photo-caption-input:focus {
  background: rgba(255, 255, 255, 0.03);
}

/* Uploading Skeleton Overlay */
.photo-uploading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 700;
}

/* ==========================================================
   BOTTOM ACTION BAR & FLOATING CONTROLS
   ========================================================== */
.btn-add-unit-big {
  width: 100%;
  padding: 1rem;
  background: rgba(245, 158, 11, 0.08);
  border: 2px dashed rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  color: var(--primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  transition: all 0.2s;
}

.btn-add-unit-big:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.action-bar-sticky {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(10, 14, 23, 0.9);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 0.85rem 1rem;
  z-index: 100;
}

.action-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  width: 100%;
}

.actions-group-full {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  width: 100%;
}

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

.btn-main {
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--text-muted);
}

.btn-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
}

.btn-whatsapp:hover {
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
}

/* ==========================================================
   MODAL STYLES (DIAL PAD PIN 921, HISTORY, SETTINGS)
   ========================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  background: #121826;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-backdrop.open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-body {
  padding: 1.5rem;
}

/* Dial Pad Keypad */
.pin-display-wrapper {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--text-dim);
  background: transparent;
  transition: all 0.2s;
}

.pin-dot.filled {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary);
}

.dialpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-width: 280px;
  margin: 0 auto;
}

.dial-btn {
  height: 60px;
  border-radius: var(--radius-md);
  background: #182236;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.dial-btn:hover {
  background: #253350;
  border-color: var(--primary);
}

.dial-btn:active {
  transform: scale(0.92);
  background: var(--primary);
  color: #000;
}

.dial-btn.action-btn {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Shake Animation for Invalid PIN */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

.shake {
  animation: shake 0.4s ease-in-out;
}

/* History Item Card */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  background: #161e30;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s;
}

.history-item:hover {
  border-color: var(--primary);
  background: #1c263c;
  transform: translateX(4px);
}

/* Photo Source Modal Options */
.photo-source-options {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.source-opt-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.15rem;
  background: #161e30;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.source-opt-btn:hover, .source-opt-btn:active {
  border-color: var(--primary);
  background: rgba(245, 158, 11, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.2);
}

.source-opt-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.source-opt-info {
  flex: 1;
}

.source-opt-title {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.2rem;
}

.source-opt-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
}

.source-opt-arrow {
  font-size: 1rem;
  color: var(--primary);
  font-weight: 700;
}

/* ==========================================================
   SUCCESS MODAL (PREMIUM GLASSMORPHISM & ANIMATION)
   ========================================================== */
.success-modal-card {
  max-width: 440px;
  text-align: center;
  border-color: rgba(16, 185, 129, 0.4);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(16, 185, 129, 0.2);
  padding: 2rem 1.5rem 1.5rem 1.5rem;
}

.success-glow-ring {
  width: 72px;
  height: 72px;
  margin: 0 auto 1.25rem auto;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
  animation: pulseGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.55);
  }
}

.success-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.success-check-svg {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawCheck 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards 0.2s;
}

@keyframes drawCheck {
  to {
    stroke-dashoffset: 0;
  }
}

.success-modal-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.35rem;
}

.success-modal-subtitle {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.success-details-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.success-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.success-detail-label {
  color: var(--text-muted);
  font-weight: 500;
}

.success-detail-val {
  color: #fff;
  font-weight: 700;
}

.success-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* ==========================================================
   GLOBAL TOAST NOTIFICATIONS
   ========================================================== */
.toast-container {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 1000;
  pointer-events: none;
  max-width: 90vw;
  width: 380px;
}

.toast-item {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(-20px) scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast-item.hide {
  transform: translateY(-15px) scale(0.9);
  opacity: 0;
}

.toast-success {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(6, 44, 33, 0.95);
}

.toast-error {
  border-color: rgba(244, 63, 94, 0.5);
  background: rgba(50, 13, 24, 0.95);
}

.toast-info {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(45, 26, 6, 0.95);
}

.toast-icon {
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* ==========================================================
   FULLSCREEN IMAGE LIGHTBOX WITH ZOOM & PAN
   ========================================================== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 16, 0.95);
  backdrop-filter: blur(18px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s ease;
}

.lightbox-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 10;
  gap: 1rem;
}

.lightbox-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.lightbox-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-caption {
  font-size: 0.8rem;
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lightbox-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.lightbox-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  transition: all 0.2s ease;
}

.lightbox-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.lightbox-btn-close {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.4);
  color: #fecdd3;
}

.lightbox-btn-close:hover {
  background: rgba(244, 63, 94, 0.4);
  border-color: var(--accent-rose);
  color: #fff;
}

.lightbox-zoom-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 48px;
  text-align: center;
}

.lightbox-viewport {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
  user-select: none;
}

.lightbox-viewport.dragging {
  cursor: grabbing;
}

.lightbox-img-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
  transform-origin: center center;
}

#lightboxImage {
  max-width: 92vw;
  max-height: 78vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  pointer-events: auto;
}

.lightbox-bottom-hints {
  padding: 0.5rem 1rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  background: rgba(10, 15, 28, 0.75);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
  .lightbox-top-bar {
    padding: 0.6rem 0.85rem;
  }
  .lightbox-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
  }
  .lightbox-title {
    font-size: 0.88rem;
  }
  .lightbox-caption {
    font-size: 0.75rem;
  }
  .lightbox-bottom-hints {
    font-size: 0.68rem;
    padding: 0.4rem 0.6rem;
  }
}

/* ==========================================================
   PRINT STYLES (PDF OPTIMIZED)
   ========================================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .app-header, .action-bar-sticky, .location-switcher, .header-actions, .btn-add-unit-big, .btn-remove-unit, .btn-add-photo, .photo-delete-btn {
    display: none !important;
  }
  .unit-card, .global-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
    background: #fff !important;
    color: #000 !important;
    page-break-inside: avoid;
  }
}
