/* --- Master Design System | J&J Kaidra Dashboard  (v5 – Redesign „Command Center") --- */

:root {
    color-scheme: dark;
    --primary: #6366f1;
    --primary-2: #818cf8;
    --primary-glow: rgba(99, 102, 241, 0.14);
    --accent: #6366f1;
    --accent-2: #818cf8;
    --accent-soft: rgba(99, 102, 241, 0.14);

    --bg-dark: #0b0d13;
    --bg-2: #0e1017;
    --sidebar-bg: #0e1017;
    --card-bg: #14161f;
    --card-2: #181b26;
    --raise: #1d212e;
    --input-bg: #0a0c12;
    --surface: #14161f;
    --surface-2: #181b26;

    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-border-strong: rgba(255, 255, 255, 0.12);
    --line: rgba(255, 255, 255, 0.07);
    --line-2: rgba(255, 255, 255, 0.12);

    --text-main: #eef0f7;
    --text-dim: #8b91a6;
    --text-faint: #5b6178;

    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --info: #22d3ee;

    --radius: 16px;
    --radius-sm: 12px;
    --shadow-card: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 22px 46px -30px rgba(0, 0, 0, 0.72);
    --shadow-pop: 0 16px 34px -16px rgba(99, 102, 241, 0.7);
}

* { box-sizing: border-box; }

html, body {
    background-color: #0b0d13 !important;
    color: #eef0f7 !important;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background:
        radial-gradient(900px 460px at 88% -8%, rgba(99, 102, 241, 0.08), transparent 62%),
        #0b0d13 !important;
    background-attachment: fixed;
    color: var(--text-main);
    margin: 0;
    display: flex;
    min-height: 100vh;
    letter-spacing: 0.1px;
    -webkit-font-smoothing: antialiased;
}

.main-content { flex-grow: 1; padding: 2rem 2.5rem 3.5rem; width: 100%; min-width: 0; }

/* Titles */
h1 { font-size: 1.7rem; margin: 0 0 0.4rem 0; font-weight: 800; letter-spacing: -0.4px; }
.subtitle { color: var(--text-dim); margin-bottom: 1.75rem; font-size: 0.92rem; }

/* Cards */
.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.022), transparent 45%), var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 1.75rem;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow-card);
    transition: border-color 0.18s;
}
.card:hover { border-color: var(--glass-border-strong); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 55%), var(--surface);
    border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 1.4rem;
    display: flex; flex-direction: column; align-items: center; box-shadow: var(--shadow-card);
    transition: transform 0.18s, border-color 0.18s;
}
.stat-card:hover { transform: translateY(-3px); border-color: rgba(99, 102, 241, 0.4); }
.stat-card h3 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin: 0; font-weight: 800; }
.stat-card .value { font-size: 2rem; font-weight: 800; margin-top: 0.5rem; color: var(--text-main); letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }

/* Forms */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; font-weight: 600; margin-bottom: 0.55rem; color: #e6ebfb; font-size: 0.9rem; }
input, select, textarea {
    width: 100%; padding: 11px 14px; background: var(--input-bg); border: 1px solid var(--glass-border);
    color: var(--text-main); border-radius: var(--radius-sm); font-size: 0.92rem; font-family: inherit;
    transition: border-color 0.16s, box-shadow 0.16s;
}
input::placeholder, textarea::placeholder { color: var(--text-faint); }

/* Auswahlkaestchen und Optionsfelder duerfen nicht die volle Breite bekommen -
   die Regel oben gilt sonst auch fuer sie und schiebt die Beschriftung ans
   Zeilenende. */
input[type="checkbox"], input[type="radio"] {
    width: auto;
    min-width: 0;
    flex: 0 0 auto;
    margin: 0;
    accent-color: var(--accent, #6366f1);
    cursor: pointer;
}

/* Raster fuer Mehrfachauswahl (Kanaele, Rollen). Lag bisher nur inline in
   general.html und fehlte damit auf allen anderen Seiten. */
.chan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 6px;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px;
    margin-top: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}
.chan-grid label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-dim);
    cursor: pointer;
    margin: 0;
    transition: background 0.14s, color 0.14s;
}
.chan-grid label:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.chan-grid label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chan-grid:empty::after,
.chan-grid .help-text { color: var(--text-faint); font-size: 0.85rem; }
input:hover, select:hover, textarea:hover { border-color: var(--glass-border-strong); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); }
.help-text { font-size: 0.84rem; color: var(--text-dim); margin-top: 8px; line-height: 1.5; }

/* Buttons */
.btn {
    padding: 11px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.92rem; font-family: inherit;
    cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, background 0.15s, filter 0.15s;
    display: flex; align-items: center; gap: 9px; border: 1px solid transparent; line-height: 1;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; box-shadow: var(--shadow-pop); }
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn-secondary { background: var(--surface-2); color: var(--text-main); border-color: var(--glass-border); }
.btn-secondary:hover { border-color: var(--primary); transform: translateY(-1px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-large { padding: 13px 24px; font-size: 0.98rem; }
.btn-small, .btn-sm { padding: 7px 13px; font-size: 0.82rem; border-radius: 9px; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; color: var(--text-faint); border-bottom: 1px solid var(--glass-border); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 800; }
td { padding: 13px 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
tr:last-child td { border-bottom: none; }

/* ============ Redesign-Bausteine (Startseite & Co.) ============ */
.hero { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius);
    background: radial-gradient(600px 200px at 90% -40%, rgba(99,102,241,.16), transparent 70%), var(--card-bg); flex-wrap: wrap; box-shadow: var(--shadow-card); }
.hero .hero-av { width: 66px; height: 66px; border-radius: 18px; display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; color: #0b0d13; flex: 0 0 auto; object-fit: cover; }
.hero .hero-name { font-size: 1.5rem; font-weight: 800; margin-top: 5px; letter-spacing: -.4px; }
.hero .hero-meta { color: var(--text-dim); font-size: .85rem; margin-top: 2px; }
.hero .hero-right { margin-left: auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .66rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.badge.admin { color: #fca5a5; background: rgba(248,113,113,.14); }
.badge.member { color: var(--accent-2); background: var(--accent-soft); }
.srvcard { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card-2); }
.srvcard .si { width: 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg,#1d64ff,#00d4ff); flex: 0 0 auto; object-fit: cover; }
.srvcard .sn { font-weight: 700; font-size: .92rem; } .srvcard .sm { font-size: .72rem; color: var(--text-dim); display: flex; gap: 8px; margin-top: 2px; }
.hero-dot { display: inline-flex; align-items: center; gap: 4px; } .hero-dot .p { width: 7px; height: 7px; border-radius: 50%; }
.hchip { display: flex; flex-direction: column; align-items: center; padding: 8px 16px; border: 1px solid rgba(34,197,94,.28); background: rgba(34,197,94,.09); border-radius: 14px; }
.hchip .v { font-size: 1.4rem; font-weight: 800; color: var(--success); } .hchip .l { font-size: .64rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: .06em; }

.sec { margin-top: 28px; }
.sec-h { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sec-h .sq { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.sec-h h2 { margin: 0; font-size: 1.05rem; font-weight: 800; letter-spacing: -.2px; } .sec-h .act { margin-left: auto; }
.link { color: var(--accent-2); font-size: .82rem; font-weight: 600; cursor: pointer; text-decoration: none; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpi { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.025), transparent 55%), var(--card-bg); }
.kpi .l { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 700; }
.kpi .v { font-size: 1.85rem; font-weight: 800; margin-top: 8px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.kpi .s { font-size: .78rem; color: var(--text-dim); margin-top: 4px; }
.up { color: var(--success); font-weight: 700; } .down { color: var(--danger); font-weight: 700; }

.tile { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-bg); transition: .15s; }
.tile:hover { border-color: var(--line-2); transform: translateY(-2px); }
.tile .th { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.tile .ti { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); }
.tile h3 { margin: 0; font-size: .95rem; font-weight: 700; } .tile .sub { font-size: .76rem; color: var(--text-faint); } .tile .st { margin-left: auto; }
.rows { display: flex; flex-direction: column; gap: 9px; font-size: .85rem; }
.rows .rr { display: flex; justify-content: space-between; color: var(--text-dim); } .rows .rr b { color: var(--text-main); }
.go { margin-top: 14px; display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; font-size: .82rem; font-weight: 600; color: var(--text-main); cursor: pointer; transition: .15s; text-decoration: none; }
.go:hover { border-color: var(--primary); background: var(--accent-soft); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 20px; font-size: .72rem; font-weight: 700; }
.pill .p { width: 7px; height: 7px; border-radius: 50%; }
.pill.good { color: var(--success); background: rgba(34,197,94,.13); } .pill.good .p { background: var(--success); }
.pill.warn { color: var(--warning); background: rgba(245,158,11,.13); } .pill.warn .p { background: var(--warning); }
.pill.off { color: var(--text-faint); background: rgba(255,255,255,.05); } .pill.off .p { background: var(--text-faint); }
.pill.accent { color: var(--accent-2); background: var(--accent-soft); } .pill.accent .p { background: var(--accent-2); }

.block { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card-bg); }
.card-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; } .card-h h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.add { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--text-main); cursor: pointer; text-decoration: none; }
.add:hover { border-color: var(--primary); background: var(--accent-soft); }

.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 26px 12px; }
.empty .ec { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: var(--raise); border: 1px solid var(--line); color: var(--text-dim); margin-bottom: 12px; }
.empty .et { font-weight: 700; font-size: .95rem; } .empty .es { font-size: .82rem; color: var(--text-faint); margin-top: 3px; }

.qa { display: flex; gap: 12px; flex-wrap: wrap; }
.qbtn { display: inline-flex; align-items: center; gap: 9px; padding: 11px 17px; border-radius: 12px; font-size: .88rem; font-weight: 600; cursor: pointer; border: 1px solid var(--line); background: var(--card-bg); color: var(--text-main); transition: .15s; text-decoration: none; }
.qbtn:hover { transform: translateY(-2px); border-color: var(--line-2); }
.qbtn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; color: #fff; box-shadow: var(--shadow-pop); }

.uc { display: flex; align-items: center; gap: 10px; }
.av { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: .72rem; font-weight: 800; color: #0b0d13; object-fit: cover; }

a:focus-visible, button:focus-visible, .btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 1050px) { .kpis { grid-template-columns: repeat(2, 1fr); } }

/* Scrollbar */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }
