/* =============================================================================
 * assets/css/style.css
 * NetDoc – Internes Cisco-Dokumentationssystem
 *
 * Aesthetik: "Network Operations Console" – ruhiges, technisches Control-Panel.
 * Dunkle Sidebar, heller Arbeitsbereich, Cyan/Teal-Akzent, dezente
 * Monospace-Akzente passend zum CLI-Kontext. Responsive.
 * ========================================================================== */

/* ---------- Design Tokens ---------- */
:root {
    --c-bg:          #eef1f5;
    --c-surface:     #ffffff;
    --c-surface-2:   #f7f9fb;
    --c-border:      #dde3ea;
    --c-text:        #1c2430;
    --c-text-soft:   #5b677a;
    --c-text-muted:  #93a0b2;

    --c-sidebar:     #0e1822;
    --c-sidebar-2:   #16232f;
    --c-sidebar-txt: #aebcca;

    --c-accent:      #0bb6b5;   /* Teal/Cyan */
    --c-accent-d:    #079a99;
    --c-accent-soft: #e2f7f6;

    --c-danger:      #e2483d;
    --c-danger-d:    #c13a30;
    --c-success:     #1f9d62;
    --c-info:        #2f80d8;
    --c-warning:     #d98a16;

    --radius:        12px;
    --radius-sm:     8px;
    --shadow-sm:     0 1px 2px rgba(16,30,45,.06), 0 1px 3px rgba(16,30,45,.05);
    --shadow:        0 4px 16px rgba(16,30,45,.08);
    --shadow-lg:     0 12px 32px rgba(16,30,45,.14);

    --font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;

    --sidebar-w: 248px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font-sans);
    color: var(--c-text);
    background: var(--c-bg);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--c-accent-d); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }

/* =============================================================================
 * LOGIN / AUTH
 * ========================================================================== */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 600px at 15% 0%, #16313a 0%, transparent 60%),
        radial-gradient(800px 500px at 100% 100%, #0c2733 0%, transparent 55%),
        #0a141c;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--c-surface);
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255,255,255,.06);
}
.auth-card__brand { text-align: center; margin-bottom: 28px; }
.auth-card__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px; height: 56px;
    font-size: 30px;
    color: #fff;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-d));
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(11,182,181,.4);
}
.auth-card__title {
    margin: 16px 0 4px;
    font-size: 26px;
    letter-spacing: -.4px;
}
.auth-card__subtitle { color: var(--c-text-muted); font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.auth-card__hint {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--c-text-muted);
}

/* =============================================================================
 * LAYOUT (Sidebar + Main)
 * ========================================================================== */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--c-sidebar) 0%, var(--c-sidebar-2) 100%);
    color: var(--c-sidebar-txt);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}
.sidebar__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 22px 22px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar__logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    font-size: 20px;
    color: #fff;
    background: linear-gradient(135deg, var(--c-accent), var(--c-accent-d));
    border-radius: 10px;
}
.sidebar__brand-text {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #fff;
}
.sidebar__nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar__footer { padding: 12px; border-top: 1px solid rgba(255,255,255,.07); }

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--c-sidebar-txt);
    font-size: 14.5px;
    font-weight: 500;
    transition: background .15s, color .15s;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.is-active {
    background: rgba(11,182,181,.16);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--c-accent);
}
.nav-link__icon { width: 20px; text-align: center; font-size: 16px; }
.nav-link--logout:hover { background: rgba(226,72,61,.16); color: #ffd9d5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Topbar ---------- */
.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    position: sticky; top: 0; z-index: 20;
}
.topbar__toggle {
    display: none;
    background: none; border: none;
    font-size: 22px; cursor: pointer; color: var(--c-text);
}
.topbar__title { font-size: 19px; font-weight: 600; flex: 1; letter-spacing: -.2px; }
.topbar__user { display: flex; align-items: center; gap: 10px; }
.topbar__avatar {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--c-accent-soft);
    color: var(--c-accent-d);
    font-weight: 700; font-size: 14px;
}
.topbar__username { font-size: 14px; font-weight: 500; color: var(--c-text-soft); }

.content { padding: 28px; flex: 1; max-width: 1200px; width: 100%; }

/* =============================================================================
 * ALERTS / FLASH
 * ========================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert--success { background: #e8f7ef; color: #14693f; border-color: #bfe6d0; }
.alert--error   { background: #fdeceb; color: #a32a22; border-color: #f4c7c3; }
.alert--info    { background: #e9f1fc; color: #1f5aa8; border-color: #c6dcf6; }

/* =============================================================================
 * TOOLBAR (Suche + Filter)
 * ========================================================================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.toolbar__filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.result-info { color: var(--c-text-muted); font-size: 13.5px; margin: 0 0 18px; }

/* ---------- Inputs ---------- */
.input, .field__input {
    font-family: inherit;
    font-size: 14px;
    padding: 10px 13px;
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background: var(--c-surface);
    color: var(--c-text);
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .field__input:focus {
    outline: none;
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px var(--c-accent-soft);
}
.input--search { min-width: 260px; }
.input--select { background: var(--c-surface); cursor: pointer; }

/* =============================================================================
 * BUTTONS
 * ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .15s, border-color .15s, transform .05s, box-shadow .15s;
    white-space: nowrap;
    text-decoration: none;
    line-height: 1.1;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--c-accent); color: #fff; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--c-accent-d); }
.btn--secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn--secondary:hover { background: var(--c-surface-2); border-color: #c7d0db; }
.btn--ghost { background: transparent; color: var(--c-text-soft); }
.btn--ghost:hover { background: var(--c-surface-2); color: var(--c-text); }
.btn--danger { background: var(--c-danger); color: #fff; }
.btn--danger:hover { background: var(--c-danger-d); }
.btn--small { padding: 6px 11px; font-size: 12.5px; }
.btn--block { width: 100%; padding: 12px; }

.inline-form { display: inline; margin: 0; }

/* =============================================================================
 * CARD GRID (Dashboard)
 * ========================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 18px;
}
.card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .18s, transform .18s, border-color .18s;
    display: flex;
    flex-direction: column;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #cfd7e1; }
.card__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.card__date { font-size: 12px; color: var(--c-text-muted); }
.card__title { font-size: 16.5px; font-weight: 650; margin-bottom: 8px; letter-spacing: -.2px; }
.card__title a { color: var(--c-text); }
.card__title a:hover { color: var(--c-accent-d); }
.card__preview { color: var(--c-text-soft); font-size: 13.5px; margin: 0 0 16px; flex: 1; }
.card__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Badge ---------- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: .3px;
    text-transform: uppercase;
    color: var(--c-accent-d);
    background: var(--c-accent-soft);
    border-radius: 999px;
}

/* =============================================================================
 * EMPTY STATE
 * ========================================================================== */
.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: var(--c-surface);
    border: 1px dashed var(--c-border);
    border-radius: var(--radius);
}
.empty-state__icon { font-size: 44px; margin-bottom: 8px; }
.empty-state h2 { font-size: 19px; margin-bottom: 6px; }
.empty-state p { color: var(--c-text-muted); margin: 0 0 18px; }

/* =============================================================================
 * FORMS (Create / Edit)
 * ========================================================================== */
.form-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    max-width: 820px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 13.5px; font-weight: 600; color: var(--c-text); }
.field__help { font-size: 12.5px; color: var(--c-text-muted); }
.field__textarea {
    resize: vertical;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    tab-size: 4;
}
.form-card__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--c-border);
    padding-top: 18px;
}

/* =============================================================================
 * ARTICLE VIEW
 * ========================================================================== */
.article {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 28px 30px;
    box-shadow: var(--shadow-sm);
    max-width: 900px;
}
.article__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--c-border);
    margin-bottom: 22px;
}
.article__title { font-size: 25px; margin: 12px 0 6px; letter-spacing: -.4px; }
.article__date { font-size: 13px; color: var(--c-text-muted); }
.article__actions { display: flex; gap: 8px; flex-shrink: 0; }
.article__body { font-size: 15px; }
.article__footer { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--c-border); }

.prose { margin: 0 0 12px; color: var(--c-text); word-wrap: break-word; }
.prose:empty { display: none; }

/* ---------- Codeblock (Cisco Commands) ---------- */
.codeblock {
    position: relative;
    margin: 14px 0;
    background: #0e1822;
    border: 1px solid #1d2c3a;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.codeblock pre {
    margin: 0;
    padding: 16px 18px;
    overflow-x: auto;
}
.codeblock code {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.65;
    color: #d7e3ee;
    white-space: pre;
}
.codeblock__copy {
    position: absolute;
    top: 8px; right: 8px;
    font-family: var(--font-sans);
    font-size: 11.5px;
    font-weight: 600;
    color: #9fb0c0;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: background .15s, color .15s;
}
.codeblock__copy:hover { background: var(--c-accent); color: #fff; border-color: var(--c-accent); }
.codeblock__copy.is-copied { background: var(--c-success); color: #fff; border-color: var(--c-success); }

/* =============================================================================
 * RESPONSIVE
 * ========================================================================== */
@media (max-width: 860px) {
    .sidebar {
        position: fixed;
        z-index: 50;
        transform: translateX(-100%);
        transition: transform .25s ease;
        box-shadow: var(--shadow-lg);
    }
    .sidebar.is-open { transform: translateX(0); }
    .topbar__toggle { display: inline-block; }
    .content { padding: 18px; }
    .article, .form-card { padding: 20px; }
    .article__head { flex-direction: column; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar__filters { width: 100%; }
    .input--search { min-width: 0; flex: 1; }
}

/* Verdeckungs-Overlay, wenn die Sidebar mobil offen ist */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8,16,24,.5);
    z-index: 40;
}
.sidebar-backdrop.is-visible { display: block; }
/* =============================================================================
 *  CSS-ERGÄNZUNG
 *  Ans Ende deiner assets/css/style.css anhängen.
 * ========================================================================== */

/* ---------- Datentabelle (Standorte) ---------- */
.data-table-wrap {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    overflow: auto;
    box-shadow: var(--shadow-sm);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th,
.data-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--c-border);
    vertical-align: top;
}
.data-table thead th {
    background: var(--c-surface-2);
    font-weight: 600;
    color: var(--c-text-soft);
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: .4px;
    position: sticky;
    top: 0;
    z-index: 1;
}
.data-table tbody tr:hover { background: var(--c-surface-2); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table .cell-strong { font-weight: 600; color: var(--c-text); }
.data-table .cell-comment { color: var(--c-text-soft); }
.data-table__actions { white-space: nowrap; width: 1%; }
.data-table__actions .inline-form { margin-left: 4px; }

/* ---------- Treffer-Highlight ---------- */
mark {
    background: #fff5b1;
    color: inherit;
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

/* ---------- Formular: 2-Spalten-Raster ---------- */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
@media (max-width: 640px) {
    .form-grid-2 { grid-template-columns: 1fr; }
}

/* ---------- Dokumenten-Karten ---------- */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}
.doc-card {
    display: flex;
    gap: 14px;
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    transition: box-shadow .18s, transform .18s, border-color .18s;
}
.doc-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #cfd7e1; }
.doc-card__icon {
    flex-shrink: 0;
    width: 48px; height: 48px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #ffefe3, #ffe0cc);
    color: #b34a00;
    border-radius: 10px;
    font-size: 24px;
}
.doc-card__body { flex: 1; min-width: 0; }
.doc-card__title {
    font-size: 15.5px;
    font-weight: 650;
    margin: 2px 0 6px;
    letter-spacing: -.2px;
    color: var(--c-text);
    word-break: break-word;
}
.doc-card__desc {
    margin: 0 0 8px;
    color: var(--c-text-soft);
    font-size: 13.5px;
}
.doc-card__meta {
    font-size: 12px;
    color: var(--c-text-muted);
    margin: 0 0 12px;
    word-break: break-word;
}
.doc-card__actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Admin-Badge in Topbar ---------- */
.topbar__badge {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: #fff;
    background: var(--c-accent);
    border-radius: 999px;
    vertical-align: middle;
}

/* ---------- Meta-Infos (Autor / letzter Bearbeiter) ---------- */
.card__meta {
    margin: 0 0 14px;
    padding-top: 10px;
    border-top: 1px solid var(--c-border);
    font-size: 12px;
    color: var(--c-text-muted);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.card__meta-label {
    color: var(--c-text-muted);
    margin-right: 4px;
}
.card__meta-item { color: var(--c-text-soft); }

.article__meta {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    color: var(--c-text-soft);
}
.article__meta-label {
    color: var(--c-text-muted);
    margin-right: 6px;
}
.article__meta strong { color: var(--c-text); font-weight: 600; }
