@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');

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

body {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    background: #f0f2f5;
    color: #212529;
    min-height: 100vh;
}

.navbar {
    background: #27ae60;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    height: 50px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.navbar-brand {
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.navbar-nav {
    display: flex;
    list-style: none;
    gap: 0;
    margin: 0;
    padding: 0;
}
.navbar-nav li a {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 0 13px;
    line-height: 50px;
    display: block;
    transition: background 0.15s;
}
.navbar-nav li a:hover,
.navbar-nav li a.active {
    background: rgba(0,0,0,0.15);
}
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 6px;
}

.navbar.navbar-admin { background: #1a56db; }

.main-content {
    padding: 28px 36px 40px;
    min-height: calc(100vh - 50px);
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}
.page-subtitle {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}
.stat-card {
    border-radius: 8px;
    padding: 26px 20px;
    text-align: center;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.stat-card .stat-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; opacity: 0.95; }
.stat-card .stat-value { font-size: 38px; font-weight: 700; line-height: 1; }
.stat-blue   { background: #2979ff; }
.stat-green  { background: #1b6b3a; }
.stat-yellow { background: #f9a825; }
.stat-red    { background: #c0392b; }
.stat-teal   { background: #00bcd4; }
.stat-gray   { background: #7f8c8d; }
.stat-dark   { background: #1a1a2e; }

.card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}
.table-show {
    font-size: 13px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
}
.table-show select {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 13px;
    outline: none;
}
.table-search {
    font-size: 13px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 6px;
}
.table-search input {
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 13px;
    outline: none;
    width: 200px;
    transition: border-color 0.15s;
}
.table-search input:focus { border-color: #1a56db; box-shadow: 0 0 0 2px rgba(26,86,219,0.12); }

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    width: 100%;
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table.dtr-inline-collapse > tbody > tr > td.dtr-control:before,
.data-table.dtr-inline-collapse > tbody > tr > th.dtr-control:before {
    right: auto;
    left: 4px;
}
.data-table > tbody > tr > td.dtr-control,
.data-table > tbody > tr > th.dtr-control {
    padding-left: 30px;
    order: -1;
}
.data-table thead tr th {
    background: #212529;
    color: #fff;
    padding: 11px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
    user-select: none;
}
.data-table tbody tr td {
    padding: 9px 12px;
    border-bottom: 1px solid #e9ecef;
    color: #212529;
    vertical-align: middle;
}
.data-table tbody tr:nth-child(even) { background: #f8f9fa; }
.data-table tbody tr:hover { background: #e8f5e9; }

.table-info-text { font-size: 13px; color: #6c757d; }

.pagination { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pagination button, .pagination a {
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.pagination button.active, .pagination a.active { background: #1a56db; color: #fff; border-color: #1a56db; }
.pagination button:hover:not(.active):not(:disabled), .pagination a:hover:not(.active) { background: #e9ecef; }
.pagination button:disabled { opacity: 0.55; cursor: default; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.btn i { font-size: 13px; }
.btn-success  { background: #27ae60; color: #fff; }
.btn-success:hover  { background: #219150; color: #fff; }
.btn-primary  { background: #1a56db; color: #fff; }
.btn-primary:hover  { background: #1648c4; color: #fff; }
.btn-warning  { background: #f39c12; color: #fff; }
.btn-warning:hover  { background: #d68910; color: #fff; }
.btn-danger   { background: #e74c3c; color: #fff; }
.btn-danger:hover   { background: #c0392b; color: #fff; }
.btn-secondary{ background: #6c757d; color: #fff; }
.btn-secondary:hover{ background: #5a6268; color: #fff; }
.btn-info     { background: #1a56db; color: #fff; }
.btn-info:hover     { background: #1648c4; color: #fff; }
.btn-outline  { background: #fff; color: #495057; border: 1px solid #ced4da; }
.btn-outline:hover  { background: #f8f9fa; }
.btn-excel    { background: #217346; color: #fff; }
.btn-excel:hover    { background: #185c38; color: #fff; }
.btn-sm { padding: 5px 9px; font-size: 12px; }

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.badge-success  { background: #27ae60; color: #fff; }
.badge-danger   { background: #e74c3c; color: #fff; }
.badge-warning  { background: #f39c12; color: #fff; }
.badge-info     { background: #17a2b8; color: #fff; }
.badge-secondary{ background: #6c757d; color: #fff; }
.badge-dark     { background: #343a40; color: #fff; }

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal-box {
    background: #fff;
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.modal-box.modal-lg { max-width: 680px; }
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e9ecef;
}
.modal-header h3 { font-size: 16px; font-weight: 600; color: #212529; }
.modal-close {
    background: none; border: none;
    font-size: 18px; cursor: pointer;
    color: #6c757d; line-height: 1;
    padding: 4px 6px; border-radius: 4px;
}
.modal-close:hover { color: #e74c3c; background: #f8d7da; }
.modal-box form { padding: 16px 20px 0; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid #e9ecef;
    margin-top: 16px;
}

.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 5px;
}
.form-control {
    width: 100%;
    padding: 8px 11px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 13px;
    outline: none;
    font-family: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: #fff;
}
.form-control:focus {
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,0.12);
}
textarea.form-control { resize: vertical; }

.alert {
    padding: 10px 16px;
    border-radius: 5px;
    font-size: 13px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger  { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }

.chart-container {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    max-width: 600px;
}
.chart-container h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }

.filter-bar {
    background: #fff;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
}

.profile-wrapper {
    display: flex;
    justify-content: center;
    padding-top: 30px;
}
.profile-box {
    background: #fff;
    border-radius: 10px;
    padding: 28px 32px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.09);
}
.profile-box h2 { font-size: 20px; font-weight: 600; margin-bottom: 20px; color: #212529; }

/* LOGIN PAGE - BLUE GLASSMORPHISM */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('/assets/images/background.jpg') center/cover no-repeat fixed;
    position: relative;
}
.login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(10, 20, 60, 0.5);
}
.login-container {
    position: relative;
    z-index: 1;
    display: flex;
    width: 820px;
    max-width: 95vw;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0,0,0,0.5);
}
.login-left {
    flex: 1;
    background: #00000082;
    padding: 52px 40px;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-left .login-logo { font-size: 42px; margin-bottom: 16px; }
.login-left h2 { font-size: 24px; font-weight: 700; margin-bottom: 10px; }
.login-left p  { font-size: 13px; opacity: 0.88; line-height: 1.7; }

.login-right {
    flex: 1;
    background: #ffffff21;
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    padding: 52px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-right h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #fff;
}
.login-right .form-group label { color: rgba(255,255,255,0.85); font-weight: 500; }
.login-right .form-control {
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
    border-radius: 8px;
    padding: 10px 14px;
}
.login-right .form-control::placeholder { color: rgba(255,255,255,0.55); }
.login-right .form-control:focus {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.7);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}
.login-right .form-control option { color: #212529; background: #fff; }
.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(160deg, #0d3b99, #1a56db);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 6px;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.3px;
}
.btn-login:hover { background: linear-gradient(160deg, #0a2f7a, #1648c4); transform: translateY(-1px); }
.btn-login:active { transform: translateY(0); }
.login-right .alert {
    background: rgba(231,76,60,0.25);
    border: 1px solid rgba(231,76,60,0.5);
    color: #fff;
    border-radius: 8px;
    margin-bottom: 16px;
}

.print-page { max-width: 820px; margin: 28px auto; padding: 0 20px; }
.print-buttons { display: flex; gap: 10px; margin-bottom: 24px; }
.print-doc {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 36px 44px;
    font-size: 13px;
}
.print-doc .doc-header {
    text-align: center;
    border-bottom: 2px solid #212529;
    padding-bottom: 14px;
    margin-bottom: 22px;
}
.print-doc .doc-header h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.print-doc .doc-header p  { font-size: 12px; color: #555; }
.print-doc .doc-section-title {
    font-size: 15px; font-weight: 700;
    margin: 20px 0 10px;
    color: #1a1a1a;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 4px;
}
.print-doc .doc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 30px;
}
.print-doc .doc-field { font-size: 13px; padding: 2px 0; }
.print-doc .doc-field strong { font-weight: 600; }
.print-doc .doc-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    font-size: 13px;
}
.print-doc .doc-table th,
.print-doc .doc-table td {
    border: 1px solid #dee2e6;
    padding: 8px 10px;
    text-align: left;
}
.print-doc .doc-table th { background: #f8f9fa; font-weight: 600; }

table.dataTable > tbody > tr.child ul.dtr-details { width: 100%; }
table.dataTable > tbody > tr.child ul.dtr-details li { display: flex; padding: 4px 0; border-bottom: 1px solid #f0f0f0; }
table.dataTable > tbody > tr.child ul.dtr-details li .dtr-title { font-weight: 600; min-width: 100px; }
table.dataTable > tbody > tr.child ul.dtr-details li .dtr-data { flex: 1; }
table.dataTable > tbody > tr.dtr-expanded td.dtr-control:before,
table.dataTable > tbody > tr.dtr-expanded th.dtr-control:before { content: '-'; }
table.dataTable > tbody > tr > td.dtr-control:before,
table.dataTable > tbody > tr > th.dtr-control:before { content: '+'; }

@media (max-width: 768px) {
    .navbar { padding: 0 16px; flex-wrap: wrap; height: auto; min-height: 50px; }
    .navbar-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        background: inherit;
        padding-bottom: 8px;
    }
    .navbar-nav.open { display: flex; }
    .navbar-nav li a { line-height: 2; padding: 4px 16px; font-size: 14px; }
    .navbar-toggle { display: block; }
    .navbar-brand { padding: 12px 0; font-size: 14px; }

    .main-content { padding: 20px 12px 30px; }
    .page-title { font-size: 20px; }
    .page-subtitle { font-size: 12px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 20px 12px; }
    .stat-card .stat-value { font-size: 28px; }

    .table-toolbar { flex-direction: column; align-items: stretch; }
    .table-search { width: 100%; }
    .table-search input { width: 100%; }
    .table-wrapper { margin: 0; }
    .card { padding: 14px 12px; }

    .login-container { flex-direction: column; max-width: 420px; }
    .login-left { padding: 28px 24px; }
    .login-right { padding: 28px 24px; }

    .profile-box { padding: 24px 20px; }
    .print-doc { padding: 20px 16px; }
    .print-doc .doc-grid { grid-template-columns: 1fr; }
    .modal-box.modal-lg { max-width: 98vw; }
    .modal-box form > div[style*="grid"] { grid-template-columns: 1fr !important; }
    .pagination { gap: 2px; }
    .pagination button, .pagination a { padding: 4px 8px; font-size: 12px; }
    .filter-bar form { flex-direction: column; }
    .filter-bar form .form-group { flex: none !important; min-width: 0 !important; width: 100%; }
    .chart-container { max-width: 100%; }
    .btn { padding: 6px 12px; font-size: 12px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .btn { padding: 6px 10px; font-size: 11px; }
    .card { padding: 10px 8px; }
    .data-table { min-width: 100%; }
    .data-table thead tr th,
    .data-table tbody tr td { padding: 5px 6px; font-size: 11px; }
    .page-title { font-size: 18px; }
}

@media print {
    .navbar, .print-buttons { display: none !important; }
    body { background: #fff; }
    .print-doc { border: none; padding: 0; box-shadow: none; }
    .print-page { margin: 0; padding: 0; max-width: 100%; }
    .data-table { min-width: auto; }
    .table-wrapper { margin: 0; }
}
