/* ==========================================================
   Hidden Harvest Color Palette
   ========================================================== */

:root {

    /* Brand Colors */

    --hh-green: #157161;
    --hh-brown: #9e6c00;

    /* Text */

    --text-color: #333333;
    --heading-color: var(--hh-green);

    /* Backgrounds */

    --page-background: #ffffff;

    --table-header: #e9ecef;
    --table-footer: #f3f3f3;

    --row-stripe: #f8f8f8;
    --row-hover: #ffffe0;

    /* Borders */

    --border-color: #cccccc;
    --light-border: #dddddd;

    /* Links */

    --link-color: #0066cc;
    --link-hover-color: #004c99;

    /* Form Controls */

    --input-border: #bbbbbb;
    --focus-color: var(--hh-green);
    --focus-shadow: rgba(21, 113, 97, 0.20);

}

/*
    Hidden Harvest uses a deliberately restrained color palette.

    Most pages use neutral colors (white, gray, black) to maximize
    readability. The organization green serves as the primary accent
    color for headings, focus indicators, and primary actions.

    The brown brand color should be used sparingly.
*/

/* ==========================================================
   Global Layout
   ========================================================== */

body {
    font-family: Arial, sans-serif;
    margin: 40px;
    background: var(--page-background);
    color: var(--text-color);
}

.page-container {
    max-width: 1100px;
}


/* ==========================================================
   Typography
   ========================================================== */

h1, h2 {
    color: var(--heading-color);
}

h1 {
    margin-bottom: 10px;
}

h2 {
    margin-top: 25px;
    margin-bottom: 20px;
}

.report-description {
    margin: 0 0 1.25rem;
    color: #555;
    font-style: italic;
}


/* ==========================================================
   Links
   ========================================================== */

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    color: var(--link-hover-color);
    text-decoration: underline;
}

/* ==========================================================
   Application Title
   ========================================================== */

.app-title a {
    color: var(--heading-color);
    text-decoration: none;
}

.app-title a:hover {
    color: var(--heading-color);
    text-decoration: underline;
}

.app-title a:visited {
    color: var(--heading-color);
}

/* ==========================================================
   Tables
   ========================================================== */

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

.driver-detail-report {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}

.driver-detail-report td:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

th {
    padding: 8px;
    text-align: left;
    background: var(--table-header);
    border: 1px solid var(--border-color);
}

td {
    padding: 8px;
    border: 1px solid var(--light-border);
}

tbody tr:nth-child(even) {
    background: var(--row-stripe);
}

tbody tr:hover {
    background: var(--row-hover);
}

tfoot th {
    font-weight: bold;
    background: #f3f3f3;
    border-top: 2px solid #666;
}

.text-right {
    text-align: right;
}
th h3.report-section-title {
	margin: 0;
}

.driver-header th {
    background-color: #e5e5e5;
    border-bottom: 1px solid #666;
}

.fiscal-year-header {
    text-align: center;
}

.fiscal-year-header + th {
    border-left: 1px solid #666;
}

.totals-row th,
.totals-row td {
    font-weight: bold;
    border-top: 2px solid black;
    border-bottom: 2px solid black;
}

.report-section-header {
    background: #e5e5e5;
}

/* ==========================================================
   Report Filters
   ========================================================== */

.report-filter {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    margin: .5rem 0 1rem 0;
}

.filter-field {
    display: flex;
    flex-direction: column;
}

.filter-field label {
    margin-bottom: .35rem;
    font-weight: 600;
}

.filter-field select,
.filter-field input,
.filter-actions button {
    height: 38px;
    box-sizing: border-box;
}

.filter-field select,
.filter-field input {
    padding: .45rem;
}

.filter-actions {
    display: flex;
    align-items: flex-end;
}

.filter-actions button {
    white-space: nowrap;
}

.filter-field select.report-filter-year {
    width: 6rem;
    max-width: 6rem;
}

.report-filter-month {
    width: 140px;
}

.report-filter-single {
    align-items: center;
}

.report-filter-single .filter-field {
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.report-filter-single .filter-field label {
    margin-bottom: 0;
}

.report-filter-single .filter-actions {
    align-items: center;
}

/* ==========================================================
   Reports
   ========================================================== */

.report-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.report-pdf-link {
    white-space: nowrap;
}

/* ==========================================================
   Report Pagination
   ========================================================== */

.report-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: .5rem;
    padding-top: .75rem;
}

.pagination-summary {
    color: #666;
    font-size: .9rem;
}

.pagination-links {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex-wrap: wrap;
}

.pagination-links a,
.pagination-current,
.pagination-disabled,
.pagination-ellipsis {
    display: inline-block;
    padding: .35rem .6rem;
    border-radius: 4px;
    font-size: .9rem;
}

.pagination-links a {
    color: var(--hh-green);
    text-decoration: none;
}

.pagination-links a:hover {
    background: #f5f5f5;
    text-decoration: none;
}

.pagination-current {
    background: var(--hh-green);
    color: white;
    font-weight: 600;
}

.pagination-disabled {
    color: #aaa;
}

.pagination-ellipsis {
    color: #666;
    padding-left: .25rem;
    padding-right: .25rem;
}

.print-pagination-note {
    margin: 0 0 1.5rem;
    color: #666;
    font-size: .9rem;
    font-style: italic;
}

/* ==========================================================
   Forms
   ========================================================== */

.form-container {
    max-width: 900px;
}

.form-section {
    margin-top: 2rem;
}

.form-section:first-child {
    margin-top: 0;
}

.form-section h3 {
    margin: 0 0 1rem;
    padding-bottom: .4rem;
    border-bottom: 1px solid #ddd;
    font-size: 1.1rem;
}

.form-grid {
    display: grid;
    gap: 1.25rem 1.5rem;
}

.grid-donor-company, .grid-recipient-company {
    grid-template-columns: 1fr 2fr;
}

.grid-contact {
    grid-template-columns: 1fr 1fr;
}

.grid-address {
    grid-template-columns: 2fr .5fr 1fr;
}

.grid-phone-fax {
    grid-template-columns: 1fr 1fr;
}

.form-row {
    display: flex;
    flex-direction: column;
}

.form-row.full {
    grid-column: 1 / -1;
}

.form-row label {
    margin-bottom: .35rem;
    font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
    padding: .5rem .65rem;
    font-size: 1rem;
    border: 1px solid var(--input-border);
    border-radius: 4px;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
    outline: none;
    border-color: var(--focus-color);
    box-shadow: 0 0 0 3px var(--focus-shadow);
}

.form-actions {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ddd;
}

.form-actions button {
    height: 38px;
    padding: 0 1.2rem;
    box-sizing: border-box;
    font-size: 1rem;
    cursor: pointer;
}

.form-actions a {
    margin-left: 1rem;
}

.donation-section-divider {
    margin-top: 2rem;
}

/* ==========================================================
   User Menu
   ========================================================== */

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-menu form {
    margin: 0;
}

.user-menu button {
    padding: .4rem .8rem;
    cursor: pointer;
}

/* ==========================================================
   Dashboard
   ========================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    display: block;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    text-decoration: none;
    color: var(--hh-black);
    transition: border-color .2s;
}

.dashboard-card:hover {
    border-color: var(--hh-green);
    text-decoration: none;
}

.dashboard-icon {
    font-size: 2rem;
    margin-bottom: .75rem;
}

.dashboard-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--hh-green);
    margin-bottom: .5rem;
}

.dashboard-description {
    color: #555;
}

/* ==========================================================
   Site Header
   ========================================================== */

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
    flex-shrink: 0;
}

/* ==========================================================
   Navigation
   ========================================================== */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}


.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}


.main-nav a {
    font-weight: 600;
}


.nav-dropdown {
    position: relative;
}


.nav-dropdown-button {
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--hh-green);
    padding: .25rem;
}


.nav-dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: .5rem 0;
    z-index: 100;
}


.nav-dropdown-content a {
    display: block;
    padding: .5rem 1rem;
    white-space: nowrap;
}


.nav-dropdown-content a:hover {
    background: #f5f5f5;
}

@media (hover: hover) {

    .nav-dropdown:hover .nav-dropdown-content {
        display: block;
    }

}

/* ==========================================================
   Mobile Navigation
   ========================================================== */

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: var(--hh-green);
    padding: .25rem;
}

.site-menu {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* ==========================================================
   Messages
   ========================================================== */

.alert {
    margin: 1rem 0;
    padding: .9rem 1rem;
    border-radius: 6px;
    border: 1px solid transparent;
}

.alert-success {
    background: #e8f7e8;
    border-color: #98d398;
    color: #205520;
}

.alert-error {
    background: #fdecec;
    border-color: #e0a4a4;
    color: #7a1d1d;
}

.alert ul {
    margin: .5rem 0 0 1.25rem;
}

/* ==========================================================
   Media Queries
   ========================================================== */

@media (max-width: 768px) {

    .site-header {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .site-menu {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding-top: 1rem;
    }

    .site-menu.is-open {
        display: flex;
    }

    .main-nav {
        flex-direction: column;
        align-items: stretch;
        gap: .5rem;
    }

    .main-nav a {
        display: block;
        padding: .5rem 0;
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-button {
        width: 100%;
        text-align: left;
        padding: .5rem 0;
    }

    .nav-dropdown-content {
        position: static;
        min-width: 0;
        border: none;
        border-radius: 0;
        padding: 0 0 0 1rem;
    }

    .nav-dropdown .nav-dropdown-content {
        display: none;
    }

    .nav-dropdown.is-open .nav-dropdown-content {
        display: block;
    }

    .nav-dropdown.is-open .nav-dropdown-button {
        color: var(--hh-green);
    }

    .user-menu {
        justify-content: flex-start;
        padding-top: .5rem;
        border-top: 1px solid #ddd;
    }

}

@media print {
    nav.main-nav {
	display: none;
    }
    div.user-menu {
	display: none;
    }
    .report-filters {
        display: none;
    }
    .report-pdf-link {
        display: none;
    }
    .report-pagination {
	display: none;
    }
    .print-pagination-note {
        display: none;
    }
}
