  /* ===== GLOBAL LAYOUT FIX ===== */
  * {
    box-sizing: border-box;
  }

  :root {
    --navbar-height: 56px; /* used to offset content when navbar is fixed */
  }

  html, body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    scroll-behavior: smooth;
  }
  
  body {
    /* Ensure page content starts below the fixed navbar to avoid layout jumps */
    padding-top: var(--navbar-height);
  }

  /* ===== PAGE TRANSITION EFFECTS ===== */
  body {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
  }

  body.page-transitioning {
    opacity: 0;
  }

  /* Prevent layout shift during transitions */
  main.container {
    min-height: 60vh;
  }

  /* Smooth content appearance - doesn't affect display, only adds transition effect */
  .tab-panel.active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
  }

  /* ===== NAVBAR STYLES ===== */
  .modern-navbar {
    background: linear-gradient(135deg, #0f766e 0%, #0b3b37 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    /* Make the navbar fixed at the top of the viewport and set a fixed height
       so we can reliably offset the page content. This prevents gaps on refresh. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    z-index: 1000;
    margin: 0;
    padding: 0;
    width: 100%;
    transition: margin-left 0.3s ease, width 0.3s ease;
  }

  .navbar-container {
    max-width: 100%;
    margin: 0;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    position: relative;
    box-sizing: border-box;
  }
  
  @media (max-width: 768px) {
    .navbar-container {
      padding: 0.75rem 1rem;
    }
  }

  .navbar-brand {
    text-decoration: none;
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
    z-index: 20;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }
  
  @media (max-width: 768px) {
    .navbar-brand {
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
    }
  }

  .navbar-brand:hover {
    opacity: 0.9;
  }

  .navbar-user {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
    margin-left: 0;
    margin-right: 0;
    flex-wrap: wrap;
    width: 100%;
  }
  
  @media (max-width: 768px) {
    .navbar-user {
      margin-left: 0;
      margin-right: 0;
    }
  }

  .navbar-user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: #ffffff;
  }

  .navbar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
  }

  .navbar-user-name {
    font-weight: 600;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }

  .navbar-logout-btn {
    background: #c62828;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }

  .navbar-logout-btn:hover {
    background: #b71c1c;
  }

  .navbar-login-btn {
    background: transparent;
    color: #ffffff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.85rem;
    transition: background 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }

  .navbar-login-btn:hover {
    background: rgba(255, 255, 255, 0.15);
  }

  .navbar-guest-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
  }

  .navbar-guest-links.left {
    margin-right: auto;
  }

  .navbar-guest-links.right {
    margin-left: auto;
  }

  /* ===== BURGER MENU BUTTON ===== */
  .navbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    padding: 0.6rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
  }
  
  @media (max-width: 768px) {
    .navbar-toggle {
      flex: 0 0 auto;
    }
  }

  .navbar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  .navbar-toggle:active {
    background: rgba(255, 255, 255, 0.15);
  }

  /* Hide desktop user section on mobile */
  .navbar-user-desktop {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-left: auto;
  }

  @media (max-width: 768px) {
    .navbar-user-desktop {
      display: none !important;
    }

    .navbar-toggle {
      display: flex !important;
    }

    .notif-bell-wrap {
      align-self: center;
    }
    .notif-bell-btn {
      font-size: 1rem;
      padding: 0.25rem 0.35rem;
    }
  }

  @media (max-width: 768px) and (min-width: 481px) {
    .modern-navbar {
      overflow: hidden;
    }
  }

  /* Keep the 44px bell/menu buttons centered inside the fixed-height navbar */
  @media (max-width: 768px) {
    .navbar-container {
      height: 100%;
      padding-top: 0;
      padding-bottom: 0;
    }
  }

  @media (max-width: 480px) {
    .notif-bell-btn {
      min-height: 40px;
      min-width: 40px;
    }
  }

  .navbar-toggle span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
  }

  .navbar-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
  }

  .navbar-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .navbar-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
  }

  /* Page transition animation */
  main.container {
    transition: opacity 0.2s ease;
  }

  /* Overlay for sidebar */
  .sidebar-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

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

  /* ===== SIDEBAR NAVIGATION ===== */
  .sidebar-nav {
    position: fixed;
    left: 0;
    /* start below the fixed navbar */
    top: var(--navbar-height);
    height: calc(100vh - var(--navbar-height));
    width: 260px;
    background: linear-gradient(180deg, #0f766e 0%, #0b3b37 100%);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding-top: 0;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }

  .sidebar-nav.active {
    transform: translateX(0);
  }

  .sidebar-nav-header {
    padding: 1.5rem 0;
    margin-bottom: 1rem;
    margin-top: 0;
    text-align: center;
  }

  .sidebar-nav-header h3 {
    color: #ffffff;
    margin: 0;
    padding: 0 1rem;
    font-size: 1rem;
  }

  .sidebar-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
  }

  .sidebar-nav-item {
    margin: 0;
    padding: 0;
  }

  .sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }

  .sidebar-nav-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
  }

  .sidebar-nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-left-color: #90ee90;
    font-weight: 600;
  }

  .sidebar-nav-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
  }

  /* ===== SIDEBAR SUB-MENU (FOR PAGE TABS) ===== */
  .sidebar-submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.2);
  }

  .sidebar-submenu.expanded {
    max-height: 1000px;
  }

  .sidebar-submenu-item {
    margin: 0;
    padding: 0;
  }

  .sidebar-submenu-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 1.25rem 0.65rem 2.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
    font-weight: 400;
    font-size: 0.85rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  }

  .sidebar-submenu-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
  }

  .sidebar-submenu-link.active {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-left-color: #90ee90;
    font-weight: 500;
  }

  .sidebar-submenu-link i {
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
  }

  .sidebar-nav-link.has-submenu {
    position: relative;
  }

  .sidebar-nav-link.has-submenu::after {
    content: '\f054';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1.25rem;
    font-size: 0.7rem;
    transition: transform 0.3s ease;
  }

  .sidebar-nav-link.has-submenu.expanded::after {
    content: '\f078';
    transform: rotate(0deg);
  }

  /* ===== ISLAMIC CALENDAR WIDGET ===== */
  .sidebar-nav .islamic-calendar-widget {
    padding: 1rem 1.25rem;
    text-align: center;
    width: 100%;
    flex-shrink: 0;
  }

  .sidebar-nav .current-time {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
  }

  .sidebar-nav .current-time .timezone {
    font-size: 0.7rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 0.25rem;
  }

  .sidebar-nav .calendar-months {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
  }

  .sidebar-nav .hijri-month {
    font-size: 0.8rem;
    color: rgba(144, 238, 144, 1);
    font-weight: 500;
  }

  .sidebar-nav .greg-month {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
  }

  .sidebar-nav .hijri-week-view {
    display: flex;
    justify-content: space-between;
    gap: 0.25rem;
  }

  .sidebar-nav .hijri-day-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.35rem 0.15rem;
    border-radius: 4px;
    transition: background-color 0.2s;
  }

  .sidebar-nav .hijri-day-item.today {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  .sidebar-nav .hijri-day-item .day-name {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
  }

  .sidebar-nav .hijri-day-item .day-number {
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.3;
  }

  .sidebar-nav .hijri-day-item .day-number.hijri {
    color: rgba(144, 238, 144, 1);
  }

  .sidebar-nav .hijri-day-item .day-number.greg {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.7rem;
  }

  .sidebar-nav .hijri-day-item.today {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
  }

  .sidebar-nav .hijri-day-item.today .day-name,
  .sidebar-nav .hijri-day-item.today .day-number {
    font-weight: 700;
  }

  .sidebar-nav .hijri-day-item.today .day-number.hijri {
    color: rgba(144, 238, 144, 1);
  }

  .sidebar-nav .hijri-day-item.today .day-number.greg {
    color: rgba(255, 255, 255, 1);
  }

  .sidebar-nav .islamic-date-large {
    font-size: 2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1;
    margin-bottom: 0.25rem;
  }

  .sidebar-nav .gregorian-date {
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
  }

  /* ===== PAGE TRANSITION EFFECTS ===== */
  main.container {
    animation: fadeIn 0.3s ease-in-out;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
  }

  @keyframes fadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Loading indicator */
  .page-loading {
    opacity: 0.6;
    pointer-events: none;
  }

  /* ===== DESKTOP HORIZONTAL SUBNAV BAR ===== */
  @media (min-width: 969px) {
    :root { --subnav-height: 42px; --breadcrumb-height: 28px; }

    /* Body offset: navbar + subnav + breadcrumb */
    body.sidebar-docked {
      margin-left: 0;
      padding-top: calc(var(--navbar-height) + var(--subnav-height) + var(--breadcrumb-height));
    }

    /* Breadcrumb bar */
    #breadcrumbBar {
      display: flex;
      position: fixed;
      top: calc(var(--navbar-height) + var(--subnav-height));
      left: 0;
      right: 0;
      height: var(--breadcrumb-height);
      align-items: center;
      padding: 0 2rem;
      background: rgba(253,251,248,0.97);
      border-bottom: 1px solid rgba(15,87,80,0.1);
      z-index: 985;
      overflow: hidden;
    }
    .bc-sep { color: rgba(15,87,80,0.3); margin: 0 0.3rem; font-size: 0.8rem; }
    .bc-item { font-size: 0.74rem; color: #6b7280; white-space: nowrap; }
    .bc-active { color: #093430; font-weight: 600; }

    /* Body offset: navbar + subnav */
    body.sidebar-docked {
      margin-left: 0;
      padding-top: calc(var(--navbar-height) + var(--subnav-height));
    }

    /* Navbar always full-width */
    body.sidebar-docked .modern-navbar,
    body.sidebar-collapsed .modern-navbar {
      margin-left: 0;
      width: 100%;
    }

    /* Content always full-width */
    body.sidebar-docked main.container,
    body.sidebar-collapsed main.container {
      width: 100% !important;
      max-width: 100% !important;
      margin-left: 0 !important;
      padding-left: 2rem !important;
      padding-right: 2rem !important;
    }

    /* ── Horizontal pill bar ── */
    .sidebar-nav.docked {
      /* Override vertical panel */
      top: var(--navbar-height);
      left: 0;
      right: 0;
      width: 100%;
      height: var(--subnav-height);
      transform: none !important;
      transition: none;
      flex-direction: row;
      align-items: center;
      overflow: visible;            /* let dropdowns escape */
      padding: 0 1.25rem;
      background: linear-gradient(to right, #0f5750, #0f766e);
      box-shadow: 0 3px 12px rgba(0,0,0,0.22);
      border-top: 1px solid rgba(255,255,255,0.08);
      z-index: 990;
      /* Must not clip the absolute-positioned dropdown children */
      clip-path: none;
    }

    /* Hide header, collapse btn, calendar in bar mode */
    .sidebar-nav.docked .sidebar-nav-header,
    .sidebar-nav.docked .sidebar-collapse-btn,
    .sidebar-nav.docked .islamic-calendar-widget {
      display: none;
    }

    /* Horizontal menu list */
    .sidebar-nav.docked .sidebar-nav-menu {
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 0.15rem;
      width: 100%;
      padding: 0;
      margin: 0;
      overflow: visible;
      list-style: none;
      flex-wrap: nowrap;
    }

    /* Flex row items */
    .sidebar-nav.docked .sidebar-nav-item {
      position: relative;
      flex-shrink: 1;            /* allow shrinking when zoomed */
      min-width: 0;
      display: flex;
      align-items: center;
    }

    /* Push logout to far right and never clip it */
    .sidebar-nav.docked .sidebar-nav-item:last-child {
      margin-left: auto;
      flex-shrink: 0;            /* logout is always fully visible */
      min-width: max-content;
    }

    /* Pill links */
    .sidebar-nav.docked .sidebar-nav-link {
      display: flex;
      align-items: center;
      gap: min(0.35rem, 0.4vw);
      padding: 0.28rem min(0.85rem, 1.0vw);
      border-radius: 20px;
      font-size: min(0.8rem, 1.15vw);
      font-weight: 500;
      white-space: nowrap;
      color: rgba(255,255,255,0.82);
      border-left: none;
      background: transparent;
      text-decoration: none;
      transition: background 0.18s, color 0.18s;
      line-height: 1;
    }
    .sidebar-nav.docked .sidebar-nav-link i {
      font-size: 0.75rem;
    }
    .sidebar-nav.docked .sidebar-nav-link:hover {
      background: rgba(255,255,255,0.14);
      color: #fff;
    }
    .sidebar-nav.docked .sidebar-nav-link.active {
      background: rgba(255,255,255,0.22);
      color: #fff;
      border-left: none;
    }

    /* Submenu chevron replaced with small down arrow */
    .sidebar-nav.docked .sidebar-nav-link.has-submenu::after {
      content: '▾';
      font-size: 0.65rem;
      margin-left: 0.2rem;
      margin-top: 0;
      opacity: 0.75;
    }

    /* Dropdown panel — vertical list */
    .sidebar-nav.docked .sidebar-submenu {
      position: fixed;
      min-width: 210px;
      background: #0a3934;
      border-radius: 10px;
      box-shadow: 0 8px 28px rgba(0,0,0,0.38);
      padding: 0.35rem;
      z-index: 9999;
      display: none;
      max-height: none !important;
      overflow: visible !important;
    }
    .sidebar-nav.docked .sidebar-submenu.expanded {
      display: block !important;
    }

    .sidebar-nav.docked .sidebar-submenu-item {
      display: block;
    }
    .sidebar-nav.docked .sidebar-submenu-link {
      display: flex;
      align-items: center;
      gap: 0.45rem;
      padding: 0.38rem 0.75rem;
      border-radius: 7px;
      font-size: 0.82rem;
      color: rgba(255,255,255,0.82);
      white-space: nowrap;
      text-decoration: none;
      transition: background 0.15s, color 0.15s;
    }
    .sidebar-nav.docked .sidebar-submenu-link i {
      font-size: 0.75rem;
      width: 14px;
      text-align: center;
    }
    .sidebar-nav.docked .sidebar-submenu-link:hover {
      background: rgba(255,255,255,0.12);
      color: #fff;
    }
    .sidebar-nav.docked .sidebar-submenu-link.active {
      background: rgba(15,118,110,0.25);
      color: #fff;
    }

    /* Hide collapse button entirely on desktop bar mode */
    .sidebar-collapse-btn { display: none !important; }
  }

  /* ===== MOBILE RESPONSIVENESS IMPROVEMENTS ===== */
  @media (max-width: 768px) {
    /* General mobile improvements */
    * {
      box-sizing: border-box;
    }

    body {
      font-size: 14px;
      line-height: 1.5;
    }

    /* Ensure no horizontal scroll */
    html, body {
      overflow-x: hidden;
      width: 100%;
      max-width: 100vw;
    }

    /* Improve touch targets */
    a, button, input, select, textarea {
      min-height: 44px;
      min-width: 44px;
    }

    /* Better spacing for mobile */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }

    /* Table responsiveness */
    .table-responsive {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin: 0 -1rem;
      padding: 0 1rem;
    }

    table {
      min-width: 600px; /* Ensure tables don't get too cramped */
      font-size: 0.85rem;
    }

    th, td {
      padding: 0.5rem;
      white-space: nowrap;
    }

    /* Form improvements */
    .form-group, .field {
      margin-bottom: 1rem;
    }

    label {
      display: block;
      margin-bottom: 0.5rem;
      font-weight: 600;
    }

    input[type="text"], input[type="email"], input[type="password"],
    input[type="number"], input[type="date"], select, textarea {
      width: 100%;
      padding: 0.75rem;
      border: 1px solid #ddd;
      border-radius: 4px;
      font-size: 16px; /* Prevents zoom on iOS */
      box-sizing: border-box;
    }

    /* Button improvements */
    .btn, .button, button[type="submit"], input[type="submit"] {
      min-height: 44px;
      padding: 0.75rem 1.5rem;
      font-size: 1rem;
      border-radius: 6px;
      cursor: pointer;
      display: inline-block;
      text-align: center;
      text-decoration: none;
      border: none;
      box-sizing: border-box;
    }

    /* Modal improvements for mobile */
    .modal, .modal-content, .popup, .overlay {
      width: 95vw !important;
      max-width: none !important;
      margin: 5vh auto !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
    }

    /* Card and section improvements */
    .card, .panel, .section, .box {
      margin: 0 -1rem 1rem -1rem;
      padding: 1rem;
      border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    /* Grid and flex improvements */
    .row, .flex-row {
      display: flex;
      flex-wrap: wrap;
      margin: 0 -0.5rem;
    }

    .col, .flex-col {
      flex: 1;
      padding: 0 0.5rem;
      min-width: 0; /* Allow flex items to shrink */
    }

    /* Hide non-essential elements on very small screens */
    .hide-mobile, .hidden-mobile {
      display: none !important;
    }

    /* Improve spacing for lists */
    ul, ol {
      padding-left: 1.5rem;
    }

    li {
      margin-bottom: 0.5rem;
    }

    /* Better image handling */
    img {
      max-width: 100%;
      height: auto;
    }

    /* Alert and message improvements */
    .alert, .message, .notification {
      margin: 0 -1rem 1rem -1rem;
      padding: 1rem;
      border-radius: 6px;
    }
  }

  @media (max-width: 968px) {
    .navbar-toggle {
      display: flex;
    }

    .sidebar-nav {
      width: 240px;
      padding-top: 0;
    }

    /* Ensure content doesn't overflow on tablet */
    main.container {
      max-width: 100vw;
      margin: 0 auto;
      padding: 1.5rem 1rem;
    }
  }

  @media (max-width: 480px) {
    /* Reduce navbar height on mobile */
    :root {
      --navbar-height: 48px;
    }
    
    body {
      padding-top: 48px;
    }
    
    .modern-navbar {
      height: 48px;
      overflow: hidden;
    }

    .notif-bell-wrap {
      align-self: center;
    }
    .notif-bell-btn {
      font-size: 1rem;
      padding: 0.25rem 0.35rem;
    }
    
    .navbar-container {
      padding: 0.4rem 0.75rem;
      gap: 0.5rem;
      min-height: 48px;
      align-items: center;
      justify-content: space-between;
      display: flex;
      position: relative;
    }

    .navbar-brand {
      font-size: 1rem;
      flex-shrink: 1;
      min-width: 0;
      display: flex;
      align-items: center;
      line-height: 1;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
    }

    .navbar-brand span {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      line-height: 1.2;
    }

    .navbar-user {
      gap: 0.25rem;
      flex-shrink: 0;
    }

    .navbar-login-btn {
      padding: 0.4rem 0.75rem;
      font-size: 0.8rem;
      white-space: nowrap;
    }

    .navbar-user-info {
      display: none;
    }

    .navbar-toggle {
      padding: 0.5rem;
      flex-shrink: 0;
      display: flex !important;
      align-items: center;
      justify-content: center;
      min-height: 40px;
      min-width: 40px;
      max-height: 40px;
      max-width: 40px;
      margin-left: auto;
      align-self: center;
      position: absolute;
      right: 0.75rem;
      top: 50%;
      transform: translateY(-50%);
      z-index: 10;
      background: rgba(255, 255, 255, 0.1);
      border-radius: 6px;
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
    }

    .navbar-toggle span {
      width: 18px;
      height: 2px;
    }

    .sidebar-nav {
      width: 100%;
      max-width: 280px;
    }

    .navbar-logout-btn,
    .navbar-login-btn {
      padding: 0.4rem 0.75rem;
      font-size: 0.8rem;
      flex-shrink: 0;
    }

    /* Mobile-specific layout fixes */
    main.container {
      padding: 1rem 0.75rem;
      max-width: 100vw;
      width: 100vw;
      margin: 0;
      box-sizing: border-box;
    }

    body.sidebar-docked {
      margin-left: 0 !important;
    }

    /* Ensure tables and content are responsive */
    table {
      font-size: 0.85rem;
    }

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

    /* Improve button spacing on mobile */
    .btn, button, .button {
      min-height: 44px;
      padding: 0.75rem 1rem;
      font-size: 0.9rem;
    }

    /* Modal improvements for mobile */
    .modal-content, .modal {
      width: 95vw !important;
      max-width: none !important;
      margin: 10vh auto !important;
    }

    /* Form improvements for mobile */
    input, select, textarea {
      font-size: 16px; /* Prevents zoom on iOS */
      padding: 0.75rem;
    }

    /* Ensure proper spacing for cards and sections */
    .card, .section, .panel {
      margin-bottom: 1rem;
      border-radius: 8px;
    }
  }

  /* ===== NOTIFICATION BELL ===== */
  .notif-bell-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
  }
  .notif-bell-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.85);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.35rem 0.45rem;
    border-radius: 6px;
    position: relative;
    transition: color 0.2s, background 0.2s;
    line-height: 1;
  }
  .notif-bell-btn:hover { color: #fff; background: rgba(255,255,255,0.12); }
  .notif-badge {
    position: absolute;
    top: -3px;
    right: -4px;
    background: #e53935;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 3px;
    pointer-events: none;
  }
  .notif-dropdown {
    position: fixed;
    top: calc(var(--navbar-height) + 8px);
    right: 16px;
    width: 300px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.18);
    z-index: 1500;
    overflow: hidden;
  }
  .notif-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 1rem;
    background: #0f766e;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
  }
  .notif-close-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
  }
  .notif-close-btn:hover { color: #fff; }
  .notif-dismiss-all-btn {
    background: none;
    border: 1px solid rgba(255,255,255,0.45);
    color: rgba(255,255,255,0.85);
    font-size: 0.72rem;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    line-height: 1.4;
  }
  .notif-dismiss-all-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }
  .notif-list { max-height: 172px; overflow-y: auto; scroll-behavior: smooth; }
  .notif-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.85rem;
  }
  .notif-item:last-child { border-bottom: none; }
  .notif-icon { font-size: 1rem; margin-top: 1px; flex-shrink: 0; }
  .notif-icon.warning { color: #f59e0b; }
  .notif-icon.alert   { color: #e53935; }
  .notif-body { flex: 1; min-width: 0; }
  .notif-title { font-weight: 600; color: #1a1a1a; margin-bottom: 1px; }
  .notif-msg   { color: #555; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .notif-actions { display: flex; gap: 0.4rem; margin-top: 0.4rem; }
  .notif-dismiss-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    border: 1px solid #ccc;
    background: none;
    color: #888;
    cursor: pointer;
  }
  .notif-dismiss-btn:hover { background: #f5f5f5; color: #333; }
  .notif-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: #999;
    font-size: 0.85rem;
  }

  /* Polish (CSS only): colored notification accents + small global touches */
  .notif-item { border-left: 4px solid transparent; transition: background 0.2s; }
  .notif-item:hover { background: #fbf6ec; }
  .notif-item:has(.notif-icon.warning) { border-left-color: #f59e0b; }
  .notif-item:has(.notif-icon.alert) { border-left-color: #e53935; }
  .notif-badge { box-shadow: 0 0 0 2px #0f766e, 0 2px 6px rgba(229, 57, 53, 0.45); }
  .notif-dropdown-header { background: linear-gradient(90deg, #0f766e 0%, #0f766e 100%); }
  .sidebar-nav-link.active { border-left-color: #e8dcc4; }
  ::selection { background: rgba(15, 118, 110, 0.28); }
  html { scrollbar-width: thin; scrollbar-color: #0f766e transparent; }
  input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.25);
  }
