/* ============================================
   PSC MANAGEMENT SYSTEM - MASTER STYLESHEET
   ============================================ */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2b6cb0;
    --primary-dark: #1a365d;
    --primary-light: #4299e1;
    --success: #48bb78;
    --success-dark: #38a169;
    --danger: #fc8181;
    --danger-dark: #e53e3e;
    --warning: #ed8936;
    --info: #63b3ed;
    --gray-100: #f7fafc;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --radius: 8px;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 25px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    color: var(--gray-800);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-light);
}
a:hover {
    color: var(--primary-dark);
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-fluid {
    max-width: 100%;
    padding: 0 20px;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-light);
    color: white;
}
.btn-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover {
    background: var(--success-dark);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover {
    background: var(--danger-dark);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-warning:hover {
    background: #dd6b20;
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-light);
    color: var(--primary-light);
}
.btn-outline:hover {
    background: var(--primary-light);
    color: white;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}
.btn-lg {
    padding: 14px 32px;
    font-size: 1.1rem;
}
.btn-block {
    width: 100%;
    justify-content: center;
}
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== CARDS ===== */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    transition: var(--transition);
}
.card:hover {
    box-shadow: var(--shadow-hover);
}
.card-header {
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 15px;
    margin-bottom: 15px;
}
.card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-700);
}
.card-body {
    padding: 5px 0;
}
.card-footer {
    border-top: 1px solid var(--gray-200);
    padding-top: 15px;
    margin-top: 15px;
}

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.95rem;
}
.form-group label .required {
    color: var(--danger-dark);
    margin-left: 3px;
}
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
    background: white;
}
.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}
.form-control.error {
    border-color: var(--danger-dark);
}
.form-control.success {
    border-color: var(--success);
}
.form-control:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}
.form-control-sm {
    padding: 6px 10px;
    font-size: 0.85rem;
}
.form-control-lg {
    padding: 14px 18px;
    font-size: 1.1rem;
}
.form-text {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 5px;
}
.form-error {
    color: var(--danger-dark);
    font-size: 0.85rem;
    margin-top: 5px;
}

/* ===== TABLES ===== */
.table-responsive {
    overflow-x: auto;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}
.table th {
    background: var(--gray-100);
    color: var(--gray-700);
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid var(--gray-200);
}
.table td {
    padding: 10px 15px;
    border-bottom: 1px solid var(--gray-200);
}
.table tr:hover {
    background: var(--gray-100);
}
.table-striped tbody tr:nth-child(odd) {
    background: var(--gray-100);
}
.table-bordered {
    border: 1px solid var(--gray-200);
}
.table-bordered th,
.table-bordered td {
    border: 1px solid var(--gray-200);
}

/* ===== ALERTS ===== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 12px;
}
.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-color: var(--success);
}
.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-color: var(--danger-dark);
}
.alert-warning {
    background: #fefcbf;
    color: #744210;
    border-color: var(--warning);
}
.alert-info {
    background: #bee3f8;
    color: #2a4365;
    border-color: var(--info);
}
.alert .close {
    margin-left: auto;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.2rem;
}

/* ===== BADGES ===== */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}
.badge-success {
    background: #c6f6d5;
    color: #22543d;
}
.badge-danger {
    background: #fed7d7;
    color: #742a2a;
}
.badge-warning {
    background: #fefcbf;
    color: #744210;
}
.badge-info {
    background: #bee3f8;
    color: #2a4365;
}
.badge-primary {
    background: #bee3f8;
    color: #2a4365;
}

/* ===== GRID ===== */
.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.row-2 {
    grid-template-columns: repeat(2, 1fr);
}
.row-3 {
    grid-template-columns: repeat(3, 1fr);
}
.row-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ===== MODAL ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: white;
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.modal-header h3 {
    font-size: 1.3rem;
    color: var(--gray-700);
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-400);
    transition: var(--transition);
}
.modal-close:hover {
    color: var(--gray-800);
}
.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding-top: 15px;
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ===== LOADING ===== */
.spinner {
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 9998;
    justify-content: center;
    align-items: center;
}
.loading-overlay.active {
    display: flex;
}

/* ===== UPLOAD ===== */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}
.upload-area:hover {
    border-color: var(--primary-light);
    background: var(--gray-100);
}
.upload-area i {
    font-size: 3rem;
    color: var(--gray-400);
    display: block;
    margin-bottom: 10px;
}
.upload-area p {
    color: var(--gray-500);
}
.upload-area .file-name {
    color: var(--primary-light);
    font-weight: 600;
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    gap: 5px;
    margin-top: 20px;
    justify-content: center;
}
.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--gray-700);
    transition: var(--transition);
}
.pagination a:hover {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}
.pagination .active {
    background: var(--primary-light);
    color: white;
    border-color: var(--primary-light);
}
.pagination .disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== TABS ===== */
.tabs {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
    overflow-x: auto;
}
.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    font-weight: 600;
    color: var(--gray-500);
    white-space: nowrap;
}
.tab:hover {
    color: var(--gray-700);
}
.tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* ===== TOOLTIP ===== */
.tooltip {
    position: relative;
    display: inline-block;
}
.tooltip .tooltip-text {
    visibility: hidden;
    background: var(--gray-800);
    color: white;
    padding: 6px 12px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 100;
}
.tooltip:hover .tooltip-text {
    visibility: visible;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .row-4 { grid-template-columns: repeat(2, 1fr); }
    .row-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .row-2 { grid-template-columns: 1fr; }
    .row-3 { grid-template-columns: 1fr; }
    .row-4 { grid-template-columns: 1fr; }
    .modal-box { padding: 20px; width: 95%; }
    .btn { padding: 8px 16px; font-size: 0.85rem; }
    .table { font-size: 0.85rem; }
    .table th, .table td { padding: 8px 10px; }
}
@media (max-width: 480px) {
    .container { padding: 0 10px; }
    .card { padding: 15px; }
    .modal-box { padding: 15px; }
}

/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger-dark); }
.text-warning { color: var(--warning); }
.text-primary { color: var(--primary-light); }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.ml-10 { margin-left: 10px; }
.mr-10 { margin-right: 10px; }

.p-10 { padding: 10px; }
.p-20 { padding: 20px; }
.p-30 { padding: 30px; }

.d-flex { display: flex; }
.d-grid { display: grid; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-column { flex-direction: column; }
.gap-10 { gap: 10px; }
.gap-20 { gap: 20px; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-circle { border-radius: 50%; }

.shadow { box-shadow: var(--shadow); }
.shadow-hover { box-shadow: var(--shadow-hover); }

.bg-white { background: white; }
.bg-gray { background: var(--gray-100); }
.bg-primary { background: var(--primary-light); color: white; }
.bg-success { background: var(--success); color: white; }
.bg-danger { background: var(--danger-dark); color: white; }

.border { border: 1px solid var(--gray-200); }
.border-top { border-top: 1px solid var(--gray-200); }
.border-bottom { border-bottom: 1px solid var(--gray-200); }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }