/* ============================================================
   Sportistic Core – Spielerverwaltung
   Design: hell, CoachPanel-Look, mobile-first
============================================================ */

:root {
    --brand: #1976d2;
    --brand-dark: #125ea6;
    --bg: #f5f7fa;
    --card: #ffffff;
    --text: #222;
    --muted: #666;
    --muted-light: #999;
    --border: #e0e0e0;
    --border-light: #f0f0f0;
    --success: #2e7d32;
    --success-bg: #e8f5e9;
    --warn: #ff9800;
    --warn-bg: #fff8e1;
    --warn-border: #ffe082;
    --err: #d32f2f;
    --err-bg: #ffebee;
    --err-border: #f44336;
    --info-bg: #e3f2fd;
    --info-border: #90caf9;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 12px; font-weight: 700; }
.muted { color: var(--muted); }

/* ------------------------------------------------------------
   SCREENS (Login, Change-PW, No-Access, Main)
------------------------------------------------------------ */
.screen { min-height: 100vh; display: flex; flex-direction: column; }

/* ------------------------------------------------------------
   AUTH CARDS (Login, Change-PW, No-Access)
------------------------------------------------------------ */
#loginScreen, #changePwScreen, #noAccessScreen {
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #1976d2 0%, #0d47a1 100%);
}

.auth-card {
    background: var(--card);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    padding: 32px 28px;
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}
.auth-logo-mark {
    font-size: 2.2rem;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-logo-brand { font-size: 1.35rem; font-weight: 700; color: var(--text); }
.auth-logo-sub { font-size: 0.85rem; color: var(--muted); }

.auth-card h2 { font-size: 1.3rem; margin-bottom: 6px; }

.auth-card label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--muted);
    margin: 14px 0 4px;
}

.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fafbfc;
}
.auth-card input:focus {
    outline: none;
    border-color: var(--brand);
    background: white;
}

.auth-error {
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--err-bg);
    border: 1px solid var(--err-border);
    border-radius: var(--radius);
    color: var(--err);
    font-size: 0.88rem;
}

.auth-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--muted-light);
}

/* ------------------------------------------------------------
   BUTTONS
------------------------------------------------------------ */
.btn {
    display: inline-block;
    padding: 9px 18px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--brand);
    color: white;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-block { display: block; width: 100%; margin-top: 18px; }
.btn-link {
    background: transparent;
    color: var(--muted);
    margin-top: 8px;
    text-decoration: underline;
}
.btn-link:hover { background: transparent; color: var(--text); }
.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.4);
    color: white;
    padding: 6px 14px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); }

/* ------------------------------------------------------------
   MAIN APP
------------------------------------------------------------ */
.app-header {
    background: linear-gradient(135deg, #1976d2, #0d47a1);
    color: white;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 10;
}
.app-header-left { display: flex; align-items: center; gap: 12px; }
.app-header-mark {
    font-size: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.app-header-brand { font-size: 1.1rem; font-weight: 700; line-height: 1.1; }
.app-header-sub { font-size: 0.75rem; opacity: 0.85; }
.app-header-right { display: flex; align-items: center; gap: 12px; }
.app-header-user { font-size: 0.9rem; opacity: 0.95; }

.app-tabs {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 0 12px;
    display: flex;
    gap: 4px;
    position: sticky;
    top: 60px;
    z-index: 9;
    overflow-x: auto;
}

.tab-btn {
    padding: 12px 18px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--muted);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.tab-btn.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}
.tab-btn:hover { color: var(--text); }

.app-main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.tab-pane { }

/* ------------------------------------------------------------
   TABLES / LISTS
------------------------------------------------------------ */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    font-size: 0.92rem;
}
.data-table thead tr {
    background: #f5f7fa;
    text-align: left;
}
.data-table th {
    padding: 10px 12px;
    border-bottom: 2px solid var(--border);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-light);
}
.data-table tbody tr[onclick] { cursor: pointer; }
.data-table tbody tr[onclick]:hover { background: #f9fbff; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-muted { background: #f5f5f5; color: var(--muted-light); }
.badge-info { background: var(--info-bg); color: #1565c0; }

.toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}
.toolbar input[type="text"] {
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.92rem;
    flex: 1;
    max-width: 320px;
    background: white;
}
.toolbar .count {
    color: var(--muted);
    font-size: 0.85rem;
}

.inline-detail {
    background: #f8fbff;
    padding: 18px 22px;
    border-top: 3px solid var(--brand);
}
.inline-detail h3 { font-size: 1.05rem; margin-bottom: 4px; }
.inline-detail .detail-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 14px; }
.inline-detail .detail-section-title { font-weight: 700; color: var(--text); margin: 6px 0 8px; font-size: 0.9rem; }

.panel-success {
    background: var(--success-bg);
    border: 1px solid #a5d6a7;
    border-radius: var(--radius);
    padding: 14px;
}
.panel-warn {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: var(--radius);
    padding: 14px;
}
.panel-err {
    background: var(--err-bg);
    border: 1px solid var(--err-border);
    border-radius: var(--radius);
    padding: 14px;
    color: var(--err);
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-orange { background: var(--warn); }
.btn-orange:hover { background: #e68900; }
.btn-red { background: var(--err-border); }
.btn-red:hover { background: #c62828; }
.btn-green { background: #4caf50; }
.btn-green:hover { background: #388e3c; }
.btn-grey { background: var(--muted-light); }

/* ------------------------------------------------------------
   FORM BITS
------------------------------------------------------------ */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: flex-end;
}
.form-row label {
    font-size: 0.78rem;
    display: block;
    color: var(--muted);
    font-weight: 600;
    margin-bottom: 3px;
}
.form-row input,
.form-row select {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 5px;
    font-size: 0.9rem;
    background: white;
}
.form-row input:focus,
.form-row select:focus { outline: none; border-color: var(--brand); }

/* ------------------------------------------------------------
   TOAST
------------------------------------------------------------ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: white;
    padding: 12px 18px;
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(0,0,0,0.16);
    min-width: 240px;
    max-width: 380px;
    font-size: 0.92rem;
    animation: toast-in 0.2s ease-out;
    border-left: 4px solid var(--brand);
}
.toast.toast-success { border-left-color: var(--success); }
.toast.toast-error { border-left-color: var(--err-border); }
@keyframes toast-in {
    from { transform: translateX(20px); opacity: 0; }
    to   { transform: translateX(0); opacity: 1; }
}

/* ------------------------------------------------------------
   MODAL
------------------------------------------------------------ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    max-height: 90vh;
    overflow: auto;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 700;
    font-size: 1.05rem;
}
.modal-close {
    background: transparent;
    border: none;
    font-size: 1.2rem;
    color: var(--muted);
    cursor: pointer;
}
.modal-body { padding: 18px 20px; }

/* ------------------------------------------------------------
   MOBILE
------------------------------------------------------------ */
@media (max-width: 640px) {
    .app-header { padding: 10px 14px; }
    .app-header-brand { font-size: 0.95rem; }
    .app-header-sub { font-size: 0.7rem; }
    .app-header-user { display: none; }
    .app-main { padding: 14px; }
    .data-table { font-size: 0.85rem; }
    .data-table th, .data-table td { padding: 8px 8px; }
    .tab-btn { padding: 10px 12px; font-size: 0.88rem; }
}
