/* Base layout */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', Tahoma, Verdana, Segoe, sans-serif;
    background-color: #FAFAFA;
    color: #000000;
    line-height: 1.5;
    font-size: 14px; /* slightly smaller overall */
}

/* Headings */
h1 {
    color: #0E5A53;
    font-size: 1.6rem;
}

h2,
h3,
h4,
h5,
h6 {
    color: #000000;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
}

a:hover,
a:focus {
    text-decoration: underline;
}

/* Header */
.site-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid #E0E0E0;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.logo-area img {
    max-height: 66px; /* 10px bigger than original */
    width: auto;
    display: block;
}

.title-area {
    margin-left: auto;
    text-align: right;
}

.title-area h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 500;
}

/* Optional admin nav (to be used in header.php) */
.admin-nav {
    background-color: #F5F5F5;
    border-bottom: 1px solid #E0E0E0;
}

.admin-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6px 24px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.admin-nav a {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 0.9rem;
    text-decoration: none;
    color: #000000;
}

.admin-nav a:hover {
    background-color: #E0E0E0;
}

.admin-nav a.active {
    background-color: rgb(26, 170, 157);
    color: #FFFFFF;
}

/* Main content shell */
.site-main {
    max-width: 1200px;
    margin: 24px auto 48px;
    padding: 0 24px;
    min-height: calc(100vh - 260px); /* rough space for header + footer */
}

/* Footer */
.site-footer {
    background-color: rgb(26, 170, 157);
    padding: 32px 24px 16px;
    color: #FFFFFF;
}

.site-footer a {
    color: #FFFFFF;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: space-between;
}

.footer-column {
    flex: 1 1 180px;
    min-width: 180px;
}

.footer-column h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    font-weight: 500;
}

.footer-column p {
    margin: 4px 0;
    font-size: 0.85rem;
}

/* Social icons */
.social-links {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 4px;
}

.social-links img {
    width: 24px;
    height: 24px;
    display: block;
    /* force icons to white */
    filter: invert(1) brightness(1000%);
}

/* Horizontal line & bottom credit */
.footer-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.4);
    margin: 24px auto 12px;
    max-width: 1200px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-bottom p {
    margin: 0 0 4px;
    font-size: 0.8rem;
}

/* ============================
   Auth / Login page
   ============================ */

.auth-container {
    max-width: 420px;
    margin: 48px auto 72px;
    padding: 28px 28px 36px;
    background-color: #FFFFFF;
    border-radius: 6px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.auth-title {
    margin: 0 0 20px;
    font-size: 1.8rem;
    font-weight: 700;
    text-align: center;
}

.auth-form .form-group {
    margin-bottom: 14px;
}

.auth-form label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.auth-form .form-control {
    width: 100%;
    padding: 8px 10px;
    border-radius: 4px;
    border: 1px solid #E0E0E0;
    background-color: #FFFFFF;
    font: inherit;
    font-size: 0.9rem;
}

.auth-form .form-control:focus {
    outline: none;
    border-color: rgb(26, 170, 157);
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 16px;
    font-size: 0.85rem;
}

.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

.btn {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    text-align: center;
    font-size: 0.9rem;
}

.btn-primary {
    background-color: rgb(26, 170, 157);
    color: #FFFFFF;
    width: 160px;
    margin: 0 auto;
    display: block;
}

.btn-primary:hover,
.btn-primary:focus {
    opacity: 0.9;
}

.auth-footer-link {
    margin-top: 16px;
    text-align: center;
    font-size: 0.85rem;
}

.auth-footer-link a {
    color: #000000;
    text-decoration: none;
}

.auth-footer-link a:hover,
.auth-footer-link a:focus {
    text-decoration: underline;
}

/* ============================
   Dashboard Layout
   ============================ */

.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 0 48px;
    font-size: 0.9rem;
}

/* Scorecards container */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

/* Individual card */
.dashboard-cards .card {
    background-color: #FFFFFF;
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #E0E0E0;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.dashboard-cards .card-label {
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 4px;
}

.dashboard-cards .card-value {
    font-size: 1.4rem;
    font-weight: 700;
    min-height: 1.4rem;
    display: flex;
    align-items: center;
}

/* Search + export bar */
.dashboard-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.dashboard-search {
    display: flex;
    gap: 8px;
}

.dashboard-search input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    min-width: 260px;
    font-size: 0.85rem;
}

.dashboard-search button {
    padding: 8px 12px;
    border: none;
    background-color: rgb(26, 170, 157);
    color: #FFFFFF;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.dashboard-search a {
    padding: 8px 12px;
    background-color: #FAFAFA;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    text-decoration: none;
    color: #000000;
    font-size: 0.85rem;
}

.dashboard-search button:hover {
    opacity: 0.9;
}

.dashboard-export a {
    padding: 8px 12px;
    background-color: rgb(26, 170, 157);
    color: #FFFFFF;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
}

.dashboard-export a:hover {
    opacity: 0.9;
}

/* Results Table */

.dashboard-table-wrapper {
    overflow-x: auto;
    margin-top: 16px;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    background-color: #FFFFFF;
    border: 1px solid #E0E0E0;
    font-size: 0.85rem;
}

.results-table th,
.results-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #E0E0E0;
    text-align: left;
}

.results-table th {
    background-color: rgb(26, 170, 157); /* teal header */
    color: #FFFFFF;
    font-weight: 600;
}

.results-table tbody tr:nth-child(odd) {
    background-color: #FFFFFF;
}

.results-table tbody tr:nth-child(even) {
    background-color: #F5F5F5; /* light grey */
}

.results-table tbody tr:hover {
    background-color: #EDEDED;
}

/* Icons inside the table */
.results-table a {
    font-size: 1.2rem;
}

/* Loading row */
.loading-cell {
    text-align: center;
    padding: 20px;
    font-size: 0.9rem;
}

/* Pagination */

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 0.85rem;
}

.pagination a {
    padding: 8px 12px;
    background-color: rgb(26, 170, 157);
    color: #FFFFFF;
    border-radius: 4px;
    text-decoration: none;
}

.pagination a:hover {
    opacity: 0.9;
}

.pagination span {
    padding: 8px 12px;
    background-color: #FAFAFA;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
}

/* ============================
   Spinners / skeleton
   ============================ */

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.15);
    border-top-color: rgb(26, 170, 157);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive tweaks */
@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .title-area {
        text-align: left;
        margin-left: 0;
    }

    .title-area h1 {
        font-size: 1.3rem;
    }

    .site-main {
        margin: 16px auto 32px;
        padding: 0 16px;
    }

    .footer-inner {
        flex-direction: column;
    }

    .dashboard-toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* ============================
   Modal styles
   ============================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-overlay.is-visible {
    display: flex;
}

.modal {
    background-color: #FFFFFF;
    border-radius: 8px;
    max-width: 480px;
    width: 100%;
    padding: 16px 20px 20px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close {
    border: none;
    background: transparent;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.modal-body .form-group {
    margin-bottom: 10px;
}
