/* =====================================================
   PBSI Sistem Informasi — style.css v3.0
   ===================================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- TOP HEADER --- */
.top-header {
    background: linear-gradient(135deg, #1a56db 0%, #1e3a8a 100%);
    color: #fff;
    padding: 0 24px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(26,86,219,0.3);
}
.logo-wrap { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 24px; line-height: 1; }
.logo-text strong { font-size: 16px; font-weight: 800; letter-spacing: 0.5px; display: block; }
.logo-text span { font-size: 10px; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-badge {
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 20px;
    padding: 4px 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.user-info { display: flex; align-items: center; gap: 10px; }
.user-details { text-align: right; }
.user-name { font-weight: 600; font-size: 13px; display: block; }
.user-role { font-size: 10px; opacity: 0.75; display: block; }
.user-time { font-size: 10px; opacity: 0.65; display: block; }
.user-avatar {
    width: 34px; height: 34px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    border: 2px solid rgba(255,255,255,0.3);
}

/* --- MAIN NAV --- */
.main-nav {
    background: #1e3a8a;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav-menu { list-style: none; display: flex; gap: 0; }
.nav-item a.nav-link {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 12.5px;
    font-weight: 500;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.nav-item a.nav-link:hover,
.nav-item.active a.nav-link {
    color: #fff;
    border-bottom-color: #60a5fa;
    background: rgba(255,255,255,0.06);
}
.nav-item a.nav-link i { font-size: 12px; }

/* --- SUB NAV --- */
.sub-nav {
    background: #fff;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 24px;
    overflow-x: auto;
}
.sub-nav-inner { display: flex; gap: 0; white-space: nowrap; }
.sub-tab {
    padding: 11px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #718096;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}
.sub-tab:hover { color: #1a56db; border-bottom-color: #bee3f8; }
.sub-tab.active { color: #1a56db; border-bottom-color: #1a56db; }

/* User info tab */
.user-info-tab {
    margin-left: auto;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 500;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 6px;
}
.badge-viewer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: #dbeafe;
    color: #2563eb;
    border-radius: 50%;
    font-size: 9px;
}
.btn-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    text-decoration: none;
    font-size: 12px;
    margin-left: 6px;
    transition: all 0.2s;
}
.btn-logout:hover {
    background: #dc2626;
    color: #fff;
}

/* --- MAIN CONTENT --- */
main.main-content {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* --- STATS CARDS --- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    transition: box-shadow 0.2s, transform 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.10); transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.stat-value { font-size: 22px; font-weight: 800; line-height: 1; color: #1a202c; }
.stat-label { font-size: 12px; color: #718096; margin-top: 3px; font-weight: 500; }

/* --- SECTION CARD --- */
.section-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    margin-bottom: 24px;
}
.section-header {
    padding: 18px 20px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f4f8;
}
.section-header-left { display: flex; align-items: center; gap: 10px; }
.section-accent {
    width: 4px; height: 22px;
    background: linear-gradient(180deg, #1a56db, #3b82f6);
    border-radius: 4px;
    display: inline-block;
    flex-shrink: 0;
}
.section-title { font-size: 15px; font-weight: 700; color: #1a202c; }
.section-body { padding: 20px; }

/* --- FILTER BAR --- */
.filter-bar {
    padding: 14px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.filter-group { display: flex; align-items: center; gap: 7px; }
.filter-group label { font-size: 12px; font-weight: 600; color: #4a5568; white-space: nowrap; }
.filter-select, .filter-input {
    height: 34px;
    border: 1.5px solid #cbd5e0;
    border-radius: 7px;
    padding: 0 10px;
    font-size: 12.5px;
    font-family: inherit;
    color: #1a202c;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-select:focus, .filter-input:focus {
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.filter-input { width: 220px; }

/* --- DATA TABLE --- */
.table-responsive { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.data-table thead th {
    background: #f8fafc;
    padding: 11px 14px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}
.data-table tbody tr { border-bottom: 1px solid #f0f4f8; transition: background 0.15s; }
.data-table tbody tr:hover { background: #f8faff; }
.data-table tbody tr:last-child { border-bottom: none; }
.data-table td { padding: 11px 14px; vertical-align: middle; }
.data-table td.td-center { text-align: center; }

/* --- ATLET PHOTO --- */
.atlet-photo {
    width: 36px; height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.atlet-photo-placeholder {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e0);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #718096;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}
.atlet-info { display: flex; align-items: center; gap: 10px; }
.atlet-name { font-weight: 600; color: #1a202c; }
.atlet-nik { font-size: 11px; color: #718096; font-family: monospace; }

/* --- BADGES --- */
.badge {
    display: inline-flex; align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-aktif    { background: #d1fae5; color: #065f46; }
.badge-nonaktif { background: #fee2e2; color: #991b1b; }
.badge-menunggu { background: #fef3c7; color: #92400e; }
.badge-l        { background: #dbeafe; color: #1e40af; }
.badge-p        { background: #fce7f3; color: #9d174d; }

/* --- ACTION BUTTONS --- */
.btn-group { display: flex; gap: 5px; }
.btn-icon {
    width: 30px; height: 30px;
    border-radius: 7px;
    border: 1.5px solid;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    background: #fff;
}
.btn-icon:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,0,0,0.1); }
.btn-icon.view   { border-color: #3b82f6; color: #2563eb; }
.btn-icon.view:hover { background: #eff6ff; }
.btn-icon.edit   { border-color: #f59e0b; color: #d97706; }
.btn-icon.edit:hover { background: #fffbeb; }
.btn-icon.delete { border-color: #ef4444; color: #dc2626; }
.btn-icon.delete:hover { background: #fef2f2; }
.btn-icon.approve { border-color: #10b981; color: #059669; }
.btn-icon.approve:hover { background: #ecfdf5; }

/* --- PRIMARY BUTTONS --- */
.btn-primary {
    height: 36px;
    padding: 0 16px;
    background: linear-gradient(135deg, #1a56db, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(26,86,219,0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(26,86,219,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    height: 36px;
    padding: 0 16px;
    background: #fff;
    color: #4a5568;
    border: 1.5px solid #cbd5e0;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-secondary:hover { border-color: #a0aec0; background: #f8fafc; }

.btn-danger {
    height: 36px;
    padding: 0 16px;
    background: #fff;
    color: #dc2626;
    border: 1.5px solid #fca5a5;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-danger:hover { background: #fef2f2; border-color: #ef4444; }

/* --- PAGINATION --- */
.table-footer {
    padding: 12px 20px;
    border-top: 1px solid #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.page-info { font-size: 12px; color: #718096; }
.pagination { display: flex; gap: 4px; }
.page-btn {
    min-width: 32px; height: 32px;
    border: 1.5px solid #e2e8f0;
    border-radius: 7px;
    background: #fff;
    color: #4a5568;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none;
    padding: 0 8px;
    transition: all 0.15s;
}
.page-btn:hover { border-color: #1a56db; color: #1a56db; background: #eff6ff; }
.page-btn.active { background: #1a56db; border-color: #1a56db; color: #fff; }
.page-btn:disabled, .page-btn.disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* --- MODAL --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.97);
    transition: transform 0.25s;
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky; top: 0; background: #fff; z-index: 1;
    border-radius: 16px 16px 0 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: #1a202c; }
.modal-close {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: #f0f4f8;
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: #718096;
    transition: all 0.15s;
}
.modal-close:hover { background: #fee2e2; color: #dc2626; }
.modal-body { padding: 20px 24px; }
.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    position: sticky; bottom: 0; background: #fff;
    border-radius: 0 0 16px 16px;
}

/* --- DETAIL MODAL --- */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-group label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.detail-group .detail-val {
    font-size: 14px;
    color: #1a202c;
    font-weight: 500;
}
.detail-divider { grid-column: 1/-1; border: none; border-top: 1px solid #e2e8f0; }
.detail-photo-wrap { text-align: center; grid-column: 1/-1; }
.detail-photo-wrap img {
    width: 90px; height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.detail-photo-placeholder {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px; color: #3b82f6;
    margin: 0 auto;
    border: 3px solid #e2e8f0;
}

/* --- FORM --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.single { grid-template-columns: 1fr; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1/-1; }
.form-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}
.form-label .req { color: #ef4444; }
.form-control {
    height: 38px;
    padding: 0 12px;
    border: 1.5px solid #cbd5e0;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #1a202c;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    border-color: #1a56db;
    box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.form-control.error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
textarea.form-control { height: auto; padding: 10px 12px; resize: vertical; min-height: 80px; }
select.form-control { cursor: pointer; }
.form-hint { font-size: 11px; color: #718096; }
.form-error { font-size: 11px; color: #dc2626; }

/* --- UPLOAD FOTO --- */
.upload-wrap {
    border: 2px dashed #cbd5e0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
}
.upload-wrap:hover { border-color: #1a56db; background: #eff6ff; }
.upload-wrap input[type="file"] { display: none; }
.upload-preview {
    width: 80px; height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e2e8f0;
    margin-bottom: 8px;
}
.upload-text { font-size: 12px; color: #718096; }
.upload-text strong { color: #1a56db; }

/* --- FLASH TOAST --- */
.flash-toast {
    position: fixed;
    top: 70px; right: 20px;
    z-index: 9999;
    min-width: 280px;
    max-width: 400px;
    padding: 14px 18px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    animation: slideIn 0.3s ease;
    transition: opacity 0.4s;
}
.flash-toast.success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.flash-toast.error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.flash-toast.info    { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* --- EMPTY STATE --- */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #a0aec0;
}
.empty-state i { font-size: 48px; margin-bottom: 12px; display: block; }
.empty-state p { font-size: 14px; }

/* --- BREADCRUMB --- */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #718096;
    margin-bottom: 18px;
}
.breadcrumb a { color: #1a56db; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: #cbd5e0; }
.breadcrumb .current { color: #1a202c; font-weight: 600; }

/* --- PAGE HEADER --- */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}
.page-title { font-size: 20px; font-weight: 800; color: #1a202c; }
.page-subtitle { font-size: 12px; color: #718096; margin-top: 2px; }

/* --- FOOTER --- */
.site-footer {
    background: #1e3a8a;
    color: rgba(255,255,255,0.7);
    padding: 14px 24px;
    margin-top: auto;
}
.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11.5px;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    main.main-content { padding: 16px; }
    .stats-row { grid-template-columns: 1fr 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; align-items: flex-start; }
    .filter-bar { flex-direction: column; align-items: flex-start; }
    .filter-input { width: 100%; }
    .modal { border-radius: 12px; }
    .header-badge { display: none; }
    .user-details { display: none; }
}
@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr; }
    .top-header { padding: 0 14px; }
    .main-nav { padding: 0 14px; }
    .sub-nav { padding: 0 14px; }
}

/* --- UTILITIES --- */
.text-muted { color: #718096; }
.text-small { font-size: 12px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-8 { gap: 8px; }
.mt-4 { margin-top: 4px; }
.monospace { font-family: 'Courier New', monospace; font-size: 12px; }
.row-highlight { background: #f0fdf4 !important; }
.text-right { text-align: right; }
