/* ═══════════════════════════════════════════════════════════
   Club Management System — Core Stylesheet
   ═══════════════════════════════════════════════════════════ */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 0px;
    --sidebar-bg: #1a2332;
    --sidebar-hover: #243347;
    --sidebar-active: #2c5282;
    --sidebar-text: #a0aec0;
    --sidebar-text-active: #ffffff;
    --header-height: 56px;
    --footer-height: 40px;
    --primary: #2c5282;
    --primary-light: #3182ce;
}

* { box-sizing: border-box; }

body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; margin: 0; padding: 0; background: #f4f6f9; min-height: 100vh; }

/* Auth Layout */
.auth-body { background: linear-gradient(135deg, #1a2332 0%, #2c5282 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.auth-wrapper { width: 100%; max-width: 440px; padding: 20px; }
.auth-card { border: none; border-radius: 12px; }

/* Sidebar */
.cms-sidebar { position: fixed; top: 0; left: 0; width: var(--sidebar-width); height: 100vh; background: var(--sidebar-bg); color: var(--sidebar-text); z-index: 1050; display: flex; flex-direction: column; transition: transform 0.3s ease; overflow: hidden; }
.cms-sidebar.collapsed { transform: translateX(calc(-1 * var(--sidebar-width))); }

.sidebar-header { padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.sidebar-brand { color: #fff; text-decoration: none; font-size: 1.1rem; font-weight: 600; display: flex; align-items: center; }
.sidebar-brand:hover { color: #fff; }
.sidebar-close { color: var(--sidebar-text); display: none; }

.sidebar-body { flex: 1; overflow-y: auto; padding: 10px 0; }
.sidebar-body::-webkit-scrollbar { width: 4px; }
.sidebar-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sidebar-link { color: var(--sidebar-text) !important; padding: 10px 20px; font-size: 0.875rem; display: flex; align-items: center; transition: all 0.2s; border-radius: 0; text-decoration: none; }
.sidebar-link:hover { background: var(--sidebar-hover); color: var(--sidebar-text-active) !important; }
.sidebar-link.active { background: var(--sidebar-active); color: var(--sidebar-text-active) !important; }
.sidebar-link i:first-child { width: 22px; text-align: center; }

.sidebar-chevron { font-size: 0.7rem; transition: transform 0.2s; }
.sidebar-link.collapsed .sidebar-chevron { transform: rotate(-90deg); }

.sidebar-submenu { padding: 2px 0; }
.sidebar-sublink { color: var(--sidebar-text) !important; padding: 7px 20px; font-size: 0.8rem; }
.sidebar-sublink:hover { color: var(--sidebar-text-active) !important; background: rgba(255,255,255,0.05); }
.sidebar-sublink.active { color: var(--sidebar-text-active) !important; background: rgba(44,82,130,0.3); }
.sidebar-sublink i { font-size: 0.4rem; opacity: 0.5; }

.sidebar-footer { padding: 12px 20px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.75rem; text-align: center; }

.sidebar-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1040; }

/* Main Content */
.cms-main { margin-left: var(--sidebar-width); min-height: 100vh; display: flex; flex-direction: column; transition: margin-left 0.3s ease; }
.cms-main.expanded { margin-left: 0; }

.cms-header { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0 20px; min-height: var(--header-height); display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1020; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.sidebar-toggle { border: none; background: none; padding: 8px; color: #4a5568; }
.sidebar-toggle:hover { color: var(--primary); }

.cms-content { flex: 1; padding: 20px; }
.cms-footer { padding: 10px 20px; text-align: center; font-size: 0.8rem; color: #718096; border-top: 1px solid #e2e8f0; background: #fff; }

/* Cards */
.card { border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); margin-bottom: 20px; }
.card-header { background: #f8fafc; border-bottom: 1px solid #e2e8f0; padding: 12px 16px; font-weight: 600; }
.card-body { padding: 16px; }

/* DataTable Adjustments */
.dataTables_wrapper .dataTables_filter input { border-radius: 6px; border: 1px solid #cbd5e0; padding: 6px 12px; }
.dataTables_wrapper .dataTables_length select { border-radius: 6px; border: 1px solid #cbd5e0; padding: 4px 8px; }
table.dataTable thead th { background: #f8fafc; font-weight: 600; font-size: 0.85rem; color: #4a5568; border-bottom: 2px solid #e2e8f0; }
table.dataTable tbody td { font-size: 0.875rem; vertical-align: middle; }

/* Badges */
.badge { font-weight: 500; font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; }

/* Buttons */
.btn-sm { font-size: 0.8rem; padding: 4px 10px; }
.btn-group-actions .btn { border-radius: 4px; margin: 0 1px; }

/* Forms */
.form-label { font-weight: 500; color: #4a5568; font-size: 0.875rem; margin-bottom: 4px; }
.form-control:focus, .form-select:focus { border-color: var(--primary-light); box-shadow: 0 0 0 0.2rem rgba(49,130,206,0.15); }
.invalid-feedback { font-size: 0.8rem; }

/* Select2 */
.select2-container--bootstrap-5 .select2-selection { min-height: 38px; border-color: #dee2e6; }

/* Loading Overlay */
.loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255,255,255,0.7); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.loading-overlay .spinner-border { width: 3rem; height: 3rem; }

/* Toast positioning */
.swal2-container.swal2-top-end { top: 70px !important; }

/* Status badges enhancement */
.badge.bg-success { background-color: #38a169 !important; }
.badge.bg-danger { background-color: #e53e3e !important; }
.badge.bg-warning { background-color: #dd6b20 !important; color: #fff !important; }
.badge.bg-info { background-color: #3182ce !important; }

/* Tab styling */
.nav-tabs .nav-link { color: #4a5568; font-weight: 500; }
.nav-tabs .nav-link.active { color: var(--primary); border-color: #dee2e6 #dee2e6 #fff; }

/* Breadcrumb */
.breadcrumb { font-size: 0.85rem; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }

/* Stat cards */
.card.border-primary { border-left: 4px solid var(--bs-primary) !important; }
.card.border-success { border-left: 4px solid var(--bs-success) !important; }
.card.border-warning { border-left: 4px solid var(--bs-warning) !important; }
.card.border-danger { border-left: 4px solid var(--bs-danger) !important; }
.card.border-info { border-left: 4px solid var(--bs-info) !important; }

/* Print */
@media print {
    .cms-sidebar, .cms-header, .cms-footer, .sidebar-overlay { display: none !important; }
    .cms-main { margin-left: 0 !important; }
    .no-print { display: none !important; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}

/* Responsive */
@media (max-width: 991.98px) {
    .cms-sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
    .cms-sidebar.show { transform: translateX(0); }
    .sidebar-close { display: block; }
    .sidebar-overlay.show { display: block; }
    .cms-main { margin-left: 0; }
}

/* Animation */
.fade-in { animation: fadeIn 0.3s ease-in; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Alert auto-dismiss animation */
.alert { animation: fadeIn 0.3s ease-in; }

/* Empty state */
.empty-state { text-align: center; padding: 60px 20px; color: #a0aec0; }
.empty-state i { font-size: 4rem; margin-bottom: 20px; }

/* Thumbnail in tables */
.table-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }

/* Sticky table header */
.table-sticky thead th { position: sticky; top: 0; z-index: 10; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #cbd5e0; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a0aec0; }