/* Modern Billiards Competition - Design System & Stylesheet */

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

:root {
    /* Color Palette */
    --bg-main: #0b0f19;
    --bg-dark: #070a10;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(28, 37, 56, 0.85);
    --bg-input: rgba(3, 7, 18, 0.6);
    
    --primary: #10b981; /* Billiard Emerald Green */
    --primary-glow: rgba(16, 185, 129, 0.2);
    --primary-hover: #059669;
    
    --accent: #f59e0b; /* Cue Ball Gold/Amber */
    --accent-glow: rgba(245, 158, 11, 0.2);
    --accent-hover: #d97706;
    
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --info: #3b82f6;
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(16, 185, 129, 0.3);
    --border-focus: rgba(16, 185, 129, 0.5);
    
    /* Layout Constants */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 25px rgba(16, 185, 129, 0.15);
    
    /* Fonts */
    --font-headers: 'Outfit', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* PWA Safe Area Variables */
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.5;
    padding-top: var(--safe-top);
    padding-bottom: calc(75px + var(--safe-bottom)); /* Leave room for mobile bottom nav */
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headers);
    font-weight: 600;
    letter-spacing: -0.025em;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Base Layout Wrapper */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

/* Top App Bar (Desktop: Header, Mobile: Sticky Header) */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

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

.logo-icon {
    width: 42px;
    height: 42px;
    background: radial-gradient(circle at 30% 30%, var(--primary), var(--primary-hover));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
    font-size: 1.25rem;
    font-weight: bold;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 40%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text p {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigations (Responsive) */
/* Desktop Sidebar / Header Menu */
.desktop-nav {
    display: flex;
    gap: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
    cursor: pointer;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-glow);
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.05);
}

/* Mobile Bottom Navigation (Sticky bottom) */
.mobile-nav {
    display: none; /* Desktop default */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(65px + var(--safe-bottom));
    background: rgba(7, 10, 16, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 100;
    padding-bottom: var(--safe-bottom);
}

.mobile-nav-menu {
    display: flex;
    height: 100%;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
    height: 100%;
    width: 20%;
    transition: all 0.2s ease;
    cursor: pointer;
}

.mobile-nav-link svg, .mobile-nav-link i {
    width: 20px;
    height: 20px;
}

.mobile-nav-link.active {
    color: var(--primary);
}

/* Views & Containers */
.view {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cards (Glassmorphism) */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    border-color: var(--border-hover);
}

.card-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title svg, .card-title i {
    color: var(--primary);
}

/* Dashboard Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(17, 24, 39, 0.45);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary);
    border: 1px solid var(--border-color);
}

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

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

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

.stat-value {
    font-size: 1.5rem;
    font-family: var(--font-headers);
    font-weight: 700;
    color: var(--text-primary);
}

/* Tables (Responsive & Sleek) */
.table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: rgba(3, 7, 18, 0.2);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

th {
    background-color: rgba(7, 10, 16, 0.7);
    font-family: var(--font-headers);
    color: var(--text-secondary);
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    user-select: none;
}

td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: background-color 0.15s ease;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Rank column special badge styling */
.rank-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.05);
}

tr:nth-child(1) .rank-badge {
    background: linear-gradient(135deg, var(--accent), #fcd34d);
    color: #451a03;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

tr:nth-child(2) .rank-badge {
    background: linear-gradient(135deg, #9ca3af, #e5e7eb);
    color: #1f2937;
}

tr:nth-child(3) .rank-badge {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fef3c7;
}

/* Form Styles & Inputs */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

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

label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    width: 100%;
}

input:hover, select:hover, textarea:hover {
    border-color: var(--border-hover);
}

input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

input:disabled, select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--text-secondary);
}

.btn-accent {
    background-color: var(--accent);
    color: #0b0f19;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-accent:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background-color: var(--danger);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-block {
    width: 100%;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Modals & Dialogs (Premium overlay) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(3, 7, 18, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    background: #0f172a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: rgba(7, 10, 16, 0.3);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* Match Scheduler layout */
.attendance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.attendance-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.attendance-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.attendance-card.present {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.attendance-card input[type="checkbox"] {
    accent-color: var(--primary);
    width: 18px;
    height: 18px;
    cursor: pointer;
}

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

.attendance-name {
    font-size: 0.9rem;
    font-weight: 500;
}

.attendance-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Generated Match Schedule layout */
.schedule-matches {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-schedule-card {
    background: rgba(3, 7, 18, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.match-vs-display {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-grow: 1;
}

.match-player {
    display: flex;
    flex-direction: column;
    width: 42%;
}

.match-player-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.match-player.right {
    text-align: right;
}

.match-player-moy {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.match-divider {
    font-family: var(--font-headers);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.8rem;
    background: rgba(245, 158, 11, 0.1);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.match-actions-controls {
    display: flex;
    gap: 8px;
}

/* Dynamic Matches Result Listing */
.matches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-row-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.match-row-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-hover);
    transform: translateX(2px);
}

.match-players-scores {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-grow: 1;
}

.match-score-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 45%;
}

.match-score-cell.right {
    justify-content: flex-end;
    text-align: right;
}

.match-score-name {
    font-weight: 500;
}

.match-score-val {
    font-family: var(--font-headers);
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 4px;
    min-width: 40px;
    text-align: center;
}

.match-score-cell.winner .match-score-val {
    background: var(--accent-glow);
    color: var(--accent);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.1);
}

.match-score-cell.winner .match-score-name {
    color: #ffffff;
}

.match-row-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.badge-played {
    background: rgba(16, 185, 129, 0.15);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

.badge-scheduled {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Detail modal scoreboard layout */
.scoreboard-comparison {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.score-column {
    width: 46%;
    background: rgba(3, 7, 18, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.score-column.winner {
    border-color: rgba(245, 158, 11, 0.3);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.03) 0%, rgba(3, 7, 18, 0.3) 100%);
}

.winner-banner {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--accent);
    font-size: 1.25rem;
}

.score-player-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    text-align: center;
}

.score-player-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.score-big-number {
    font-family: var(--font-headers);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.score-column.winner .score-big-number {
    color: var(--accent);
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
}

.score-big-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 24px;
}

.score-stats-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.score-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 8px;
}

.score-stat-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.score-stat-lbl {
    color: var(--text-secondary);
}

.score-stat-val {
    font-weight: 600;
}

.scoreboard-vs-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    background: #0f172a;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-family: var(--font-headers);
    color: var(--accent);
    font-weight: 800;
    z-index: 10;
    margin-left: -20px;
    margin-right: -20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.turns-banner {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

/* PDF Drag and Drop Area */
.pdf-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.01);
    transition: all 0.2s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.pdf-drop-zone:hover, .pdf-drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(16, 185, 129, 0.02);
}

.pdf-icon {
    font-size: 2.5rem;
    color: var(--text-secondary);
}

.pdf-drop-zone:hover .pdf-icon, .pdf-drop-zone.dragover .pdf-icon {
    color: var(--primary);
    transform: scale(1.05);
}

.pdf-drop-zone p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pdf-drop-zone .highlight {
    color: var(--primary);
    font-weight: 600;
}

.parsed-preview-box {
    margin-top: 20px;
    background: rgba(3, 7, 18, 0.4);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.raw-text-log {
    background: #030712;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    padding: 12px;
    font-family: monospace;
    font-size: 0.75rem;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    color: var(--text-secondary);
}

/* PDF Extracted Concept Matches List */
.concept-matches-container {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.concept-match-card {
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
}

.concept-match-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 6px;
}

/* Search and Action Bar layout */
.search-bar-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    min-width: 200px;
}

.search-input-wrapper input {
    padding-left: 36px;
}

.search-icon-inside {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

/* Alert Notification Banner */
.alert-banner {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: #fbbf24;
    font-size: 0.85rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-banner.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* Help text for Formula */
.formula-help {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.formula-help ul {
    margin-left: 16px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.formula-help code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    color: var(--accent);
}

/* Responsive Overrides */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(75px + var(--safe-bottom) + 16px);
    }
    
    .app-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .desktop-nav {
        display: none; /* Hide on mobile */
    }
    
    .mobile-nav {
        display: block; /* Show bottom nav on mobile */
    }
    
    .logo-text h1 {
        font-size: 1.25rem;
    }
    
    .logo-text p {
        font-size: 0.7rem;
    }
    
    .card {
        padding: 16px;
        margin-bottom: 16px;
    }
    
    th, td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    /* Hide some columns in tables on small screens to fit neatly */
    .hide-mobile {
        display: none;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .attendance-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
    
    .match-vs-display {
        gap: 8px;
    }
    
    .match-player-name {
        font-size: 0.85rem;
    }
    
    .match-row-card {
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .match-players-scores {
        width: 100%;
    }
    
    .match-row-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        border-top: 1px solid rgba(255, 255, 255, 0.03);
        padding-top: 8px;
    }
    
    .scoreboard-comparison {
        flex-direction: column;
        gap: 12px;
    }
    
    .score-column {
        width: 100%;
    }
    
    .scoreboard-vs-circle {
        margin: 8px 0;
        align-self: center;
    }
}

/* Sub-Tab Navigation for Planning (Weekplanning vs Blokschema) */
.sub-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.sub-nav-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.sub-nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.sub-nav-btn.active {
    color: var(--primary);
    background: var(--primary-glow);
}

/* Matrix (Blokschema) styles */
.matrix-wrapper {
    overflow-x: auto;
    margin-top: 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.matrix-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 750px;
    font-size: 0.85rem;
}

.matrix-table th, .matrix-table td {
    padding: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.matrix-table th {
    background-color: rgba(7, 10, 16, 0.9);
}

.matrix-table th.player-header {
    text-align: left;
    white-space: nowrap;
    min-width: 120px;
    background-color: rgba(7, 10, 16, 0.8);
}

.matrix-table td.player-row-lbl {
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
    background-color: rgba(7, 10, 16, 0.4);
}

.matrix-table td.diagonal {
    background-color: rgba(255, 255, 255, 0.05);
    background-image: linear-gradient(135deg, transparent 45%, var(--border-color) 45%, var(--border-color) 55%, transparent 55%);
    background-size: 10px 10px;
    cursor: not-allowed;
}

.matrix-cell {
    padding: 6px !important;
    cursor: pointer;
    transition: all 0.15s ease;
}

.matrix-cell:hover:not(.diagonal) {
    background-color: rgba(16, 185, 129, 0.1) !important;
}

.matrix-cell-empty {
    color: var(--text-muted);
    font-size: 0.75rem;
}

.matrix-cell-scheduled {
    color: var(--accent);
    font-weight: 500;
    background-color: rgba(245, 158, 11, 0.04);
}

.matrix-cell-played {
    font-family: monospace;
    font-weight: 600;
    background-color: rgba(16, 185, 129, 0.03);
}

.matrix-round-indicator {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 2px;
}

/* KPI Selector and Layout */
.kpi-section {
    margin-bottom: 24px;
    background: rgba(17, 24, 39, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.kpi-header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.kpi-card {
    background: rgba(3, 7, 18, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: border-color 0.2s ease;
}

.kpi-card:hover {
    border-color: rgba(255, 255, 255, 0.12);
}

.kpi-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.kpi-value {
    font-size: 1.3rem;
    font-family: var(--font-headers);
    font-weight: 700;
    color: #ffffff;
}

/* Date headers in history */
.history-date-group {
    margin-bottom: 24px;
}

.history-date-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
}

