:root {
    --bg: #e9edf3;
    --surface: #ffffff;
    --surface-alt: #eef1f6;
    --border: #d3d9e4;
    --text: #1a1d27;
    --text-muted: #6b7180;
    /* Neutraler Standard-Akzent (Login/Admin); im Spieler-Dashboard wird er je nach
       Seite überschrieben — siehe .side-startup / .side-investor unten. */
    /* Gedeckte, professionelle B2B-Palette (entsättigt). */
    --accent: #3d5a80;
    --accent-hover: #30496a;
    --success: #3f7d5f;
    --warning: #b07d3c;
    --danger: #b3463f;
    --stripe: rgba(0,0,0,0.025);
    --radius: 8px;
}

/* Rollenfarben: das ganze Dashboard nimmt den Akzent seiner Seite an.
   Startup = Smaragdgrün, Investor = Violett. Status-Farben (Erfolg/Gefahr)
   bleiben bewusst rot/grün und werden NICHT überschrieben. */
.side-startup  { --accent: #3f7a5e; --accent-hover: #34664e; }
.side-investor { --accent: #6b5b8e; --accent-hover: #5a4c78; }

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'IBM Plex Sans', -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

.container { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.container-wide { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 0.5rem; }
h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text); }
h3 { font-size: 1rem; font-weight: 600; }

/* Header */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header .logo { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.header .logo span { color: var(--accent); }
.header .meta { color: var(--text-muted); font-size: 0.85rem; }

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(20,30,50,0.06), 0 1px 2px rgba(20,30,50,0.04);
}

/* Forms */
input, select, button {
    font-family: inherit;
    font-size: 0.9rem;
}
input[type="number"], input[type="text"], input[type="password"] {
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    width: 100%;
    transition: border-color 0.2s;
}
input:focus { outline: none; border-color: var(--accent); }

button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: #000; }
.btn-success:hover { opacity: 0.9; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { opacity: 0.9; }
.btn-small { padding: 0.3rem 0.6rem; font-size: 0.8rem; }
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* Deal Table */
.deal-table {
    width: 100%;
    border-collapse: collapse;
}
.deal-table th {
    text-align: left;
    padding: 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}
.deal-table td {
    padding: 0.6rem 0.5rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.deal-table tr:last-child td { border-bottom: none; }
.deal-table .input-cell { width: 130px; }
.deal-table .input-cell input { width: 110px; }
.deal-table .points-cell { text-align: right; font-weight: 600; min-width: 70px; }
.deal-table .status-cell { width: 160px; text-align: center; }

/* Total row */
.deal-table .total-row td {
    border-top: 2px solid var(--accent);
    font-weight: 700;
    padding-top: 0.75rem;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-proposed { background: rgba(251,191,36,0.15); color: var(--warning); }
.badge-confirmed { background: rgba(74,222,128,0.15); color: var(--success); }
.badge-rejected { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge-change { background: rgba(91,141,239,0.15); color: var(--accent); }

/* Notification popup */
.notification-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.notification-card {
    background: var(--surface);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 1.5rem;
    max-width: 420px;
    width: 90%;
    animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.notification-card h3 { margin-bottom: 1rem; color: var(--accent); }
.notification-card .deal-info { margin-bottom: 1rem; padding: 0.75rem; background: var(--bg); border-radius: var(--radius); }
.notification-card .actions { display: flex; gap: 0.5rem; justify-content: flex-end; }

/* Confidential briefing modal content */
#briefing-content .briefing-title { color: var(--accent); margin: 0 0 0.75rem; font-size: 1.15rem; }
#briefing-content h4 { margin: 1rem 0 0.4rem; }
#briefing-content p { margin: 0 0 0.7rem; }
#briefing-content ul { margin: 0 0 0.7rem 1.2rem; }
#briefing-content li { margin-bottom: 0.3rem; }
#briefing-content em { color: var(--text-muted); }
#briefing-content .briefing-goal {
    margin: 1rem 0 0.3rem;
    padding: 0.85rem 1rem;
    background: var(--bg);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    font-size: 0.98rem;
}

/* Pitch-Deck: kleiner Trigger neben dem Gegenpartei-Namen */
.deck-link {
    background: none;
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: 6px;
    cursor: pointer;
    padding: 0.05rem 0.4rem;
    margin-left: 0.25rem;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--accent);
    opacity: 0.95;
    vertical-align: baseline;
}
.deck-link:hover { opacity: 1; background: color-mix(in srgb, var(--accent) 10%, transparent); }

/* Pitch-Deck Modal: vertikaler Karten-Stack */
#deck-content .deck-cover {
    padding: 1.4rem 1.25rem;
    margin-bottom: 0.9rem;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
}
#deck-content .deck-cover-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; }
#deck-content .deck-tagline { margin-top: 0.4rem; font-size: 1rem; opacity: 0.92; }
#deck-content .deck-card {
    padding: 1rem 1.1rem;
    margin-bottom: 0.8rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    background: var(--surface-alt);
}
#deck-content .deck-card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
#deck-content .deck-hero {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0.4rem 0 0.6rem;
    line-height: 1.15;
}
#deck-content p { margin: 0 0 0.6rem; line-height: 1.5; }
#deck-content ul { margin: 0 0 0.4rem 1.2rem; }
#deck-content li { margin-bottom: 0.25rem; }
#deck-content em { color: var(--text-muted); }
#deck-content .deck-subhead { font-weight: 600; margin: 0.5rem 0 0.3rem; }
#deck-content .deck-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.3rem 0 0.6rem;
    font-size: 0.9rem;
}
#deck-content .deck-table th,
#deck-content .deck-table td {
    border: 1px solid var(--border);
    padding: 0.35rem 0.5rem;
    text-align: left;
}
#deck-content .deck-table thead th {
    background: var(--surface);
    color: var(--accent);
    font-weight: 600;
}
#deck-content .deck-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.02); }

/* Budget bar */
.budget-bar {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 0.5rem;
}
.budget-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

/* Login */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    width: 380px;
    max-width: 90%;
}
.login-card h1 { text-align: center; margin-bottom: 1.5rem; }
.login-card .field { margin-bottom: 1rem; }
.login-card label { display: block; margin-bottom: 0.3rem; color: var(--text-muted); font-size: 0.85rem; }
.login-card button { width: 100%; margin-top: 0.5rem; }

/* Admin */
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 768px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}
.admin-summary-table th, .admin-summary-table td {
    padding: 0.4rem 0.6rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 0.9rem;
}
.admin-summary-table th { color: var(--text-muted); font-weight: 500; }
/* Zahlenspalten (Invest, Equity %, Event-Mult, Strafe) rechtsbündig */
.admin-summary-table th:nth-child(6), .admin-summary-table td:nth-child(6),
.admin-summary-table th:nth-child(7), .admin-summary-table td:nth-child(7),
.admin-summary-table th:nth-child(8), .admin-summary-table td:nth-child(8),
.admin-summary-table th:nth-child(9), .admin-summary-table td:nth-child(9) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Tabs */
.tabs { display: flex; gap: 0.25rem; margin-bottom: 1rem; }
.tab {
    padding: 0.5rem 1rem;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--surface-alt);
    color: var(--text-muted);
    cursor: pointer;
    border: 1px solid var(--border);
    border-bottom: none;
    font-weight: 500;
}
.tab.active { background: var(--surface); color: var(--accent); }

/* Responsive */
@media (max-width: 640px) {
    .deal-table { font-size: 0.85rem; }
    .deal-table .input-cell input { width: 80px; }
    .container { padding: 1rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
