:root {
    --brand-orange: #DC4D01;
    --brand-orange-hover: #B64000;
    --brand-orange-focus: rgba(220, 77, 1, 0.45);
    --brand-orange-light: rgba(220, 77, 1, 0.08);
}

body {
    background: #ffffff;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.container {
    background-color: #ffffff;
    margin: clamp(32px, 8vh, 80px) auto;
    padding: clamp(20px, 5vw, 32px);
    width: min(600px, 92vw);
    border-radius: 18px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

h2 {
    text-align: center;
    color: #333;
}

form label {
    display: block;
    margin-top: 15px;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 14px;
    margin-top: 5px;
    border-radius: 1rem;
    border: 1px solid #d1d5db;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.4;
    background-color: rgba(255, 255, 255, 0.9);
    appearance: none; /* removes default arrow for custom styling */
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'><path fill='none' stroke='%23666' stroke-width='1.5' d='M1 1l4 4 4-4'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 7px;
    cursor: text;
}

select {
    cursor: pointer;
}

/* Flash messages (e.g. login errors / successes) */
.flash-messages {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.flash-error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 8px 12px;
    border-radius: 0.75rem;
    font-size: 14px;
}

.flash-success {
    background: #dcfce7;
    border: 1px solid #22c55e;
    color: #166534;
    padding: 8px 12px;
    border-radius: 0.75rem;
    font-size: 14px;
}

.flash-info {
    background: #e0f2fe;
    border: 1px solid #3b82f6;
    color: #1d4ed8;
    padding: 8px 12px;
    border-radius: 0.75rem;
    font-size: 14px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 2px rgba(255,255,255,0.9), 0 0 0 4px var(--brand-orange-focus);
    outline: none;
    background-color: rgba(255, 255, 255, 0.95);
    cursor: text;
}

.typeahead-wrapper {
    position: relative;
    width: 100%;
}

.typeahead-input {
    width: 100%;
    display: block;
}

.typeahead-list {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: rgba(255, 255, 255, 0.97);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 0.75rem;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.16);
    max-height: 240px;
    overflow-y: auto;
    display: none;
    z-index: 90;
}

.typeahead-list.active {
    display: block;
}

.typeahead-list li {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    color: #1f2937;
    transition: background-color 0.15s ease, color 0.15s ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.typeahead-list li:hover,
.typeahead-list li.active {
    background: rgba(220, 77, 1, 0.12);
    color: var(--brand-orange);
}

.typeahead-label-primary {
    font-weight: 600;
}

.typeahead-label-secondary {
    font-size: 0.85rem;
    color: #6b7280;
}

.location-section {
    margin-bottom: 18px;
}

.location-section h3 {
    margin-bottom: 8px;
    font-size: 1.05rem;
    color: #111827;
}

.location-field-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
}

.location-field-grid .location-field {
    flex: 1 1 240px;
    min-width: 220px;
}

.location-field-grid .location-field label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

button,
.btn-primary {
    margin-top: 20px;
    width: 100%;
    padding: 14px 18px;
    background: var(--brand-orange);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    box-shadow: 0 8px 20px rgba(220, 77, 1, 0.28);
}

button:hover,
.btn-primary:hover {
    background-color: var(--brand-orange-hover);
    box-shadow: 0 12px 26px rgba(182, 64, 0, 0.32);
    transform: scale(1.02);
}

button:focus-visible,
.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 0 0 6px var(--brand-orange-focus);
    transform: scale(1.01);
}

.back-button,
.btn-secondary {
    background: #fff;
    color: var(--brand-orange) !important;
    border: 2px solid var(--brand-orange);
    padding: 14px 24px;
    font-size: 17px;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 4px 12px rgba(220, 77, 1, 0.15);
    width: auto;
}

.back-button:hover,
.btn-secondary:hover {
    background-color: rgba(220, 77, 1, 0.08);
    border-color: var(--brand-orange-hover);
    color: var(--brand-orange-hover) !important;
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(182, 64, 0, 0.18);
}

.back-button:focus-visible,
.btn-secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 0 0 6px var(--brand-orange-focus);
    transform: scale(1.01);
}

button.primary-submit,
.primary-submit.btn-primary {
    width: 100%;
    padding: 18px 22px;
    font-size: 19px;
    background: linear-gradient(135deg, var(--brand-orange), var(--brand-orange-hover));
    box-shadow: 0 14px 32px rgba(220, 77, 1, 0.35);
}

button.primary-submit:hover,
.primary-submit.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-orange-hover), #8f2c00);
    box-shadow: 0 18px 36px rgba(182, 64, 0, 0.38);
}

.form-actions-card {
    margin-top: 28px;
    padding: 20px 24px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.08);
    background: linear-gradient(145deg, rgba(255,255,255,0.92), rgba(244,246,249,0.92));
    box-shadow: 0 6px 18px rgba(15, 28, 63, 0.08);
}

.form-actions-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2a44;
}

.form-actions-card p {
    margin: 6px 0 18px;
    color: #4a5874;
    font-size: 15px;
}

.form-actions-card .action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.form-actions-card .action-buttons .back-button {
    flex: 1 1 220px;
    justify-content: center;
    text-align: center;
    padding: 14px 20px;
}

/* Mobile-friendly form layout */
@media (max-width: 768px) {
    .form-page .container {
        width: 92%;
        max-width: 480px;
        margin: 0 auto;
        padding: 16px 12px 80px;
        border-radius: 18px;
        box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    }

    .form-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin-bottom: 16px;
    }

    .form-header h2 {
        margin: 0;
        font-size: 1.4rem;
    }

    .mobile-form label {
        display: block;
        margin-top: 12px;
    }

    .mobile-form,
    .mobile-form * {
        box-sizing: border-box;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .mobile-submit-bar {
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px 0 env(safe-area-inset-bottom);
        background: linear-gradient(to top, #020617, rgba(2,6,23,0.9));
    }

    .mobile-submit-bar .btn-primary,
    .mobile-submit-bar .primary-submit {
        width: 100%;
        margin-top: 0;
    }
}

/* Mobile-focused officer home tiles */
.mobile-home {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .mobile-home {
        justify-items: center;
    }

    .mobile-home .btn-primary,
    .home-secondary {
        display: block;
        width: 80%;
        max-width: 320px;
        margin: 0 auto;
        text-align: center;
    }
}

.home-page {
    position: relative;
    min-height: 100vh;
}

.home-page::before {
    display: none;
}

.home-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

.home-card {
    width: 100%;
    max-width: 960px;
    padding: clamp(2.5rem, 5vw, 4rem);
    border-radius: 2rem;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    text-align: center;
}

@media (max-width: 768px) {
    .home-card {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
}

.home-logo {
    height: 3rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .home-logo {
        height: 3.5rem;
    }
}

.home-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    color: #1f2d3d;
}

.home-subtitle {
    margin: 0.75rem 0 2.5rem;
    color: #4a5874;
    font-size: 1.05rem;
    letter-spacing: 0.04em;
}

.home-grid {
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 640px) {
    .home-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem;
    }
}

@media (min-width: 1024px) {
    .home-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.home-bubble {
    background: rgba(255,255,255,0.92);
    border-radius: 1.5rem;
    padding: 1.75rem;
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.25rem;
    min-height: 220px;
}

.home-bubble:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 38px rgba(15, 23, 42, 0.16);
}

.home-bubble h3 {
    margin: 0;
    font-size: 1.3rem;
    color: #23324d;
}

.home-bubble p {
    margin: 0;
    color: #606f85;
    font-size: 0.95rem;
    line-height: 1.5;
}

.home-bubble .btn-primary {
    margin-top: 0;
    width: 100%;
}

.home-secondary {
    margin-top: 2rem;
    display: block;
    width: auto;
    text-align: center;
    padding: 0.9rem 2.2rem;
    margin-left: auto;
    margin-right: auto;
}

.admin-page {
    position: relative;
    min-height: 100vh;
}

.admin-page::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(0,0,0,0.5));
    pointer-events: none;
}

.admin-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(2rem, 5vw, 4rem);
}

.admin-card {
    width: 100%;
    max-width: 1100px;
    background: #ffffff;
    border-radius: 2rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    padding: clamp(2.4rem, 4vw, 3.6rem);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.admin-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 2.6rem);
    color: #1f2d3d;
}

.admin-subtitle {
    color: #58657b;
    margin: 0.25rem 0 2rem;
    font-size: 1.05rem;
    letter-spacing: 0.03em;
}

.admin-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--brand-orange);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
}

.admin-back:hover {
    color: var(--brand-orange-hover);
    transform: translateX(-2px);
}

.admin-nav-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2.25rem;
}

@media (min-width: 640px) {
    .admin-nav-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.75rem;
    }
}

@media (min-width: 1024px) {
    .admin-nav-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.admin-nav-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.9rem;
    padding: 1.85rem;
    background: rgba(255,255,255,0.94);
    border-radius: 1.6rem;
    text-decoration: none;
    color: #1f2d3d;
    box-shadow: 0 18px 32px rgba(15, 23, 42, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.admin-nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 40px rgba(15, 23, 42, 0.18);
}

.admin-nav-card h3 {
    margin: 0;
    font-size: 1.25rem;
}

.admin-nav-card p {
    margin: 0;
    color: #5f6d85;
    font-size: 0.95rem;
    line-height: 1.5;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    border-radius: 1.25rem;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 680px;
    font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-table th {
    background: rgba(31, 45, 61, 0.08);
    color: #1f2d3d;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.admin-table tr:nth-child(even) td {
    background-color: rgba(241, 245, 249, 0.55);
}

.admin-table tr:hover td {
    background-color: rgba(234, 241, 250, 0.85);
}

.admin-table form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.admin-table select {
    min-width: 180px;
    max-width: 260px;
}

.admin-table .table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ---------- Responsive refinements ---------- */

@media (max-width: 820px) {
    .container {
        width: min(560px, 94vw);
        border-radius: 16px;
        padding: clamp(20px, 6vw, 28px);
    }

    form label {
        font-size: 0.97rem;
    }

    .home-card,
    .admin-card,
    .auth-card {
        max-width: 640px;
        padding: clamp(2rem, 6vw, 3rem);
    }

    .home-grid,
    .admin-nav-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    body {
        background-attachment: scroll;
    }

    .container {
        margin: clamp(24px, 7vh, 48px) auto;
        width: min(520px, 94vw);
        padding: clamp(18px, 6vw, 26px);
    }

    .back-button,
    .btn-primary,
    .btn-secondary,
    button.primary-submit {
        font-size: 1.05rem;
        padding: 14px;
    }

    .form-actions-card .action-buttons {
        flex-direction: column;
    }

    .form-actions-card .action-buttons .back-button {
        width: 100%;
    }

    .home-grid,
    .admin-nav-grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
        gap: 1.4rem;
    }

    .home-card,
    .admin-card,
    .auth-card {
        width: min(520px, 94vw);
        padding: clamp(1.75rem, 7vw, 2.5rem);
    }

    .home-bubble,
    .admin-nav-card {
        min-height: 0;
        padding: 1.5rem;
    }

    .table-scroll {
        border-radius: 1rem;
    }

    .admin-table {
        font-size: 0.92rem;
        min-width: 600px;
    }
}

@media (max-width: 480px) {
    .container {
        width: 92vw;
        border-radius: 14px;
    }

    .typeahead-list {
        border-radius: 0.65rem;
        max-height: 200px;
    }

    .home-logo,
    .auth-logo {
        height: 2.6rem;
    }

    .home-title {
        font-size: clamp(1.75rem, 6vw, 2.2rem);
    }

    .admin-header h1 {
        font-size: clamp(1.6rem, 6vw, 2.1rem);
    }

    .home-secondary {
        width: 100%;
    }
}

@media (max-width: 320px) {
    .container {
        width: 96vw;
        padding: clamp(14px, 4vw, 20px);
        margin: clamp(16px, 4vh, 32px) auto;
        border-radius: 12px;
    }

    .home-card,
    .admin-card,
    .auth-card {
        width: 96vw;
        padding: clamp(1.5rem, 5vw, 2rem);
        border-radius: 1.25rem;
    }

    .home-grid,
    .admin-nav-grid {
        gap: 1rem;
    }

    .home-bubble,
    .admin-nav-card {
        padding: 1.25rem;
        min-height: 180px;
    }

    .home-bubble h3 {
        font-size: 1.1rem;
    }

    .home-bubble p {
        font-size: 0.85rem;
    }

    button,
    .btn-primary,
    .back-button,
    .btn-secondary {
        font-size: 0.95rem;
        padding: 12px 16px;
    }

    button.primary-submit {
        font-size: 1.05rem;
        padding: 16px 18px;
    }

    .typeahead-list {
        max-height: 180px;
        font-size: 0.9rem;
    }

    .typeahead-list li {
        padding: 8px 12px;
    }

    .form-actions-card {
        padding: 16px 18px;
    }

    .form-actions-card h3 {
        font-size: 1rem;
    }

    .form-actions-card p {
        font-size: 0.85rem;
    }

    .data-wrapper {
        padding: clamp(1.5rem, 4vw, 2rem);
    }

    .data-card {
        padding: clamp(1.25rem, 4vw, 1.75rem);
        border-radius: 1.25rem;
    }

    .submissions-title {
        font-size: 1.5rem;
    }

    .admin-table {
        font-size: 0.8rem;
        min-width: 500px;
    }

    .table thead th,
    .table tbody td {
        padding: 8px 10px;
    }

    input[type="text"],
    input[type="email"],
    input[type="number"],
    input[type="password"],
    textarea,
    select {
        font-size: 14px;
        padding: 8px;
    }

    .allocation-row {
        flex-direction: column;
        gap: 8px;
    }

    .allocation-row label {
        width: 100%;
    }
}

.auth-page {
    position: relative;
    min-height: 100vh;
}

.auth-page::before {
    display: none;
}

.auth-wrapper {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 16px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border-radius: 1.75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
    padding: clamp(2.5rem, 5vw, 3.5rem);
    text-align: center;
}

.auth-logo {
    height: 3rem;
    margin-bottom: 1.5rem;
}

.auth-card h2 {
    color: #1f2d3d;
    font-size: 1.9rem;
    margin-bottom: 0.75rem;
}

.auth-subtitle {
    color: #606f85;
    margin-bottom: 2rem;
    letter-spacing: 0.03em;
}

.auth-form label {
    text-align: left;
    font-weight: 600;
    color: #23324d;
    margin-top: 1rem;
}

.auth-form button {
    margin-top: 1.75rem;
}

.auth-footer {
    margin-top: 1.75rem;
    display: flex;
    justify-content: center;
}

.data-page {
    position: relative;
    min-height: 100vh;
}

.data-page::before {
    display: none;
}

.data-wrapper {
    position: relative;
    min-height: 100vh;
    padding: clamp(2.5rem, 5vw, 4rem);
}

.data-card {
    background: #ffffff;
    border-radius: 1.75rem;
    padding: clamp(2rem, 4vw, 3rem);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border: 1px solid rgba(0,0,0,0.05);
}

.submissions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.submissions-title {
    margin: 0;
    font-size: 2rem;
    color: #1f2d3d;
}

.submissions-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-orange);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.submissions-back:hover {
    color: var(--brand-orange-hover);
}

.submissions-back:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.95), 0 0 0 6px var(--brand-orange-focus);
    border-radius: 9999px;
    padding: 0 0.4rem;
}

/* ========== Ledger polish ========== */
.ledger-header h2 {
  margin: 0 0 8px 0;
}

.ledger-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin: 10px 0 6px 0;
}

.ledger-search {
  flex: 1 1 340px;
  max-width: 480px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #ccc;
  font-size: 16px;
  background-color: #fff;
}

.ledger-stats {
  display: flex;
  gap: 10px;
  align-items: center;
  color: #555;
  font-size: 14px;
  margin-bottom: 8px;
}
.ledger-stats .dot { opacity: 0.6; }

.ledger-scroll {
  max-height: 70vh;            /* sticky header shines when table scrolls */
  overflow: auto;
  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,0.12);
  background: #fff;
}

/* Table refresh */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
}

.table thead th {
  position: sticky;
  top: 0;
  background: var(--brand-orange);
  color: #fff;
  text-align: left;
  padding: 14px 16px;
  letter-spacing: 0.2px;
  z-index: 1;
}
.table thead th:first-child { border-top-left-radius: 12px; }
.table thead th:last-child  { border-top-right-radius: 12px; }

.table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  background: #fff;
}

.table tbody tr:nth-child(even) td { background: #fafafa; }
.table tbody tr:hover td { background: #f4f6f8; }

.table .col-amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.signature-img {
  max-height: 70px;
  max-width: 280px;
  display: block;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
}

/* ===== Dark mode overrides ===== */

:root {
    --bg-body: #020617;
    --bg-card: #0f172a;
    --bg-elevated: #111827;
    --border-subtle: #1f2937;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --table-header-bg: #111827;
    --table-row-bg: #020617;
    --table-row-alt-bg: #020617;
    --table-row-hover-bg: #111827;
}

/* Global background + text */
body {
    background: var(--bg-body);
    color: var(--text-main);
}

/* Main cards/containers */
.container,
.home-card,
.admin-card,
.auth-card,
.data-card {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    border: 1px solid var(--border-subtle);
}

/* Headings / subtitles */
h1, h2, h3, h4,
.home-title,
.admin-header h1,
.submissions-title,
.auth-card h2 {
    color: #f9fafb;
}

.admin-subtitle,
.submissions-back,
.auth-subtitle,
.admin-nav-card p,
.ledger-stats {
    color: var(--text-muted);
}

.home-subtitle {
    color: #ffffff;
}

/* Home / admin nav bubbles */
.home-bubble,
.admin-nav-card {
    background: var(--bg-elevated);
    color: var(--text-main);
    box-shadow: 0 18px 40px rgba(0,0,0,0.8);
}

/* Forms / inputs / selects */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
textarea,
select {
    background-color: #020617;
    color: var(--text-main);
    border: 1px solid #334155;
    box-shadow: none;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder,
input[type="password"]::placeholder,
input[type="date"]::placeholder,
textarea::placeholder {
    color: #6b7280;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    border-color: var(--brand-orange);
    box-shadow: 0 0 0 1px var(--brand-orange-focus);
    background-color: #020617;
}

/* Typeahead dropdown */
.typeahead-list {
    background: #020617;
    border-color: #1f2937;
    box-shadow: 0 18px 32px rgba(0,0,0,0.8);
}

.typeahead-list li {
    color: var(--text-main);
}

.typeahead-label-secondary {
    color: #6b7280;
}

/* Buttons already use brand orange; just tweak secondary */
.back-button,
.btn-secondary {
    background: transparent;
    color: var(--brand-orange) !important;
    border-color: var(--brand-orange);
    box-shadow: 0 4px 14px rgba(0,0,0,0.8);
}

/* Admin background overlay – soften for dark mode */
.admin-page::before {
    background: radial-gradient(circle at top, rgba(248, 250, 252, 0.08), transparent 60%);
}

/* Tables (admin-table) */
.table-scroll {
    box-shadow: inset 0 0 0 1px rgba(15,23,42,0.6);
    border-radius: 1rem;
}

.admin-table th,
.admin-table td {
    border-bottom: 1px solid #1f2937;
}

.admin-table th {
    background: var(--table-header-bg);
    color: #f9fafb;
}

.admin-table td {
    background-color: var(--table-row-bg);
    color: var(--text-main);
}

.admin-table tr:nth-child(even) td {
    background-color: var(--table-row-alt-bg);
}

.admin-table tr:hover td {
    background-color: var(--table-row-hover-bg);
}

/* Ledger table specific */
.ledger-scroll {
    background: var(--bg-elevated);
    box-shadow: 0 6px 22px rgba(0,0,0,0.85);
}

.table thead th {
    background: var(--brand-orange);
    color: #fff;
}

.table tbody td {
    background: #020617;
    border-bottom: 1px solid #111827;
    color: var(--text-main);
}

.table tbody tr:nth-child(even) td {
    background: #020617;
}

.table tbody tr:hover td {
    background: #111827;
}

/* Auth/footer text */
.auth-footer {
    color: var(--text-muted);
}

/* Signature image border pop on dark bg */
.signature-img {
    box-shadow: 0 6px 20px rgba(0,0,0,0.9);
}

/* ===== Dark mode refinements ===== */

/* Make most text white by default */
body,
p,
label,
span,
li,
.home-card,
.admin-card,
.auth-card,
.data-card {
    color: #ffffff;
}

/* Form labels and section headings */
form label,
.location-section h3,
.auth-form label,
.ledger-header h2 {
    color: #ffffff;
}

/* Placeholders stay grey (already set, just ensure consistency) */
input::placeholder,
textarea::placeholder {
    color: #6b7280;
}

/* Inputs: very dark background */
input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="date"],
textarea,
select {
    background-color: #020617; /* nearly black / very dark blue */
    color: #ffffff;
    border-color: #334155;
}

/* Company/location sections: grey card background */
.location-section {
    background: #111827;
    border-radius: 1rem;
    padding: 16px;
    margin-bottom: 18px;
    border: 1px solid #1f2937;
}

/* Allocation rows (company/equipment sections): dark grey background */
.allocation-row {
    background: #1f2937 !important; /* dark grey */
    border: 1px solid #374151 !important;
    border-radius: 0.5rem;
}

/* Inputs within allocation rows: dark blue background */
.allocation-row input[type="text"],
.allocation-row input[type="number"],
.allocation-row textarea,
.allocation-row select {
    background-color: #020617 !important; /* dark blue/black */
    color: #ffffff !important;
    border-color: #334155 !important;
}

.allocation-row input[type="text"]::placeholder,
.allocation-row textarea::placeholder {
    color: #6b7280 !important;
}

.allocation-row input[type="text"]:focus,
.allocation-row input[type="number"]:focus,
.allocation-row textarea:focus {
    background-color: #020617 !important;
    border-color: var(--brand-orange) !important;
    box-shadow: 0 0 0 1px var(--brand-orange-focus) !important;
}

/* Labels within allocation rows: white text */
.allocation-row label {
    color: #ffffff !important;
}

/* "Need to add a new location?" card: grey background */
.form-actions-card {
    background: #111827;
    border: 1px solid #1f2937;
    box-shadow: 0 8px 24px rgba(0,0,0,0.7);
}

.form-actions-card h3,
.form-actions-card p {
    color: #ffffff;
}

/* Home page text: ensure high contrast */
.home-title,
.home-subtitle {
    color: #ffffff;
}

.home-bubble h3,
.home-bubble p {
    color: #ffffff;
}
