/* =========================
   SAFEALERT – GLOBAL STYLES
   ========================= */

* {
  box-sizing: border-box;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
}

body {
  margin: 0;
  background: #f4f6f8;
  color: #1f2937;
}

/* =========================
   HEADER
   ========================= */

.header {
  background: #0f172a;
  color: #ffffff;
  padding: 16px 24px;
  font-size: 20px;
  font-weight: 600;
}

/* =========================
   MAIN CONTAINER (ALL PAGES)
   ========================= */

.container {
  max-width: 420px;
  margin: 70px auto;
  background: #ffffff;
  padding: 28px;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

/* INTRO SECTION STYLES */
.intro-section {
  background: #f0f9ff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 18px;
  border-left: 4px solid #2563eb;
}

/* =========================
   HEADINGS
   ========================= */

h1,
h2 {
  margin-top: 0;
  margin-bottom: 24px;
  text-align: center;
  font-size: 24px;
  font-weight: 600;
}

h3 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 18px;
  font-weight: 600;
}

/* =========================
   FORM ELEMENTS
   ========================= */

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  margin-top: 14px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 15px;
}

textarea {
  resize: vertical;
}

/* =========================
   BUTTONS
   ========================= */

button {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
}

button:hover {
  background: #1d4ed8;
}

/* =========================
   ALERT / ACTION BUTTONS
   ========================= */

.alert-btn {
  display: block;
  text-align: center;
  padding: 14px;
  margin-top: 14px;
  border-radius: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 500;
}

/* =========================
   ALERT/NOTIFICATION STYLES
   ========================= */

.alert {
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  font-size: 14px;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid #10b981;
}

.alert-error {
  background: #fee2e2;
  color: #7f1d1d;
  border-left: 4px solid #ef4444;
}

.alert-warning {
  background: #fef3c7;
  color: #78350f;
  border-left: 4px solid #f59e0b;
}

.alert-info {
  background: #dbeafe;
  color: #0c2d6b;
  border-left: 4px solid #3b82f6;
}


.accident {
  background: #dc2626;
}

.fire {
  background: #b91c1c;
}

.parking {
  background: #f59e0b;
}

.theft {
  background: #374151;
}

.medical {
  background: #16a34a;
}

/* =========================
   TEXT HELPERS
   ========================= */

.note {
  margin-top: 16px;
  font-size: 13px;
  color: #6b7280;
  text-align: center;
}

/* =========================
   FOOTER
   ========================= */

.footer {
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  padding: 16px;
}

/* =========================
   LOGO STYLES
   ========================= */

.auth-logo {
  display: block;
  margin: 0 auto 24px;
  max-width: 140px;
  height: auto;
}

.page-logo {
  display: block;
  margin: 0 auto 20px;
  max-width: 110px;
  height: auto;
}

/* =========================
   ERROR PAGE
   ========================= */

.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.error-container {
  max-width: 500px;
  background: #ffffff;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.error-container .logo {
  max-width: 140px;
  margin: 0 auto 24px;
}

.error-code {
  font-size: 72px;
  font-weight: 800;
  color: #dc2626;
  margin: 0;
  line-height: 1;
}

.error-title {
  font-size: 24px;
  font-weight: 600;
  color: #1f2937;
  margin: 16px 0 12px;
}

.error-message {
  font-size: 16px;
  color: #6b7280;
  margin-bottom: 32px;
  line-height: 1.6;
}

.error-btn {
  display: inline-block;
  padding: 12px 32px;
  background: #2563eb;
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.error-btn:hover {
  background: #1d4ed8;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

/* =========================
   ADMIN OVERRIDE (ONLY ADMIN)
   ========================= */


.admin-header {
  background: #020617;
}

.admin-container {
  max-width: 380px;
  margin: 90px auto;
  background: #020617;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  color: #e5e7eb;
}

.admin-container h2 {
  text-align: center;
  margin-bottom: 24px;
}

.admin-container input {
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #334155;
}

.admin-container input::placeholder {
  color: #94a3b8;
}

.admin-container button {
  background: #dc2626;
}

.admin-container button:hover {
  background: #b91c1c;
}

.admin-note {
  text-align: center;
  font-size: 12px;
  margin-top: 18px;
  color: #94a3b8;
}

/* =========================
   ADMIN LAYOUT FIX
   ========================= */

.admin-wrapper {
  max-width: 420px;
  margin: 40px auto;
  padding: 0 16px;
}

.admin-wide {
  max-width: 700px;
}

/* =========================
   DASHBOARD STYLES
   ========================= */

.dashboard-wrapper {
  max-width: 1000px;
  margin: 28px auto;
  padding: 0 16px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.stat-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.stat-title {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 26px;
  font-weight: 700;
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.action-card {
  padding: 18px;
  border-radius: 14px;
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.action-users {
  background: #16a34a;
}

.action-vehicles {
  background: #f59e0b;
}

.action-alerts {
  background: #dc2626;
}

.qr-inventory {
  background: #16a34a;
}

.generate-qr {
  background: #f59e0b;
}

.print-qr {
  background: #dc2626;
}

.assign-qr {
  background: #16a34a;
}

.action-danger {
  background: #2b25dc;
}

.action-logout {
  background: #374151;
}

.action-card:hover {
  opacity: 0.9;
}

/* =========================
   SIDEBAR LAYOUT (ADMIN + USER)
   ========================= */

.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 220px;
  height: calc(100vh - 56px);
  background: #020617;
  padding-top: 16px;
}

.sidebar a {
  display: block;
  padding: 12px 18px;
  color: #cbd5f5;
  text-decoration: none;
  font-size: 14px;
}

.sidebar a:hover {
  background: #1e293b;
  color: #fff;
}

/* shift content when sidebar exists */
.with-sidebar {
  margin-left: 150px;
}

/* =========================
   TABLES (ADMIN / USER LISTS)
   ========================= */

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  font-size: 14px;
}

.table th {
  background: #f1f5f9;
  font-weight: 600;
}

/* =========================
   STATUS BADGES
   ========================= */

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.badge-green {
  background: #16a34a;
  color: #fff;
}

.badge-red {
  background: #dc2626;
  color: #fff;
}

.badge-yellow {
  background: #f59e0b;
  color: #fff;
}

.badge-gray {
  background: #374151;
  color: #fff;
}

/* =========================
   SMALL ACTION LINKS
   ========================= */

.link-btn {
  display: inline-block;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px;
  text-decoration: none;
  background: #2563eb;
  color: #fff;
}

.link-btn.danger {
  background: #dc2626;
}

.link-btn.warn {
  background: #f59e0b;
}

.link-btn.primary {
  background: #2563eb;
}

/* Additional badge style */
.badge-yellow {
  background: #fde68a;
  color: #92400e;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}

/* =========================
   HEADER & SIDEBAR COMPONENTS
   ========================= */

.app-header {
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
}

.menu-btn {
  font-size: 22px;
  background: transparent;
  border: none;
  color: #fff;
  margin-right: 12px;
  cursor: pointer;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  width: 200px;
  height: calc(100vh - 56px);
  background: #0b1324;
  transition: left 0.3s ease;
  z-index: 1000;
}

.admin-dashboard-wrapper {
  margin-left: 100px;
  padding: 80px 24px 24px;
}

.user-dashboard-wrapper {
  margin-left: 0;
  padding: 80px 48px 24px;
  max-width: none;
}

.user-dashboard-wrapper.with-sidebar {
  margin-left: 0 !important;
  padding-left: 48px;
}

.user-dashboard-wrapper h2 {
  color: #020617;
}

.sidebar-wrapper {
  width: 240px;
  background: #1a1f2e;
  min-height: calc(100vh - 70px);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-menu-item {
  display: block;
  padding: 14px 16px;
  background: #263242;
  color: #e2e8f0;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.sidebar-menu-item:hover {
  background: #364454;
  color: #fff;
  border-left-color: #3b82f6;
  transform: translateX(2px);
}

.main-content {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

.menu-toggle {
  background: none;
  border: none;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  padding: 8px;
  display: none;
}

/* =========================
   MOBILE RESPONSIVENESS (CONSOLIDATED)
   ========================= */

/* Desktop - Hide menu toggle */
@media (min-width: 769px) {
  .menu-toggle {
    display: none !important;
  }

  .sidebar-wrapper {
    position: relative;
    display: flex !important;
    width: 240px;
    transform: none !important;
  }

  .main-content {
    flex: 1;
    padding: 30px;
  }

  .user-dashboard-wrapper {
    padding: 30px !important;
    max-width: 100% !important;
  }

  .dashboard-wrapper {
    padding: 30px !important;
  }
}

/* Tablet and Mobile */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  /* Header */
  .header {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px !important;
  }

  .header img {
    height: 40px !important;
  }

  .app-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
  }

  /* Menu Toggle */
  .menu-toggle,
  .menu-btn {
    display: inline-block !important;
    font-size: 22px;
    background: none;
    border: none;
    color: #fff;
    margin-right: 12px;
    cursor: pointer;
    padding: 8px;
  }

  /* Sidebar */
  .sidebar {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
    background: #020617;
    padding: 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    overflow-x: auto;
    top: 0 !important;
  }

  .sidebar a {
    flex: 0 0 calc(50% - 4px);
    padding: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .app-sidebar {
    left: -240px;
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .app-sidebar.open {
    left: 0;
    transform: translateX(0);
  }

  .sidebar-wrapper {
    position: fixed;
    top: 70px;
    left: 0;
    width: 280px;
    height: calc(100vh - 70px);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
  }

  .sidebar-wrapper.open {
    transform: translateX(0);
  }

  /* Main Content Areas */
  .with-sidebar {
    margin-left: 0 !important;
  }

  .main-content {
    flex: 1;
    padding: 16px;
    width: 100%;
  }

  .user-dashboard-wrapper {
    margin-left: 0 !important;
    padding: 16px !important;
  }

  .admin-dashboard-wrapper {
    margin-left: 0 !important;
    padding: 16px !important;
  }

  .dashboard-wrapper {
    margin-left: 0 !important;
    padding: 16px !important;
    margin-top: 16px;
  }

  /* Stats and Actions Grids */
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .stat-card {
    padding: 16px !important;
  }

  .actions-grid {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .action-card {
    padding: 16px !important;
    font-size: 14px !important;
    width: 100%;
    text-align: center;
  }

  /* Tables - Horizontal Scroll */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table {
    font-size: 12px;
    min-width: 600px;
  }

  .table th,
  .table td {
    padding: 8px !important;
    white-space: nowrap;
  }

  /* Forms */
  input,
  select,
  textarea {
    font-size: 16px;
    /* Prevents zoom on iOS */
    padding: 12px;
    margin-bottom: 12px;
    width: 100%;
  }

  button {
    font-size: 14px;
    padding: 12px;
    width: 100%;
  }

  /* Container */
  .container {
    max-width: 100% !important;
    padding: 16px !important;
    margin: 16px auto !important;
  }

  /* Alert Buttons */
  .alert-btn {
    font-size: 13px;
    padding: 12px;
    width: 100%;
  }

  /* Link Buttons */
  .link-btn {
    font-size: 12px;
    padding: 8px;
    display: inline-block;
    margin-bottom: 8px;
  }

  /* Flex Grid Override */
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Flex layouts that need to stack */
  [style*="display:flex"][style*="gap:10px"] {
    flex-direction: column !important;
  }

  /* Form row responsive utility */
  .form-row-responsive {
    flex-direction: column !important;
  }

  .form-row-responsive>div {
    flex: 1 1 100% !important;
  }
}

/* Extra Small Devices */
@media (max-width: 480px) {
  .header {
    padding: 10px 12px !important;
  }

  .header img {
    height: 36px !important;
  }

  .stat-card {
    padding: 12px !important;
  }

  .action-card {
    padding: 14px !important;
    font-size: 13px !important;
  }

  .container {
    padding: 12px !important;
    margin: 12px auto !important;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px;
    padding: 10px;
  }

  .table {
    font-size: 11px;
  }

  .table th,
  .table td {
    padding: 6px !important;
  }
}

/* =========================
   END OF FILE
   ========================= */
/* Logo Mobile Responsiveness */
@media (max-width: 768px) {

  .auth-logo,
  .page-logo {
    max-width: 150px;
  }

  .header img {
    height: 35px !important;
  }

  .error-container {
    padding: 30px 20px;
  }

  .error-code {
    font-size: 56px;
  }

  .error-title {
    font-size: 20px;
  }

  .error-message {
    font-size: 14px;
  }

  .error-btn {
    padding: 10px 24px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .auth-logo {
    max-width: 120px !important;
  }

  .page-logo {
    max-width: 100px !important;
  }

  .header img {
    height: 30px !important;
  }
}
/* ========================= CHECKBOX ALIGNMENT FIX ========================= */
input[type="checkbox"] { width: auto !important; margin: 0 !important; display: inline-block !important; }
form div[style*="display:flex"] input[type="checkbox"] { flex-shrink: 0 !important; width: auto !important; margin: 0 !important; }
