/* WM-Tippspiel — Branding angelehnt an iBE Corporate Design.
   Hausfarben: Dunkelblau #00324B, Blaugrau #9AAEB7
   Produktfarben: Blau #5985C2, Orange #E0822D, Grün #9DC042
*/

:root {
    --ibe-dark: #00324B;
    --ibe-gray: #9AAEB7;
    --ibe-blue: #5985C2;
    --ibe-orange: #E0822D;
    --ibe-green: #9DC042;
    --ibe-dark-hover: #004a6e;
    --ibe-light-bg: #f4f7f9;
    --ibe-card-shadow: 0 2px 8px rgba(0, 50, 75, 0.08);
    --ibe-border: #e0e7eb;
    --ibe-red: #d9534f;
}

* { box-sizing: border-box; }

body {
    font-family: 'Roboto', sans-serif;
    font-weight: 300;
    background: var(--ibe-light-bg);
    color: #333;
    margin: 0;
    min-height: 100vh;
}

a { color: var(--ibe-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============ SIDEBAR ============ */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: 240px; height: 100vh;
    background: var(--ibe-dark); color: #fff;
    display: flex; flex-direction: column;
    z-index: 100;
}
.sidebar-logo {
    padding: 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; gap: 12px;
}
.sidebar-logo img { height: 36px; width: auto; }
.sidebar-logo .app-title {
    font-size: 17px; font-weight: 500; line-height: 1.1;
}
.sidebar-logo .app-subtitle {
    font-size: 11px; opacity: 0.7; letter-spacing: 0.5px;
    text-transform: uppercase;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 18px; color: #fff;
    text-decoration: none; font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}
.sidebar-nav a:hover { background: rgba(255,255,255,0.06); }
.sidebar-nav a.active {
    background: rgba(89,133,194,0.18);
    border-left-color: var(--ibe-blue);
    font-weight: 500;
}
.sidebar-nav .nav-section {
    padding: 14px 18px 6px;
    font-size: 10px; letter-spacing: 1px;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
}
.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 14px 18px; font-size: 12px;
    color: rgba(255,255,255,0.6);
}
.sidebar-footer .username { color: #fff; font-weight: 500; }
.sidebar-footer a { color: var(--ibe-blue); }

/* ============ MAIN ============ */
.main-content {
    margin-left: 240px; padding: 28px;
    min-height: 100vh;
}
.topbar {
    display: flex; justify-content: space-between;
    align-items: center; margin-bottom: 22px;
}
.topbar h1 {
    margin: 0; font-size: 24px; font-weight: 500;
    color: var(--ibe-dark);
}
.topbar .topbar-actions { display: flex; gap: 10px; }

/* ============ CARDS ============ */
.card {
    background: #fff; border-radius: 8px;
    box-shadow: var(--ibe-card-shadow);
    padding: 20px; margin-bottom: 18px;
    border: 1px solid var(--ibe-border);
}
.card h2, .card h3 {
    margin: 0 0 14px 0;
    color: var(--ibe-dark); font-weight: 500;
}
.card h2 { font-size: 18px; }
.card h3 { font-size: 15px; }

.grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.stats-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 18px;
}
.stat {
    background: #fff; border-radius: 8px;
    padding: 18px; border: 1px solid var(--ibe-border);
    box-shadow: var(--ibe-card-shadow);
}
.stat .label {
    font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.5px; color: var(--ibe-gray);
    margin-bottom: 6px;
}
.stat .value {
    font-size: 26px; font-weight: 500;
    color: var(--ibe-dark); line-height: 1;
}
.stat .sub {
    font-size: 12px; color: #888; margin-top: 6px;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-block; padding: 8px 16px;
    border: none; border-radius: 4px;
    font-family: 'Roboto', sans-serif; font-weight: 400;
    font-size: 14px; cursor: pointer; text-decoration: none;
    transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ibe-blue); color: #fff; }
.btn-primary:hover { background: #4a72ad; }
.btn-success { background: var(--ibe-green); color: #fff; }
.btn-success:hover { background: #82a836; }
.btn-warning { background: var(--ibe-orange); color: #fff; }
.btn-danger  { background: var(--ibe-red); color: #fff; }
.btn-secondary { background: var(--ibe-gray); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: 12px; }

/* ============ FORMS ============ */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block; margin-bottom: 5px;
    color: var(--ibe-dark); font-size: 13px; font-weight: 500;
}
.form-control, input[type=text], input[type=password], input[type=email],
input[type=number], input[type=datetime-local], select, textarea {
    width: 100%; padding: 9px 12px;
    border: 1px solid var(--ibe-border); border-radius: 4px;
    font-family: 'Roboto', sans-serif; font-size: 14px;
    background: #fff; transition: border-color 0.15s;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--ibe-blue);
}
.form-inline {
    display: inline-flex; gap: 6px; align-items: center;
}

/* ============ TABLES ============ */
table {
    width: 100%; border-collapse: collapse; background: #fff;
}
table th {
    padding: 11px 12px; background: var(--ibe-dark); color: #fff;
    font-size: 12px; font-weight: 500; text-transform: uppercase;
    letter-spacing: 0.5px; text-align: left;
}
table td {
    padding: 10px 12px; border-bottom: 1px solid var(--ibe-border);
    font-size: 14px;
}
table tr:last-child td { border-bottom: none; }
table tr:hover td { background: #fafcfd; }

/* ============ BADGES ============ */
.badge {
    display: inline-block; padding: 2px 8px;
    border-radius: 10px; font-size: 11px;
    font-weight: 500; line-height: 1.5;
}
.badge-blue   { background: var(--ibe-blue);   color: #fff; }
.badge-green  { background: var(--ibe-green);  color: #fff; }
.badge-orange { background: var(--ibe-orange); color: #fff; }
.badge-gray   { background: var(--ibe-gray);   color: #fff; }
.badge-dark   { background: var(--ibe-dark);   color: #fff; }
.badge-red    { background: var(--ibe-red);    color: #fff; }

/* ============ ALERTS ============ */
.alert {
    padding: 11px 16px; border-radius: 4px; margin-bottom: 16px;
    border-left: 4px solid var(--ibe-blue); background: #eff5fb;
    font-size: 14px;
}
.alert-success { border-color: var(--ibe-green); background: #f1f8e6; }
.alert-warning { border-color: var(--ibe-orange); background: #fdf2e5; }
.alert-danger  { border-color: var(--ibe-red); background: #fbecec; }
.alert-info    { border-color: var(--ibe-blue); background: #eff5fb; }

/* ============ MATCH / SPIEL ============ */
.match {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 14px; background: #fff;
    border: 1px solid var(--ibe-border); border-radius: 6px;
    margin-bottom: 8px;
}
.match.beendet { background: #fafcfd; }
.match.live    { border-left: 4px solid var(--ibe-orange); }
.match .team-home, .match .team-away {
    flex: 1; display: flex; align-items: center; gap: 8px;
    min-width: 0; font-weight: 400;
}
.match .team-home { justify-content: flex-end; text-align: right; }
.match .team-away { justify-content: flex-start; }
.match .team-flag { font-size: 22px; line-height: 1; }
.match .team-name { font-size: 14px; font-weight: 400; }
.match .team-kuerzel {
    font-family: 'Roboto Mono', monospace; font-size: 13px;
    background: var(--ibe-light-bg); padding: 1px 6px;
    border-radius: 3px; color: var(--ibe-dark);
}
.match .score {
    font-size: 18px; font-weight: 500; color: var(--ibe-dark);
    padding: 4px 12px; background: var(--ibe-light-bg);
    border-radius: 4px; min-width: 60px; text-align: center;
}
.match .vs { color: var(--ibe-gray); font-size: 14px; }
.match .meta {
    font-size: 11px; color: #888; min-width: 120px;
    text-align: center;
}
.match .meta .kickoff {
    display: block; font-weight: 500; color: var(--ibe-dark);
}
.match .tipp-input {
    display: flex; align-items: center; gap: 4px;
    min-width: 100px; justify-content: center;
}
.match .tipp-input input[type=number] {
    width: 44px; padding: 4px 6px; text-align: center;
    font-size: 14px; font-weight: 500;
}
.match .tipp-input .colon { color: var(--ibe-gray); font-weight: 500; }
.match .punkte-pill {
    display: inline-block; padding: 2px 8px;
    border-radius: 10px; font-size: 11px; font-weight: 500;
}
.match .punkte-pill.p3 { background: var(--ibe-green); color: #fff; }
.match .punkte-pill.p1 { background: var(--ibe-orange); color: #fff; }
.match .punkte-pill.p0 { background: #ddd; color: #555; }

/* ============ PHASE-TABS ============ */
.phase-tabs {
    display: flex; gap: 4px; border-bottom: 1px solid var(--ibe-border);
    margin-bottom: 16px; flex-wrap: wrap;
}
.phase-tabs a {
    padding: 9px 16px; color: var(--ibe-dark);
    border-bottom: 3px solid transparent;
    font-weight: 400; font-size: 14px;
    text-decoration: none; transition: all 0.15s;
}
.phase-tabs a:hover { background: var(--ibe-light-bg); }
.phase-tabs a.active {
    border-bottom-color: var(--ibe-blue);
    color: var(--ibe-blue); font-weight: 500;
}

.phase-info {
    display: flex; gap: 14px; align-items: center;
    padding: 10px 14px; background: #fff;
    border: 1px solid var(--ibe-border); border-radius: 6px;
    margin-bottom: 14px; font-size: 13px;
}
.phase-info .deadline-open { color: var(--ibe-green); font-weight: 500; }
.phase-info .deadline-closed { color: var(--ibe-red); font-weight: 500; }

/* ============ RANG-LISTE ============ */
.rang-1 td { background: linear-gradient(to right, #fff8d6 0%, #fff 100%) !important; font-weight: 500; }
.rang-2 td { background: linear-gradient(to right, #f0f0f0 0%, #fff 100%) !important; }
.rang-3 td { background: linear-gradient(to right, #fce4d4 0%, #fff 100%) !important; }
.rang-cell {
    font-weight: 500; color: var(--ibe-dark);
    text-align: center; width: 50px;
}
.medal { font-size: 16px; }

/* ============ LOGIN / REGISTER ============ */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center;
    justify-content: center; background: linear-gradient(135deg, #00324B 0%, #5985C2 100%);
    padding: 20px;
}
.auth-card {
    background: #fff; padding: 36px 32px;
    border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,0.15);
    width: 100%; max-width: 420px;
}
.auth-card .logo {
    text-align: center; margin-bottom: 22px;
}
.auth-card .logo img { height: 50px; }
.auth-card h1 {
    margin: 0 0 6px 0; font-size: 22px; font-weight: 500;
    color: var(--ibe-dark); text-align: center;
}
.auth-card .subtitle {
    text-align: center; color: var(--ibe-gray);
    font-size: 13px; margin-bottom: 22px;
}
.auth-card .btn { width: 100%; padding: 11px; font-size: 15px; margin-top: 8px; }
.auth-card .footer-link {
    text-align: center; margin-top: 18px;
    font-size: 13px; color: var(--ibe-gray);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 16px; }
    .topbar h1 { font-size: 20px; }
    .stat .value { font-size: 22px; }
    .match { flex-wrap: wrap; }
}

/* ============ Mobile-Toggle ============ */
.menu-toggle {
    display: none; background: var(--ibe-dark); color: #fff;
    border: none; padding: 8px 12px; border-radius: 4px;
    font-size: 18px; cursor: pointer;
}
@media (max-width: 768px) { .menu-toggle { display: inline-block; } }
