@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;600;700&display=swap');

:root {
    /* New Bright Green Palette */
    --primary-brightest: #0eff00;
    /* Neon Green */
    --primary-bright: #1fc600;
    /* Vivid Green */
    --primary-main: #089000;
    /* Main Green */
    --primary-dark: #0a5d00;
    /* Dark Green */
    --primary-darkest: #063b00;
    /* Deepest Green */

    /* Derived / UI */
    --primary-pale: #e8fce8;
    /* Very Light Green BG */
    --sidebar-bg: #063b00;
    /* Sidebar dark green */
    --sidebar-header: #0a5d00;
    --sidebar-active: #089000;
    --sidebar-hover: rgba(14, 255, 0, 0.10);
    --accent: #0eff00;

    --white: #ffffff;
    --text-main: #1a2e1a;
    /* Deep green-tinted dark text */
    --text-muted: #4a6b4a;
    --body-bg: #f0faf0;
    /* Subtle green-tinted page background */
}

/* ─── Base ─────────────────────────────────────────── */
body {
    font-family: 'Inter', sans-serif;
    background: var(--body-bg);
    color: var(--text-main);
    overflow-x: hidden;
    font-size: 0.97rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Poppins', 'Inter', sans-serif;
    color: var(--primary-darkest);
    font-weight: 600;
}

a {
    color: var(--primary-main);
}

a:hover {
    color: var(--primary-dark);
}

/* ─── Auth Pages (Login/Register) ──────────────────── */
.hero-gradient {
    background: linear-gradient(135deg, var(--primary-darkest) 0%, var(--primary-main) 100%);
    min-height: 100vh;
}

.auth-card {
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: none;
    overflow: hidden;
}

.auth-sidebar-image {
    background-size: cover;
    background-position: center;
    min-height: 100%;
}

/* ─── Sidebar Layout ────────────────────────────────── */
.wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

#sidebar {
    min-width: 250px;
    max-width: 250px;
    background: var(--sidebar-bg);
    color: #fff;
    transition: all 0.3s;
    min-height: 100vh;
}

#sidebar.active {
    margin-left: -250px;
}

#sidebar .sidebar-header {
    padding: 20px;
    background: var(--sidebar-header);
    border-bottom: 2px solid rgba(14, 255, 0, 0.2);
}

/* Invert Logo for Sidebar */
.white-logo {
    filter: brightness(0) invert(1);
    -webkit-filter: brightness(0) invert(1);
}

#sidebar ul.components {
    padding: 20px 0;
}

#sidebar ul li a {
    padding: 13px 20px;
    font-size: 0.95em;
    font-weight: 500;
    display: block;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: all 0.25s;
    border-left: 4px solid transparent;
    letter-spacing: 0.01em;
}

#sidebar ul li a:hover,
#sidebar ul li.active>a {
    color: #fff;
    background: var(--sidebar-hover);
    border-left: 4px solid var(--accent);
}

#sidebar ul li.active>a {
    background: rgba(14, 255, 0, 0.12);
    color: var(--accent);
    font-weight: 600;
}

#content {
    width: 100%;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

/* ─── Responsive Sidebar ────────────────────────────── */
@media (max-width: 768px) {
    #sidebar {
        margin-left: -250px;
    }

    #sidebar.active {
        margin-left: 0;
    }
}

@media (min-width: 769px) {
    #sidebar.active {
        margin-left: -250px;
    }
}

/* ─── Buttons ───────────────────────────────────────── */
.btn-primary {
    background-color: var(--primary-main);
    border-color: var(--primary-main);
    color: #fff;
    padding: 9px 22px;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    box-shadow: 0 4px 14px rgba(8, 144, 0, 0.3);
}

.btn-success {
    background-color: var(--primary-bright);
    border-color: var(--primary-bright);
    color: #fff;
    font-weight: 600;
}

.btn-success:hover {
    background-color: var(--primary-main);
    border-color: var(--primary-main);
}

.btn-outline-primary {
    color: var(--primary-main);
    border-color: var(--primary-main);
}

.btn-outline-primary:hover {
    background-color: var(--primary-main);
    border-color: var(--primary-main);
    color: #fff;
}

/* ─── Top Navbar (inside portals) ───────────────────── */
.navbar.bg-light {
    background: #fff !important;
    border-bottom: 1px solid var(--primary-pale);
}

/* ─── Cards ─────────────────────────────────────────── */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(6, 59, 0, 0.08), 0 1px 4px rgba(6, 59, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(6, 59, 0, 0.12);
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    border-bottom: 1px solid var(--primary-pale);
}

/* ─── Price Badge ────────────────────────────────────── */
.price-badge {
    background: linear-gradient(135deg, var(--primary-main), var(--primary-bright));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
    letter-spacing: 0.02em;
}

/* ─── Forms ─────────────────────────────────────────── */
.form-control,
.form-select {
    border-radius: 8px;
    padding: 8px 12px;
    border: 1.5px solid #d1e8d1;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-main);
    box-shadow: 0 0 0 3px rgba(8, 144, 0, 0.13);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--primary-darkest);
    margin-bottom: 4px;
}

/* ─── Tables ─────────────────────────────────────────── */
.table thead th {
    background: var(--primary-pale);
    color: var(--primary-darkest);
    font-weight: 600;
    border-bottom: 2px solid #c6e8c6;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-hover tbody tr:hover {
    background: #f2faf2;
}

/* ─── Badges ─────────────────────────────────────────── */
.badge.bg-success {
    background-color: var(--primary-main) !important;
}

/* ─── Section Header ─────────────────────────────────── */
.section-header {
    border-bottom: 2px solid var(--primary-pale);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* ─── Autocomplete ───────────────────────────────────── */
.autocomplete-items {
    position: absolute;
    border: 1px solid #c6e8c6;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(6, 59, 0, 0.1);
    border-radius: 0 0 8px 8px;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    border-bottom: 1px solid #e8f5e8;
}

.autocomplete-items div:hover {
    background-color: var(--primary-pale);
    color: var(--primary-dark);
}

.autocomplete-active {
    background-color: var(--primary-pale) !important;
    color: var(--primary-dark);
}

/* ─── UI Alignment Fixes ─────────────────────────────── */
.filter-row .form-control,
.filter-row .form-select,
.filter-row .btn {
    height: 38px !important;
}

.filter-row-sm .form-control-sm,
.filter-row-sm .form-select-sm,
.filter-row-sm .btn-sm {
    height: 31px !important;
}

/* ─── Navbar Login Button ────────────────────────────── */
.navbar .nav-item .btn-outline-light {
    color: #ffffff !important;
    border-color: #ffffff !important;
}

.navbar .nav-item .btn-outline-light:hover,
.navbar .nav-item .btn-outline-light:focus {
    color: var(--primary-dark) !important;
    background-color: var(--accent) !important;
    border-color: var(--accent) !important;
}

/* ─── Dashboard Stat Cards ───────────────────────────── */
.stat-card {
    border-left: 4px solid var(--primary-main);
    border-radius: 10px;
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-pale);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-main);
    font-size: 1.3rem;
}

/* ─── Alert/Message Styling ──────────────────────────── */
.alert-success {
    background: #d4f8d4;
    border-color: var(--primary-bright);
    color: var(--primary-darkest);
}

.alert-info {
    background: #e0f7e0;
    border-color: var(--primary-main);
    color: var(--primary-darkest);
}

/* ─── Table Scroll (horizontal + vertical) ────────── */

/* Force horizontal scroll on all .table-responsive wrappers */
.table-responsive {
    overflow-x: auto !important;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* smooth iOS scroll */
    max-height: 70vh;
    /* vertical scroll when > 70% viewport height */
    scrollbar-width: thin;
    scrollbar-color: var(--primary-main) #e8fce8;
}

/* Custom scrollbar (webkit) */
.table-responsive::-webkit-scrollbar {
    height: 7px;
    width: 7px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #e8fce8;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: var(--primary-main);
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Prevent cells from wrapping so the scroll actually triggers */
.table-responsive table {
    min-width: 700px;
    /* minimum before horizontal scroll kicks in */
    white-space: nowrap;
}

/* Sticky header so column names stay visible while scrolling vertically */
.table-responsive table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--primary-pale) !important;
    box-shadow: 0 2px 0 #c6e8c6;
}

/* Sticky Actions column — always visible on the right */
.table-responsive table th:last-child,
.table-responsive table td:last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: #fff;
    box-shadow: -3px 0 8px rgba(6, 59, 0, 0.08);
}

.table-responsive table thead th:last-child {
    z-index: 3;
    /* above both sticky header and sticky column */
    background: var(--primary-pale) !important;
}

/* Hover row — keep sticky Actions column visible */
.table-hover tbody tr:hover td:last-child {
    background: #f2faf2;
}

/* Allow certain text columns to wrap (address, school etc.) */
.table-responsive table td.wrap-text {
    white-space: normal;
    min-width: 140px;
}