/* ==========================================
   DESIGN SYSTEM & CSS VARIABLES
   ========================================== */
:root {
    --bg-primary: #0e1117;
    --bg-secondary: #161b22;
    --bg-card: rgba(22, 27, 34, 0.7);
    --bg-card-hover: rgba(33, 38, 45, 0.85);
    
    --primary: #10b981;      /* Grass green */
    --primary-glow: rgba(16, 185, 129, 0.2);
    --primary-hover: #059669;
    
    --accent: #06b6d4;       /* Neon Cyan */
    --accent-glow: rgba(6, 182, 212, 0.2);
    
    --yellow: #f59e0b;       /* Warning/Gold */
    --yellow-glow: rgba(245, 158, 11, 0.2);
    
    --danger: #ef4444;       /* Error/Red */
    --danger-hover: #dc2626;
    --danger-glow: rgba(239, 68, 68, 0.2);
    
    --text-main: #f0f6fc;
    --text-muted: #8b949e;
    --border-color: rgba(240, 246, 252, 0.1);
    --border-glow: rgba(255, 255, 255, 0.05);
    
    --sidebar-width: 260px;
    --header-height: 80px;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-main: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-speed: 0.25s;
}

/* ==========================================
   BASE & RESET STYLES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-sans);
    -webkit-font-smoothing: antialiased;
}

/* Mobile specific helper components (hidden by default on desktop PC) */
.btn-mobile-menu,
.mobile-drawer-close,
.mobile-drawer-overlay,
.mobile-bottom-nav {
    display: none;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==========================================
   APP CONTAINER LAYOUT
   ========================================== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Navigation */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 20px 14px;
    flex-shrink: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px 20px 12px;
    border-bottom: 1px solid var(--border-color);
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--bg-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.logo-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.5;
}

.brand h2 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-main), #c9d1d9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Team Selector Dropdown Card */
.team-selector-card {
    background: rgba(255, 255, 255, 0.02);
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    margin: 16px 8px 8px 8px;
}

.team-selector-card label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}

.team-select-dropdown {
    width: 100%;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    padding: 8px 10px !important;
    font-size: 0.85rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer;
}

.nav-menu {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.02);
    transform: translateX(4px);
}

.nav-item.active {
    color: var(--text-main);
    background-color: var(--primary-glow);
    box-shadow: inset 0 0 0 1px var(--primary);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item.active .nav-icon {
    color: var(--primary);
}

.sidebar-footer {
    padding-top: 14px;
    border-top: 1px solid var(--border-color);
}

.team-badge-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.team-badge {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--bg-secondary), #30363d);
    color: var(--primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    font-size: 0.85rem;
}

.team-info {
    display: flex;
    flex-direction: column;
}

.team-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.team-league {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area Layout */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.top-header {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background-color: var(--bg-primary);
    flex-shrink: 0;
}

.header-title-area h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.header-title-area p {
    font-size: 0.85rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.current-date {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.9rem;
    font-weight: 500;
}

.view-content {
    flex-grow: 1;
    padding: 32px 40px;
    overflow-y: auto;
    background: radial-gradient(circle at 70% 20%, rgba(16, 185, 129, 0.02) 0%, transparent 60%);
}

/* ==========================================
   COMPONENTS & UI ELEMENTS
   ========================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    outline: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background-color: var(--primary);
    color: #0b0c0e;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--text-main);
}

.btn-danger:hover {
    background-color: var(--danger-hover);
    box-shadow: 0 0 15px var(--danger-glow);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-icon {
    width: 16px;
    height: 16px;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-accent {
    background-color: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-warning {
    background-color: var(--yellow-glow);
    color: var(--yellow);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
    background-color: var(--danger-glow);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-success {
    background-color: var(--primary-glow);
    color: var(--primary);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-secondary {
    background-color: rgba(255,255,255,0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

/* Glass Card */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    box-shadow: var(--shadow-main);
    transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.glass-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* General Layout utilities */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.small { font-size: 0.8rem; }
.hidden { display: none !important; }
.link-btn {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: color 0.2s;
}
.link-btn:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ==========================================
   VIEWS - SPECIFIC UI STYLING
   ========================================== */
.content-view {
    display: none;
    height: 100%;
}

.content-view.active {
    display: block;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 1. DASHBOARD VIEW STYLING */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-icon.green { background: var(--primary-glow); color: var(--primary); }
.stat-icon.cyan { background: var(--accent-glow); color: var(--accent); }
.stat-icon.yellow { background: var(--yellow-glow); color: var(--yellow); }
.stat-icon.magenta { background: rgba(219, 39, 119, 0.15); color: #db2777; }

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-value {
    font-size: 1.35rem;
    font-weight: 700;
    margin-top: 2px;
}

.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.dashboard-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Match & Training Highlights */
.match-highlight-card, .training-highlight-card {
    min-height: 180px;
}

.highlight-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.vs-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.team-symbol {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #30363d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    border: 2px solid var(--border-color);
}

.team-symbol.my-team {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.vs-text {
    font-weight: 700;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.highlight-details {
    text-align: right;
}

.highlight-time {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--accent);
}

.highlight-loc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Rankings & Lists */
.ranking-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ranking-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.rank-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank-num {
    width: 24px;
    font-weight: 700;
    color: var(--accent);
}

.player-rank-info {
    display: flex;
    flex-direction: column;
}

.rank-player-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.rank-player-pos {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rank-score {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--primary);
}

/* 2. KADER VIEW STYLING */
.section-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
}

.search-bar-container {
    flex-grow: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255,255,255,0.03);
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(255,255,255,0.05);
}

.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}

.player-card {
    position: relative;
    overflow: hidden;
}

.player-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.player-number {
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.15);
    line-height: 1;
}

.player-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 12px 0 20px 0;
    text-align: center;
}

.player-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-secondary), #30363d);
    border: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.3s;
}

.player-card:hover .player-avatar {
    transform: scale(1.08);
    border-color: var(--primary);
}

.player-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.player-position {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.player-card-footer {
    display: flex;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.player-mini-stat {
    display: flex;
    flex-direction: column;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.player-mini-stat span:last-child {
    font-weight: 700;
    color: var(--text-main);
    font-size: 0.85rem;
}

.player-card-actions {
    position: absolute;
    top: 14px;
    right: 14px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.player-card:hover .player-card-actions {
    opacity: 1;
}

.icon-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.3);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255,255,255,0.1);
}

.icon-btn.btn-edit:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.btn-delete:hover { border-color: var(--danger); color: var(--danger); }

.icon-btn svg {
    width: 14px;
    height: 14px;
}

/* 3. TRAINING VIEW STYLING */
.training-layout {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
    height: calc(100vh - var(--header-height) - 100px);
}

.training-list-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.training-list-panel .section-actions {
    flex-shrink: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 16px;
}

.training-scroll-list {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.training-item {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.training-item:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}

.training-item.active {
    background: var(--primary-glow);
    border-color: var(--primary);
}

.training-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.training-item-focus {
    font-weight: 600;
    font-size: 0.95rem;
}

.training-item-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.training-item-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.training-item.active .training-item-stats {
    color: rgba(255, 255, 255, 0.7);
}

/* Detail Panel for Attendance */
.training-detail-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    text-align: center;
}

.empty-icon {
    width: 64px;
    height: 64px;
    stroke-width: 1.5;
    margin-bottom: 16px;
    opacity: 0.3;
}

.training-detail-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.detail-header-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.detail-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Attendance Progress Bar */
.attendance-summary-bar {
    display: flex;
    height: 24px;
    border-radius: 6px;
    overflow: hidden;
    margin: 16px 0 12px 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #0b0c0e;
    flex-shrink: 0;
}

.bar-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
}

.bar-segment.present { background-color: var(--primary); }
.bar-segment.excused { background-color: var(--yellow); }
.bar-segment.unexcused { background-color: var(--danger); color: #fff; }

#sectionTrainingPlayers,
#sectionTrainingCoaches,
#sectionTrainingAttendance {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#sectionTrainingPlan {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

#trainingPlanQuickBanner {
    flex-shrink: 0;
}

.attendance-quick-info {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.attendance-list-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible;
}

.attendance-list-container h4 {
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.attendance-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-height: 200px;
    max-height: 68vh;
    overflow-y: auto;
    padding-right: 6px;
}

.attendance-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: rgba(255,255,255,0.01);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.att-player-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.att-number {
    font-weight: 700;
    color: var(--accent);
    width: 24px;
}

.attendance-buttons {
    display: flex;
    gap: 6px;
}

.att-btn {
    border: 1px solid var(--border-color);
    background: rgba(0,0,0,0.2);
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: all 0.15s ease;
}

.att-btn.present:hover, .att-btn.present.active {
    background-color: var(--primary);
    color: #0b0c0e;
    border-color: var(--primary);
}

.att-btn.excused:hover, .att-btn.excused.active {
    background-color: var(--yellow);
    color: #0b0c0e;
    border-color: var(--yellow);
}

.att-btn.unexcused:hover, .att-btn.unexcused.active {
    background-color: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

/* 4. SPIELE VIEW STYLING */
.match-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.match-meta-info {
    display: flex;
    flex-direction: column;
}

.match-date-badge {
    font-weight: 700;
    color: var(--accent);
}

.match-location-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.match-fixture {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.match-team {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 700;
    font-size: 1.15rem;
    width: 220px;
}

.match-team.host { justify-content: flex-end; }
.match-team.guest { justify-content: flex-start; }

.match-score-board {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0e1117;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 20px;
    min-width: 90px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
}

.match-score-board.pending {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0;
    font-weight: 500;
}

/* PC Desktop View specific match card layout (> 768px) */
@media (min-width: 769px) {
    .match-card {
        display: grid;
        grid-template-columns: 200px 1fr;
        align-items: center;
        row-gap: 14px;
        column-gap: 20px;
        padding: 18px 22px;
    }

    .match-meta-info {
        grid-column: 1;
    }

    .match-fixture {
        grid-column: 2;
    }

    .match-actions {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        flex-wrap: wrap;
        border-top: 1px solid var(--border-color);
        padding-top: 12px;
        margin-top: 2px;
    }

    .match-actions .btn {
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        height: 36px;
        padding: 6px 14px;
        font-size: 0.85rem;
        font-weight: 500;
    }
}

/* 5. CALENDAR VIEW STYLING */
.calendar-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.calendar-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
}

.calendar-header-nav h3 {
    font-size: 1.35rem;
    font-weight: 700;
}

.calendar-grid-container {
    display: flex;
    flex-direction: column;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    text-align: center;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    margin-left: 1px;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-auto-rows: minmax(110px, auto);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

.calendar-day-cell {
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 8px;
    background: rgba(255, 255, 255, 0.005);
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: background 0.2s;
    position: relative;
}

.calendar-day-cell:hover {
    background: rgba(255, 255, 255, 0.015);
}

.calendar-day-number {
    align-self: flex-end;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.calendar-day-cell.today .calendar-day-number {
    color: var(--primary);
    background: var(--primary-glow);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--primary);
}

.calendar-day-cell.other-month {
    opacity: 0.25;
}

.calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex-grow: 1;
    max-height: 80px;
}

/* Event badges in calendar */
.cal-event {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s;
    border: 1px solid transparent;
}

.cal-event:hover {
    transform: scale(1.03);
}

.cal-event.training {
    background-color: var(--primary-glow);
    color: var(--primary);
    border-color: rgba(16, 185, 129, 0.2);
}

.cal-event.match {
    background-color: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(6, 182, 212, 0.2);
}

.cal-event.championship.proposed {
    background-color: rgba(255, 165, 2, 0.25);
    color: #ffa502;
    border-color: rgba(255, 165, 2, 0.4);
    font-weight: 700;
}

.cal-event.championship.agreed {
    background-color: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border-color: rgba(46, 213, 115, 0.4);
}

/* 6. STATISTIKEN VIEW STYLING */
.stats-layout-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

.stat-table-card {
    padding: 20px;
}

.table-container {
    overflow-x: auto;
    margin-top: 12px;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.stats-table th {
    padding: 12px;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.stats-table tbody tr:hover {
    background: rgba(255,255,255,0.02);
}

/* 7. VEREIN VIEW STYLING */
.club-layout-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 24px;
    align-items: start;
}

.club-table-card {
    padding: 20px;
}

/* ==========================================
   MODAL DIALOGS STYLING
   ========================================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-backdrop.active {
    display: flex;
    animation: fadeInModal 0.2s ease forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
    overflow: hidden;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-backdrop.active .modal-content {
    transform: translateY(0);
}

.modal-content.modal-lg {
    max-width: 800px;
}

.modal-content.modal-xl {
    max-width: 1280px;
    width: 95vw;
}

#matchPlanningModal .modal-content {
    max-width: 1280px;
    width: 95vw;
    max-height: 90vh;
    max-height: 90dvh;
    display: flex;
    flex-direction: column;
}

.planning-scroll-container {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 4px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.7rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-main);
}

form {
    padding: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-group.col {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="time"],
select {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
    border-color: var(--primary);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
}

/* Match Stats Form Styling */
.result-input-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: rgba(0,0,0,0.2);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.team-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.team-name-label {
    font-weight: 700;
    font-size: 1rem;
}

.score-input {
    width: 80px !important;
    text-align: center;
    font-size: 1.5rem !important;
    font-weight: 800;
    padding: 10px 0 !important;
}

.score-divider {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-muted);
}

.players-stats-section h4 {
    margin-bottom: 12px;
    font-size: 1rem;
}

.stats-table-container {
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.player-stats-table {
    width: 100%;
    border-collapse: collapse;
}

.player-stats-table th {
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
    padding: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.player-stats-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.player-stats-table tr:hover {
    background: rgba(255,255,255,0.01);
}

.player-stats-table input[type="number"] {
    padding: 6px 10px;
    font-size: 0.85rem;
    background: rgba(0,0,0,0.3);
}

.stats-input-num {
    width: 70px;
}

.stats-input-event {
    width: 60px;
}

/* ==========================================
   NEW STYLES FOR MORE COMPLEX MODELS & PLANNER
   ========================================== */

/* Checkbox group list (multi team mapping) */
.checkbox-group-list {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
}

.checkbox-group-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 0;
    cursor: pointer;
}

.checkbox-group-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Assigned Coaches List Box (Team details) */
.team-coaches-list-box {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    min-height: 50px;
    max-height: 120px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.assigned-coach-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.02);
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.coach-assignment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.assigned-coach-name {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Planning Dashboard Styles */
.planning-dashboard {
    display: grid;
    grid-template-columns: 180px 180px 1fr;
    gap: 16px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.plan-stat-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    border-radius: 8px;
}

.plan-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 4px;
}

.budget-block {
    justify-content: flex-start;
}

.budget-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 2px;
}

.budget-progress-bar-container {
    flex-grow: 1;
    height: 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 5px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    max-width: 250px;
}

.budget-progress-bar {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.budget-progress-bar.overbudget {
    background-color: var(--danger);
}

.budget-progress-bar.underbudget {
    background-color: var(--yellow);
}

/* Slider customized styling for planning */
.slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.slider-input {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    accent-color: var(--primary);
    cursor: pointer;
}

.slider-value-display {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--accent);
    min-width: 55px;
    text-align: right;
}

.attendance-badge-inline {
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.72rem;
}

/* Scrollbar customization for modern look */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ==========================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================== */
@media (max-width: 992px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    
    .stats-layout-grid {
        grid-template-columns: 1fr;
    }

    .club-layout-grid {
        grid-template-columns: 1fr;
    }

    .planning-dashboard {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Mobile Container Layout */
    .app-container {
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        width: 100vw;
        overflow: hidden;
        position: relative;
    }

    /* Mobile Off-Canvas Drawer (Sidebar) */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        height: 100dvh;
        width: 280px;
        max-width: 85vw;
        background-color: var(--bg-secondary);
        border-right: 1px solid var(--border-color);
        z-index: 1001;
        padding: 20px 16px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.6);
        display: flex;
        flex-direction: column;
    }

    .sidebar.open {
        transform: translateX(0) !important;
        visibility: visible !important;
    }

    .brand {
        position: relative;
        padding-bottom: 16px;
    }

    .mobile-drawer-close {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 0;
        top: 4px;
        width: 32px;
        height: 32px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        color: var(--text-muted);
        cursor: pointer;
    }

    .mobile-drawer-close svg {
        width: 18px;
        height: 18px;
    }

    /* Drawer Overlay Backdrop */
    .mobile-drawer-overlay {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }

    .mobile-drawer-overlay.open {
        opacity: 1 !important;
        pointer-events: auto !important;
        visibility: visible !important;
    }

    .team-selector-card {
        margin: 14px 0 10px 0;
    }

    .nav-menu {
        flex-direction: column;
        overflow-y: auto;
        margin-top: 10px;
        padding-bottom: 10px;
        gap: 6px;
    }

    .nav-item {
        padding: 12px 14px;
        font-size: 0.95rem;
        gap: 12px;
        white-space: normal;
    }

    .sidebar-footer {
        flex-direction: column;
        gap: 10px;
        padding-top: 14px;
        border-top: 1px solid var(--border-color);
        margin-top: auto;
    }

    .sidebar-footer .team-badge-container {
        display: flex;
    }

    .sidebar-footer .user-profile-box {
        flex-direction: column !important;
        align-items: stretch !important;
        border-top: 1px solid var(--border-color) !important;
        padding-top: 10px !important;
        gap: 6px !important;
    }

    .sidebar-footer .user-profile-box #userEmailDisplay {
        font-size: 0.75rem !important;
        max-width: 100%;
    }

    .sidebar-footer .user-profile-box div[style*="display: flex"] {
        width: 100% !important;
        gap: 6px !important;
    }

    /* Main Content Layout on Mobile */
    .main-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        width: 100vw;
        padding-bottom: 65px; /* Leave space for bottom nav */
    }

    /* Mobile Header Bar */
    .top-header {
        height: 60px;
        min-height: 60px;
        padding: 0 14px;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-secondary);
        z-index: 50;
    }

    .btn-mobile-menu {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid var(--border-color);
        color: var(--text-main);
        cursor: pointer;
        flex-shrink: 0;
        position: relative;
        z-index: 10;
        -webkit-tap-highlight-color: transparent;
    }

    .btn-mobile-menu svg {
        width: 20px;
        height: 20px;
    }

    .header-title-area h1 {
        font-size: 1.15rem;
        line-height: 1.2;
    }

    .header-title-area p {
        display: none;
    }

    .header-actions {
        width: auto;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .header-actions .btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .current-date {
        display: none;
    }

    /* Fixed Mobile Bottom Navigation Bar */
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 65px;
        background: rgba(22, 27, 34, 0.94);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-color);
        z-index: 999;
        justify-content: space-around;
        align-items: center;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }

    .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        flex: 1;
        height: 100%;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 0.65rem;
        font-weight: 500;
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
        stroke-width: 2;
        transition: transform 0.2s ease;
    }

    .mobile-nav-item.active {
        color: var(--primary);
        font-weight: 700;
    }

    .mobile-nav-item.active svg {
        color: var(--primary);
        transform: translateY(-2px);
    }

    /* View Content Padding */
    .view-content {
        flex: 1;
        padding: 12px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Dashboard Mobile Adjustments */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        width: 36px;
        height: 36px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-label {
        font-size: 0.7rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .dashboard-layout {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Kader (Roster) Mobile Optimizations */
    .view-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .view-actions {
        width: 100%;
        flex-direction: column;
        gap: 10px;
    }

    .search-bar {
        width: 100%;
    }

    .player-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .player-card {
        padding: 12px;
    }

    .player-actions {
        gap: 6px;
    }

    .player-actions .btn {
        padding: 6px;
    }

    /* Training Mobile View */
    .training-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
        gap: 14px;
    }

    .training-list-panel {
        display: flex;
        flex-direction: column;
        height: 260px;
        max-height: 260px;
        overflow: hidden;
    }

    .training-detail-panel {
        height: auto;
        min-height: auto;
    }

    .detail-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .detail-header-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
    }

    .detail-header-actions .btn {
        width: 100%;
        min-height: 38px;
        padding: 8px 6px;
        font-size: 0.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    .attendance-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 10px 12px;
    }

    .attendance-buttons {
        width: 100%;
        display: flex;
        gap: 6px;
    }

    .att-btn {
        flex: 1;
        min-height: 36px;
        padding: 6px 4px;
        font-size: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .attendance-btn-group {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .attendance-btn {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 0.8rem;
    }

    .attendance-quick-info {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        width: 100%;
        margin-bottom: 16px;
    }

    .attendance-quick-info .badge {
        flex: 1 1 auto;
        min-width: 95px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 6px 8px;
        font-size: 0.75rem;
        white-space: nowrap;
    }

    .attendance-summary-bar {
        font-size: 0.7rem;
    }

    .bar-segment {
        font-size: 0.68rem;
        padding: 0 4px;
    }

    /* Matches Mobile Optimization */
    .match-card {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
        text-align: center;
    }

    .match-fixture {
        flex-direction: column;
        gap: 10px;
    }

    .match-team {
        width: 100%;
        justify-content: center !important;
    }

    .match-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        width: 100%;
        margin-top: 10px;
    }

    .match-actions .btn {
        width: 100%;
        min-height: 38px;
        padding: 8px 6px;
        font-size: 0.8rem;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
    }

    /* Calendar Mobile View */
    .calendar-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }

    .calendar-views {
        width: 100%;
        justify-content: center;
    }

    .calendar-weekdays {
        font-size: 0.65rem;
    }

    .calendar-days {
        grid-auto-rows: minmax(58px, auto);
        gap: 3px;
    }

    .calendar-day-cell {
        padding: 3px;
        min-height: 58px;
    }

    .calendar-day-number {
        font-size: 0.75rem;
    }

    .cal-event {
        font-size: 0.58rem;
        padding: 2px 4px;
        margin-top: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Statistics Table Sticky Column & Horizontal Scroll */
    .stats-table-container {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
        border-radius: 8px;
        border: 1px solid var(--border-color);
    }

    .stats-table {
        min-width: 600px;
    }

    .stats-table th:first-child,
    .stats-table td:first-child {
        position: sticky;
        left: 0;
        background-color: var(--bg-secondary);
        z-index: 2;
        border-right: 1px solid var(--border-color);
    }

    /* Modals & Forms on Mobile */
    .modal-backdrop {
        padding: 10px;
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        max-height: 88dvh;
        border-radius: 18px 18px 0 0;
        padding: 18px;
        overflow-y: auto;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    /* Prevent mobile OS auto-zoom on input focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .mobile-bottom-nav {
        height: 60px;
    }

    .mobile-nav-item span {
        font-size: 0.6rem;
    }

    .mobile-nav-item svg {
        width: 18px;
        height: 18px;
    }
}

/* Mobile Live Match Tracker Sticky Action Bar & Responsive Modal */
.mobile-tracker-sticky-bar {
    display: none;
}

@media (max-width: 768px) {
    .mobile-tracker-sticky-bar {
        display: flex;
        position: fixed;
        bottom: 68px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 990;
        background: rgba(15, 23, 42, 0.94);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.18);
        padding: 6px 12px;
        border-radius: 30px;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6);
        gap: 8px;
        width: calc(100% - 24px);
        max-width: 420px;
        justify-content: space-around;
    }
    .mobile-tracker-sticky-bar button {
        flex: 1;
        padding: 8px 10px;
        font-weight: 700;
        font-size: 0.85rem;
        border-radius: 20px;
    }

    #liveSubModal .modal-content {
        padding: 14px;
        max-height: 90vh;
        max-height: 90dvh;
    }
    #liveSubModal .player-stats-table th,
    #liveSubModal .player-stats-table td {
        padding: 6px 4px;
        font-size: 13px;
    }
    #liveSubModal .live-sub-in-select {
        font-size: 14px !important;
        padding: 6px 4px !important;
    }
    #liveSubModal .modal-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    #liveSubModal .modal-footer button {
        width: 100%;
    }
}

/* ==========================================
   LOGIN SCREEN STYLING & USER PROFILE
   ========================================== */
.login-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at center, #1b263b 0%, var(--bg-primary) 100%);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.login-wrapper[style*="display: none"] {
    display: none !important;
    pointer-events: none !important;
    visibility: hidden !important;
    z-index: -1 !important;
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
    background: rgba(22, 27, 34, 0.85);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.logo-icon-large {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: bounceBall 2s infinite ease-in-out;
}

@keyframes bounceBall {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(180deg); }
}

.login-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-main);
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.login-card .form-group label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.login-card input[type="email"],
.login-card input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-main);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.25s ease;
}

.login-card input[type="email"]:focus,
.login-card input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.25);
    background: rgba(0, 0, 0, 0.5);
}

.login-card .btn-block {
    margin-top: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.login-card .btn-block:hover {
    box-shadow: 0 0 12px var(--primary-glow);
}

.user-profile-box {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

#btnLogout:hover {
    background-color: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* Match Planning Modal Layout Optimization */
#matchPlanningForm {
    padding: 10px 18px 8px 18px;
}

#matchPlanningForm .planning-dashboard {
    padding: 10px;
    margin-bottom: 10px;
    gap: 10px;
}

#matchPlanningForm .plan-stat-block {
    padding: 6px 10px;
}

#matchPlanningForm .players-stats-section {
    margin-top: 8px;
}

#matchPlanningForm .players-stats-section h4 {
    margin-bottom: 4px;
    font-size: 0.9rem;
}

/* Meisterschafts & Gegner Card Styling */
.opponent-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(0, 0, 0, 0.25));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.opponent-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.opponent-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.2s ease;
}

.opponent-contact-btn:hover {
    filter: brightness(1.2);
}

.badge-status-proposed {
    background: rgba(255, 165, 2, 0.2);
    color: #ffa502;
    border: 1px solid rgba(255, 165, 2, 0.4);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.badge-status-agreed {
    background: rgba(46, 213, 115, 0.2);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.4);
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

/* ==========================================
   EINSATZZEITEN-MATRIX & LANDSCAPE STYLING
   ========================================== */
.planning-tab-btn {
    opacity: 0.75;
    transition: all 0.2s ease;
}
.planning-tab-btn.active {
    opacity: 1;
    background: var(--primary) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
    font-weight: 700;
}

.matrix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    background: rgba(15, 23, 42, 0.4);
}
.matrix-table th, .matrix-table td {
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    text-align: center;
    vertical-align: middle;
}
.matrix-period-header {
    background: rgba(30, 41, 59, 0.85);
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}
.matrix-step-header {
    background: rgba(15, 23, 42, 0.7);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 10px;
}
.matrix-slot-label {
    background: rgba(30, 41, 59, 0.6);
    font-weight: 700;
    text-align: left !important;
    white-space: nowrap;
    color: #fff;
    min-width: 120px;
}
.matrix-cell-select {
    width: 100%;
    min-width: 110px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
}
.matrix-cell-select:focus {
    border-color: var(--primary);
}
.matrix-cell-subbed {
    background: rgba(16, 185, 129, 0.15) !important;
    border-left: 3px solid var(--primary) !important;
}
.matrix-cell-dupe {
    background: rgba(239, 68, 68, 0.25) !important;
    border: 2px solid #ef4444 !important;
}
.matrix-sub-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
    padding: 1px 4px;
    border-radius: 3px;
    margin-bottom: 2px;
}

/* Responsive Training Phase Card Grid */
.training-phase-grid {
    display: grid !important;
    grid-template-columns: 1fr 240px !important;
    gap: 14px !important;
    align-items: start !important;
}

.training-phase-grid.no-sketch {
    grid-template-columns: 1fr !important;
}

@media (max-width: 768px) {
    .training-phase-grid {
        grid-template-columns: 1fr !important;
    }
}


.player-stats-table th.sortable-header {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.player-stats-table th.sortable-header:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.player-stats-table th.sortable-header .sort-icon {
    margin-left: 4px;
    font-size: 0.75rem;
    display: inline-block;
}
