:root {
  --critical-red: #ff3b30;
  --urgent-orange: #ff9500;
  --normal-green: #34c759;
  --dark-blue: #0a84ff;
  --dark-gray: #1c1c1e;
  --light-gray: #f2f2f7;
  --card-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  --transition-fast: all 0.2s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  background-color: #f8f8f8;
  color: #1c1c1e;
  line-height: 1.6;

    transition: background-color 0.3s, color 0.3s;
}

.dark-mode {
    background-color: #121212;
    color: white;
}

/* === LOGIN SCREEN === */
.login-container {
  display: flex;
  justify-content:center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 450px;
  overflow: hidden;
  transform: translateY(-5%);
  animation: fadeInUp 0.6s ease;
}

.logo {
  background: var(--critical-red);
  color: white;
  padding: 30px 20px;
  text-align: center;
}

.logo i {
  font-size: 3rem;
  margin-bottom: 15px;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

#loginForm {
  padding: 30px;
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #3a3a3c;
  font-size: 0.9rem;
}

.input-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  font-size: 1rem;
  transition: var(--transition-fast);
}

.input-group input:focus {
  border-color: var(--dark-blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.1);
}

.login-btn {
  width: 100%;
  padding: 16px;
  background: var(--critical-red);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  margin-top: 10px;
}

.login-btn:hover {
  background: #d70015;
  transform: translateY(-2px);
}

.login-btn i {
  margin-right: 8px;
}

.emergency-bypass {
  padding: 0 30px 30px;
}

#emergencyOverride {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--critical-red);
  border: 2px solid var(--critical-red);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

#emergencyOverride:hover {
  background: rgba(255, 59, 48, 0.1);
}

/* === DASHBOARD STYLES === */
.dashboard {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}

/* Alert Bar */
.alert-bar {
  padding: 12px 20px;
  background: var(--critical-red);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
}

.alert-bar i {
  margin-right: 10px;
  animation: pulse 1.5s infinite;
}

.alert-btn {
  background: white;
  color: var(--critical-red);
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.alert-btn:hover {
  transform: translateX(3px);
}

/* Dashboard Header */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: white;
  border-bottom: 1px solid #e5e5ea;
}

.header-left h1 {
  font-size: 1.3rem;
  color: var(--dark-gray);
}

.header-left h1 i {
  color: var(--critical-red);
  margin-right: 10px;
}

.responder-status {
  display: flex;
  align-items: center;
  margin-top: 5px;
  font-size: 0.9rem;
  color: #636366;
}

.status-indicator {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-indicator.active {
  background: var(--normal-green);
  box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.3);
}

.logout-btn {
  background: transparent;
  color: var(--critical-red);
  border: 1px solid var(--critical-red);
  padding: 8px 14px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(255, 59, 48, 0.1);
}

/* Dashboard Content */
.dashboard-content {
  display: flex;
  flex: 1;
  min-height: calc(100vh - 120px);
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: white;
  border-right: 1px solid #e5e5ea;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
}

.nav-btn {
  display: flex;
  align-items: center;
  padding: 20px 26px;
  margin-bottom: 6px;
  border-radius: 25px;
  background: transparent;
  border: none;
  color: #636366;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
  position: relative;
}

.nav-btn i {
  margin-right: 22px;
  font-size: 1.5rem;
  width: 24px;
  text-align: center;
}

.nav-btn.active {
  background: rgba(10, 132, 255, 0.1);
  color: var(--dark-blue);
  font-weight: 600;
}

.nav-btn.active i {
  color: var(--dark-blue);
}

.alert-badge {
  position: absolute;
  right: 16px;
  background: var(--critical-red);
  color: white;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: bold;
}

.priority-filter {
  padding: 20px 16px;
  border-top: 1px solid #e5e5ea;
  margin-top: 10px;
}

.priority-filter h3 {
  font-size: 0.9rem;
  color: #636366;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}

.dashboard-footer {
  background-color: #222; /* or whatever background you want */
  color: #fff;
  text-align: center;
  padding: 15px;
  font-size: 14px;
  position: relative; /* or fixed if you want sticky footer */
  bottom: 0;
  width: 100%;
}
.system-status {
  margin-bottom: 5px;
}
.status-indicator {
  height: 10px;
  width: 10px;
  background-color: limegreen;
  border-radius: 50%;
  display: inline-block;
  margin-right: 5px;
}
.last-updated {
  font-size: 12px;
  opacity: 0.8;
}

.priority-filter h3 i {
  margin-right: 10px;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-options label {
  display: flex;
  align-items: center;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.filter-options label:hover {
  background: rgba(116, 116, 128, 0.1);
}

.filter-options input {
  margin-right: 10px;
}

.priority-high span { color: var(--critical-red); }
.priority-medium span { color: var(--urgent-orange); }
.priority-low span { color: var(--normal-green); }

/* Main Content */
.main-content {
  flex: 1;
  padding: 20px;
  background: var(--light-gray);
  overflow-y: auto;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.4rem;
  color: var(--dark-gray);
}

.section-header h2 i {
  margin-right: 10px;
  color: var(--dark-blue);
}

.section-actions {
  display: flex;
  gap: 10px;
}

.action-btn {
  padding: 8px 14px;
  background: white;
  border: 1px solid #d1d1d6;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

.action-btn i {
  font-size: 0.9rem;
}

.action-btn:hover {
  background: #f2f2f7;
}

.refresh-btn { color: var(--dark-blue); }
.map-view { color: var(--urgent-orange); }

/* Emergency Grid */
.emergency-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.emergency-card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.emergency-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: #f8f8f8;
  border-bottom: 1px solid #e5e5ea;
}

.priority-badge {
  font-weight: 700;
  font-size: 0.8rem;
}

.time-ago {
  font-size: 0.8rem;
  color: #636366;
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin-bottom: 12px;
  color: var(--dark-gray);
}

.card-body p {
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #636366;
  display: flex;
  align-items: center;
}

.card-body i {
  margin-right: 8px;
  width: 16px;
  color: #8e8e93;
}

.description {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e5e5ea;
  color: #1c1c1e !important;
}

.card-footer {
  display: flex;
  padding: 12px 16px;
  border-top: 1px solid #e5e5ea;
  gap: 8px;
}

.card-footer .action-btn {
  flex: 1;
  justify-content: center;
  padding: 8px;
  font-size: 0.8rem;
}

.assign-btn { color: var(--dark-blue); }
.navigate-btn { color: var(--urgent-orange); }
.details-btn { color: #636366; }

/* Priority Colors */
.critical .priority-badge { color: var(--critical-red); }
.critical .card-header { border-left: 4px solid var(--critical-red); }

.urgent .priority-badge { color: var(--urgent-orange); }
.urgent .card-header { border-left: 4px solid var(--urgent-orange); }

/* Dashboard Footer */
.dashboard-footer {
  padding: 12px 20px;
  background: white;
  border-top: 1px solid #e5e5ea;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #636366;
}

.system-status {
  display: flex;
  align-items: center;
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }
  
  .emergency-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .dashboard-content {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    padding: 10px;
    border-right: none;
    border-bottom: 1px solid #e5e5ea;
  }
  
  .sidebar-nav {
    flex-direction: row;
    overflow-x: auto;
    padding: 5px;
  }
  
  .nav-btn {
    flex-direction: column;
    padding: 10px;
    font-size: 0.7rem;
    min-width: 80px;
  }
  
  .nav-btn i {
    margin-right: 0;
    margin-bottom: 5px;
    font-size: 1.2rem;
  }
  
  .nav-btn span {
    display: none;
  }
  
  .priority-filter {
    display: none;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .login-card {
    max-width: 100%;
  }
  
  .emergency-card {
    min-width: 100%;
  }
  
  .card-footer {
    flex-direction: column;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .header-right {
    width: 100%;
  }
  
  .logout-btn {
    width: 100%;
  }
}