/* console/public/assets/console.css
   Design system 1:1 abgeleitet von netconnections.de (Farben, Schrift, Header-
   Struktur, Link-/Button-Stile — aus der echten, ausgelieferten CSS der Seite
   extrahiert, nicht nachempfunden). */

@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600;700&display=swap');

:root {
    --nc-blue: #207CB5;
    --nc-blue-dark: #014862;
    --nc-bg-page: #C0C0C0;
    --nc-bg-content: #FFFFFF;
    --nc-bg-header: #F0F0F0;
    --nc-text: #000000;
    --nc-text-secondary: #444444;
    --nc-text-muted: #888888;
    --nc-border: #DDDDDD;
    --nc-danger: #C20B21;
    --nc-danger-bg: #FBE9EB;
    --nc-header-height: 44px;
}

* { box-sizing: border-box; }

html {
    font-size: 13px; /* 19px im Original (netconnections.de) — auf Nutzerwunsch ~30% kleiner */
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Open Sans', Arial, Helvetica, sans-serif;
    font-size: 1rem;
    line-height: 150%;
    color: var(--nc-text);
    background: var(--nc-bg-page);
}

h1, .h1 {
    font-size: 2.1rem;
    line-height: 110%;
    font-weight: 700;
    color: var(--nc-text);
    margin: 0;
    padding: 0 0 1.2rem 0;
}

h2, .h2 {
    font-size: 1.6rem;
    line-height: 120%;
    font-weight: 700;
    color: var(--nc-text);
    margin: 0;
    padding: 1.6rem 0 1rem 0;
}

a {
    color: var(--nc-blue);
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
    color: rgba(0, 0, 0, 0.8);
}

/* ---- Layout shell ---- */

.nc-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nc-header-height);
    background: var(--nc-bg-header);
    box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.3);
}

.nc-header-inner {
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nc-logo img {
    display: block;
    height: 22px;
    width: auto;
}

.nc-nav {
    display: flex;
    align-items: center;
    gap: 1.75rem;
}

.nc-nav a {
    color: var(--nc-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

.nc-nav a:hover {
    color: var(--nc-blue);
}

.nc-nav a.nc-logout {
    color: var(--nc-text-muted);
    font-weight: 400;
}

.nc-nav-toggle {
    display: none;
    background: none;
    border: none;
    padding: 0.4rem;
    margin: 0;
    cursor: pointer;
    color: var(--nc-text);
}

.nc-nav-toggle svg {
    display: block;
    width: 24px;
    height: 24px;
}

.nc-page {
    max-width: 1200px;
    margin: calc(var(--nc-header-height) + 2rem) auto 3rem auto;
    padding: 0 1.5rem;
}

.nc-content {
    background: var(--nc-bg-content);
    border-radius: 4px;
    box-shadow: 0 2px 16px -2px rgba(0, 0, 0, 0.2);
    padding: 1rem 2.5rem 2.5rem 2.5rem;
}

/* ---- Forms ---- */

.nc-field { margin: 0 0 1.1rem 0; }

.nc-field label {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--nc-text-secondary);
    margin-bottom: 0.35rem;
}

input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--nc-border);
    border-radius: 3px;
    background: #fff;
    color: var(--nc-text);
}

textarea { resize: vertical; }

input[type="text"]:focus, input[type="password"]:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--nc-blue);
    box-shadow: 0 0 0 3px rgba(32, 124, 181, 0.15);
}

/* ---- Buttons ---- */

.nc-btn, button[type="submit"] {
    display: inline-block;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 0.65rem 1.5rem;
    background: var(--nc-blue);
    color: #fff;
    transition: background 0.15s ease;
}

.nc-btn:hover, button[type="submit"]:hover {
    background: var(--nc-blue-dark);
    color: #fff;
    text-decoration: none;
}

button[type="submit"]:disabled {
    cursor: default;
    opacity: 0.75;
    background: var(--nc-blue-dark);
}

button[type="submit"] .nc-btn-spinner {
    display: none;
}

button[type="submit"].is-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

button[type="submit"].is-loading .nc-btn-spinner {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: nc-spin 0.7s linear infinite;
}

@keyframes nc-spin {
    to { transform: rotate(360deg); }
}

.nc-btn-outline {
    display: inline-block;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid var(--nc-border);
    border-radius: 4px;
    padding: 0.6rem 1.4rem;
    background: #fff;
    color: var(--nc-text-secondary);
}

.nc-btn-outline:hover {
    border-color: var(--nc-blue);
    color: var(--nc-blue);
    text-decoration: none;
}

.nc-btn-green {
    display: inline-block;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    padding: 0.6rem 1.4rem;
    background: #2E8B45;
    color: #fff;
    transition: background 0.15s ease;
}

.nc-btn-green:hover {
    background: #226835;
    color: #fff;
    text-decoration: none;
}

.nc-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 0.5rem;
}

/* ---- Toolbar (search / product switcher rows) ---- */

.nc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0 0 1.5rem 0;
}

.nc-toolbar select { width: auto; }
.nc-toolbar input[type="text"] { width: auto; flex: 1 1 220px; }

/* ---- Table ---- */

table { border-collapse: collapse; width: 100%; }

th {
    text-align: left;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--nc-text-secondary);
    text-transform: none;
    border-bottom: 2px solid var(--nc-border);
    padding: 0.6rem 0.5rem;
}

td {
    border-bottom: 1px solid var(--nc-border);
    padding: 0.7rem 0.5rem;
    vertical-align: top;
}

tr:last-child td { border-bottom: none; }

/* ---- Error banner ---- */

.error {
    color: var(--nc-danger);
    background: var(--nc-danger-bg);
    border-left: 3px solid var(--nc-danger);
    padding: 0.75rem 1rem;
    border-radius: 3px;
    margin: 0 0 1.25rem 0;
}

/* ---- Login card ---- */

.nc-login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--nc-bg-page);
}

.nc-login-card {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 16px -2px rgba(0, 0, 0, 0.2);
    padding: 2.5rem;
}

.nc-login-card .nc-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.nc-login-card .nc-logo img { height: 22px; }

.nc-login-card h1 {
    font-size: 1.4rem;
    text-align: center;
    padding-bottom: 1.5rem;
}

.nc-login-card button[type="submit"] { width: 100%; }

/* ---- Wiki ---- */

.nc-wiki-layout { display: flex; gap: 2rem; align-items: flex-start; }
.nc-wiki-files { flex: 0 0 280px; margin: 0; padding: 0; list-style: none; }
.nc-wiki-files li { border-bottom: 1px solid var(--nc-border); }
.nc-wiki-files a { display: block; padding: 0.5rem 0; text-decoration: none; font-size: 0.9rem; }
.nc-wiki-files a:hover { color: var(--nc-blue); }
.nc-wiki-article { flex: 1; min-width: 0; }

/* ---- Links ---- */

.nc-link-list {
    list-style: none;
    margin: 0 0 2rem 0;
    padding: 0;
}

.nc-link-list li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--nc-border);
}

.nc-link-list a {
    font-weight: 600;
}

.nc-link-hint {
    color: var(--nc-text-muted);
    font-size: 0.8rem;
    white-space: nowrap;
}

/* ---- Chat ---- */

.nc-chat-log { margin: 0 0 1.5rem 0; }

.nc-chat-turn { display: flex; margin-bottom: 1.1rem; }
.nc-chat-turn.role-user { justify-content: flex-end; }
.nc-chat-turn.role-assistant { justify-content: flex-start; }

.nc-chat-bubble {
    max-width: 70%;
    padding: 0.75rem 1.1rem;
    border-radius: 7px;
    font-size: 0.95rem;
}

.nc-chat-turn.role-user .nc-chat-bubble {
    background: var(--nc-bg-header);
    color: var(--nc-text);
}

.nc-chat-turn.role-assistant .nc-chat-bubble {
    background: #fff;
    border: 1px solid var(--nc-border);
}

.nc-chat-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--nc-text-muted);
    margin-bottom: 0.3rem;
}

/* ---- Table (horizontal scroll on narrow screens instead of squeezing) ---- */

.nc-table-wrap { width: 100%; }

/* ---- Responsive ---- */

@media (max-width: 640px) {
    /* 6 nav links + logo don't fit one fixed-height row at phone width.
       Collapse into a hamburger dropdown instead of wrapping -- wrapping
       inside a still-fixed-height header let the second row overlap the
       page content below it. */
    .nc-header-inner { padding: 0 1rem; }

    .nc-nav-toggle { display: block; }

    .nc-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--nc-bg-header);
        box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.15);
        padding: 0.25rem 1rem 0.75rem 1rem;
    }

    .nc-nav.is-open { display: flex; }

    .nc-nav a {
        width: 100%;
        padding: 0.6rem 0;
        border-bottom: 1px solid var(--nc-border);
    }

    .nc-nav a:last-child { border-bottom: none; }

    .nc-content { padding: 1rem 1.25rem 1.5rem 1.25rem; }

    .nc-toolbar { flex-direction: column; align-items: stretch; }
    .nc-toolbar select,
    .nc-toolbar input[type="text"],
    .nc-toolbar button,
    .nc-toolbar a { width: 100%; flex: none; text-align: center; }

    /* Tables scroll horizontally rather than crushing columns unreadable. */
    .nc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { min-width: 480px; }

    .nc-wiki-layout { flex-direction: column; }
    .nc-wiki-files { flex: none; width: 100%; }
    .nc-wiki-article img { max-width: 100%; height: auto; }

    .nc-chat-bubble { max-width: 88%; }

    .nc-actions { flex-wrap: wrap; }
    .nc-actions > * { flex: 1 1 auto; text-align: center; }

    .nc-login-card { padding: 1.75rem 1.5rem; }
}
