/* ===== VARIABLES & RESET ===== */
:root {
    --primary-color: #003366ff;
    --secondary-color: #10773b;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --gray-color: #95a5a6;
    --white-color: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 6px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* ===== CONTAINER & LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

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

.table-container {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-top: 30px;
    overflow-x: auto;
}

.table-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 15px;
}

/* ===== TABS ===== */
.tab {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab button {
    background-color: inherit;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 12px 20px;
    transition: var(--transition);
    font-size: 16px;
    color: var(--gray-color);
    border-bottom: 3px solid transparent;
}

.tab button:hover {
    color: var(--dark-color);
}

.tab button.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: 600;
}

.tabcontent {
    display: none;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== FORMS ===== */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    background-color: var(--white-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-weight: 600;
    color: var(--dark-color);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

input, select, textarea {
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 16px;
    transition: var(--transition);
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

textarea {
    min-height: 100px;
    resize: vertical;
}

/* ===== BUTTONS ===== */
button {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--light-color);
    color: var(--dark-color);
}

.btn-secondary:hover {
    background-color: #d5dbdb;
}

.btn-danger {
    background-color: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-export {
    background-color: var(--secondary-color);
    color: white;
    padding: 10px 15px;
}

.btn-export:hover {
    background-color: #27ae60;
    transform: translateY(-1px);
}

/* ===== BUTTON GROUP ===== */
.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group .btn-export {
    font-size: 14px;
    padding: 8px 12px;
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: var(--dark-color);
    text-transform: uppercase;
    font-size: 14px;
}

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

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 15px;
    min-width: 40px;
    background-color: var(--light-color);
    color: var(--dark-color);
}

.pagination button:hover {
    background-color: #d5dbdb;
}

.pagination button:disabled {
    background-color: #ddd;
    color: #999;
    cursor: not-allowed;
}

/* ===== SEARCH ===== */
.search-container {
    display: flex;
    max-width: 400px;
    width: 100%;
}

.search-container input {
    flex: 1;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.search-container button {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding: 0 15px;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--white-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    max-width: 500px;
    width: 90%;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 20px;
}

/* ===== REPORT SECTION ===== */
.report-controls {
    background-color: var(--white-color);
    padding: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.report-section {
    background-color: var(--white-color);
    padding: 25px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.report-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.stat-label {
    color: var(--gray-color);
    font-size: 14px;
}

.chart-container {
    height: 400px;
    width: 100%;
    position: relative;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .table-actions, .report-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    .report-stats {
        grid-template-columns: 1fr 1fr;
    }
    
    .button-group {
        width: 100%;
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 480px) {
    .tab button {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .report-stats {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    button {
        width: 100%;
        justify-content: center;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn-export {
        width: 100%;
        justify-content: center;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    opacity: 0.95;
}

.notification-icon {
    font-size: 20px;
    margin-right: 15px;
}

.notification-content {
    flex: 1;
}

.notification.info {
    background-color: #e7f5ff;
    color: #1864ab;
    border-left: 4px solid #1864ab;
}

.notification.success {
    background-color: #ebfbee;
    color: #2b8a3e;
    border-left: 4px solid #2b8a3e;
}

.notification.error {
    background-color: #fff5f5;
    color: #c92a2a;
    border-left: 4px solid #c92a2a;
}