/* ============================================
   Analytics Rocket — Kunden-Portal CSS
   Dark Theme, Cyan Accent
   ============================================ */

:root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0b1120;
    --border: rgba(148,163,184,.12);
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --accent: #00d4ff;
    --accent-hover: #00b8e6;
    --accent-glow: rgba(0,212,255,.15);
    --success: #34d399;
    --warning: #f59e0b;
    --danger: #f87171;
    --radius: 14px;
    --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    -webkit-font-smoothing: antialiased;
}

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

/* ---- Sidebar ---- */
.portal-sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform .3s ease;
}

.sidebar-logo {
    padding: 1.75rem 1.5rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid var(--border);
}
.sidebar-logo .logo-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, #00d4ff, #0ea5e9);
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; color: #000; font-weight: 800;
}
.sidebar-logo .logo-text {
    font-size: 1.05rem; font-weight: 800; color: var(--text);
}
.sidebar-logo .logo-sub {
    font-size: .7rem; color: var(--text-muted); margin-top: 1px;
}

.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }

.sidebar-section {
    font-size: .65rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .08em;
    padding: .75rem 1.5rem .4rem;
}

.sidebar-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .7rem 1.5rem;
    color: var(--text-muted);
    font-size: .88rem; font-weight: 500;
    transition: all .2s;
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    color: var(--text); background: rgba(148,163,184,.06);
}
.sidebar-link.active {
    color: var(--accent); background: var(--accent-glow);
    border-left-color: var(--accent);
}
.sidebar-link i { width: 20px; text-align: center; font-size: .9rem; }

.sidebar-user {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: .75rem;
}
.sidebar-user .user-avatar {
    width: 36px; height: 36px; border-radius: 10px;
    background: linear-gradient(135deg, #00d4ff, #0ea5e9);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700; color: #000;
}
.sidebar-user .user-name { font-size: .85rem; font-weight: 600; }
.sidebar-user .user-role { font-size: .7rem; color: var(--text-muted); }

/* ---- Main Content ---- */
.portal-main {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    padding: 2rem 2.5rem;
}

.page-header {
    margin-bottom: 2rem;
}
.page-header h1 {
    font-size: 1.6rem; font-weight: 800;
    background: linear-gradient(90deg, var(--text), var(--accent));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
.page-header p {
    color: var(--text-muted); font-size: .88rem; margin-top: .3rem;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex; align-items: flex-start; gap: 1rem;
}
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; flex-shrink: 0;
}
.stat-icon.cyan   { background: rgba(0,212,255,.12); color: var(--accent); }
.stat-icon.green  { background: rgba(52,211,153,.12); color: var(--success); }
.stat-icon.orange { background: rgba(245,158,11,.12); color: var(--warning); }
.stat-icon.purple { background: rgba(167,139,250,.12); color: #a78bfa; }

.stat-value {
    font-size: 1.8rem; font-weight: 800; line-height: 1;
}
.stat-label {
    font-size: .8rem; color: var(--text-muted); margin-top: .25rem;
}
.stat-sub {
    font-size: .75rem; color: var(--text-muted); margin-top: .15rem;
}

/* ---- Tables ---- */
.table-wrap {
    overflow-x: auto;
}
table {
    width: 100%; border-collapse: collapse;
}
th {
    text-align: left; padding: .75rem 1rem;
    font-size: .75rem; font-weight: 700; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: .04em;
    border-bottom: 1px solid var(--border);
}
td {
    padding: .85rem 1rem;
    font-size: .88rem;
    border-bottom: 1px solid var(--border);
}
tr:hover td { background: rgba(148,163,184,.03); }

/* ---- Badges ---- */
.badge {
    display: inline-block; padding: .25rem .7rem;
    border-radius: 20px; font-size: .75rem; font-weight: 600;
}
.badge-offen   { background: rgba(245,158,11,.12); color: var(--warning); }
.badge-bezahlt { background: rgba(52,211,153,.12); color: var(--success); }
.badge-storniert { background: rgba(248,113,113,.12); color: var(--danger); }
.badge-aktiv   { background: rgba(0,212,255,.12); color: var(--accent); }
.badge-abgeschlossen { background: rgba(52,211,153,.12); color: var(--success); }
.badge-pausiert { background: rgba(148,163,184,.12); color: var(--text-muted); }

/* ---- Progress Bar (Projekt-Stages) ---- */
.progress-stages {
    display: flex; gap: .5rem; margin: 1.25rem 0;
}
.progress-stage {
    flex: 1; text-align: center;
}
.progress-stage .stage-bar {
    height: 6px; border-radius: 3px;
    background: rgba(148,163,184,.15);
    margin-bottom: .5rem;
    position: relative; overflow: hidden;
}
.progress-stage .stage-bar .fill {
    position: absolute; top: 0; left: 0; bottom: 0;
    width: 100%;
    background: linear-gradient(90deg, #00d4ff, #0ea5e9);
    border-radius: 3px;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .4s ease;
}
.progress-stage.done .stage-bar .fill { transform: scaleX(1); }
.progress-stage.current .stage-bar .fill { transform: scaleX(.5); background: var(--warning); }
.progress-stage .stage-label {
    font-size: .72rem; color: var(--text-muted); font-weight: 500;
}
.progress-stage.done .stage-label { color: var(--accent); }
.progress-stage.current .stage-label { color: var(--warning); font-weight: 700; }

/* ---- Activity / Timeline ---- */
.activity-list { list-style: none; }
.activity-item {
    display: flex; gap: 1rem; padding: .85rem 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--accent); margin-top: .35rem; flex-shrink: 0;
}
.activity-text { font-size: .88rem; line-height: 1.5; }
.activity-date { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }

/* ---- Forms ---- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
    display: block; font-size: .82rem; font-weight: 600;
    color: var(--text-muted); margin-bottom: .4rem;
}
.form-input, .form-textarea, .form-select {
    width: 100%; padding: .75rem 1rem;
    background: rgba(15,23,42,.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text); font-size: .88rem;
    transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-textarea { resize: vertical; min-height: 120px; font-family: inherit; }

.btn {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .7rem 1.5rem;
    border: none; border-radius: var(--radius-sm);
    font-size: .88rem; font-weight: 600;
    cursor: pointer; transition: all .2s;
}
.btn-primary {
    background: linear-gradient(90deg, #00d4ff, #0ea5e9);
    color: #000;
}
.btn-primary:hover { opacity: .88; }
.btn-success {
    background: linear-gradient(90deg, #34d399, #10b981);
    color: #000;
}
.btn-whatsapp {
    background: #25d366; color: #fff;
}
.btn-whatsapp:hover { opacity: .88; }

/* ---- Contact Card ---- */
.contact-card {
    display: flex; align-items: center; gap: 1.25rem;
    padding: 1.5rem;
}
.contact-avatar {
    width: 60px; height: 60px; border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff, #0ea5e9);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: #000; font-weight: 700;
}
.contact-info h3 { font-size: 1.05rem; font-weight: 700; }
.contact-info p { font-size: .85rem; color: var(--text-muted); }
.contact-actions {
    display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap;
}

/* ---- Login Page ---- */
.login-page {
    display: flex; align-items: center; justify-content: center;
    min-height: 100vh; padding: 1rem;
}
.login-card {
    width: 100%; max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2.5rem 2rem;
}
.login-logo {
    text-align: center; margin-bottom: 2rem;
}
.login-logo .logo-icon {
    width: 56px; height: 56px; border-radius: 16px;
    background: linear-gradient(135deg, #00d4ff, #0ea5e9);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #000; margin-bottom: .75rem;
}
.login-logo h1 { font-size: 1.3rem; font-weight: 800; }
.login-logo p { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

.login-error {
    background: rgba(248,113,113,.1);
    border: 1px solid rgba(248,113,113,.3);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    color: #fca5a5; font-size: .85rem;
    margin-bottom: 1.25rem;
    display: flex; align-items: center; gap: .5rem;
}
.login-success {
    background: rgba(52,211,153,.1);
    border: 1px solid rgba(52,211,153,.3);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    color: #6ee7b7; font-size: .85rem;
    margin-bottom: 1.25rem;
    display: flex; align-items: center; gap: .5rem;
}

/* ---- Mobile ---- */
.mobile-toggle {
    display: none;
    position: fixed; top: 1rem; left: 1rem; z-index: 200;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: .6rem .75rem;
    color: var(--text); font-size: 1.1rem; cursor: pointer;
}

@media (max-width: 768px) {
    .mobile-toggle { display: block; }
    .portal-sidebar {
        transform: translateX(-100%);
    }
    .portal-sidebar.open {
        transform: translateX(0);
    }
    .portal-main {
        margin-left: 0;
        padding: 1.25rem;
        padding-top: 4rem;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .contact-card { flex-direction: column; text-align: center; }
}

/* ---- Misc ---- */
.empty-state {
    text-align: center; padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state i { font-size: 2.5rem; margin-bottom: 1rem; opacity: .4; }
.empty-state p { font-size: .9rem; }

.section-title {
    font-size: 1.05rem; font-weight: 700; margin-bottom: 1rem;
}

.back-link {
    display: inline-flex; align-items: center; gap: .4rem;
    font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem;
}
.back-link:hover { color: var(--accent); }
