/* ============================================================
   PortfolioOS – Design System
   Farben zentral als CSS-Variablen – einfach anpassbar
   ============================================================ */

:root {
    --bg:           #f4f6f9;
    --surface:      #ffffff;
    --accent:       #2563eb;
    --accent-hover: #1d4ed8;
    --text:         #1e293b;
    --text-muted:   #64748b;
    --positive:     #16a34a;
    --negative:     #dc2626;
    --border:       #e2e8f0;
    --shadow:       0 1px 3px rgba(0,0,0,0.08);

    /* Diagrammfarben */
    --chart-1: #2563eb;
    --chart-2: #0ea5e9;
    --chart-3: #8b5cf6;
    --chart-4: #f59e0b;
    --chart-5: #10b981;
    --chart-6: #f43f5e;
    --chart-7: #64748b;

    --radius: 12px;
    --radius-sm: 8px;
}

/* ============================================================
   Reset & Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

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

/* ============================================================
   Auth-Seite (Login / Register)
   ============================================================ */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 32px;
}
.auth-logo .logo-icon { font-size: 32px; }
.auth-logo .logo-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.auth-tabs {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    width: 100%;
    max-width: 400px;
}
.auth-tabs button {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: all 0.2s;
}
.auth-tabs button.active {
    background: var(--accent);
    color: #fff;
}

form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

/* ============================================================
   Formular-Elemente
   ============================================================ */
.form-group {
    margin-bottom: 18px;
}
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    background: var(--surface);
    transition: border-color 0.2s;
    outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* ============================================================
   Buttons
   ============================================================ */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 4px;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
    padding: 8px 16px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-secondary:hover { background: var(--accent); color: #fff; }

/* ============================================================
   Alerts
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 400px;
}
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }

/* ============================================================
   Karten (für Dashboard)
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 8px;
}
.card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.5px;
}
.card-value.positive { color: var(--positive); }
.card-value.negative { color: var(--negative); }

/* ============================================================
   Tabellen
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
}
thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}
tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f8fafc; }

/* ============================================================
   Utility
   ============================================================ */
.text-positive { color: var(--positive); font-weight: 600; }
.text-negative { color: var(--negative); font-weight: 600; }
.text-muted    { color: var(--text-muted); }
.text-right    { text-align: right; }

/* ============================================================
   Navigation
   ============================================================ */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}
.navbar-brand .logo-icon { font-size: 22px; }
.navbar-brand .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}
.navbar-user {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ============================================================
   Hauptinhalt
   ============================================================ */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ============================================================
   Karten-Grid
   ============================================================ */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* ============================================================
   Leer-Zustand
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 80px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.empty-icon  { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-text  { color: var(--text-muted); font-size: 14px; }

/* ============================================================
   Modal
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 24px;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}
.modal h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
}
