:root {
    /* Palette inspired by the referenced site — tweak as needed */
    --brand-green: #2E7D32; /* primary (navbar) */
    --brand-green-dark: #1B5E20; /* darker (navbar end) */
    --brand-green-light: #3E8C3E; /* unused for sidebar now */
    --sidebar-green: #1E5120; /* darker sidebar start */
    --accent-gold: #D79E2A; /* warm accent */
    --muted-bg: #F6F8F5; /* page background */
    --card-bg: #FFFFFF;
    --text: #222222;
    --muted-text: #6c757d;
    --radius: 0.5rem;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 6px 18px rgba(21,34,21,0.08);
    --focus-green: rgba(46,125,50,0.24); /* focus ring color (light green) */
    --touch-min: 44px; /* recommended minimum touch size */
}

html, body {
    font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    background: var(--muted-bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Replace the default blue focus ring with a light green one (applies to buttons, links, inputs) */
.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus,
.nav-link:focus,
.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem var(--focus-green);
}

/* Navbar */
.top-row.navbar {
    background: linear-gradient(90deg, var(--brand-green) 0%, var(--brand-green-dark) 100%);
    color: #fff;
}
.navbar .navbar-brand {
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Sidebar - slightly darker green than before */
.sidebar {
    /* start from a darker sidebar green and blend to the brand green */
    background: linear-gradient(180deg, var(--sidebar-green) 0%, var(--brand-green) 100%) !important;
    color: #fff !important;
    border-right: 1px solid rgba(0,0,0,0.12);
    padding-top: 0.5rem;
}

/* Sidebar links - readable on dark green background */
.sidebar .nav-link {
    color: #fff;
    padding: .6rem 1rem;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
    display: flex;
    align-items: center;
    gap: .5rem;
}
.sidebar .nav-link.active, .sidebar .nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
    text-decoration: none;
}

/* Global nav-link fallback for non-sidebar uses */
.nav-link {
    color: var(--text);
    padding: .6rem 1rem;
    border-radius: var(--radius);
    transition: background .15s, color .15s;
}
.nav-link.active, .nav-link:hover {
    background: rgba(46,125,50,0.06);
    color: var(--brand-green-dark);
    text-decoration: none;
}

/* Page content */
.content {
    padding-top: 1.25rem;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Cards and tables */
.card, .table {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
}

/* Make tables scrollable on small screens */
.table {
    width: 100%;
    border-collapse: collapse;
}
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Buttons */
.btn-primary {
    background-color: var(--brand-green);
    border-color: var(--brand-green-dark);
    color: #fff;
    border-radius: .45rem;
    box-shadow: 0 6px 12px rgba(46,125,50,0.08);
}
.btn-primary:hover {
    background-color: var(--brand-green-dark);
    border-color: var(--brand-green-dark);
}

/* Secondary/outline */
.btn-secondary {
    background: white;
    border-radius: .45rem;
    color: var(--brand-green-dark);
    border: 1px solid rgba(0,0,0,0.06);
}

/* Accent utility */
.btn-accent {
    background: var(--accent-gold);
    color: #111;
    border-color: rgba(0,0,0,0.06);
}

/* Forms */
.form-control {
    border-radius: .35rem;
    border: 1px solid rgba(0,0,0,0.08);
    transition: box-shadow .12s, border-color .12s;
    min-height: 2.4rem;
    padding: .5rem .6rem;
    box-sizing: border-box;
}
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(46,125,50,0.12);
    border-color: var(--brand-green);
}

/* Tables */
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(46,125,50,0.03);
}
.table th {
    font-weight: 600;
    color: var(--brand-green-dark);
}

/* Buttons in lists */
.btn-sm {
    border-radius: .35rem;
}

/* Headings and sections */
h1 {
    font-weight: 600;
    color: var(--brand-green-dark);
}

/* MOBILE / SMALL SCREEN IMPROVEMENTS */
@media (max-width: 992px) {
  /* Keep the sidebar element present on small screens so the NavMenu component
     (which relies on the checkbox toggler and .nav-scrollable inside the sidebar)
     can show the collapsible menu. Previously the sidebar was hidden completely,
     preventing mobile toggling from working. */
  .sidebar {
    display: block;
    position: relative;
    width: 100%;
  }

  /* Make top navbar brand more compact */
  .navbar .navbar-brand { padding-left: 1rem; font-size: 1.05rem; }

  /* Ensure content uses more horizontal space */
  .content { padding-left: .75rem; padding-right: .75rem; }

  /* Tables: wrap in scroll container; safe default if markup doesn't include .table-responsive */
  .table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Increase touch target for links/buttons inside lists and navs */
  .nav-link, .btn, .btn-sm {
    padding-top: .7rem;
    padding-bottom: .7rem;
    min-height: var(--touch-min);
  }

  /* Stack small form fields vertically */
  .row.g-3 > [class*="col-"] {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
  }

  /* Make primary actions full width and easy to tap */
  .btn-primary, .btn-secondary, .btn-accent {
    display: block;
    width: 100%;
    margin-bottom: .5rem;
  }

  /* Smaller tables spacing */
  .table td, .table th {
    padding: .45rem .6rem;
  }

  /* Compact headers */
  h1 { font-size: 1.25rem; margin-bottom: .6rem; }

  /* Make small icons + labels in lists wrap nicely */
  .sidebar .nav-link { gap: .6rem; padding-left: .9rem; padding-right: .9rem; }

  /* Ensure modals/overlays and offcanvas nav get top spacing */
  .modal, .offcanvas { padding-top: 1rem; }
}

/* VERY SMALL (phones) optimizations */
@media (max-width: 576px) {
  .content { padding-left: .5rem; padding-right: .5rem; }
  .navbar .navbar-brand { font-size: 1rem; }
  .btn-primary, .btn-secondary { font-size: 0.95rem; padding: .6rem; }
  .table td, .table th { font-size: .95rem; }
}

/* Accessibility hint for focus-visible */
:focus-visible {
  outline: 3px solid var(--brand-green-dark);
  outline-offset: 2px;
}