/* === Base Styles === */
body {
    font-family: system-ui, sans-serif;
    background-color: #f2f2f2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding-top: 2rem;
}

h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: #444;
    font-weight: 600;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
}

button {
    width: 100%;
    padding: 0.75rem;
    background-color: #007bff;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

button:hover {
    background-color: #0056b3;
}

/* === Containers === */
.container,
.login-container,
.form-container {
    background: white;
    padding: 2rem 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
}

.form-container {
    padding: 2rem;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    margin: 2rem auto;
}

/* === Messages === */
.message {
    text-align: center;
    margin: 1rem 0;
    font-weight: 500;
}

.error {
    color: red;
    text-align: center;
}

.success {
    color: green;
    text-align: center;
}

/* === Navigation & Links === */
.back-link,
.back,
.logout {
    text-align: center;
    margin-top: 1rem;
}

.logout {
    margin-bottom: 2rem;
}

.back-link a {
    color: #007bff;
    text-decoration: none;
}

.back-link a:hover {
    text-decoration: underline;
}

/* === Table Styles === */
table {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 1rem;
    background: white;
    border-collapse: collapse;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
    width: calc(100% - 2rem);
    box-sizing: border-box;
}

th, td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: #f0f0f0;
    font-weight: 600;
}

tr:hover {
    background-color: #f9f9f9 !important;
}

/* Table Actions */
.actions a {
    margin-right: 0.75rem;
    color: #444;
    text-decoration: none;
}

.actions a:hover {
    color: #000;
}

.actions i {
    font-size: 1.1rem;
}

/* === Responsive Table === */
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead {
        display: none;
    }
    tr {
        margin-bottom: 1rem;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        background: #fff;
        border-radius: 6px;
        padding: 1rem;
    }
    td {
        padding: 0.5rem 0;
        display: flex;
        justify-content: space-between;
        font-size: 0.95rem;
    }
    td::before {
        content: attr(data-label);
        font-weight: bold;
        color: #666;
    }
}

/* === DataTables Styling Overrides === */
.dataTables_wrapper {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
    box-sizing: border-box;
}

table.dataTable {
    padding: 0;
}

.dataTables_filter label {
    font-weight: 600;
    color: #444;
}

.dataTables_filter input {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
    margin-left: 0.5rem;
    min-width: 250px;
    max-width: 300px;
}

.dataTables_paginate {
    margin-top: 1rem;
    text-align: center;
}

.dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    border-radius: 6px;
    background-color: #eee;
    border: 1px solid #ccc;
    color: #333;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button:hover {
    background-color: #007bff;
    color: white !important;
    border-color: #007bff;
}

.dataTables_length label {
    font-weight: 600;
    color: #444;
}

.dataTables_length select {
    padding: 0.4rem 0.6rem;
    margin-left: 0.5rem;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.dataTables_info {
    font-size: 0.95rem;
    color: #555;
    margin-top: 1rem;
    text-align: center;
}

table.dataTable thead .sorting:after,
table.dataTable thead .sorting_asc:after,
table.dataTable thead .sorting_desc:after {
    margin-left: 0.5rem;
    opacity: 0.4;
}

@media (max-width: 768px) {
    .dataTables_filter,
    .dataTables_length,
    .dataTables_info,
    .dataTables_paginate {
        text-align: center;
        float: none !important;
        width: 100%;
    }

    .dataTables_filter input,
    .dataTables_length select {
        width: 100%;
        max-width: 300px;
        margin-top: 0.5rem;
    }

    .dataTables_wrapper {
        padding: 0;
    }
}

table.dataTable > thead > tr > th,
table.dataTable > thead > tr > td {
    border-bottom: 0 !important;
    padding: 0.75rem 1rem !important;
}

table.dataTable tbody th,
table.dataTable tbody td {
    padding: 0.75rem 1rem !important;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.filter-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.filter-group label {
    margin-bottom: 4px;
    font-weight: bold;
}

.filter-group input[type="date"] {
    padding: 4px 8px;
    font-size: 14px;
    width: 180px;
}