* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
}

.login-body {
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 32px;
}

.brand-icon {
    background: #164e63;
    color: #67e8f9;
    border-radius: 12px;
    padding: 16px;
    width: fit-content;
    margin: 0 auto 20px;
    font-weight: bold;
    letter-spacing: 2px;
}

h1 {
    font-size: 24px;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 8px;
}

.subtitle {
    text-align: center;
    font-size: 11px;
    letter-spacing: 1px;
    color: #94a3b8;
    margin-bottom: 32px;
}

label {
    display: block;
    font-size: 14px;
    margin: 16px 0 8px;
}

input {
    width: 100%;
    padding: 14px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
    color: white;
    font-size: 16px;
}

input:focus {
    outline: 2px solid #0891b2;
}

button {
    width: 100%;
    margin-top: 24px;
    padding: 15px;
    border: 0;
    border-radius: 8px;
    background: #0e7490;
    color: white;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
}

button:hover {
    background: #0891b2;
}

.error {
    padding: 12px;
    border-radius: 8px;
    background: #7f1d1d;
    color: #fecaca;
    font-size: 14px;
}

.footer {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    line-height: 2;
    margin: 24px 0 0;
}

.dashboard {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
}

.panel {
    padding: 24px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    margin-bottom: 20px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.dashboard-header button {
    margin: 0;
    width: auto;
}

.status {
    color: #4ade80;
}

a {
    color: #67e8f9;
    text-decoration: none;
}

select, textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 16px;
}

.action-button {
    display: block;
    padding: 16px;
    background: #0e7490;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    text-align: center;
}

.action-button:hover {
    background: #0891b2;
}

.secondary-button {
    background: #334155;
}

.section-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(min(100%, 250px), 1fr));
    gap: 16px;
}

.section-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 20px;
}

.section-card small {
    color: #67e8f9;
    letter-spacing: 1px;
}

.section-card h3 {
    font-size: 17px;
}

.muted {
    color: #94a3b8;
    font-size: 13px;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #334155;
    white-space: nowrap;
}

th {
    color: #94a3b8;
    font-size: 13px;
}

.draft-status {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 6px;
    background: #78350f;
    color: #fde68a;
    font-size: 13px;
    font-weight: bold;
}

@media (max-width: 600px) {
    .dashboard {
        padding: 10px;
    }

    .panel {
        padding: 16px;
    }

    .dashboard-header h2 {
        font-size: 20px;
    }
}


.form-page {
    max-width: 850px;
}

fieldset {
    padding: 0;
    border: none;
    min-width: 0;
}

.form-field {
    padding: 12px 0;
    border-bottom: 1px solid #334155;
}

.form-field label {
    font-weight: 600;
}

.radio-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-choice {
    flex: 1;
    min-width: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 8px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
    cursor: pointer;
}

.radio-choice input {
    width: 18px;
    height: 18px;
    accent-color: #0891b2;
}

.radio-choice:has(input:checked) {
    border-color: #22d3ee;
    background: #164e63;
}

.save-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    position: sticky;
    bottom: 0;
    background: #1e293b;
    padding: 12px 0;
}

.save-message {
    background: #14532d;
    color: #bbf7d0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.section-link {
    display: block;
    color: #e2e8f0;
    transition: border-color 0.2s;
}

.section-link:hover {
    border-color: #22d3ee;
}

textarea {
    resize: vertical;
}

input[type="date"],
input[type="datetime-local"] {
    color-scheme: dark;
}

@media (max-width: 600px) {
    .form-field {
        padding: 8px 0;
    }

    .radio-choice {
        font-size: 13px;
    }
}

.measurement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.quick-observations {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.quick-button {
    width: auto;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid #475569;
    background: #334155;
    font-size: 13px;
}

.manual-time {
    margin-top: 20px;
    padding: 12px;
    border: 1px solid #334155;
    border-radius: 8px;
}

.manual-time summary {
    cursor: pointer;
    color: #67e8f9;
}

.observation-cell {
    white-space: normal;
    min-width: 150px;
    overflow-wrap: anywhere;
}

@media (max-width: 480px) {
    .measurement-grid {
        grid-template-columns: 1fr;
    }
}


.review-item {
    padding: 18px 0;
    border-bottom: 1px solid #334155;
}

.review-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.warning-text {
    color: #fbbf24;
    font-size: 14px;
}

.confirmation {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 8px;
    line-height: 1.5;
}

.confirmation input {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.submitted-status {
    display: inline-block;
    padding: 8px 14px;
    background: #14532d;
    color: #bbf7d0;
    border-radius: 6px;
    font-weight: bold;
}


.edit-button {
    display: inline-block;
    padding: 8px 16px;
    background: #334155;
    border: 1px solid #475569;
    border-radius: 6px;
    color: #67e8f9;
    font-size: 14px;
    font-weight: bold;
}

.edit-button:hover {
    background: #0e7490;
    color: #ffffff;
}

.save-actions .action-button {
    align-self: end;
}


.remove-button {
    display: inline-block;
    padding: 8px 12px;
    margin-left: 5px;
    background: #450a0a;
    color: #fca5a5;
    border: 1px solid #991b1b;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
}

.remove-button:hover {
    background: #991b1b;
    color: white;
}

.danger-button {
    background: #991b1b;
}

.danger-button:hover {
    background: #b91c1c;
}

.removed-status {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 6px;
    background: #450a0a;
    color: #fca5a5;
    font-size: 13px;
    font-weight: bold;
}

hr {
    border: none;
    border-top: 1px solid #334155;
    margin: 20px 0;
}


.entry-method {
    margin-top: 22px;
    padding: 16px;
    border: 1px solid #475569;
    border-radius: 10px;
    background: #0f172a;
}

#manual-time-fields {
    margin-top: 16px;
}

#automatic-time-info {
    padding: 10px 0;
}

.time-source {
    display: inline-block;
    padding: 4px 7px;
    margin: 5px 0;
    border-radius: 4px;
    font-size: 11px;
    font-weight: bold;
}

.manual-source {
    background: #78350f;
    color: #fde68a;
}

.auto-source {
    background: #14532d;
    color: #bbf7d0;
}

[hidden] {
    display: none !important;
}


.superseded-message {
    padding: 14px;
    background: #334155;
    border-radius: 8px;
    color: #cbd5e1;
    margin-bottom: 15px;
}

.history-link {
    display: inline-block;
    margin-left: 12px;
    color: #94a3b8;
}

.history-link:hover {
    color: #67e8f9;
}


.checksum-value {
    padding: 14px;
    margin: 12px 0 20px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    user-select: all;
}


/* ADFL mobile optimization */

@media screen and (max-width: 768px) {

    body {
        font-size: 15px;
    }

    .dashboard,
    .form-page {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        margin: 0 auto;
    }

    .panel {
        padding: 16px;
        margin-bottom: 14px;
        min-width: 0;
        overflow-wrap: anywhere;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 21px;
    }

    h3 {
        font-size: 17px;
    }

    .dashboard-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .section-grid,
    .measurement-grid,
    .save-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .section-card {
        min-height: auto;
        padding: 16px;
    }

    input:not([type="radio"]):not([type="checkbox"]),
    select,
    textarea {
        width: 100%;
        min-width: 0;
        font-size: 16px;
    }

    input[type="radio"],
    input[type="checkbox"] {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }

    button,
    .action-button {
        min-height: 46px;
        white-space: normal;
        font-size: 15px;
    }

    .radio-options {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .quick-observations {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .quick-button {
        width: 100%;
        font-size: 13px;
        min-height: 44px;
    }

    .save-actions {
        position: static;
        padding: 12px 0;
    }

    table {
        font-size: 13px;
        min-width: 540px;
    }

    .edit-button,
    .remove-button {
        display: block;
        text-align: center;
        margin: 5px 0;
        padding: 10px;
    }

    .entry-method {
        padding: 12px;
    }

    .footer {
        font-size: 11px;
        text-align: center;
    }

    .checksum-value {
        font-size: 12px;
        overflow-wrap: anywhere;
    }

    .login-card {
        width: 100%;
        max-width: 420px;
        padding: 22px;
    }

}

@media screen and (max-width: 380px) {

    .dashboard,
    .form-page {
        padding: 8px;
    }

    .panel {
        padding: 12px;
    }

    h2 {
        font-size: 19px;
    }

}

/* End mobile optimization */


.mobile-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}


/* User management */

.user-details {
    margin: 12px 0;
    padding: 14px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
}

.user-details summary {
    cursor: pointer;
    color: #67e8f9;
    font-weight: bold;
    padding: 8px 0;
}

.user-details form {
    margin-top: 15px;
}

.user-details input {
    margin-bottom: 14px;
}

.user-details label {
    display: block;
    margin-bottom: 8px;
}

/* End user management */


/* ADFL Login User Guide */

.login-user-guide {
    margin-top: 20px;
    padding: 14px;
    border: 1px solid #475569;
    border-radius: 8px;
    background: #0f172a;
    text-align: left;
}

.login-user-guide summary {
    color: #67e8f9;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.guide-content {
    margin-top: 16px;
    font-size: 13px;
    line-height: 1.7;
    color: #cbd5e1;
}

.guide-content h3 {
    color: #e2e8f0;
    font-size: 15px;
    margin-top: 16px;
}

.guide-content ol,
.guide-content ul {
    padding-left: 22px;
}

.guide-content li {
    margin-bottom: 8px;
}

.guide-note {
    font-size: 12px;
    color: #94a3b8;
    border-top: 1px solid #334155;
    padding-top: 12px;
    margin-top: 14px;
}

/* End ADFL Login User Guide */

