/* ==========================================================
   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);
}

.wita-clock-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.wita-time {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.wita-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-dim);
}

/* ==========================================================
   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;
}

/* 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.1);
  color: var(--accent-rose);
  border: 1px solid rgba(244, 63, 94, 0.2);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove-unit:hover {
  background: var(--accent-rose);
  color: #fff;
}

/* 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;
  justify-content: space-between;
  gap: 0.75rem;
}

.draft-status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-dim);
}

.draft-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

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

.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;
  pointer-events: none;
  transition: all 0.25s ease;
}

.modal-backdrop.open {
  opacity: 1;
  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;
}

/* ==========================================================
   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;
  }
}
