/* ============================================================
   Brew City Rentals Prototype Styles
   Main stylesheet for layout, navigation, tables, forms, reports,
   dashboard cards, checkout screens, and responsive behavior.
   Green theme version.
   ============================================================ */


/* ============================================================
   1. Global Reset and Base Page Styles
   ============================================================ */

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f4f6f2;
    color: #111111;
    font-size: 14px;
}


/* ============================================================
   2. Header
   ============================================================ */

header {
    background-color: #002d04;
    color: #ffffff;
    padding: 16px 0;
}

header .container,
.header-inner {
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 20px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    color: #ffffff;
}

header h1 {
    margin: 0;
    color: #ffffff;
    font-size: 30px;
    line-height: 1.1;
}

header p {
    margin: 6px 0 0 0;
    color: #ffffff;
    font-size: 14px;
}


/* ============================================================
   3. Navigation and Dropdown Menus
   ============================================================ */

.site-nav {
    background-color: #4f7942;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.nav-inner {
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.nav-link {
    height: 38px;
    padding: 0 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    border-radius: 5px;
    white-space: nowrap;
}

.nav-link:hover,
.nav-item:hover .nav-menu-trigger,
.nav-menu-trigger:focus {
    background-color: #ffffff;
    color: #0d3b05;
}

.nav-item {
    position: relative;
    height: 38px;
    display: inline-flex;
    align-items: center;
}

.nav-menu-trigger {
    cursor: default;
    outline: none;
}

.nav-menu {
    display: none;
    position: absolute;
    top: 38px;
    left: 0;
    min-width: 245px;
    background-color: #ffffff;
    border: 1px solid #cbd8c4;
    border-radius: 6px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.20);
    z-index: 1000;
    padding: 6px 0;
}

.nav-item:hover .nav-menu,
.nav-item:focus-within .nav-menu {
    display: block;
}

.nav-menu a {
    display: block;
    color: #0d3b05;
    text-decoration: none;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: normal;
    line-height: 1.2;
}

.nav-menu a:hover {
    background-color: #edf5e9;
    color: #002d04;
}

.nav-logout {
    margin-left: auto;
}


/* ============================================================
   4. Main Layout Containers and Headings
   ============================================================ */

.container,
main.container {
    max-width: 1050px;
    margin: 22px auto;
    background-color: #ffffff;
    padding: 26px;
    border-radius: 7px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
}

h2 {
    margin-top: 0;
    margin-bottom: 18px;
    color: #111111;
    font-size: 24px;
}

h3 {
    color: #111111;
    margin-top: 26px;
    margin-bottom: 12px;
    font-size: 18px;
}


/* ============================================================
   5. Standard Module Page Header
   Used on maintenance, report, and transaction pages.
   ============================================================ */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid #cbd8c4;
}

.page-header h2 {
    margin-bottom: 8px;
}

.page-header p {
    margin: 0;
    color: #333333;
    line-height: 1.4;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}


/* ============================================================
   6. Links and Action Buttons
   ============================================================ */

a {
    color: #1d5c16;
}

a:hover {
    color: #002d04;
}

.primary-action {
    background-color: #2f5d22;
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 14px;
    border-radius: 5px;
    display: inline-block;
    white-space: nowrap;
}

.primary-action:hover {
    background-color: #4f7942;
    color: #ffffff;
}

.secondary-link {
    margin-left: 10px;
}

.cancel-link {
    display: inline-block;
}


/* ============================================================
   7. Forms and Inputs
   ============================================================ */

form {
    margin: 16px 0;
}

label {
    display: block;
    font-weight: bold;
    margin-top: 12px;
    margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    max-width: 520px;
    padding: 8px;
    border: 1px solid #bfcfba;
    border-radius: 4px;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: 2px solid #9fbd96;
    border-color: #4f7942;
}

textarea {
    min-height: 90px;
}

input[type="checkbox"] {
    margin-right: 6px;
}

input[type="submit"],
button,
.button-link {
    background-color: #2f5d22;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    padding: 9px 14px;
    margin-top: 14px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

input[type="submit"]:hover,
button:hover,
.button-link:hover {
    background-color: #4f7942;
}


/* ============================================================
   8. Search Panels
   Used above maintenance tables and reports.
   ============================================================ */

.search-panel {
    background-color: #f3f8f0;
    border: 1px solid #cbd8c4;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 18px;
}

.search-panel form {
    margin: 0;
}

.search-actions {
    margin-top: 12px;
}


/* ============================================================
   9. Standard Form Panels
   Used on add, edit, deactivate, and delete pages.
   ============================================================ */

.form-panel {
    background-color: #f3f8f0;
    border: 1px solid #cbd8c4;
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 18px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 20px;
}

.form-grid label {
    margin-top: 0;
}

.form-grid input[type="text"],
.form-grid input[type="email"],
.form-grid input[type="password"],
.form-grid input[type="date"],
.form-grid input[type="number"],
.form-grid select,
.form-grid textarea {
    max-width: none;
}

.form-full {
    grid-column: 1 / -1;
}

.form-check-row {
    margin-top: 14px;
}

.form-actions {
    margin-top: 20px;
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}


/* ============================================================
   10. Tables and Sortable Table Headers
   This section controls all data tables and clickable sort links.
   ============================================================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    font-size: 14px;
}

th {
    background-color: #2f5d22 !important;
    color: #ffffff !important;
    text-align: left;
    padding: 10px;
    font-weight: bold;
    border: 1px solid #2f5d22;
}

td {
    border: 1px solid #d7dfd2;
    padding: 9px;
    vertical-align: top;
}

tr:nth-child(even) {
    background-color: #f7faf5;
}

/* Normal table links inside body cells stay green. */

td a {
    color: #1d5c16;
}

td a:hover {
    color: #002d04;
}

/* Sortable table header links stay white on green. */

th a,
th a:link,
th a:visited,
th a:active,
th a:hover,
th a:focus,
th a.table-sort-link,
th a.table-sort-link:link,
th a.table-sort-link:visited,
th a.table-sort-link:active,
th a.table-sort-link:hover,
th a.table-sort-link:focus {
    color: #ffffff !important;
    background-color: transparent !important;
    text-decoration: underline;
    font-weight: bold;
}

/* Keep sort arrows visible. */

.table-sort-link {
    color: #ffffff !important;
    background-color: transparent !important;
    text-decoration: underline;
    font-weight: bold;
}

/* Hover effect for sortable headers. */

th a:hover,
th a.table-sort-link:hover {
    color: #ffffff !important;
    text-decoration: underline;
}


/* ============================================================
   11. Success and Error Messages
   ============================================================ */

.success {
    background-color: #e8f6ec;
    color: #1d6b32;
    border-left: 5px solid #2c8a43;
    padding: 10px 12px;
    border-radius: 4px;
}

.error {
    background-color: #fdecec;
    color: #8a1f1f;
    border-left: 5px solid #b83232;
    padding: 10px 12px;
    border-radius: 4px;
}


/* ============================================================
   12. Dashboard
   ============================================================ */

.dashboard-welcome {
    background-color: #f3f8f0;
    border-left: 5px solid #2f5d22;
    padding: 12px 16px;
    margin-bottom: 20px;
    border-radius: 6px;
}

.dashboard-welcome p {
    margin: 5px 0;
}

.dashboard-intro {
    margin-bottom: 22px;
}

.dashboard-section {
    margin-top: 30px;
    padding-top: 4px;
}

.dashboard-section h3 {
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid #cbd8c4;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 12px 0 26px 0;
}

.dashboard-card {
    min-height: 125px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    background-color: #fbfdf9;
    border: 1px solid #cbd8c4;
    border-radius: 6px;
    padding: 16px;
    text-decoration: none;
    color: #111111;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.dashboard-card:hover {
    background-color: #edf5e9;
    border-color: #4f7942;
    color: #111111;
    transform: translateY(-2px);
    box-shadow: 0 4px 11px rgba(0, 0, 0, 0.12);
}

.dashboard-card .card-title {
    display: block;
    color: #0d3b05;
    font-size: 17px;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 14px;
}

.dashboard-card .card-text {
    display: block;
    color: #111111;
    font-size: 14px;
    line-height: 1.3;
    font-weight: normal;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.card-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background-color: #2f5d22;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 15px;
    line-height: 1;
}

.dashboard-card .card-header .card-title {
    margin-bottom: 0;
}

.admin-card {
    border-left: 5px solid #0d3b05;
}

.admin-icon {
    background-color: #0d3b05;
}


/* ============================================================
   13. Rental Checkout DVD Selector
   ============================================================ */

.dvd-filter-panel {
    background-color: #f3f8f0;
    border: 1px solid #cbd8c4;
    border-radius: 6px;
    padding: 16px;
    margin: 18px 0;
}

.dvd-filter-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
    align-items: end;
}

.dvd-filter-row label {
    margin-top: 0;
}

.dvd-results-meta {
    margin: 10px 0;
    color: #444444;
    font-size: 13px;
}

.dvd-selection-table-wrap {
    max-height: 360px;
    overflow-y: auto;
    border: 1px solid #cbd8c4;
    border-radius: 6px;
    background-color: #ffffff;
}

.dvd-selection-table {
    margin-top: 0;
    table-layout: fixed;
}

.dvd-selection-table th,
.dvd-selection-table td {
    font-size: 13px;
}

.dvd-selection-table th:nth-child(1),
.dvd-selection-table td:nth-child(1) {
    width: 70px;
    text-align: center;
}

.dvd-selection-table th:nth-child(2),
.dvd-selection-table td:nth-child(2) {
    width: 135px;
}

.dvd-selection-table th:nth-child(4),
.dvd-selection-table td:nth-child(4) {
    width: 125px;
}

.dvd-selection-table th:nth-child(5),
.dvd-selection-table td:nth-child(5),
.dvd-selection-table th:nth-child(6),
.dvd-selection-table td:nth-child(6) {
    width: 85px;
}

.dvd-title-cell strong {
    color: #0d3b05;
}


/* ============================================================
   14. Rental Checkout Customer Selector
   ============================================================ */

.customer-filter-panel {
    margin-bottom: 16px;
}

.customer-results-meta {
    margin: 8px 0 0 0;
    color: #444444;
    font-size: 13px;
}

.checkout-form-section {
    background-color: #f3f8f0;
    border: 1px solid #cbd8c4;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 18px;
}


/* ============================================================
   15. Compact Audit Log Table
   ============================================================ */

.audit-table {
    table-layout: fixed;
    font-size: 13px;
}

.audit-table th,
.audit-table td {
    overflow-wrap: anywhere;
    word-break: normal;
}

.audit-table th:nth-child(1),
.audit-table td:nth-child(1) {
    width: 65px;
}

.audit-table th:nth-child(2),
.audit-table td:nth-child(2) {
    width: 145px;
}

.audit-table th:nth-child(3),
.audit-table td:nth-child(3) {
    width: 190px;
}

.audit-table th:nth-child(4),
.audit-table td:nth-child(4) {
    width: 190px;
}

.audit-user,
.audit-action {
    line-height: 1.35;
}

.audit-user strong,
.audit-action strong {
    color: #111111;
}

.audit-description {
    line-height: 1.35;
}


/* ============================================================
   16. Utility Text
   ============================================================ */

.muted {
    color: #555555;
    font-size: 12px;
}


/* ============================================================
   17. Printable Report Cleanup
   ============================================================ */

.print-actions {
    margin-bottom: 20px;
}


/* ============================================================
   18. Footer
   ============================================================ */

.site-footer {
    background-color: #0d3b05;
    color: #ffffff;
    text-align: center;
    padding: 22px 10px;
    margin-top: 28px;
}

.footer-inner {
    max-width: 1050px;
    margin: 0 auto;
    padding: 0 20px;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    color: #ffffff;
}

.footer-inner p {
    color: #ffffff;
    margin: 0 0 12px 0;
}

.footer-logo {
    margin-top: 8px;
}

.footer-logo img {
    max-width: 90px;
    height: auto;
    display: inline-block;
    border-radius: 6px;
}


/* ============================================================
   19. Medium Screen Responsive Layout
   ============================================================ */

@media screen and (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .nav-inner {
        flex-wrap: wrap;
        padding-top: 8px;
        padding-bottom: 8px;
        min-height: auto;
    }

    .nav-logout {
        margin-left: 0;
    }
}


/* ============================================================
   20. Smaller Screen Responsive Layout
   ============================================================ */

@media screen and (max-width: 800px) {
    .dvd-filter-row {
        grid-template-columns: 1fr;
    }

    .dvd-selection-table-wrap {
        overflow-x: auto;
    }

    .dvd-selection-table {
        min-width: 760px;
    }

    .audit-table {
        font-size: 12px;
    }
}

@media screen and (max-width: 700px) {
    .page-header {
        flex-direction: column;
    }

    .page-header-actions {
        justify-content: flex-start;
    }

    .secondary-link {
        display: inline-block;
        margin-left: 0;
        margin-top: 8px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 650px) {
    .container,
    main.container {
        margin: 12px;
        padding: 18px;
    }

    header h1 {
        font-size: 25px;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .nav-inner {
        align-items: flex-start;
    }

    .nav-link,
    .nav-item {
        height: 34px;
    }

    .nav-link {
        font-size: 13px;
        padding: 0 10px;
    }

    .nav-menu {
        position: static;
        min-width: 100%;
        width: 100%;
        margin-top: 4px;
    }

    table {
        font-size: 13px;
    }

    .card-header {
        align-items: flex-start;
    }

    .card-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 13px;
    }
}


/* ============================================================
   21. Print Styles
   ============================================================ */

@media print {
    .site-nav,
    .print-actions {
        display: none;
    }

    body {
        background: #ffffff;
    }

    .container,
    main.container {
        box-shadow: none;
        margin: 0;
        width: 100%;
        max-width: none;
    }
}


/* ============================================================
   22. Final Table Header Safety Override
   This section must stay LAST.
   It restores the green table header and white header text even
   when sortable links are used.
   ============================================================ */

table tr th {
    background-color: #2f5d22 !important;
    color: #ffffff !important;
    border: 1px solid #2f5d22 !important;
}

table tr th a,
table tr th a:link,
table tr th a:visited,
table tr th a:hover,
table tr th a:active,
table tr th a:focus,
table tr th a.table-sort-link,
table tr th a.table-sort-link:link,
table tr th a.table-sort-link:visited,
table tr th a.table-sort-link:hover,
table tr th a.table-sort-link:active,
table tr th a.table-sort-link:focus {
    color: #ffffff !important;
    background-color: transparent !important;
    text-decoration: underline !important;
    font-weight: bold !important;
}

