:root {
  --sidebar-width: 260px;
  --sidebar-bg: #ffffff;
  --sidebar-border: #e4e7ec;
  --sidebar-text: #0f172a;
  --sidebar-muted: #94a3b8;
  --brand-green: #22c55e;
  --body-bg: #f4f6f8;
  --government-blue: #1e40af;
  --government-orange: #ea580c;
}

/* Sessions incomplete responsive tweaks */
/* Sessions incomplete responsive tweaks */
.sessions-incomplete-page .sessions-mobile-list .accordion-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  margin-bottom: 0.75rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
}

.sessions-incomplete-page .sessions-mobile-list .accordion-button {
  background-color: #f8fafc;
  border-radius: 14px;
  font-size: 0.95rem;
}

.sessions-incomplete-page .sessions-mobile-list .accordion-button:not(.collapsed) {
  background-color: #ecfdf3;
  color: #166534;
}

.sessions-incomplete-page .sessions-mobile-list .sessions-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #e2e8f0;
}

.sessions-incomplete-page .sessions-detail-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.sessions-incomplete-page .sessions-detail-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.sessions-incomplete-page .sessions-detail-list span {
  color: #64748b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sessions-incomplete-page .sessions-detail-list strong {
  font-size: 0.9rem;
}

.sessions-incomplete-page .driver-table thead {
  background-color: #f8fafc;
}

.sessions-incomplete-page .driver-table tbody tr td {
  padding: 0.75rem 0.5rem;
}

@media (max-width: 768px) {
  .sessions-incomplete-page .card {
    border-radius: 16px;
  }

  .sessions-incomplete-page .sessions-mobile-list .accordion-item {
    margin-bottom: 0.6rem;
  }

  .sessions-incomplete-page .sessions-mobile-list .accordion-button {
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
  }

  .sessions-incomplete-page .sessions-mobile-list .sessions-detail-list {
    font-size: 0.82rem;
    gap: 0.25rem;
  }

  .sessions-incomplete-page .sessions-mobile-list .sessions-detail-list span {
    font-size: 0.72rem;
  }
}

/* Government Website Styling - Navbar */
.navbar {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-bottom: 3px solid var(--government-blue) !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.navbar-brand {
  font-family: 'Roboto', 'Segoe UI', system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin: 0 !important;
  padding: 0.5rem 0 !important;
}

/* Ensure navbar container spans full width */
.navbar > .container,
.navbar > .container-fluid {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 15px !important;
}

/* Reset any conflicting styles */
.app-header {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Mobile Responsive Header */
@media (max-width: 991px) {
  .navbar {
    padding: 0.5rem 0 !important;
  }
  
  .navbar-brand {
    font-size: 0.9rem !important;
    padding: 0.25rem 0.75rem !important;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .navbar-brand .d-md-none {
    font-size: 0.85rem !important;
    padding: 0.25rem 0.5rem !important;
  }
  
  /* Ensure header content is properly aligned */
  .app-header .container-fluid {
    padding: 0 10px !important;
  }
}

@media (max-width: 576px) {
  .navbar-brand {
    font-size: 0.8rem !important;
    padding: 0.25rem 0.5rem !important;
  }
  
  .navbar-brand .d-md-none {
    font-size: 0.75rem !important;
    padding: 0.2rem 0.3rem !important;
  }
  
  /* Adjust spacing for mobile */
  .app-header .container-fluid {
    padding: 0 5px !important;
  }
  
  /* Ensure no horizontal scroll */
  body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
}
/* ===== Footer Styles ===== */
.rcpoa-footer {
  --footer-bg: #f5f5f5;
  --footer-border: #1e40af;
  --footer-text: #333;
  --footer-link: #1e40af;
  --footer-hover: #0d47a1;
  
  background: var(--footer-bg);
  border-top: 3px solid var(--footer-border);
  font-family: 'Arial', sans-serif;
  width: 100%;
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 1.5rem 0 0;
  box-sizing: border-box;
}

/* Sidebar Responsiveness */
@media (min-width: 992px) {
  body:not(.sidebar-collapsed) .rcpoa-footer {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }
  
  body.sidebar-collapsed .rcpoa-footer {
    margin-left: 0;
    width: 100%;
  }
}

@media (max-width: 991.98px) {
  body:not(.sidebar-collapsed) .rcpoa-footer,
  body.sidebar-collapsed .rcpoa-footer {
    margin-left: 0;
    width: 100%;
  }
}

/* Footer Content */
.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Logo Section */
.footer-logo-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.footer-logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a237e;
  margin: 0 0 0.25rem;
}

.footer-logo-subtitle {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

/* Country Badge */
.footer-country {
  text-align: center;
  margin-bottom: 1.5rem;
}

.footer-country-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.country-badge {
  display: flex;
  align-items: center;
  font-weight: 600;
  color: #166534;
  gap: 0.25rem;
}

.country-badge i {
  color: #166534;
}

.country-separator {
  color: #999;
  margin: 0 0.5rem;
}

.country-name {
  font-weight: 600;
  color: #1a237e;
}

/* Bottom Section */
.footer-bottom {
  padding: 1rem 0;
  border-top: 1px solid #ddd;
}

.footer-copyright {
  text-align: center;
  margin-bottom: 1rem;
}

.copyright-text {
  color: #555;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.divider {
  color: #999;
}

.footer-mission {
  max-width: 800px;
  margin: 1rem auto;
}

.mission-text {
  font-weight: 500;
  color: #444;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.mission-desc {
  color: #666;
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.5;
}

/* Links */
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}

.footer-link {
  color: var(--footer-link);
  text-decoration: none;
  font-size: 0.85rem;
  padding: 0.3rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  transition: all 0.2s;
}

.footer-link:hover {
  background: var(--footer-link);
  color: white;
  border-color: var(--footer-link);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .footer-content {
    padding: 0 10px;
  }
  
  .footer-logo-title {
    font-size: 1.1rem;
  }
  
  .footer-logo-subtitle,
  .copyright-text,
  .mission-text,
  .mission-desc {
    font-size: 0.8rem;
  }
  
  .footer-links {
    gap: 0.5rem;
  }
  
  .footer-link {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* Mobile Footer Optimization */
@media (max-width: 768px) {
  footer {
    padding: 1rem 0;
  }
  
  footer .container-fluid {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  
  footer .row {
    margin: 0;
  }
  
  footer .col-12 {
    padding: 0.25rem;
  }
  
  footer span {
    font-size: 0.85rem;
  }
  
  footer small {
    font-size: 0.75rem;
  }
}

/* Data Privacy Alert Styling */
.alert-info {
  background-color: #eff6ff;
  border-color: var(--government-blue);
  border-left: 4px solid var(--government-blue);
}

.alert-info .bi-shield-check {
  color: var(--government-blue);
}

/* Made in India Badge */
.text-success.fw-bold {
  color: #138808 !important; /* Government of India green */
}

/* Dark theme variables */
body.dark-theme {
  --sidebar-bg: #1e293b;
  --sidebar-border: #334155;
  --sidebar-text: #f1f5f9;
  --sidebar-muted: #94a3b8;
  --body-bg: #0f172a;
  background-color: #0f172a;
  color: #f1f5f9;
}

body.dark-theme .card {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-theme .table {
  color: #f1f5f9;
}

body.dark-theme .form-control,
body.dark-theme .form-select {
  background-color: #1e293b;
  border-color: #334155;
  color: #f1f5f9;
}

body.dark-theme .form-control:focus,
body.dark-theme .form-select:focus {
  background-color: #1e293b;
  border-color: #22c55e;
  color: #f1f5f9;
}

body.light-theme {
  background-color: #ffffff;
  color: #0f172a;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  margin: 0;
  min-height: 100vh;
  background: var(--body-bg);
  color: #0f172a;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main-content {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 60px);
}

.content {
  flex: 1;
  width: 100%;
  padding: clamp(1rem, 2vw, 2.5rem);
  overflow-x: hidden;
}

.page-loader {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 2000;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

body.dark-theme .page-loader {
  background: rgba(15, 23, 42, 0.95);
}

.page-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader .loader-text {
  font-weight: 600;
  color: #0f172a;
}

body.dark-theme .page-loader .loader-text {
  color: #f1f5f9;
}

h1,
h2,
h3 {
  color: #14532d;
  font-weight: 600;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 20px auto;
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

form label {
  display: block;
  margin-top: 10px;
  font-weight: 500;
  color: #0f172a;
}

form input,
form select {
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 10px;
  border: 1px solid #cbd5f5;
  background: #fff;
  transition: border-color 0.2s ease;
}

form input:focus,
form select:focus {
  border-color: var(--brand-green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

form button {
  margin-top: 18px;
  padding: 12px 24px;
  background: var(--brand-green);
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

form button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 15px rgba(34, 197, 94, 0.3);
}

#addDriverSubmit .saving-label {
  display: inline-flex;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 24px;
}

table th,
table td {
  border: 1px solid #e2e8f0;
  padding: 12px 16px;
  text-align: left;
}

table th {
  background: #16a34a;
  color: #fff;
  font-weight: 600;
}

.driver-table-wrapper {
  width: 100%;
}

.driver-table td[data-label] a {
  color: inherit;
  text-decoration: none;
}

@media (max-width: 768px) {
  .driver-table {
    border: 0;
  }
  .driver-table thead {
    display: none;
  }
  .driver-table tbody tr {
    display: block;
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
    padding: 0.25rem 0.75rem;
  }
  .driver-table tbody tr td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: none;
    padding: 0.5rem 0;
  }
  .driver-table tbody tr td::before {
    content: attr(data-label);
    font-weight: 600;
    margin-right: 0.75rem;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.75rem;
  }
  .driver-table .btn-group {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .driver-table .btn-group .btn {
    flex: 1 1 calc(50% - 0.35rem);
  }
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.stack-responsive {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.stack-responsive > * {
  flex: 1;
}

@media (max-width: 768px) {
  .stack-responsive {
    flex-direction: column;
  }
}

/* Layout */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1040;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.app-header .navbar {
  background: linear-gradient(90deg, #15803d, #22c55e);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  min-height: 60px;
  position: relative;
}

.app-header .navbar .container-fluid {
  position: relative;
}

@media (max-width: 767px) {
  .app-header .navbar-brand {
    font-size: 0.9rem;
  }
  
  .app-header .navbar-brand i {
    font-size: 1rem;
  }
}

.station-info {
  min-height: 40px;
  position: relative;
  top: 0;
}

.app-sidebar {
  position: fixed;
  top: 60px;
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - 60px);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  transition: transform 0.3s ease;
  z-index: 1030;
  overflow-y: auto;
}

.app-header.has-station-info ~ .app-sidebar {
  top: 100px;
  height: calc(100vh - 100px);
}

.app-header.has-station-info ~ .app-main {
  margin-top: 100px;
  min-height: calc(100vh - 100px);
}

body.sidebar-collapsed .app-sidebar {
  transform: translateX(-100%);
}

@media (max-width: 991px) {
  .app-sidebar {
    top: 60px;
    height: calc(100vh - 60px);
    transform: translateX(-100%);
    z-index: 1050;
  }
  
  .app-header.has-station-info ~ .app-sidebar {
    top: 100px;
    height: calc(100vh - 100px);
  }
  
  .app-header.has-station-info ~ .app-main {
    margin-top: 100px;
    min-height: calc(100vh - 100px);
  }
  
  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  
  #sidebarToggle {
    display: block !important;
    visibility: visible !important;
  }
}

@media (max-width: 767.98px) {
  .app-sidebar {
    width: min(78vw, 240px);
    padding: 1rem 0.75rem;
  }

  .sidebar-brand {
    padding: 0.75rem 0.5rem 0.5rem;
    margin-bottom: 0.25rem;
  }

  .sidebar-brand p {
    font-size: 0.95rem;
  }

  .sidebar-brand small {
    font-size: 0.7rem;
  }

  .sidebar-nav {
    padding-right: 0;
  }

  .sidebar-section + .sidebar-section {
    margin-top: 1rem;
  }

  .sidebar-section-title {
    font-size: 0.7rem;
    margin-bottom: 0.35rem;
  }

  .sidebar-link {
    gap: 0.55rem;
    padding: 0.45rem 0.6rem;
    font-size: 0.88rem;
  }

  .sidebar-link i {
    font-size: 0.82rem;
  }

  .sidebar-footer {
    padding-top: 0.5rem;
    margin-top: 0.75rem;
  }
}


.sidebar-brand {
  padding: 0.85rem;
  border-bottom: 1px solid var(--sidebar-border);
  margin-bottom: 0.45rem;
}

.sidebar-brand i {
  display: block;
  margin: 0 auto;
}

.sidebar-brand p {
  color: var(--sidebar-text);
  font-size: 1rem;
  margin-top: 0.4rem;
}

.sidebar-brand small {
  font-size: 0.68rem;
  color: var(--sidebar-text-muted);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.15rem;
}

.sidebar-section + .sidebar-section {
  margin-top: 1.2rem;
}

.sidebar-section-title {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--sidebar-muted);
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

/* Default CAPSLOCK for all text inputs (except password) */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
textarea,
select:not([name*="password"]):not([id*="password"]) {
  text-transform: uppercase;
}

input[type="password"],
input[name*="password"],
input[id*="password"] {
  text-transform: none !important;
}

.sidebar-links li + li {
  margin-top: 0.2rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.75rem;
  color: var(--sidebar-text);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.25;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-link i {
  font-size: 0.9rem;
  color: var(--sidebar-muted);
  transition: color 0.15s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
  background: rgba(34, 197, 94, 0.12);
  color: var(--brand-green);
}

.sidebar-footer .btn {
  min-height: 36px;
}

.sidebar-link:hover i,
.sidebar-link.active i {
  color: var(--brand-green);
}

.sidebar-footer {
  border-top: 1px solid var(--sidebar-border);
  padding-top: 0.75rem;
  margin-top: 1rem;
}

.app-sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
  z-index: 1025;
}

.app-sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

@media (min-width: 992px) {
  body {
    padding-top: 60px;
    padding-left: 0;
  }
  
  .app-sidebar-overlay {
    display: none;
  }
  
  #sidebarToggle {
    display: block !important;
    visibility: visible !important;
  }
}

@media (max-width: 991px) {
  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  body.sidebar-open .app-sidebar-overlay {
    opacity: 1;
    visibility: visible;
  }
}

.app-main {
  margin-top: 60px;
  margin-left: 0;
  padding: 2rem clamp(1rem, 2vw, 2.5rem);
  min-height: calc(100vh - 60px);
  transition: margin-left 0.3s ease, width 0.3s ease;
  width: 100%;
  position: relative;
}

@media (min-width: 992px) {
  body:not(.sidebar-collapsed) .app-main {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
  
  body.sidebar-collapsed .app-main {
    margin-left: 0;
    width: 100%;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (max-width: 991px) {
  .app-main {
    padding: 1.5rem 1rem 2rem;
    margin-left: 0 !important;
    width: 100% !important;
  }
  
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .card {
    margin-bottom: 1rem;
  }
  
  .btn-group {
    flex-wrap: wrap;
  }
  
  .btn-group .btn {
    margin-bottom: 0.25rem;
  }
}

@media (max-width: 576px) {
  .app-main {
    padding: 1rem 0.75rem 1.5rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.5rem;
  }
  
  .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Error pages */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #e4f5ec 0%, #c1f0da 100%);
}

.error-card {
  max-width: 520px;
  width: 100%;
  background: #ffffff;
  border-radius: 24px;
  padding: clamp(2rem, 4vw, 3rem);
  box-shadow: 0 25px 60px rgba(12, 74, 110, 0.12);
}

.error-card .icon-wrapper {
  width: 90px;
  height: 90px;
  border-radius: 24px;
  display: grid;
  place-items: center;
}

.error-card pre {
  max-height: 220px;
}

@media (max-width: 480px) {
  .error-card {
    padding: 1.75rem;
    border-radius: 20px;
  }
}

/* Driver report mobile accordion */
.op-mobile-list .accordion-item {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  margin-bottom: 0.75rem;
}

.op-mobile-list .accordion-button {
  background-color: #f8fafc;
  gap: 0.75rem;
  border: none;
  box-shadow: none;
  font-size: 0.95rem;
  border-radius: 14px !important;
}

.op-mobile-list .accordion-button:not(.collapsed) {
  background-color: #ecfdf3;
  color: #166534;
}

.op-mobile-list .accordion-button:focus {
  box-shadow: none;
}

.op-mobile-list .accordion-body {
  background-color: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.op-mobile-list .accordion-body ul li i {
  font-size: 1rem;
  width: 1.25rem;
  text-align: center;
}

.op-mobile-list .accordion-body ul li span {
  flex: 1;
}

/* ===== Comprehensive Mobile Responsive Styles ===== */

/* Mobile Dashboard and Cards */
@media (max-width: 768px) {
  /* Dashboard cards and stats */
  .stats-card {
    margin-bottom: 1rem;
  }
  
  .card-deck {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  /* Tables */
  .table-responsive {
    border-radius: 0.375rem;
  }
  
  .table {
    font-size: 0.875rem;
  }
  
  .table th,
  .table td {
    padding: 0.5rem;
    vertical-align: middle;
  }
  
  /* Forms */
  .form-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .form-group {
    margin-bottom: 1rem;
  }
  
  /* Buttons */
  .btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .btn-group .btn {
    width: 100%;
  }
  
  /* Navigation */
  .navbar-nav {
    text-align: center;
  }
  
  .navbar-nav .nav-link {
    padding: 0.5rem 1rem;
  }
  
  /* Modals */
  .modal-dialog {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  .modal-body {
    padding: 1rem;
  }
  
  /* Charts */
  .chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 1rem;
  }
  
  /* Pagination */
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  .page-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
}

/* Small Mobile Devices */
@media (max-width: 576px) {
  /* Header adjustments */
  .app-header .navbar-brand {
    font-size: 0.9rem;
  }
  
  .app-header .dropdown-menu {
    position: fixed;
    top: 60px;
    right: 10px;
    left: 10px;
    width: auto;
  }
  
  .app-header .dropdown-menu .dropdown-item,
  .app-header .dropdown-menu .dropdown-item-text {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
  }
  
  .app-header .dropdown-menu i {
    font-size: 0.85rem;
    margin-right: 0.4rem;
  }
  
  .app-header .dropdown-menu {
    padding: 0.5rem 0.4rem;
  }
  
  .app-header .dropdown-menu .dropdown-item,
  .app-header .dropdown-menu .dropdown-item-text {
    font-size: 0.9rem;
    padding: 0.45rem 0.85rem;
    line-height: 1.25;
  }
  
  .app-header .dropdown-menu .dropdown-divider {
    margin: 0.4rem 0;
  }
  
  .app-header .dropdown-menu i {
    font-size: 0.9rem;
    margin-right: 0.5rem;
  }
  
  /* Main content */
  .app-main {
    padding: 1rem;
    margin-top: 60px;
  }
  
  /* Cards */
  .card {
    margin-bottom: 1rem;
    border-radius: 0.5rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  /* Tables - make them scrollable horizontally */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .table {
    min-width: 600px;
  }
  
  /* Forms */
  .form-control,
  .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Buttons */
  .btn {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    min-height: 44px; /* Touch-friendly */
  }
  
  .btn-sm {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
    min-height: 38px;
  }
  
  /* Badges */
  .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
  }
  
  /* Alerts */
  .alert {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
  
  /* Progress bars */
  .progress {
    height: 0.75rem;
  }
  
  /* Tooltips */
  .tooltip-inner {
    font-size: 0.75rem;
  }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
  /* Reduce padding and margins */
  .app-main {
    padding: 0.75rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  .container-fluid {
    padding: 0 0.5rem;
  }
  
  /* Typography */
  h1 {
    font-size: 1.5rem;
  }
  
  h2 {
    font-size: 1.25rem;
  }
  
  h3 {
    font-size: 1.1rem;
  }
  
  /* Forms */
  .form-label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
  }
  
  /* Tables */
  .table th,
  .table td {
    padding: 0.375rem 0.5rem;
    font-size: 0.8rem;
  }
  
  /* Hide less important columns on very small screens */
  .table .d-none-mobile {
    display: none;
  }
  
  /* Buttons */
  .btn {
    font-size: 0.8rem;
    padding: 0.375rem 0.75rem;
  }
  
  /* Modals */
  .modal-header {
    padding: 0.75rem 1rem;
  }
  
  .modal-footer {
    padding: 0.75rem 1rem;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
}

/* Landscape mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .app-main {
    padding: 0.75rem 1rem;
  }
  
  .modal-dialog {
    margin: 0.5rem;
    max-height: calc(100vh - 1rem);
  }
  
  .modal-body {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
  }
}

/* ===== Admin Pages Mobile Responsive ===== */

/* Admin pages with custom HTML structure */
@media (max-width: 768px) {
  /* Admin page headers */
  .admin-page .app-main .d-flex.flex-column.flex-md-row {
    flex-direction: column !important;
    gap: 1rem !important;
  }
  
  .admin-page .app-main .d-flex.gap-2 {
    flex-direction: column !important;
    width: 100% !important;
  }
  
  .admin-page .app-main .d-flex.gap-2 .btn,
  .admin-page .app-main .d-flex.gap-2 .form-select {
    width: 100% !important;
  }
  
  /* Admin page specific fixes */
  .admin-page .w-100.w-md-auto {
    width: 100% !important;
  }
  
  .admin-page .d-flex.align-items-center {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  /* Admin tables */
  .table-responsive {
    border-radius: 0.375rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  }
  
  /* Admin cards and stats */
  .stats-card,
  .info-card {
    margin-bottom: 1rem;
  }
  
  /* Admin forms */
  .admin-form .row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .admin-form .col-md-6,
  .admin-form .col-md-4,
  .admin-form .col-md-3 {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }
}

@media (max-width: 576px) {
  /* Admin page specific mobile fixes */
  .app-main {
    padding: 1rem !important;
  }
  
  /* Admin page headers - stack everything */
  .app-main .d-flex.justify-content-between {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  
  .app-main .d-flex.align-items-center {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  
  /* Admin buttons */
  .app-main .btn-group {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .app-main .btn-group .btn {
    width: 100%;
  }
  
  /* Admin tables */
  .table {
    font-size: 0.8rem;
  }
  
  .table th,
  .table td {
    padding: 0.375rem 0.5rem;
  }
  
  /* Hide less important columns */
  .table .hide-mobile {
    display: none !important;
  }
  
  /* Admin modals */
  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }
  
  /* Admin forms */
  .form-control,
  .form-select {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  /* Admin cards */
  .card-body {
    padding: 1rem;
  }
  
  .card-title {
    font-size: 1.1rem;
  }
}

/* Storage Analytics Page Specific */
@media (max-width: 768px) {
  .storage-analytics .chart-container {
    height: 250px !important;
    margin-bottom: 1rem;
  }
  
  .storage-analytics .progress {
    height: 1rem;
  }
  
  .storage-analytics .stats-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .storage-analytics .stats-grid .col-md-3,
  .storage-analytics .stats-grid .col-md-4 {
    width: 100% !important;
    flex: 0 0 100% !important;
  }
}

@media (max-width: 480px) {
  .storage-analytics .card-body {
    padding: 0.75rem;
  }
  
  .storage-analytics h3 {
    font-size: 1.1rem;
  }
  
  .storage-analytics .table th,
  .storage-analytics .table td {
    padding: 0.25rem 0.375rem;
    font-size: 0.75rem;
  }
}

/* Reports Page Specific */
@media (max-width: 768px) {
  .reports-page .filter-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  
  .reports-page .filter-section .row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .reports-page .filter-section .col-md-3,
  .reports-page .filter-section .col-md-4 {
    width: 100% !important;
    flex: 0 0 100% !important;
  }
}

/* Access Requests Page Specific */
@media (max-width: 576px) {
  .access-requests .request-card {
    margin-bottom: 1rem;
  }
  
  .access-requests .request-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .access-requests .request-actions .btn {
    width: 100%;
  }
}

/* Login Sessions Page Specific */
@media (max-width: 768px) {
  .login-sessions .session-card {
    margin-bottom: 1rem;
  }
  
  .login-sessions .session-details {
    font-size: 0.875rem;
  }
}

/* Print styles */
@media print {
  .app-sidebar,
  .app-header,
  .btn,
  .navbar {
    display: none !important;
  }
  
  .app-main {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .card {
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
