/* ═══════════════════════════════════════════════════════════════
   MODULE: Kommandozentrale (Home, To-Dos, E-Mail)
   ═══════════════════════════════════════════════════════════════ */

/* ── Module Grid (Home) ───────────────────────────────────── */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
}
.module-card {
    background: var(--bg-panel);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: 3px;
    padding: 22px;
    text-decoration: none;
    color: var(--text);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--border-glow);
}
.module-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.5;
    transition: opacity 0.3s;
}
.module-card:hover {
    border-color: var(--cyan);
    box-shadow: 0 0 26px var(--cyan-glow);
    transform: translateY(-3px);
}
.module-card:hover::before { opacity: 1; }

.module-icon {
    font-size: 34px;
    color: var(--cyan);
    text-shadow: 0 0 16px var(--cyan-glow);
}
.module-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-bright);
    text-transform: uppercase;
}
.module-desc {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}
.module-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.module-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    padding: 4px 0;
    border-bottom: 1px dashed rgba(0, 229, 255, 0.1);
}
.module-item-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.module-item-sender {
    color: var(--gold);
    font-family: var(--font-mono);
    font-size: 11px;
    flex-shrink: 0;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.module-empty {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-dim);
    font-style: italic;
}

/* Prio Dots */
.prio-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.prio-high { background: var(--red); box-shadow: 0 0 6px var(--red); }
.prio-medium { background: var(--gold); box-shadow: 0 0 6px var(--gold); }
.prio-low { background: var(--green); box-shadow: 0 0 6px var(--green); }

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── System Status List (Home) ───────────────────────────── */
.sys-status-list {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sys-status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    border-radius: 2px;
    border: 1px solid rgba(0, 255, 157, 0.15);
    background: rgba(0, 255, 157, 0.04);
    font-size: 12px;
}
.sys-status-item .status-dot { width: 7px; height: 7px; }
.sys-status-name {
    font-family: var(--font-display);
    font-size: 10.5px;
    letter-spacing: 1px;
    color: var(--text);
    flex: 1;
}
.sys-status-state {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 1px;
    color: var(--green);
}
.sys-status-item.offline {
    border-color: rgba(255, 51, 85, 0.4);
    background: rgba(255, 51, 85, 0.07);
    box-shadow: 0 0 12px rgba(255, 51, 85, 0.15);
    animation: offlineBlink 2s ease-in-out infinite;
}
.sys-status-item.offline .sys-status-name {
    color: var(--red);
    font-weight: 700;
}
.sys-status-item.offline .sys-status-state {
    color: var(--red);
}
@keyframes offlineBlink {
    0%, 100% { box-shadow: 0 0 12px rgba(255, 51, 85, 0.15); }
    50% { box-shadow: 0 0 20px rgba(255, 51, 85, 0.4); }
}
.sys-status-warn {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--red);
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 51, 85, 0.3);
}

/* ── To-Do Filters ────────────────────────────────────────── */
.todo-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.filter-pill {
    font-family: var(--font-display);
    font-size: 11px;
    letter-spacing: 1.5px;
    padding: 8px 16px;
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 20px;
    color: var(--text-dim);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.25s;
    text-transform: uppercase;
}
.filter-pill:hover {
    border-color: var(--cyan);
    color: var(--cyan);
}
.filter-pill.active {
    background: rgba(0, 229, 255, 0.12);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 14px var(--cyan-glow);
    text-shadow: 0 0 8px var(--cyan-glow);
}
.pill-count {
    background: rgba(0, 229, 255, 0.15);
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 10px;
}

/* ── To-Do List ───────────────────────────────────────────── */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.todo-item {
    background: var(--bg-panel);
    border: 1px solid rgba(0, 229, 255, 0.12);
    border-radius: 3px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.25s;
    position: relative;
}
.todo-item:hover {
    border-color: var(--cyan-dim);
    box-shadow: 0 0 16px var(--cyan-glow);
}
.todo-item.todo-done {
    opacity: 0.55;
    background: rgba(0, 255, 157, 0.03);
    border-color: rgba(0, 255, 157, 0.15);
}
.todo-item.todo-done .todo-title {
    text-decoration: line-through;
    color: var(--text-dim);
}

.todo-check {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid var(--cyan-dim);
    background: transparent;
    color: var(--green);
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s;
}
.todo-check:hover {
    border-color: var(--green);
    box-shadow: 0 0 10px rgba(0, 255, 157, 0.3);
}
.todo-check.checked {
    background: rgba(0, 255, 157, 0.15);
    border-color: var(--green);
}

.todo-content { flex: 1; min-width: 0; }
.todo-title {
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-bright);
    letter-spacing: 0.3px;
}
.todo-notes {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 3px;
}
.todo-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 7px;
    flex-wrap: wrap;
}

.prio-badge {
    font-family: var(--font-mono);
    font-size: 9.5px;
    letter-spacing: 1.5px;
    padding: 2px 10px;
    border-radius: 2px;
    border: 1px solid;
}
.prio-badge.prio-high { color: var(--red); border-color: rgba(255,51,85,0.4); background: rgba(255,51,85,0.08); }
.prio-badge.prio-medium { color: var(--gold); border-color: rgba(255,171,0,0.4); background: rgba(255,171,0,0.08); }
.prio-badge.prio-low { color: var(--green); border-color: rgba(0,255,157,0.4); background: rgba(0,255,157,0.08); }

.todo-cat {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.todo-due {
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--cyan);
}
.todo-due.overdue {
    color: var(--red);
    text-shadow: 0 0 8px rgba(255,51,85,0.4);
}
.todo-delete {
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.todo-item:hover .todo-delete { opacity: 1; }

/* ── E-Mail List ──────────────────────────────────────────── */
.email-list {
    display: flex;
    flex-direction: column;
}
.email-item {
    display: grid;
    grid-template-columns: 180px 1fr 120px;
    gap: 14px;
    align-items: center;
    padding: 13px 20px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.07);
    transition: background 0.2s;
}
.email-item:hover { background: var(--bg-hover); }
.email-sender {
    font-family: var(--font-display);
    font-size: 12px;
    color: var(--gold);
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.email-subject {
    font-size: 14px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.email-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    text-align: right;
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE: Bottom Navigation (Handy-optimiert)
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    body { padding-bottom: 64px; }

    /* Sidebar wird zur Bottom-Nav */
    .layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: fixed;
        bottom: 0;
        left: 0;
        top: auto;
        z-index: 9995;
        flex-direction: row;
        align-items: stretch;
        padding: 0;
        background: rgba(4, 8, 14, 0.97);
        border-right: none;
        border-top: 1px solid rgba(0, 229, 255, 0.3);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(10px);
    }
    .sidebar-header { display: none; }
    .sidebar-links { display: none; }
    .sidebar-footer { display: none; }

    .sidebar-nav {
        flex-direction: row;
        padding: 6px 4px;
        gap: 2px;
        width: 100%;
        justify-content: space-around;
    }
    .nav-item {
        flex-direction: column;
        gap: 3px;
        padding: 8px 6px;
        font-size: 8.5px;
        letter-spacing: 0.5px;
        border-left: none;
        border-bottom: 2px solid transparent;
        border-radius: 0;
        text-align: center;
        flex: 1;
    }
    .nav-item .icon { font-size: 17px; }
    .nav-item:hover {
        border-left: none;
        border-bottom-color: var(--cyan);
    }
    .nav-item.active {
        background: linear-gradient(180deg, transparent, rgba(0, 229, 255, 0.1));
        border-left: none;
        border-bottom-color: var(--cyan);
    }
    .nav-item.active::before { display: none; }

    .main-content {
        padding: 18px 14px 20px;
    }
    .hud-clock {
        position: static;
        margin-bottom: 12px;
        text-align: right;
    }

    /* Karten & Grids stapeln */
    .charts-row, .dual-panel { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-value { font-size: 20px; }
    .module-grid { grid-template-columns: 1fr; gap: 12px; }

    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    .page-header h1 { font-size: 17px; letter-spacing: 2px; }

    /* Tabellen horizontal scrollbar */
    .card-body { overflow-x: auto; }
    .table { min-width: 600px; }
    .card-body.no-pad { overflow: visible; }

    /* E-Mail Liste mobil */
    .email-item {
        grid-template-columns: 1fr;
        gap: 3px;
        padding: 12px 16px;
    }
    .email-date { text-align: left; }

    /* Buttons */
    .btn { padding: 9px 14px; font-size: 10.5px; }
    .quick-actions { flex-direction: column; }
    .quick-actions .btn { width: 100%; text-align: center; }

    /* HUD Ecken ausblenden auf Handy (zu viel) */
    .hud-corner { width: 22px; height: 22px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .todo-item { flex-wrap: wrap; }
    .todo-delete { margin-left: auto; }
}

/* ── Reiter-Verwaltung (tabs.html) ───────────────────────── */
.tab-order {
    display: flex;
    gap: 4px;
}
.tab-order .btn {
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1;
}
.tab-title {
    font-family: var(--font-display);
    font-size: 12.5px;
    letter-spacing: 1px;
    color: var(--text-bright);
}
.tab-url {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.07);
    padding: 2px 8px;
    border-radius: 2px;
    border: 1px solid rgba(0, 229, 255, 0.15);
}
.tab-actions {
    display: flex;
    gap: 6px;
}

/* ── Admin FAB (mobil: Reiter-Verwaltung) ────────────────── */
.admin-fab {
    display: none;
    position: fixed;
    bottom: 78px;
    right: 14px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(8, 18, 30, 0.95);
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-size: 18px;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 0 18px var(--cyan-glow), var(--border-glow);
    z-index: 9994;
    transition: all 0.25s;
}
.admin-fab:hover {
    background: var(--cyan);
    color: var(--bg-deep);
    box-shadow: 0 0 26px var(--cyan-glow);
}

@media (max-width: 768px) {
    .admin-fab { display: flex; }
}

/* ── Projekt-Pipeline (arbeit.html) ─────────────────────────── */
.pipeline-wrap {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 18px;
    align-items: start;
}
@media (max-width: 1100px) {
    .pipeline-wrap {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 620px) {
    .pipeline-wrap {
        grid-template-columns: repeat(4, minmax(240px, 1fr));
        overflow-x: auto;
        padding-bottom: 10px;
    }
}
.pipeline-col {
    background: rgba(8, 18, 30, 0.72);
    border: 1px solid rgba(0, 229, 255, 0.12);
    border-radius: 6px;
    min-width: 0;
    overflow: hidden;
}
.pipeline-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: rgba(0, 229, 255, 0.06);
    border-bottom: 1px solid rgba(0, 229, 255, 0.15);
}
.pipe-icon { color: var(--cyan); font-size: 12px; }
.pipe-label {
    font-family: var(--font-display, inherit);
    font-size: 12px;
    letter-spacing: 1.5px;
    color: var(--text-bright);
    flex: 1;
}
.pipe-count {
    background: var(--cyan);
    color: var(--bg-deep);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
}
.pipeline-col[data-status="verkauft"] .pipeline-head {
    background: rgba(0, 255, 157, 0.07);
    border-bottom-color: rgba(0, 255, 157, 0.2);
}
.pipeline-col[data-status="verkauft"] .pipe-icon,
.pipeline-col[data-status="verkauft"] .pipe-label { color: var(--green, #00ff9d); }
.pipeline-col[data-status="verkauft"] .pipe-count { background: var(--green, #00ff9d); }
.pipeline-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 60px;
}
.pipe-empty {
    font-size: 12px;
    text-align: center;
    padding: 14px 0;
    letter-spacing: 1px;
}
.project-card {
    background: rgba(13, 28, 44, 0.9);
    border: 1px solid rgba(0, 229, 255, 0.14);
    border-radius: 5px;
    padding: 10px 12px;
    box-shadow: 0 0 14px rgba(0, 229, 255, 0.05);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.project-card:hover {
    border-color: rgba(0, 229, 255, 0.4);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.12);
}
.pc-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}
.pc-type {
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--cyan);
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.18);
    padding: 1px 7px;
    border-radius: 2px;
}
.pc-price {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: #ffd166;
}
.pc-customer {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: 0.3px;
}
.pc-title {
    font-size: 12.5px;
    color: var(--text-dim, #9fb6c9);
    margin-top: 1px;
}
.pc-notes {
    font-size: 11.5px;
    color: var(--text-dim, #7e95a8);
    margin-top: 6px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 10.5px;
    color: var(--text-dim, #7e95a8);
}
.pc-due.overdue { color: #ff5c7a; }
.pc-actions {
    display: flex;
    gap: 5px;
    margin-top: 10px;
    border-top: 1px solid rgba(0, 229, 255, 0.08);
    padding-top: 8px;
}
.pc-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: rgba(0, 229, 255, 0.07);
    border: 1px solid rgba(0, 229, 255, 0.2);
    color: var(--cyan);
    border-radius: 3px;
    padding: 3px 0;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.pc-btn:hover { background: var(--cyan); color: var(--bg-deep); }
.pc-btn-next { background: rgba(0, 255, 157, 0.08); border-color: rgba(0, 255, 157, 0.25); color: var(--green, #00ff9d); }
.pc-btn-next:hover { background: var(--green, #00ff9d); color: var(--bg-deep); }
.pc-btn-kva { background: rgba(255, 209, 102, 0.1); border-color: rgba(255, 209, 102, 0.35); color: #ffd166; }
.pc-btn-kva:hover { background: #ffd166; color: var(--bg-deep); }
.pc-btn-inv { background: rgba(0, 255, 157, 0.1); border-color: rgba(0, 255, 157, 0.35); color: #00ff9d; }
.pc-btn-inv:hover { background: #00ff9d; color: var(--bg-deep); }
.pc-btn-del { background: rgba(255, 92, 122, 0.08); border-color: rgba(255, 92, 122, 0.25); color: #ff5c7a; }
.pc-btn-del:hover { background: #ff5c7a; color: var(--bg-deep); }
.stat-value.cyan { color: var(--cyan); }

/* ── Muster-Generierung (arbeit.html) ───────────────────────── */
.pc-website {
    margin-top: 8px;
    font-size: 11px;
}
.pc-website a {
    color: var(--cyan);
    text-decoration: none;
    word-break: break-all;
    opacity: .85;
}
.pc-website a:hover { opacity: 1; text-decoration: underline; }
.pc-btn-gen { background: rgba(255, 209, 102, 0.08); border-color: rgba(255, 209, 102, 0.3); color: #ffd166; }
.pc-btn-gen:hover { background: #ffd166; color: var(--bg-deep); }
.pc-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.pc-customer { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pc-customer-link { color: var(--cyan); text-decoration: none; font-weight: 600; }
.pc-customer-link:hover { text-decoration: underline; }
.pc-todo-badge {
    font-size: 10.5px; padding: 2px 8px; border-radius: 8px; text-decoration: none;
    background: rgba(255, 92, 122, .12); border: 1px solid rgba(255, 92, 122, .3); color: #ff5c7a;
}
.header-search { display: flex; gap: 6px; align-items: center; }
.header-search .search-input {
    width: 180px; background: var(--surface, rgba(13,20,33,.9)); border: 1px solid rgba(0,229,255,.2);
    color: #e8f6ff; border-radius: 6px; padding: 8px 12px; font-size: 13px; font-family: inherit;
}
.header-search .search-input:focus { outline: none; border-color: var(--cyan); }
@media (max-width: 860px) { .header-search .search-input { width: 110px; } }
.pc-badge {
    font-size: 10.5px; letter-spacing: .4px; padding: 2px 9px; border-radius: 10px;
    background: rgba(0, 229, 255, 0.08); border: 1px solid rgba(0, 229, 255, 0.25);
    color: var(--cyan);
}
.upload-status { font-size: 12px; margin-top: 5px; color: var(--cyan); opacity: .9; }
.pc-gen-status { margin-top: 8px; font-size: 11px; line-height: 1.5; }
.gen-loading { color: #ffd166; }
.gen-ok { color: var(--green, #00ff9d); }
.gen-err { color: #ff5c7a; }
.gen-open {
    display: inline-block; margin-top: 6px;
    background: rgba(0, 229, 255, 0.1); border: 1px solid rgba(0, 229, 255, 0.35);
    color: var(--cyan); border-radius: 3px; padding: 4px 10px;
    font-size: 11px; font-weight: 600; text-decoration: none;
}
.gen-open:hover { background: var(--cyan); color: var(--bg-deep); }
