* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #000000 0%, #1A1A1A 100%);
    color: #FFFFFF;
    font-family: Arial, sans-serif;
    min-height: 100vh;
    padding: 2vw;
}

header {
    background: #000000;
    border-bottom: 4px solid #FF0000;
    padding: 1rem 1.5rem;
    text-align: center;
    box-shadow: 0 6px 12px rgba(255, 0, 0, 0.4), inset 0 -1px 5px rgba(255, 0, 0, 0.2);
    position: relative;
    z-index: 5; /* Ensure header buttons are above content */
}

.logo {
    max-height: 200px;
    display: inline-block;
    margin-bottom: 1rem;
    border: 6px solid #C0C0C0;
    box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5), -3px -3px 6px rgba(255, 255, 255, 0.2) inset;
}

header a {
    color: #C0C0C0;
    text-decoration: none;
    font-size: 1.2rem;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

header a:hover {
    color: #FF0000;
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.7);
}

.container, .login-container {
    max-width: 90%;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(26, 26, 26, 0.95);
    border: 3px solid #C0C0C0;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6), inset 0 0 5px rgba(192, 192, 192, 0.1);
}

.login-container {
    max-width: 400px;
    text-align: center;
}

.login-container .logo {
    display: block;
    margin: 0 auto 1rem;
}

form {
    margin: 1.5rem 0;
}

input, button, select {
    display: block;
    width: 100%;
    margin: 0.5rem 0; /* Reduced from 1rem for tighter spacing */
    padding: 0.8rem; /* Slightly smaller padding */
    background: #1A1A1A;
    color: #FFFFFF;
    border: 2px solid #C0C0C0;
    border-radius: 8px; /* Slightly smaller radius */
    font-size: 1rem; /* Slightly smaller font */
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

input:focus, select:focus {
    border-color: #FF0000;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.6), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

button {
    background: linear-gradient(to bottom, #FF0000, #B30000);
    color: #FFFFFF;
    border: 2px solid #C0C0C0;
    cursor: pointer;
    font-weight: bold;
}

button:hover {
    background: linear-gradient(to bottom, #C0C0C0, #A9A9A9);
    color: #000000;
    border-color: #FF0000;
    box-shadow: 0 4px 12px rgba(192, 192, 192, 0.6);
}

.error {
    color: #FF0000;
    font-size: 1rem;
    margin-top: 0.5rem;
    text-shadow: 0 0 3px rgba(255, 0, 0, 0.5);
}

h1, h2, h3 {
    color: #FFFFFF;
    border-bottom: 2px solid #FF0000;
    padding-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(255, 0, 0, 0.4);
    text-align: center;
    margin-bottom: 1rem;
}

.button-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2rem;
}

.button {
    display: inline-block;
    padding: 1.2rem 2.5rem;
    background: linear-gradient(to bottom, #FF0000, #B30000);
    color: #FFFFFF;
    text-decoration: none;
    border: 3px solid #C0C0C0;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 180px;
    text-align: center;
}

.button:hover {
    background: linear-gradient(to bottom, #C0C0C0, #A9A9A9);
    color: #000000;
    border-color: #FF0000;
    box-shadow: 0 8px 16px rgba(192, 192, 192, 0.7);
}

.timeclock-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.timeclock-buttons button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    background: #FF0000;
    color: #FFFFFF;
    border: 1px solid #C0C0C0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex: 1 1 80px;
    max-width: 100px;
}

.timeclock-buttons button:hover {
    background: #C0C0C0;
    color: #000000;
}

.worked-time {
    text-align: center;
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #C0C0C0;
}

.table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.timeclock-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(26, 26, 26, 0.95);
    border: 1px solid #C0C0C0;
}

.timeclock-table th,
.timeclock-table td {
    padding: 0.4rem; /* Reduced padding for tighter fit */
    text-align: center;
    border-bottom: 1px solid #C0C0C0;
    font-size: 0.9rem;
}

.timeclock-table th {
    background: #FF0000;
    color: #FFFFFF;
    font-weight: bold;
}

.timeclock-table tr:nth-child(even) {
    background: rgba(50, 50, 50, 0.5);
}

.correction-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.correction-form input[type="text"],
.correction-form input[type="date"],
.correction-form input[type="time"] {
    width: 100px;
    padding: 0.3rem;
    font-size: 0.8rem;
    margin: 0.2rem 0;
    background: #1A1A1A;
    color: #FFFFFF;
    border: 1px solid #C0C0C0;
    border-radius: 5px;
}

.correction-form input[type="number"] {
    width: 60px;
    padding: 0.3rem;
    font-size: 0.8rem;
    margin: 0.2rem 0;
    background: #1A1A1A;
    color: #FFFFFF;
    border: 1px solid #C0C0C0;
    border-radius: 5px;
}

.correction-form button {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
}

.date-input {
    width: 80px;
    padding: 0.3rem;
    font-size: 0.8rem;
    margin: 0.2rem 0;
    background: #1A1A1A;
    color: #FFFFFF;
    border: 1px solid #C0C0C0;
    border-radius: 5px;
}

.time-input {
    width: 80px;
    padding: 0.3rem;
    font-size: 0.8rem;
    margin: 0.2rem 0;
    background: #1A1A1A;
    color: #FFFFFF;
    border: 1px solid #C0C0C0;
    border-radius: 5px;
}

.number-input {
    width: 60px;
    padding: 0.3rem;
    font-size: 0.8rem;
    margin: 0.2rem 0;
    background: #1A1A1A;
    color: #FFFFFF;
    border: 1px solid #C0C0C0;
    border-radius: 5px;
}

.readonly-input {
    width: 100%;
    padding: 0.4rem; /* Match table padding */
    font-size: 0.9rem;
    background: #1A1A1A;
    color: #C0C0C0; /* Lighter for readability */
    border: 1px solid #C0C0C0;
    border-radius: 5px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    body { padding: 1vw; }
    header, .container { padding: 1rem; }
    .logo { max-height: 160px; }
    .timeclock-table th, .timeclock-table td { font-size: 0.8rem; padding: 0.3rem; }
    .correction-form input[type="text"],
    .correction-form input[type="date"],
    .correction-form input[type="time"] { width: 100px; }
    .date-input, .time-input { width: 70px; }

    /* Responsive table styles for employee table - NOW HANDLED GLOBALLY */
    /* Remove the specific table rules from here */
}

@media (max-width: 480px) {
    header a { display: block; margin-top: 0.5rem; }
    h2, h3 { font-size: 1.3rem; }
    .logo { max-height: 120px; }
    .timeclock-buttons { flex-direction: column; gap: 0.3rem; }
    .timeclock-buttons button { width: 100%; max-width: none; }
    .correction-form { flex-direction: column; gap: 0.3rem; }
    .correction-form input[type="text"],
    .correction-form input[type="date"],
    .correction-form input[type="time"] { width: 100%; }
    .date-input, .time-input { width: 100%; }
}

/* Home and Logout Button Styling */
.home-btn, .logout-btn {
    display: inline-block;
    background: linear-gradient(to bottom, #FF0000, #B30000);
    color: #FFFFFF;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border: 3px solid #C0C0C0;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.home-btn {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.logout-btn {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
}

.home-btn:hover, .logout-btn:hover {
    background: linear-gradient(to bottom, #C0C0C0, #A9A9A9);
    color: #000000;
    border-color: #FF0000;
    box-shadow: 0 6px 12px rgba(192, 192, 192, 0.6);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .home-btn, .logout-btn {
        position: static;
        transform: none;
        margin: 0.5rem auto;
        width: fit-content;
    }
}

/* Change Password Form Styling */
.change-password-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 2rem;
}

.change-password-form label {
    color: #FFFFFF;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.change-password-form select {
    width: 50%;
    max-width: 300px;
}

/* Enhanced Message Styling */
.message {
    text-align: center;
    font-size: 1.1rem;
    margin-top: 1rem;
    color: #FF0000;
    text-shadow: 0 0 3px rgba(255, 0, 0, 0.5);
}

/* Vehicle Form and Update Styling */
.vehicle-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* Reduced gap for tighter layout */
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.form-group {
    flex: 1 1 200px; /* Minimum width for inputs */
    max-width: 250px; /* Cap width for consistency */
}

.vehicle-update-form {
    display: inline-block;
    margin: 0;
}

.vehicle-update-form button {
    padding: 0.4rem 0.8rem; /* Slightly smaller for table fit */
    font-size: 0.9rem;
}

.edit-btn {
    background: linear-gradient(to bottom, #FF0000, #B30000);
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.save-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* --- Employee Page Table Styles (TWO COLUMN LAYOUT - ALL SIZES) --- */
.employees-page .table-wrapper table {
    border: 0;
    /* Remove width: 100%, border-collapse: collapse; background as they are handled by tr */
}
.employees-page .table-wrapper thead {
    display: none; /* Hide original headers */
}
.employees-page .table-wrapper tr {
    display: flex; /* Use flexbox for columns */
    flex-wrap: wrap; /* Allow items to wrap */
    margin-bottom: 1.5rem; /* Space between employee blocks */
    border: 1px solid #C0C0C0;
    border-radius: 8px;
    background: rgba(35, 35, 35, 0.7);
    padding: 0.5rem; /* Add padding inside the flex container */
}
.employees-page .table-wrapper td {
    display: block; /* Keep td as block inside flex item */
    flex-basis: 50%; /* Aim for two columns */
    box-sizing: border-box; /* Include padding in width calculation */
    padding: 0.5rem; /* Padding around each cell */
    text-align: left; /* Align text to the left */
    font-size: 0.9rem;
    border: 1px outset #C0C0C0; /* Changed to 1px outset silver */
    padding-left: 0.5rem; /* Reset padding-left */
    position: static; /* Reset position */
}
.employees-page .table-wrapper td:last-child {
    border-bottom: 0;
}
.employees-page .table-wrapper td::before {
    content: attr(data-label); /* Display the label */
    display: block; /* Label on its own line */
    font-weight: bold;
    color: #FF0000; /* Make label stand out */
    margin-bottom: 0.2rem; /* Space between label and value */
    font-size: 0.8rem; /* Slightly smaller label */
    position: static;
    left: auto;
    width: auto;
    padding-right: 0;
    white-space: normal;
    text-align: left;
}
/* Full width for Actions */
.employees-page .table-wrapper td.action-buttons {
    flex-basis: 100%; /* Make actions span full width */
    text-align: center; /* Center buttons */
    margin-top: 0.5rem; /* Add some space above actions */
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2); /* Slightly different background for actions */
    border: 1px outset #C0C0C0; /* Apply 1px outset border here too */
    border-top: 1px dotted #555; /* Re-apply top border override */
}
.employees-page .table-wrapper td.action-buttons::before {
    display: none; /* Hide the "Actions:" label */
}
.employees-page .table-wrapper td.action-buttons button,
.employees-page .table-wrapper td.action-buttons form {
    display: inline-block;
    margin: 0.2rem;
    /* Inherit button styles or add specifics if needed */
    width: auto; /* Ensure buttons aren't full width */
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
}

/* --- Modal Styles --- */
.modal {
    display: none; /* Hide modals by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 1000;
}

.modal-content {
    background: rgba(26, 26, 26, 0.95); /* Match container */
    margin: 10% auto;
    padding: 2rem;
    border: 3px solid #C0C0C0; /* Match container */
    border-radius: 12px; /* Match container */
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
    width: 60%;
    max-width: 800px; /* Add max-width */
    max-height: 80vh;
    overflow-y: auto;
    position: relative; /* For close button positioning */
}

.modal-content h2, .modal-content h3 {
    margin-top: 0;
    text-align: center; /* Center modal titles */
}

.close-btn {
    position: absolute; /* Position relative to modal-content */
    top: 1rem;
    right: 1.5rem;
    color: #C0C0C0;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1; /* Prevent extra spacing */
}

.close-btn:hover {
    color: #FF0000;
}

/* Adjust form layout within modals */
.modal-content form {
    margin-top: 1rem;
}

.modal-content form label {
    display: block;
    margin-bottom: 1rem; /* Space between labels */
    font-weight: bold;
}

.modal-content form input,
.modal-content form select,
.modal-content form button {
    margin-top: 0.3rem; /* Space between label and input */
    margin-bottom: 0.5rem; /* Tweak spacing */
}

/* Ensure modal button follows theme */
.modal-content form button {
    width: auto; /* Allow button to size to content */
    display: block; /* Make button block level */
    margin-left: auto; /* Push to right */
    margin-right: auto; /* Center if needed (or remove this line for right align)*/
    padding: 0.8rem 1.5rem; /* Comfortable padding */
}

/* Interchange Suggestions Styling */
.exchange-parts-section {
    margin-bottom: 2rem;
}

.parts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin: 1rem 0;
}

.part-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.part-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.part-number {
    font-weight: bold;
    color: #007cba;
    font-size: 14px;
}

.part-category {
    background: #e7f3ff;
    color: #007cba;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.part-description {
    color: #333;
    margin: 8px 0;
    font-size: 13px;
}

.part-manufacturer {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.interchange-count {
    background: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-top: 8px;
    text-align: center;
}

.exchange-suggestions-section {
    border-top: 2px solid #e9ecef;
    padding-top: 2rem;
}

.interchange-vehicles {
    margin-top: 1rem;
}

.interchange-vehicle-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.interchange-vehicle-card .vehicle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.interchange-vehicle-card .vehicle-header h4 {
    margin: 0;
    color: #007cba;
    font-size: 16px;
}

.interchange-vehicle-card .vehicle-stats {
    display: flex;
    gap: 10px;
}

.interchange-vehicle-card .vehicle-stats .stat {
    background: #e7f3ff;
    color: #007cba;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

.interchange-vehicle-card .vehicle-details {
    font-size: 13px;
    color: #666;
}

.interchange-vehicle-card .categories,
.interchange-vehicle-card .manufacturers {
    margin: 5px 0;
}