/* css/components.css — Cards, Tabellen, Toolbar, Pagination */

/* ── Cards ───────────────────────────────────────────────── */
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-title {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 600;
}

/* ── Toolbar (Suche + Filter) ────────────────────────────── */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.toolbar input[type="text"] {
    width: 240px;
    padding: 8px 13px;
}

.toolbar select {
    width: auto;
    padding: 8px 13px;
}

/* ── Tabelle ──────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    max-width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th {
    text-align: left;
    padding: 9px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
    border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}

th[data-sort]:hover {
    color: var(--c-accent);
}

th.sort-asc::after {
    content: ' ↑';
    color: var(--c-accent);
}

th.sort-desc::after {
    content: ' ↓';
    color: var(--c-accent);
}

td {
    padding: 11px 12px;
    border-bottom: 1px solid var(--c-border);
    color: var(--c-text);
    white-space: nowrap;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--c-surface2);
}

.loading-row,
.error-row {
    text-align: center;
    color: var(--c-text-muted);
    padding: 2rem !important;
}

.error-row {
    color: var(--c-red);
}

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info {
    font-size: 13px;
    color: var(--c-text-muted);
}

#pagination-btns {
    display: flex;
    align-items: center;
    gap: 8px;
}

#pagination-btns button {
    padding: 6px 14px;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: background var(--transition);
    color: var(--c-text);
}

#pagination-btns button:hover:not(:disabled) {
    background: var(--c-surface2);
}

#pagination-btns button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#pagination-btns span {
    font-size: 13px;
    color: var(--c-text-muted);
}

/* ── Login-spezifisch ─────────────────────────────────────── */
.login-wrap {
    width: 100%;
    max-width: 420px;
}

.login-logo {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.4px;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-logo .dot {
    width: 34px;
    height: 34px;
    background: var(--c-accent);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo .dot svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
}

.login-card {
    background: var(--c-surface);
    border-radius: 18px;
    border: 1px solid var(--c-border);
    padding: 2.5rem;
    box-shadow: var(--shadow);
}

.login-card h1 {
    font-family: var(--font-head);
    font-size: 22px;
    margin-bottom: 6px;
}

.login-card p {
    color: var(--c-text-muted);
    font-size: 14px;
    margin-bottom: 1.75rem;
}

.form-group {
    margin-bottom: 1.1rem;
}

.error-msg {
    color: var(--c-red);
    font-size: 13px;
    margin-top: 10px;
    min-height: 20px;
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bar-track {
    background: var(--c-surface2);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--c-accent);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bar-val {
    text-align: right;
    color: var(--c-text-muted);
    font-size: 12px;
    min-width: 30px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--c-border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.green {
    background: var(--c-green);
}

.activity-dot.blue {
    background: var(--c-accent);
}

.activity-dot.amber {
    background: var(--c-amber);
}

.activity-dot.red {
    background: var(--c-red);
}

.stats-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.stat-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: box-shadow var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.stat-icon svg {
    width: 18px;
    height: 18px;
}

.stat-label {
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--c-text-muted);
    margin-bottom: 6px;
}

.stat-value {
    font-family: var(--font-head);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1;
}

.stat-sub {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-top: 6px;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    backdrop-filter: blur(2px);
}

.modal-overlay.show {
    display: flex;
    animation: fadeIn 0.18s ease;
}

.modal-box {
    background: var(--c-surface);
    border-radius: var(--radius);
    border: 1px solid var(--c-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
    width: 100%;
    max-width: min(700px, 90vw);
    max-height: 80vh;
    overflow-y: auto;
    padding: 2rem;
}

#modal-content pre {
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

#modal-content pre {
    background: #b4b3b396;
    border-radius: var(--radius-sm);

    border: 2px solid var(--c-border);
}

#modal-content pre code.hljs {
    background: transparent !important;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-family: var(--font-head);
    font-size: 17px;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--c-text-muted);
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: color var(--transition), background var(--transition);
}

.modal-close-btn:hover {
    color: var(--c-text);
    background: var(--c-surface2);
}

.modal-close-btn svg {
    width: 18px;
    height: 18px;
}

.modal-error {
    color: var(--c-red);
    font-size: 13px;
    margin-bottom: 10px;
    min-height: 18px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 1.5rem;
}

.btn-secondary {
    padding: 10px 18px;
    background: var(--c-surface2);
    color: var(--c-text);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition);
}

.btn-secondary:hover {
    background: var(--c-border);
}

.news-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
}

.news-card h3 {
    font-family: var(--font-head);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.news-card p {
    font-size: 14px;
    color: var(--c-text-muted);
    line-height: 1.6;
}

.news-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.news-card.open .news-content {
    max-height: 500px;
    /* ausreichend groß, um den Inhalt anzuzeigen */
}

.news-card::after {
    content: 'Mehr …';
    font-size: 12px;
    color: #6d6d6d;
    display: block;
    margin-top: 8px;
}

.news-card.open::after {
    content: 'Weniger ↑';
}

/* ── Notizen ─────────────────────────────────────────────── */

.notizen-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

.notiz-item {
    border-bottom: 1px solid var(--c-border);
    padding: 5px 5px;
}


.notiz-link {
    font-size: 12px;
    color: var(--c-text-muted);
    margin-bottom: 2px;
}

.notiz-link:hover {
    color: var(--c-accent);
    text-decoration: underline;
}




/* ── @media ───────────────────────────────────────── */
@media (max-width: 768px) {
    .stats-grid-4 {
        grid-template-columns: repeat(1, 1fr);
    }

    .stats-grid-2 {
        grid-template-columns: repeat(1, 1fr);
    }

    .notizen-grid {
        grid-template-columns: repeat(1, 1fr);
    }
}