/* Main Dashboard Container */
.hda-dashboard {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    color: #333;
}

/* Headings */
.hda-dashboard h2 {
    color: #830E1A;
    /* Deep Red */
    border-bottom: 2px solid #D7B243;
    /* Gold */
    padding-bottom: 10px;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 600;
}

/* Form Styles */
#hda-upload-form {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 6px;
    border: 1px solid #eee;
}

#hda-upload-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
}

#hda-upload-form select,
#hda-upload-form input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    height: 45px;
    /* Fixed height for alignment */
}

/* Horizontal Layout */
.hda-upload-row {
    display: flex;
    gap: 20px;
    align-items: flex-end;
    /* Align bottom so button matches inputs */
}

.hda-form-group {
    flex: 1;
}

.hda-upload-actions {
    flex: 0 0 auto;
    /* Don't grow */
    padding-bottom: 2px;
    /* Slight adjustment for button alignment if needed */
}

.hda-dashboard button,
.hda-dashboard .button {
    background-color: #830E1A;
    color: #fff;
    border: none;
    padding: 0 25px;
    /* Horizontal padding */
    height: 45px;
    /* Match input height */
    line-height: 45px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    display: inline-block;
    box-sizing: border-box;
    vertical-align: bottom;
}

.hda-dashboard button:hover,
.hda-dashboard .button:hover {
    background-color: #6a0b15;
    color: #ffd;
}

.hda-dashboard hr {
    margin: 40px 0;
    border: none;
    border-top: 1px solid #eee;
}

/* Table Styles */
.hda-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    /* For rounded corners on header */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.hda-table thead {
    background-color: #830E1A;
    color: #fff;
}

.hda-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    border-bottom: 3px solid #D7B243;
    color: #fff;
}

.hda-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.hda-table tbody tr:hover {
    background-color: #fcfcfc;
}

/* Status Badges */
.hda-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

.hda-status-submitted {
    background: #e3f2fd;
    color: #1565c0;
}

.hda-status-resubmit_required {
    background: #ffebee;
    color: #c62828;
}

.hda-status-ready_for_audit {
    background: #fff3e0;
    color: #ef6c00;
}

.hda-status-under_audit,
.hda-status-under_review {
    background: #fff8e1;
    color: #f57f17;
}

.hda-status-completed {
    background: #e8f5e9;
    color: #2e7d32;
}

/* View File Link */
.hda-table a {
    color: #830E1A;
    text-decoration: none;
    font-weight: 500;
}

.hda-table a:hover {
    text-decoration: underline;
    color: #D7B243;
}

/* Action Button Overrides specific to table */
.hda-table .button {
    font-size: 0.9em;
    padding: 6px 12px;
    margin-right: 5px;
    height: auto;
    /* Reset fixed height */
    line-height: normal;
    /* Reset line-height */
}

.hda-spinner {
    color: #830E1A;
    font-style: italic;
    margin-left: 10px;
}

#hda-upload-message {
    margin-top: 15px;
    font-weight: 500;
}

/* Mobile Optimizations */
@media screen and (max-width: 768px) {
    .hda-dashboard {
        padding: 15px;
        margin: 20px 10px;
    }

    .hda-upload-row {
        flex-direction: column;
        gap: 0;
        align-items: stretch;
    }

    .hda-form-group {
        margin-bottom: 15px;
    }

    .hda-upload-actions {
        padding-bottom: 0;
    }

    .hda-dashboard button,
    .hda-dashboard .button {
        width: 100%;
        text-align: center;
    }

    /* Keep table scrollable on small screens if needed, 
       OR stack it for a card view which is better for this complexity */

    .hda-table thead {
        display: none;
        /* Hide headers on mobile */
    }

    .hda-table,
    .hda-table tbody,
    .hda-table tr,
    .hda-table td {
        display: block;
        width: 100%;
    }

    .hda-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
        background: #fff;
    }

    .hda-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #eee;
    }

    .hda-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 15px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        color: #830E1A;
    }

    .hda-table td:last-child {
        border-bottom: none;
        text-align: center;
        padding-left: 15px;
        /* Reset padding for action buttons */
    }

    .hda-table td:last-child::before {
        display: none;
        /* No label for actions, just buttons */
    }
}