/* ==========================================================================
   SISTEM ABSENSI PELATIH EKSTRAKULIKULER - MODERN DESIGN SYSTEM
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --primary-glow: rgba(79, 70, 229, 0.25);
    
    --secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
    --accent-emerald: #10b981;
    --accent-emerald-light: #ecfdf5;
    --accent-amber: #f59e0b;
    --accent-amber-light: #fffbeb;
    --accent-rose: #f43f5e;
    --accent-rose-light: #fff1f2;
    --accent-sky: #0284c7;
    --accent-sky-light: #f0f9ff;
    --accent-purple: #9333ea;
    --accent-purple-light: #faf5ff;
    --accent-teal: #0d9488;
    --accent-teal-light: #f0fdfa;
    
    /* Neutrals */
    --bg-page: #f8fafc;
    --surface-card: #ffffff;
    --surface-muted: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
    --border-focus: #818cf8;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 10px 25px -5px rgba(79, 70, 229, 0.35);

    /* Radii */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 9999px;
    
    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Setup */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

html {
    scroll-behavior: smooth;
    font-size: 15px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-page);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(139, 92, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(14, 165, 233, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    padding: 24px 16px 40px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Main Container Layout */
.container {
    max-width: 1380px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ==========================================================================
   HEADER SECTION
   ========================================================================== */
.main-header {
    background: var(--surface-card);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-xl);
    padding: 24px 32px;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
    overflow: hidden;
}

.main-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.brand-wrapper {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-icon {
    width: 60px !important;
    height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    border-radius: var(--radius-lg);
    background: #ffffff;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border-color);
    flex-shrink: 0 !important;
    transition: var(--transition);
    overflow: hidden !important;
    padding: 4px;
    box-sizing: border-box;
}

.brand-icon:hover {
    transform: translateY(-2px) scale(1.05);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.brand-icon img,
.brand-icon img.brand-logo-img,
img.brand-logo-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 52px !important;
    max-height: 52px !important;
    object-fit: contain !important;
    display: block !important;
}

.brand-text h1 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.brand-text .app-badge {
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.brand-text p {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-top: 3px;
    font-weight: 400;
}

.header-meta {
    display: flex;
    align-items: center;
    gap: 16px;
}

.live-time-card {
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 12px;
}

.live-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-emerald);
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    }
    70% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.time-content {
    display: flex;
    flex-direction: column;
}

.time-clock {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.time-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ==========================================================================
   FLASH ALERTS
   ========================================================================== */
.alert-banner {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-banner.success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-banner.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-banner.error {
    background: #fff1f2;
    border: 1px solid #fecdd3;
    color: #9f1239;
}

.alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.95rem;
}

.alert-content i {
    font-size: 1.25rem;
}

.alert-close {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: inherit;
    opacity: 0.6;
    transition: var(--transition);
}

.alert-close:hover {
    opacity: 1;
}

/* ==========================================================================
   STATISTICS KPI CARDS
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}

.stat-card {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 18px;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-icon.indigo {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.emerald {
    background: var(--accent-emerald-light);
    color: var(--accent-emerald);
}

.stat-icon.amber {
    background: var(--accent-amber-light);
    color: var(--accent-amber);
}

.stat-icon.sky {
    background: var(--accent-sky-light);
    color: var(--accent-sky);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-number {
    font-size: 1.55rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    margin-top: 2px;
}

.stat-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* ==========================================================================
   MAIN DUAL-COLUMN CONTENT LAYOUT
   ========================================================================== */
.main-content {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
}

/* Card Container Styles */
.card-section {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
}

.section-header-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.section-header p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

/* ==========================================================================
   FORM SECTION STYLING
   ========================================================================== */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

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

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

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.label-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-title i {
    color: var(--primary);
    font-size: 0.95rem;
}

.label-action-btn {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    border: none;
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    cursor: pointer;
    transition: var(--transition);
}

.label-action-btn:hover {
    background: #e0e7ff;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper i.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
}

.input-control {
    width: 100%;
    padding: 12px 16px;
    padding-left: 42px;
    background: #ffffff;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.input-control.no-icon {
    padding-left: 16px;
}

select.input-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

textarea.input-control {
    padding-left: 16px;
    resize: vertical;
    min-height: 90px;
}

.input-control:hover {
    border-color: #cbd5e1;
}

.input-control:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
    background-color: #ffffff;
}

.input-control:focus + .input-icon,
.input-wrapper:focus-within i.input-icon {
    color: var(--primary);
}

/* Drag & Drop File Upload */
.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    background: #f8fafc;
    padding: 26px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.upload-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 5;
}

.dropzone-icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--primary);
    margin-bottom: 4px;
    transition: var(--transition);
}

.upload-dropzone:hover .dropzone-icon-circle {
    transform: translateY(-3px) scale(1.05);
    color: var(--primary-hover);
}

.dropzone-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dropzone-subtitle {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.dropzone-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 4px;
}

.dropzone-badge {
    font-size: 0.72rem;
    font-weight: 600;
    background: #ffffff;
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-color);
}

/* Upload Counter & Preview Grid */
.preview-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 10px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.preview-card {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    aspect-ratio: 4/3;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-card .preview-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.8));
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-card .btn-remove-preview {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(244, 63, 94, 0.9);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.preview-card .btn-remove-preview:hover {
    background: #e11d48;
    transform: scale(1.15);
}

/* Submit Button */
.btn-submit-form {
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-md);
    padding: 16px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-glow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-submit-form::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: rotate(45deg);
    transition: 0.6s;
}

.btn-submit-form:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(79, 70, 229, 0.45);
}

.btn-submit-form:hover::before {
    left: 100%;
}

.btn-submit-form:active {
    transform: translateY(1px);
}

/* ==========================================================================
   GALLERY SECTION STYLING
   ========================================================================== */
.gallery-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-emerald);
    background: var(--accent-emerald-light);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 4px 12px;
    border-radius: var(--radius-pill);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.gallery-item {
    aspect-ratio: 1/1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.4);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.85) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 14px;
    color: #ffffff;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay-badge {
    align-self: flex-start;
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(4px);
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    margin-bottom: 6px;
}

.gallery-overlay-action {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
}

/* Empty Gallery Slot */
.gallery-item.empty-slot {
    border: 2px dashed #cbd5e1;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: default;
}

.gallery-item.empty-slot:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: #cbd5e1;
}

.gallery-item.empty-slot i {
    font-size: 32px;
    color: #cbd5e1;
}

.gallery-item.empty-slot span {
    font-size: 0.75rem;
    font-weight: 600;
}

.gallery-footer-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.gallery-footer-info span {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

/* ==========================================================================
   HISTORY TABLE SECTION
   ========================================================================== */
.table-section {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 30px;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Table Toolbar: Search & Filter */
.table-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar-search {
    flex: 1;
    min-width: 260px;
    max-width: 420px;
    position: relative;
}

.toolbar-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
}

.toolbar-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: var(--transition);
}

.toolbar-search input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

.toolbar-filters {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-select {
    padding: 9px 34px 9px 14px;
    background-color: var(--surface-muted);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.toolbar-select:focus {
    outline: none;
    border-color: var(--border-focus);
    background-color: #ffffff;
}

input[type="date"].toolbar-select {
    background-image: none;
    padding-right: 14px;
}

.record-count-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--surface-muted);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
}

/* Modern Table */
.table-responsive {
    overflow-x: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    background: #ffffff;
}

table.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
    text-align: left;
}

table.modern-table thead {
    background: #f8fafc;
}

table.modern-table th {
    padding: 14px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

table.modern-table tbody tr {
    transition: var(--transition);
}

table.modern-table tbody tr:hover {
    background-color: #f8fafc;
}

table.modern-table tbody tr:not(:last-child) td {
    border-bottom: 1px solid var(--border-color);
}

table.modern-table td {
    padding: 16px 18px;
    color: var(--text-primary);
    vertical-align: middle;
}

.row-num {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.coach-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coach-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.88rem;
    flex-shrink: 0;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.coach-name {
    font-weight: 600;
    color: var(--text-primary);
}

/* Extracurricular Badges */
.ekskul-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.ekskul-badge.sepak-bola {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.ekskul-badge.basket {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.ekskul-badge.voli {
    background: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.ekskul-badge.pencak-silat {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ekskul-badge.paskibra {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

.ekskul-badge.paduan-suara {
    background: #faf5ff;
    color: #7e22ce;
    border: 1px solid #e9d5ff;
}

.ekskul-badge.teater {
    background: #fff1f2;
    color: #be123c;
    border: 1px solid #fecdd3;
}

.ekskul-badge.robotika {
    background: #ecfeff;
    color: #0e7490;
    border: 1px solid #a5f3fc;
}

.ekskul-badge.default {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.datetime-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}

.datetime-date {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.datetime-time {
    color: var(--text-secondary);
    font-size: 0.78rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.notes-cell {
    max-width: 280px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.4;
    word-break: break-word;
}

/* Photos in Table - Modern Thumbnails */
.table-photos-group {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.table-thumbs-strip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 2px;
}

.table-thumb-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1.5px solid var(--border-color);
    background: #f1f5f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.table-thumb-wrap:hover {
    border-color: var(--primary);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 14px rgba(79, 70, 229, 0.22);
}

.table-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.table-thumb-wrap:hover .table-thumb-img {
    transform: scale(1.08);
}

.thumb-zoom-icon {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.table-thumb-wrap:hover .thumb-zoom-icon {
    opacity: 1;
}

.table-thumb-more {
    width: 36px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.75rem;
    border: 1.5px dashed var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    padding: 0;
}

.table-thumb-more:hover {
    background: var(--primary);
    color: #ffffff;
    border-style: solid;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
}

.table-photos-caption {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: var(--transition);
}

.table-photos-group:hover .table-photos-caption {
    color: var(--primary);
    background: var(--primary-light);
}

.photos-pill-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-view-photos {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.25);
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-view-photos:hover {
    background: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.btn-view-photos i {
    font-size: 0.85rem;
}

.no-photos-tag {
    color: var(--text-muted);
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #f8fafc;
    border-radius: var(--radius-pill);
    border: 1px dashed #cbd5e1;
}

/* Empty State Table */
.table-empty-state {
    padding: 48px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
}

.table-empty-state i {
    font-size: 42px;
    color: #cbd5e1;
}

.table-empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.table-empty-state p {
    font-size: 0.88rem;
    max-width: 360px;
}

/* ==========================================================================
   MODAL LIGHTBOX
   ========================================================================== */
.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content {
    max-width: 900px;
    width: 100%;
    background: #0f172a;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.lightbox-modal.active .lightbox-content {
    transform: scale(1);
}

.lightbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.lightbox-title {
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lightbox-counter {
    font-size: 0.8rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
}

.lightbox-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: var(--transition);
}

.lightbox-close-btn:hover {
    background: var(--accent-rose);
    transform: rotate(90deg);
}

.lightbox-body {
    position: relative;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #020617;
    overflow: hidden;
}

.lightbox-image {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    display: block;
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-nav-btn:hover {
    background: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav-btn.prev {
    left: 16px;
}

.lightbox-nav-btn.next {
    right: 16px;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.main-footer {
    background: var(--surface-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    flex-wrap: wrap;
    gap: 12px;
}

.footer-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-tag {
    font-weight: 600;
    color: var(--primary);
}

/* ==========================================================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 1100px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px 10px 30px;
    }
    
    .main-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }
    
    .brand-text h1 {
        font-size: 1.35rem;
    }
    
    .header-meta {
        width: 100%;
        justify-content: space-between;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .card-section, .table-section {
        padding: 20px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .preview-grid,
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-search {
        max-width: 100%;
    }
    
    .main-footer {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .preview-grid,
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .brand-icon {
        width: 46px;
        height: 46px;
        font-size: 20px;
    }
}