/* Primary Design Token Utilities & CSS Variables */
:root {
  --primary-sage: #3B5D50;
  --primary-dark: #2F4858;
  --primary-light: #F4F7F5;
  --accent-gold: #D4AF37;
  --accent-gold-light: #FFFBF0;
  --accent-gold-hover: #B38F24;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --bg-app: #F8FAFC;
  --card-bg: #FFFFFF;

  --status-belum: #94A3B8;
  --status-siap: #3B82F6;
  --status-berjalan: #10B981;
  --status-selesai: #059669;
  --status-tertunda: #EF4444;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Global Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 70px;
}

/* Header Component - Super Compact & Sleek */
.header-banner {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-sage) 100%);
  color: white;
  padding: 12px 16px 12px 16px;
  border-bottom-left-radius: 14px;
  border-bottom-right-radius: 14px;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.hashtag-badge {
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #FDE68A;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  letter-spacing: 0.3px;
}

.sync-status {
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
}

.sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #34D399;
  box-shadow: 0 0 5px #34D399;
}

.sync-dot.offline {
  background-color: #F87171;
  box-shadow: 0 0 5px #F87171;
}

.event-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 2px;
  letter-spacing: -0.3px;
}

.event-sub {
  font-size: 0.78rem;
  opacity: 0.9;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

/* Quick Metrics Bar - Compact Height */
.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  text-align: center;
}

.metric-val {
  font-size: 0.9rem;
  font-weight: 800;
  color: white;
  line-height: 1.1;
}

.metric-lbl {
  font-size: 0.62rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Container & Layout */
.app-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px 12px;
}

/* Navigation Tabs (Desktop & Tablet) */
.nav-tabs-desktop {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 3px;
  background: white;
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  scrollbar-width: none;
}

.nav-tabs-desktop::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.tab-btn:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.tab-btn.active {
  background: var(--primary-sage);
  color: white;
  box-shadow: 0 2px 6px rgba(59, 93, 80, 0.2);
}

/* Control & Filter Header */
.control-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input {
  width: 100%;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid #CBD5E1;
  background: white;
  font-size: 0.82rem;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary-sage);
  box-shadow: 0 0 0 2px rgba(59, 93, 80, 0.12);
}

.filter-pills {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.pill-btn {
  border: 1px solid #E2E8F0;
  background: white;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn.active {
  background: var(--primary-dark);
  color: white;
  border-color: var(--primary-dark);
}

/* Rundown Cards & Timeline - Compact & Clear */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rundown-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
}

.rundown-card:hover {
  box-shadow: var(--shadow-md);
}

.rundown-card.active-now {
  border: 2px solid var(--status-berjalan);
  background: #F0FDF4;
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.12);
}

.rundown-card.is-completed {
  opacity: 0.82;
  background: #F8FAFC;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.time-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--primary-dark);
}

.delay-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  display: inline-block;
}

.delay-tag.delayed {
  background: #FEE2E2;
  color: #B91C1C;
}

.delay-tag.ahead {
  background: #E0F2FE;
  color: #0369A1;
}

.delay-tag.ontime {
  background: #DCFCE7;
  color: #15803D;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-meta {
  display: flex;
  gap: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-notes {
  font-size: 0.78rem;
  color: #475569;
  background: #F1F5F9;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border-left: 3px solid var(--primary-sage);
}

/* Action Controls per Card */
.card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid #EDF2F7;
  padding-top: 6px;
}

.status-select {
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid #CBD5E1;
  font-size: 0.75rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
}

.status-select.status-Belum {
  background: #F1F5F9;
  color: #475569;
}

.status-select.status-Siap {
  background: #EFF6FF;
  color: #1D4ED8;
}

.status-select.status-Berjalan {
  background: #ECFDF5;
  color: #047857;
  border-color: #10B981;
}

.status-select.status-Selesai {
  background: #D1FAE5;
  color: #065F46;
}

.status-select.status-Tertunda {
  background: #FEF2F2;
  color: #B91C1C;
}

.btn-group {
  display: flex;
  gap: 4px;
}

.btn-action {
  border: 1px solid #E2E8F0;
  background: white;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-action:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.btn-action.btn-edit {
  color: var(--primary-dark);
  border-color: #CBD5E1;
}

.btn-action.btn-shift {
  color: var(--accent-gold-hover);
  background: var(--accent-gold-light);
  border-color: #FDE68A;
}

/* Mobile Bottom Bar Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #E2E8F0;
  padding: 6px 10px;
  z-index: 1000;
  justify-content: space-around;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.nav-item-mobile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px;
}

.nav-item-mobile.active {
  color: var(--primary-sage);
}

.nav-item-mobile svg {
  width: 18px;
  height: 18px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-dark);
}

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

.form-group {
  margin-bottom: 10px;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 3px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #CBD5E1;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary-sage);
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.btn-primary {
  background: var(--primary-sage);
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-secondary {
  background: #E2E8F0;
  color: var(--text-main);
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* Grid Sections - Compact */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.item-card {
  background: white;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
}

.item-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid #E2E8F0;
  box-shadow: var(--shadow-sm);
}

.contact-info h4 {
  font-size: 0.88rem;
  font-weight: 700;
}

.contact-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.contact-btns {
  display: flex;
  gap: 6px;
}

.btn-whatsapp {
  background: #25D366;
  color: white;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
}

.btn-call {
  background: #2563EB;
  color: white;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 0.72rem;
  font-weight: 700;
}

/* Media Queries */
@media (max-width: 768px) {
  .nav-tabs-desktop {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .metrics-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .event-title {
    font-size: 1.15rem;
  }

  .header-banner {
    padding: 10px 12px;
  }
}