/*GENERAL*/
body {
    font-family: "Lato", sans-serif;
    margin: 0;
    background-color: #f8f9fa; 
    color: #212529;
    font-size: 16px;
}

h1 {
    color: #212529;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 0.5em;
    margin-top: 0;
}

/*LAYOUT CONTAINER*/
.container {
    max-width: 85%;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/*NAVIGATION BAR*/
nav {
    background-color: #343a40;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

nav a {
    color: #dee2e6;
    text-decoration: none;
    margin-right: 0.5rem;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 5px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

nav a:hover {
    background-color: #495057;
    color: #ffffff;
    text-decoration: none;
}

nav a.active {
    background-color: #272a2ef9;
    color: #ffffff;
}

nav .logout-form {
    margin-left: auto;
}

/*BUTTONS*/
.btn {
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.2s ease-in-out;
}

.btn-primary {
    background-color: #007bff;
    color: white;
}
.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #4f677d;
    color: white;
}
.btn-secondary:hover {
    background-color: #424a50;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
}

/*TABLE STYLES*/
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 1.5em;
}

th, td {
    border-bottom: 1px solid #dee2e6;
    text-align: center;
    padding: 12px;
    vertical-align: middle;
}

td {
    font-weight: 600;
    line-height: 1.4;
}

th {
    font-weight: 750;
    color: #495057;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

td.actions {
    white-space: nowrap;
    text-align: center;
}

td.actions .btn {
    margin-left: 5px;
}

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

/*FORM STYLES*/
.container form p {
    display: flex;
    flex-direction: column;
    margin-bottom: 1.5rem;
}

form label {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

form input[type="text"],
form input[type="password"],
form input[type="date"],
form input[type="number"],
form input[type="url"],
form select,
form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

form input:focus,
form select:focus,
form textarea:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.form-actions {
    display: flex;       
    align-items: center;  
    gap: 1rem;            
    margin-top: 2rem;     
    padding-top: 1.5rem;  
    border-top: 1px solid #dee2e6;
}

.add-new-link {
    display: inline-block; 
    margin-top: 0.5rem;
    font-size: 0.9rem;
    font-weight: bold;
    color: #6c757d;
}

/*DETAIL PAGE STYLES*/
.detail-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #dee2e6;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem 2rem; 
    line-height: 1.5;
}

.detail-grid dt {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6c757d;
    margin-top: 1.25rem;
}


.detail-grid dt:first-child {
    margin-top: 0;
}


.detail-grid dd {
    margin-left: 0;
    font-size: 1.1rem;
}

/*PAGE HEADER STYLES*/
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2rem;
}

.page-header h1 {
    margin-bottom: 0;
    border-bottom: none;
}

/*DASHBOARD STYLES*/
.stat-card-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.stat-card {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.stat-card-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #212529;
}

.stat-card.is-positive {
    background-color: #167e2e;
    color: white;
}

.stat-card.is-positive .stat-card-label,
.stat-card.is-positive .stat-card-value {
    color: white;
}

.stat-card.is-negative {
    background-color: #811520; 
    color: white;
}

.stat-card.is-negative .stat-card-label,
.stat-card.is-negative .stat-card-value {
    color: white;
}

/*LOGIN PAGE STYLES*/
body.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;      
}

.login-container {
    background-color: #ffffff;
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px; /* Set a max width for the login box */
}

.login-container h2 {
    margin-top: 0;
    text-align: center;
    border-bottom: none;
    padding-bottom: 1rem;
}

.login-container .form-actions button {
    width: 100%;
}

@media (max-width: 992px) {
    .stat-card-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .stat-card-container {
        grid-template-columns: 1fr;
    }
}