/* ===== Auth pages (login, admin) ===== */

:root {
    --brand-green: #588811;
    --brand-green-light: #a7ff4b;
    --brand-green-soft: rgba(88, 136, 17, 0.12);
    --bg: #f6f8f5;
    --card-bg: #ffffff;
    --text: #1f1f1f;
    --text-muted: #6b6b6b;
    --border: rgba(0, 0, 0, 0.08);
}

/* ---- Login page ---- */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    padding: 20px;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 2px 24px rgba(0, 0, 0, 0.06);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.auth-logo img {
    height: 56px;
    margin-bottom: 16px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 24px;
}

.auth-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

.auth-success {
    background: var(--brand-green-soft);
    color: var(--brand-green);
    border: 1px solid var(--brand-green-light);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

.auth-form {
    text-align: left;
}

.auth-field {
    margin-bottom: 16px;
}

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.auth-field input[type="text"],
.auth-field input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--brand-green);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--brand-green);
}

.field-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 4px 0 8px;
}

.auth-btn {
    width: 100%;
    padding: 12px;
    background: var(--brand-green);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.auth-btn:hover {
    background: #4a7409;
}

.auth-back {
    display: inline-block;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.auth-back:hover {
    color: var(--brand-green);
}

/* ---- Admin nav ---- */
.admin-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-nav-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-nav-logo {
    height: 32px;
}

.admin-nav-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.admin-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.admin-nav-link {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.admin-nav-link:hover {
    color: var(--brand-green);
}

/* ---- Tracker nav additions ---- */
.nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.nav-link {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
}

.nav-link:hover {
    color: var(--brand-green);
}

.nav-user {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* ---- Admin container ---- */
.admin-container {
    max-width: 900px;
    margin: 24px auto;
    padding: 0 20px;
}

.admin-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    padding: 24px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.admin-card-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}

.admin-btn-new {
    display: inline-block;
    padding: 8px 16px;
    background: var(--brand-green);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
}

.admin-btn-new:hover {
    background: #4a7409;
}

.admin-btn-cancel {
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
}

/* ---- Admin table ---- */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border);
}

.admin-table tbody tr {
    border-bottom: 1px solid var(--border);
}

.admin-table tbody tr:last-child {
    border-bottom: none;
}

.admin-table td {
    padding: 12px;
    vertical-align: middle;
}

.admin-username {
    font-weight: 600;
}

.admin-branches {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 200px;
}

.admin-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-action-link {
    color: var(--brand-green);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.admin-delete-form {
    display: inline;
}

.admin-action-delete {
    background: none;
    border: none;
    color: #c33;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    padding: 0;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-admin {
    background: var(--brand-green-soft);
    color: var(--brand-green);
}

.badge-user {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
}

.muted {
    color: var(--text-muted);
}

/* ---- Branch checkboxes ---- */
.branch-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.branch-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.branch-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-green);
    margin: 0;
}

.branch-checkbox input:checked + span {
    color: var(--brand-green);
    font-weight: 600;
}

/* ---- Admin form ---- */
.admin-form {
    text-align: left;
    max-width: 500px;
    margin: 0 auto;
}

.admin-form-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 20px;
}

.admin-form-actions .auth-btn {
    width: auto;
    padding: 10px 24px;
}

.admin-nav-link.active {
    color: var(--brand-green);
    font-weight: 700;
}

.report-container {
    max-width: 1400px;
}

.report-filter-card,
.report-results-card {
    margin-bottom: 20px;
}

.report-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 16px;
    align-items: end;
}

.report-field label {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.report-field input,
.report-field select {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    font: inherit;
}

.report-field input:focus,
.report-field select:focus {
    outline: none;
    border-color: var(--brand-green);
}

.report-check {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    color: var(--text-muted);
    font-size: 13px;
}

.report-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--brand-green);
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.report-actions .auth-btn {
    width: auto;
    padding: 10px 18px;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.report-summary-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    border-radius: 12px;
    background: var(--card-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.report-summary-card strong {
    color: var(--brand-green);
    font-size: 26px;
    line-height: 1.2;
}

.report-summary-card span {
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.report-table-wrap {
    overflow-x: auto;
}

.report-table {
    min-width: 1050px;
}

.report-nowrap {
    white-space: nowrap;
}

.report-empty {
    padding: 32px !important;
    color: var(--text-muted);
    text-align: center;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
    .auth-card {
        padding: 24px;
    }

    .admin-nav {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }

    .admin-nav-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .admin-table {
        font-size: 12px;
    }

    .admin-table thead {
        display: none;
    }

    .admin-table tbody tr {
        display: block;
        padding: 12px;
        border-bottom: 1px solid var(--border);
    }

    .admin-table td {
        display: block;
        padding: 2px 0;
    }

    .report-filters {
        grid-template-columns: 1fr;
    }

    .report-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-table thead {
        display: table-header-group;
    }

    .report-table tbody tr {
        display: table-row;
        padding: 0;
    }

    .report-table td {
        display: table-cell;
        padding: 10px 12px;
    }
}
