:root {
    --bg: #f6f7fb;
    --bg-card: #f1f2f7;
    --text: #101828;
    --muted: #667085;
    --border: #d0d5dd;
    --placeholder: #aaa;
    --error: red;
    --success: green;
    --brand: #4f46e5;
    --brandRing: rgba(79, 70, 229, 0.15);
    --nav-bar: #333;
    --nav-bg: rgb(160, 14, 14);
    --nav-fg: white;
    --radius: 14px;
}

body {
    /* font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; */
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    margin: 0;
    padding: 18px;
    line-height: 1.0;
    color: var(--gray-900);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    flex: 1;
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
    max-width: 900px;
    margin: 0 auto;
}

.card {
    background: var(--bg-card);
    border: 1px solid #eaecf0;
    border-radius: 22px;
    padding: 22px;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
    border-top-left-radius: 0px;
    border-top-right-radius: 0px;
    border-bottom-left-radius: 22px;
    border-bottom-right-radius: 22px;
}

.header {
    margin-bottom: 18px;
}

.header h1 {
    margin: 0 0 6px;
    font-size: 22px;
    color: rgb(38, 38, 156);
}

.header p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

#clock {
    font-family: 'Lucida Console', Monaco, monospace;
    margin: auto auto;
    width: 100%;
    text-align: right;
}

/* ✅ FORM LAYOUT (GRID + GAP) */
.form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

/* ✅ RESPONSIVE 2-COLUMN */
@media (min-width: 700px) {
    .form {
        grid-template-columns: repeat(2, 1fr);
    }

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

/* ✅ GROUP WRAPPER */
.form-group {
    display: grid;
    gap: 8px;
}

label {
    font-weight: 600;
    font-size: 14px;
}

/* ✅ IMPORTANT: Fix default font mismatch for form elements */
input,
textarea,
select,
button {
    font: inherit;
}

/* ✅ INPUT/TEXTAREA/SELECT STYLE (but avoid checkbox/radio!) */
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
    width: 100%;
    padding: 6px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease,
        transform 120ms ease;
}

/* ✅ placeholder look */
input::placeholder,
textarea::placeholder {
    color: var(--placeholder)
}

/* ✅ textarea resize control */
textarea {
    resize: vertical;
    min-height: 120px;
}

/* ✅ focus ring = PRO LOOK */
input:focus,
textarea:focus,
select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brandRing);
}

/* ✅ focus-visible (better accessibility) */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 3px;
}

.input-error {
    margin: -2px 0 0;
    border: 2px solid #ff4444 !important;
    background-color: rgb(253, 221, 213) !important;
}


input:not([type="checkbox"]):read-only {
    border-color: transparent;
    background-color: transparent;
    padding-left: 0;
    /* Align text with labels if border is gone */
    cursor: default;
    box-shadow: none;
    color: cadetblue
}

/* Ensure it doesn't react to focus */
input:not([type="checkbox"]):read-only:focus {
    border-color: transparent;
    box-shadow: none;
}



/* ✅ helper text */
.hint {
    margin: -2px 0 0;
    font-size: 13px;
    color: var(--muted);
}

/* ✅ error message */
.error {
    margin: -2px 0 0;
    font-size: 13px;
    color: var(--error)
}

.formsuccess {
    margin: 13px 0 0;
    font-size: 18px;
    color: var(--success)
}

.formerror {
    margin: 13px 0 0;
    font-size: 18px;
    color: var(--error)
}


/* ✅ checkbox / radio brand color */
input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--brand);
}

/* ✅ checkbox row alignment */
.form-group.checkbox label {
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #344054;
    user-select: none;
}

/* ✅ small “section label” for better UI */
.section-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    color: #344054;
    text-transform: uppercase;
    margin-top: 2px;
}

/* ✅ button */
.btn {
    padding: 12px 16px;
    border: none;
    border-radius: 14px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 1020ms ease, opacity 180ms ease;
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ✅ secondary button */
.btn-secondary {
    background: #242629;
}

/* ✅ footer actions */
.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ✅ Fine print */
.fine-print {
    font-size: 13px;
    color: var(--muted);
}

.fine-print a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.fine-print a:hover {
    text-decoration: underline;
}



/* StyledTable */
.pagination {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
}

.pagination button {
    padding: 4px 8px;
    cursor: pointer;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 4px;
}

.pagination button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* NAVBAR */
.force-closed {
    display: none !important;
}

.navbar {
    display: flex;
    align-items: center;
    background-color: var(--nav-bar);
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    position: relative;
}

/* For #clock field */
.navbar h3 {
    margin-left: auto;
    font-size: 14px;
    color: rgb(159, 178, 196);
    padding: 14px 16px;
    margin-top: 0;
    margin-bottom: 0;
}

/* Navigation without submenu */
.navbar a {
    font-size: 16px;
    color: var(--nav-fg);
    text-align: center;
    padding: 14px 16px;
    text-decoration: none;
}

/* top-left round corner for 'Home' */
#home {
    border-top-left-radius: 22px;
}

/* Subnav button */
.subnav .subnavbtn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    border: none;
    color: var(--nav-fg);
    padding: 14px 16px;
    background-color: inherit;
    cursor: pointer;
}

/* Add a red background color to navigation links on hover */
.navbar a:hover,
.subnav:hover .subnavbtn {
    background-color: var(--nav-bg);
}

/* Style the subnav content - positioned absolute */
.subnav-content {
    display: none;
    position: absolute;
    left: 0;
    background-color: var(--nav-bg);
    width: 100%;
    z-index: 1;
}

/* Style the subnav links */
.subnav-content a {
    float: left;
    color: var(--nav-fg);
    text-decoration: none;
}

/* Add a grey background color on hover */
.subnav-content a:hover {
    background-color: #eee;
    color: var(--nav-bg)
}

/* When you move the mouse over the subnav container, open the subnav content */
.subnav:hover .subnav-content {
    display: block;
}

/* disable submit button */
form:has(:invalid) button[type="submit"] {
    opacity: 0.5;
    filter: grayscale(1);
    /* pointer-events: none;   dont allow click submit button */
    cursor: not-allowed;
}


.stats-grid {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 8px 20px;
    /*font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/
    align-items: baseline;

    .label {
        font-weight: bold;
    }

    .stats-content {
        color: #0e13a2;
    }
}