  :root {
    /* Toy Train Palette */
    --brand-red: #E51A24;
    --brand-blue: #0052FF;
    --brand-green: #00B04F;
    --brand-yellow: #F2B800;
    --dark-bg: #121829;
    
    /* Vibrant Layout Backgrounds */
    --page-bg: #EAF2FF;             /* Soft playful blue backdrop */
    --card-bg: #FFFFFF;
    --border-toy: #1D2338;          /* High-contrast border outline */
    
    /* Chunky Toy Box Shadows */
    --toy-shadow-red: 0 6px 0px #B00F17;
    --toy-shadow-blue: 0 6px 0px #003BCC;
    --toy-shadow-yellow: 0 6px 0px #B88C00;
    --toy-shadow-green: 0 6px 0px #007A37;
    --toy-shadow-dark: 0 6px 0px #090C15;
    
    /* App Specific Token Mappings */
    --sidebar-bg: var(--brand-red);
  }

  * { box-sizing: border-box; }
  
  /* Base Body with Track Pattern Accent */
  body {
    background-color: var(--page-bg);
    background-image: radial-gradient(var(--brand-yellow) 15%, transparent 16%);
    background-size: 24px 24px;
    color: var(--dark-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
  }

  .hidden { display: none !important; }

  /* ==========================================================================
     GLOBAL TOY COMPONENTS (BUTTONS, CARDS, INPUTS)
     ========================================================================== */
  
  /* Cards - Chunky Wooden/Plastic Blocks */
  .card, .dashboard-card, #auth-section, .billing-card {
    background: var(--card-bg) !important;
    border: 3px solid var(--border-toy) !important;
    border-radius: 18px !important;
    box-shadow: var(--toy-shadow-dark) !important;
    padding: 20px;
    position: relative;
    overflow: hidden;
  }
  
  /* Alternating Block Top Borders (Toy Cars) */
  .card:nth-child(4n+1) { border-top: 10px solid var(--brand-red) !important; }
  .card:nth-child(4n+2) { border-top: 10px solid var(--brand-blue) !important; }
  .card:nth-child(4n+3) { border-top: 10px solid var(--brand-green) !important; }
  .card:nth-child(4n+4) { border-top: 10px solid var(--brand-yellow) !important; }

  /* Interactive Toy Buttons */
  button, .btn-primary {
    background-color: var(--brand-green) !important;
    color: #FFFFFF !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 3px solid var(--border-toy) !important;
    border-radius: 12px !important;
    box-shadow: var(--toy-shadow-green) !important;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
  }
  
  button:hover, .btn-primary:hover {
    opacity: 1;
    transform: translateY(-2px);
  }

  button:active, .btn-primary:active {
    transform: translateY(4px) !important;
    box-shadow: 0 2px 0px #007A37 !important;
  }
  
  /* Button Variants */
  button.secondary, .btn-secondary {
    background-color: var(--brand-yellow) !important;
    color: var(--dark-bg) !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 3px solid var(--border-toy) !important;
    border-radius: 12px !important;
    box-shadow: var(--toy-shadow-yellow) !important;
    border: 3px solid var(--border-toy) !important;
    transition: transform 0.08s ease, box-shadow 0.08s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
  }

  button.danger {
    background-color: var(--brand-red) !important;
    color: #ffffff !important;
    box-shadow: var(--toy-shadow-red) !important;
  }

  button.info {
    background-color: var(--brand-blue) !important;
    color: #ffffff !important;
    box-shadow: var(--toy-shadow-blue) !important;
  }

  button.link-btn {
    background: none !important;
    color: var(--brand-blue) !important;
    border: none !important;
    box-shadow: none !important;
    text-decoration: underline;
    text-transform: none;
    padding: 5px;
  }

  /* Form Inputs */
  input, select, textarea {
    display: block;
    width: 100%;
    margin-bottom: 12px;
    padding: 12px;
    border: 2.5px solid var(--border-toy) !important;
    border-radius: 10px !important;
    font-weight: 600;
    font-size: 15px;
    background-color: #FAFAFA;
    font-family: inherit;
  }
  
  input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand-blue) !important;
    box-shadow: 0 0 0 4px rgba(0, 82, 255, 0.25) !important;
    background-color: #FFFFFF;
  }

  /* Train Track Dividers */
  hr, .track-divider {
    border: none;
    border-top: 4px dashed var(--brand-yellow);
    margin: 24px 0;
  }

  /* Generic responsive row/group helpers used across the dashboard forms
     (schedule form, A2P form, billing plan grid, save/cancel button rows) */
  .form-row-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 0;
    width: 100%;
  }

  .btn-group-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }

  .grid-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 15px;
  }

/* ==========================================================================
     LANDING & SALES PAGE STYLES (INDEX.HTML)
     ========================================================================== */

  /* Navigation Bar - Mobile First */
  header { 
    background-color: var(--brand-red); 
    border-bottom: 4px solid var(--border-toy); 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    box-shadow: 0 4px 0px rgba(0,0,0,0.15);
  }
  
  .nav-container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 10px 14px; 
    display: flex; 
    flex-wrap: nowrap; /* Allows mobile dropdown menu to wrap underneath */
    justify-content: space-between;
    gap: 10px;
    align-items: center; 
  }

  .logo-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
  .logo-brand img { width: 32px; height: 32px; object-fit: contain; }
  .logo-brand h1 { font-size: 20px; font-weight: 800; margin: 0; color: #FFFFFF; text-shadow: 2px 2px 0px var(--border-toy); }

  .brand-title { 
    display: none; /* Hidden on mobile to save space */
    font-size: 20px; 
    font-weight: 800; 
    margin: 0; 
    color: #FFFFFF; 
    text-shadow: 2px 2px 0px var(--border-toy); 
  }

  /* Mobile Dropdown Nav Links */
  .nav-links {
    display: flex;
    flex-direction: column;
    align-items: center; 
    width: 100%;
    background-color: #B00F17; /* Slightly darker engine red */
    border-top: 3px dashed var(--brand-yellow);
    overflow-x: auto; /* Enable smooth horizontal swipe on small screens */
     -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar Firefox */
    padding: 10px 16px;
    gap: 8px;
  }
  
  .nav-links.hidden-mobile {
    display: none;
  }
  
  .nav-links a {
    text-decoration: none;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: 800;
    padding: 10px 14px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid transparent;
  }
  
  .nav-links a:hover {
    background-color: var(--brand-yellow);
    color: var(--dark-bg);
    border: 2px solid var(--border-toy);
  }

  /* Right Actions Container */
  .header-actions { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    flex-shrink: 0;
  }
  .btn-login { 
    background-color: #FFFFFF !important; 
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 3px solid var(--border-toy) !important;
    border-radius: 12px !important;
    color: var(--dark-bg) !important; 
    box-shadow: var(--toy-shadow-dark);
    padding: 6px 12px !important;
    font-size: 12px !important;
  }
  
  .btn-signup { 
    background-color: var(--brand-green) !important; 
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 3px solid var(--border-toy) !important;
    border-radius: 12px !important;
    color: #ffffff !important; 
    border: 2px solid var(--border-toy) !important;
    box-shadow: var(--toy-shadow-dark);
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  /* Hamburger Toggle Button */
  .hamburger-toggle {
    background-color: var(--brand-yellow) !important;
    color: var(--dark-bg) !important;
    border: 2px solid var(--border-toy) !important;
    box-shadow: 0 3px 0px var(--border-toy) !important;
    padding: 6px !important;
    margin-bottom: 0 !important;
    min-height: auto !important;
    border-radius: 8px !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hero Banner */
  .hero { 
    padding: 40px 16px 40px; 
    text-align: center; 
    background: transparent;
  }
  
  .hero-container { 
    max-width: 850px; 
    margin: 0 auto; 
    background: #FFFFFF;
    border: 4px solid var(--border-toy);
    border-radius: 24px;
    padding: 24px 16px;
    box-shadow: var(--toy-shadow-dark);
  }
  
  .badge-pill { 
    display: inline-flex; 
    align-items: center; 
    gap: 6px; 
    background-color: var(--brand-yellow); 
    color: var(--dark-bg); 
    font-size: 12px; 
    font-weight: 800; 
    padding: 6px 14px; 
    border-radius: 20px; 
    text-transform: uppercase; 
    border: 2px solid var(--border-toy);
    box-shadow: 0 3px 0px var(--border-toy);
    margin-bottom: 16px; 
  }
  
  .hero h2 { font-size: 28px; font-weight: 900; color: var(--dark-bg); margin: 0 0 16px 0; line-height: 1.2; }
  .hero p { font-size: 15px; color: #475569; margin: 0 0 24px 0; font-weight: 600; }
  .hero-buttons { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

  /* Feature Grid Blocks */
  .features { padding: 40px 16px; max-width: 1100px; margin: 0 auto; }
  .section-title { text-align: center; margin-bottom: 30px; }
  .section-title h3 { font-size: 24px; color: var(--dark-bg); font-weight: 900; margin: 0 0 10px 0; }
  .section-title p { font-size: 14px; color: #475569; font-weight: 600; }
  
  .grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
  
  .feature-card { 
    background-color: #ffffff; 
    border: 3px solid var(--border-toy); 
    border-radius: 16px; 
    padding: 20px; 
    box-shadow: var(--toy-shadow-dark);
    position: relative;
  }

  .feature-card:nth-child(3n+1) { border-top: 8px solid var(--brand-red); }
  .feature-card:nth-child(3n+2) { border-top: 8px solid var(--brand-blue); }
  .feature-card:nth-child(3n+3) { border-top: 8px solid var(--brand-green); }

  .feature-icon-box { 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    background: var(--brand-yellow); 
    width: 48px; 
    height: 48px; 
    border-radius: 12px; 
    border: 2px solid var(--border-toy);
    color: var(--dark-bg); 
    margin-bottom: 12px; 
    box-shadow: 0 3px 0px var(--border-toy);
  }
  
  .feature-card h4 { font-size: 18px; font-weight: 800; color: var(--dark-bg); margin: 0 0 8px 0; }
  .feature-card p { font-size: 14px; color: #475569; font-weight: 500; }

  /* Trust & Compliance Banner */
  .trust-banner { 
    background-color: var(--dark-bg); 
    color: #ffffff; 
    padding: 40px 16px; 
    text-align: center;
    border-top: 4px solid var(--border-toy);
    border-bottom: 4px solid var(--border-toy);
  }
  
  .trust-container { max-width: 900px; margin: 0 auto; }
  .trust-container h3 { font-size: 22px; margin: 0 0 12px 0; color: var(--brand-yellow); font-weight: 800; }
  .trust-container p { font-size: 14px; color: #cbd5e1; margin: 0 0 20px 0; }
  .trust-badges { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; font-size: 13px; font-weight: 700; }
  .trust-badge-item { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    background: #1E293B; 
    padding: 6px 12px; 
    border-radius: 12px; 
    border: 2px solid #334155;
  }

  /* Pricing Section Blocks */
  .pricing { padding: 40px 16px; max-width: 950px; margin: 0 auto; }
  .pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-top: 24px; }
  
  .price-card { 
    background: #ffffff; 
    border: 3.5px solid var(--border-toy); 
    border-radius: 20px; 
    padding: 24px 16px; 
    text-align: center; 
    position: relative; 
    box-shadow: var(--toy-shadow-dark);
  }
  
  .price-card.featured { 
    border: 4px solid var(--brand-blue); 
    box-shadow: var(--toy-shadow-blue);
  }
  
  .price-card .popular-tag { 
    position: absolute; 
    top: -14px; 
    left: 50%; 
    transform: translateX(-50%); 
    background: var(--brand-yellow); 
    color: var(--dark-bg); 
    font-size: 11px; 
    font-weight: 900; 
    padding: 4px 12px; 
    border-radius: 12px; 
    border: 2px solid var(--border-toy);
    text-transform: uppercase; 
  }
  
  .price-title { font-size: 20px; font-weight: 800; color: var(--dark-bg); margin: 0 0 8px 0; }
  .price-amount { font-size: 34px; font-weight: 900; color: var(--brand-blue); margin: 0 0 12px 0; }
  .price-amount span { font-size: 13px; font-weight: 600; color: #64748b; }
  .price-features { list-style: none; padding: 0; margin: 0 0 20px 0; text-align: left; font-size: 13px; font-weight: 600; }
  .price-features li { padding: 8px 0; border-bottom: 2px dashed #e2e8f0; display: flex; align-items: center; gap: 8px; }

  /* Footer */
  footer { 
    background-color: #FFFFFF; 
    border-top: 4px solid var(--border-toy); 
    padding: 24px 16px; 
    font-size: 13px; 
    font-weight: 600;
    color: #64748b; 
  }
  
  .footer-container { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
  .footer-links a { color: var(--brand-blue); text-decoration: none; font-weight: 700; }
  .footer-links a:hover { text-decoration: underline; }

  /* ==========================================================================
     APP DASHBOARD STYLES (APP.HTML & BILLING.HTML)
     ========================================================================== */

  #auth-section { 
    max-width: 400px; 
    /* Mobile: keep a side gutter instead of running edge-to-edge (auto margins
       collapse to 0 once the card stretches to fill a narrow viewport) */
    margin: 30px 16px; 
    padding: 20px; 
    border-top: 10px solid var(--brand-yellow) !important; 
  }

  #dashboard { display: flex; flex-direction: column; min-height: 100vh; }

  /* App Dashboard Header Navigation */
  .sidebar { 
    width: 100%; 
    background-color: var(--brand-red) !important; 
    color: white; 
    padding: 12px 14px; 
    display: flex; 
    flex-direction: column; /* Stack header elements on mobile */
    align-items: stretch; 
    gap: 10px;
    border-bottom: 4px solid var(--border-toy);
    box-shadow: 0 4px 0px rgba(0,0,0,0.15);
    box-sizing: border-box;
  }
  
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .sidebar-header h3 { margin: 0; font-size: 20px; color: #ffffff; font-weight: 900; text-shadow: 2px 2px 0px var(--border-toy); }

  /* Collapsible panel (nav links + user/logout) toggled by the hamburger on
     mobile. On desktop it's invisible as a box (display:contents) so its
     children lay out exactly as direct children of .sidebar, same as before. */
  .sidebar-menu-panel {
    display: contents;
  }

  /* Sidebar footer (user email + logout) - base/mobile rules live here so the
     email can't overflow narrow screens before the desktop override kicks in */
  .sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .sidebar-footer p {
    max-width: 100%;
    word-break: break-all;
  }

  /* Dashboard nav tabs */
  .nav-group { 
    display: flex; 
    gap: 8px; 
    width: 100%; 
    margin-top: 0; 
    overflow-x: auto; 
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-group::-webkit-scrollbar { display: none; }
  
  .nav-item { 
    padding: 8px 14px; 
    color: #ffffff; 
    text-decoration: none; 
    display: inline-block; 
    cursor: pointer; 
    font-size: 13px; 
    border-radius: 10px; 
    font-weight: 700; 
    border: 2px solid transparent;
    white-space: nowrap; /* Prevent tab titles from line breaking */
    flex-shrink: 0;
  }
  
  .nav-item:hover { background-color: rgba(255,255,255,0.2); }
  
  .nav-item.active { 
    background-color: var(--brand-yellow) !important; 
    color: var(--dark-bg) !important; 
    font-weight: 900; 
    border: 2px solid var(--border-toy);
    box-shadow: 0 3px 0px var(--border-toy);
  }

  .main-content { flex: 1; padding: 16px; background-color: transparent; width: 100%; min-width: 0; }

  /* .table-container clips to the rounded card shape (overflow: hidden).
     The actual horizontal scrolling happens one level in, on .table-scroll —
     splitting these two responsibilities is what guarantees wide table
     content (like a row of action buttons) can never visually escape the
     card, regardless of how wide the content ends up being. */
  .table-container { 
    width: 100%; 
    max-width: 100%;
    margin-top: 15px; 
    border-radius: 14px; 
    border: 3px solid var(--border-toy); 
    background: #FFFFFF;
    box-shadow: var(--toy-shadow-dark);
    overflow: hidden;
  }

  .table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  table { width: 100%; border-collapse: collapse; min-width: 500px; }
  th, td { border-bottom: 2px solid #e2e8f0; padding: 10px 12px; text-align: left; font-size: 13px; font-weight: 600; }
  th { background-color: #F1F5F9; font-weight: 800; color: var(--dark-bg); }
  
  .action-btn { 
    display: inline-block; 
    width: auto; 
    padding: 6px 12px; 
    margin-bottom: 4px; 
    font-size: 12px; 
    border-radius: 8px; 
    min-height: auto;
  }

  .modal-overlay { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; height: 100%; 
    background: rgba(18, 24, 41, 0.75); 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    z-index: 1000; 
    padding: 10px; 
  }
  
  .modal-content { 
    background: white; 
    padding: 20px; 
    width: 100%; 
    max-width: 500px; 
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 18px; 
    border: 4px solid var(--border-toy);
    box-shadow: 0 10px 0px rgba(0,0,0,0.3); 
    border-top: 10px solid var(--brand-blue); 
  }

  .progress-bar-bg { width: 100%; height: 14px; background: #e2e8f0; border-radius: 8px; border: 2px solid var(--border-toy); overflow: hidden; }
  .progress-bar-fill { height: 100%; width: 0%; background: var(--brand-green); transition: width 0.3s ease; }
  .badge-plan { background: var(--brand-yellow); color: var(--dark-bg); font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 10px; border: 2px solid var(--border-toy); }

  /* ==========================================================================
     MOBILE MEDIA QUERIES (767 and down) + DESKTOP MEDIA QUERIES (768px and up)
     ========================================================================== */
  /* Mobile Dropdown Position Fix */
@media (max-width: 767px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    flex-direction: column;
    background-color: #B00F17;
    border-top: 3px dashed var(--brand-yellow);
    border-bottom: 4px solid var(--border-toy);
    padding: 10px 16px;
    gap: 8px;
    margin: 0;
  }
  
  .nav-links.hidden-mobile {
    display: none !important;
  }

  /* Reflow each table row into a compact "card" on mobile: the first cells
     (Name/Email/Phone, or whatever the row's non-action data is) sit
     together on one line, and the last cell — always Actions where it
     exists — drops to its own full-width row underneath with its buttons
     laid out in a small wrapping grid, instead of being squeezed into a
     narrow column or stacked as tall full-width bars. */
  table, thead, tbody {
    display: block;
    width: 100%;
    min-width: 0; /* overrides the desktop table's min-width: 500px, which
                     was silently forcing every row (and everything in it)
                     to be at least 500px wide on phone-sized screens */
  }

  table thead {

    display: none; /* column labels aren't needed once rows become cards */
  }

  tr {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 6px 14px;
    width: 100%;
    padding: 14px 20px; /* horizontal padding matches the 20px used on
      .card/.billing-card elsewhere, so row content doesn't touch the
      card's edges the way it was */
    border-bottom: 2px solid #e2e8f0;
  }

  tr:last-child {
    border-bottom: none;
  }

  td, th {
    display: block;
    border: none;
    padding: 0;
    flex: 1 1 auto;
    min-width: 100px;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
  }

  /* The Actions cell (always last, when a row has one) becomes its own
     full-width row underneath the other data. Buttons sit in a CSS grid
     with two fixed equal columns (not flex-wrap, which kept mis-measuring
     button text and overflowing) — grid columns are a hard 50/50 split of
     the cell's own width, so buttons cannot exceed it regardless of their
     text. A 3rd/4th button (e.g. on the Schedule table) simply wraps to
     the next row. Contact rows only carry 2 buttons (Profile & Schedules,
     Send Msg) since Edit/Delete moved to the profile page. */
  td:has(.action-btn), th:has(.action-btn) {
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
  }

  td .action-btn {
    display: block;
    width: 100%;
    min-width: 0;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    margin-bottom: 0;
    padding-left: 8px;
    padding-right: 8px;
  }

  /* Stack the schedule-form frequency/date fields on phones instead of
     letting them squeeze into a row */
  .form-row-flex {
    flex-direction: column;
    align-items: stretch !important; /* the inline align-items:flex-end some
      instances use is meant for the desktop row (aligning a button with
      input bottoms) — in a column-direction flex container that same
      property controls horizontal alignment, which was shoving every
      stacked field to the right instead of letting it fill the width */
  }

  /* Give the two billing plan cards a bit less demanded width on small phones */
  .grid-plans {
    grid-template-columns: 1fr;
  }

  /* Dashboard header collapses to a compact bar (logo + hamburger), exactly
     like the marketing site's header. Tapping the hamburger reveals the nav
     tabs and the user/logout row as a dropdown panel instead of showing
     everything at once. */
  .sidebar-menu-panel {
    display: none;
    flex-direction: column;
    width: 100%;
  }

  .sidebar-menu-panel.open {
    display: flex;
  }

  .sidebar-menu-panel .nav-group {
    flex-direction: column;
    overflow-x: visible;
    margin-top: 10px;
  }

  .sidebar-menu-panel .nav-item {
    white-space: normal;
    text-align: left;
  }

  .sidebar-menu-panel .sidebar-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 3px dashed var(--brand-yellow);
  }
}

@media (min-width: 768px) {
   .logo-brand img { width: 36px; height: 36px; }
    .logo-brand h1 { font-size: 22px; }

    /* Show full text title alongside image logo on desktop */
    .brand-title { 
      display: inline-block; 
      font-size: 22px; 
    }
      
    /* Hide Hamburger Toggle on Desktop */
    .hamburger-toggle { display: none !important; }
  
    /* Display Links Inline next to Brand & Buttons on Desktop */
    header { display: flex; align-items: center; }

    /* Right-Aligned Desktop Buttons */
    .header-actions {
      margin-left: auto;
      gap: 10px;
    }
    
    .nav-container {
      width: 100%;
      padding: 12px 20px;
      flex-wrap: nowrap;
      gap: 20px;
    }
  
    .nav-links, .nav-links.hidden-mobile {
      display: flex !important;
      position: static;
      flex-direction: row;
      width: auto !important;
      background-color: transparent;
      border: none;
      padding: 0;
      margin: 0;
      gap: 16px;
    }
  
    .nav-links a {
      background-color: transparent;
      padding: 8px 14px;
      font-size: 14px;
    }
  
    .btn-login, .btn-signup {
      padding: 8px 16px !important;
      font-size: 14px !important;
    }

    /* Desktop Hero & Features */
    .hero { padding: 80px 20px 60px; }
    .hero-container { padding: 40px 25px; }
    .hero h2 { font-size: 46px; }
    .hero p { font-size: 18px; }
    .features, .pricing { padding: 60px 20px; }
    .section-title h3 { font-size: 32px; }

    /* Auth card recentres with its own horizontal breathing room on desktop */
    #auth-section { margin: 30px auto; }

    /* Desktop Dashboard Layout */
    #dashboard { flex-direction: row; }
    
    .sidebar { 
      width: 240px; 
      flex-direction: column; 
      justify-content: flex-start; 
      padding: 25px 0; 
      align-items: stretch; 
      border-right: 4px solid var(--border-toy);
      border-bottom: none;
      gap: 0;
      
    }
    
    .sidebar-header { padding: 0 20px; margin-bottom: 30px; }
    .sidebar-header h3 { font-size: 22px; }
    
    .nav-group { 
      flex-direction: column; 
      width: 100%; 
      overflow-x: visible; 
      padding: 0 12px; 
      gap: 8px;
    }

    /* Automatically pushes footer elements strictly to the bottom */
    .sidebar-footer { 
      margin-top: auto !important; /* Pushes user info & logout to the very bottom */
      padding: 20px 16px 0 16px !important; 
      border-top: 3px dashed var(--brand-yellow) !important; 
      width: 100%;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
    }
  
    /* Style adjustment for the user email text */
    .sidebar-footer p {
      margin: 0 !important;
      font-size: 13px !important;
      color: #FFFFFF !important;
      word-break: break-all; /* Prevents long email addresses from overflowing */
    }
  
    /* Full-width Log Out Button at the bottom */
    .sidebar-footer button {
      width: 100% !important;
      margin-bottom: 0 !important;
    }
  
    .nav-item { padding: 12px 16px; display: block; font-size: 14px; }
    .main-content { padding: 35px; }
  }
