/* =========================
   RESET & BASIS
   ========================= */

html, body {
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    color: #222;
    background: #f3f3f3;
}

* {
    box-sizing: border-box;
}

/* Nur dezentes Global-Link-Styling */
a {
    color: #1f4e79;
}

a:hover {
    text-decoration: underline;
}

/* =========================
   LAYOUT
   ========================= */

.offiz-page {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.offiz-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.offiz-panel {
    background: #ffffff;
    border: 1px solid #d8d8d8;
    padding: 18px;
    border-radius: 6px;
}

.offiz-panel h1,
.offiz-panel h2,
.offiz-panel h3 {
    margin-top: 0;
    margin-bottom: 14px;
    color: #222;
}

.offiz-title {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: bold;
    color: #222;
}

.offiz-subtitle {
    margin: 0 0 12px 0;
    color: #666;
    font-size: 13px;
}

/* =========================
   FORMULARE
   ========================= */

.offiz-form {
    max-width: 900px;
}

.offiz-form-row {
    display: grid;
    grid-template-columns: 240px minmax(260px, 1fr);
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}

.offiz-label {
    font-weight: bold;
    padding-top: 9px;
    color: #222;
}

.offiz-field-meta {
    display: block;
    margin-top: 4px;
    color: #666;
    font-weight: normal;
    line-height: 1.35;
}

/* WICHTIG: nur Offiz-Inputs stylen */
.offiz-input,
.offiz-form input[type="text"],
.offiz-form input[type="password"],
.offiz-form input[type="datetime"],
.offiz-form input[type="number"],
.offiz-form select,
.offiz-form textarea,
.offiz-login-box input[type="text"],
.offiz-login-box input[type="password"],
.offiz-login-box input[type="datetime"],
.offiz-login-box input[type="number"],
.offiz-login-box select,
.offiz-login-box textarea {
    width: 100%;
    max-width: 100%;
    padding: 9px 10px;
    border: 1px solid #c8c8c8;
    background: #fff;
    color: #222;
    font-size: 14px;
    line-height: 1.35;
    border-radius: 4px;
}

.offiz-form textarea,
.offiz-login-box textarea,
textarea.offiz-input {
    min-height: 120px;
    resize: vertical;
}

.offiz-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* =========================
   BUTTONS
   ========================= */

/* Ebenfalls nur Offiz-Buttons stylen */
.offiz-btn,
.offiz-actions button,
.offiz-actions input[type="submit"],
.offiz-actions input[type="button"],
.offiz-login-box button,
.offiz-login-box input[type="submit"],
.offiz-login-box input[type="button"],
.offiz-nav-toggle {
    padding: 9px 14px;
    border: 1px solid #bcbcbc;
    background: #f6f6f6;
    color: #222;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    border-radius: 4px;
}

.offiz-btn:hover,
.offiz-actions button:hover,
.offiz-actions input[type="submit"]:hover,
.offiz-actions input[type="button"]:hover,
.offiz-login-box button:hover,
.offiz-login-box input[type="submit"]:hover,
.offiz-login-box input[type="button"]:hover,
.offiz-nav-toggle:hover {
    background: #ececec;
}

/* =========================
   STATUS
   ========================= */

.offiz-ok {
    color: #1f6b1f;
    font-weight: bold;
}

.offiz-error {
    color: #a10000;
    font-weight: bold;
}

.offiz-note {
    border: 1px solid #d8d8d8;
    background: #fafafa;
    padding: 10px 12px;
    margin-top: 12px;
    color: #444;
    border-radius: 4px;
}

/* =========================
   KEY VALUE / INFOTABELLEN
   ========================= */

.offiz-kv {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.offiz-kv td {
    border: 1px solid #dcdcdc;
    padding: 8px 10px;
    vertical-align: top;
}

.offiz-kv td:first-child {
    width: 240px;
    background: #f7f7f7;
    font-weight: bold;
}

/* =========================
   DATENTABELLEN
   ========================= */

.offiz-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.offiz-table {
    width: 100%;
    min-width: 900px;
    border-collapse: collapse;
    background: #fff;
}

.offiz-table th,
.offiz-table td {
    border: 1px solid #dcdcdc;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.offiz-table th {
    background: #f0f0f0;
    font-weight: bold;
    white-space: nowrap;
}

.offiz-table tr:nth-child(even) td {
    background: #fafafa;
}

/* =========================
   TOP NAVIGATION
   ========================= */

.offiz-topnav {
    background: #ffffff;
    border-bottom: 1px solid #d8dee8;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.offiz-topnav-inner {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 16px;
    min-height: 56px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.offiz-brand {
    font-weight: bold;
    margin-right: 20px;
}

.offiz-nav {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex: 1;
}

.offiz-nav-item {
    position: relative;
}

.offiz-nav > .offiz-nav-item > a {
    display: block;
    padding: 10px 14px;
    border-radius: 6px;
    color: #2f3b52;
    font-weight: 500;
    text-decoration: none;
}

.offiz-nav > .offiz-nav-item > a:hover {
    background: #eef3f9;
    text-decoration: none;
}

.offiz-nav-item-right {
    margin-left: auto;
}

/* =========================
   SUBMENU
   ========================= */

.offiz-subnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 300px;
    background: #ffffff;
    border: 1px solid #cfd7e3;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    padding: 6px 0;
    z-index: 999;
}

.offiz-nav-item.open .offiz-subnav {
    display: block;
}

.offiz-subnav li {
    list-style: none;
}

.offiz-subnav a {
    display: block;
    padding: 10px 14px;
    font-size: 14px;
    color: #2f3b52;
    text-decoration: none;
}

.offiz-subnav a:hover {
    background: #eef3f9;
    text-decoration: none;
}

.offiz-subnav-group-title {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    color: #7a8699;
    padding: 12px 14px 6px 14px;
    border-top: 1px solid #e6ecf3;
    background: #f8fafc;
    margin-top: 6px;
    pointer-events: none;
}

.offiz-subnav-group-title:first-child {
    border-top: none;
    margin-top: 0;
}

/* =========================
   TOOLTIP
   ========================= */

.has-tooltip {
    position: relative;
}

.offiz-tooltip {
    display: none;
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 10px;
    background: #2f3b52;
    color: #fff;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 13px;
    width: 260px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.offiz-tooltip::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: #2f3b52;
}

.has-tooltip:hover .offiz-tooltip {
    display: block;
}

/* =========================
   LOGIN-SPEZIAL
   ========================= */

.offiz-login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.offiz-login-box {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border: 1px solid #d8dee8;
    padding: 26px 28px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    border-radius: 8px;
}

.offiz-login-box .offiz-title,
.offiz-login-box .offiz-subtitle {
    text-align: center;
}

.offiz-login-box .offiz-form-row {
    display: block;
    margin-bottom: 14px;
}

.offiz-login-box .offiz-label {
    display: block;
    padding-top: 0;
    margin-bottom: 6px;
}

.offiz-login-box .offiz-actions {
    justify-content: center;
}

.offiz-login-box .offiz-note {
    text-align: center;
}

/* =========================
   MOBILE
   ========================= */

.offiz-nav-toggle {
    display: none;
}

@media (max-width: 900px) {
    .offiz-page {
        padding: 12px;
    }

    .offiz-panel {
        padding: 14px;
    }

    .offiz-form-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .offiz-label {
        padding-top: 0;
    }

    .offiz-kv td:first-child {
        width: 180px;
    }
}

@media (max-width: 768px) {
    .offiz-nav {
        display: none;
        flex-direction: column;
        width: 100%;
    }

    .offiz-nav.open {
        display: flex;
    }

    .offiz-nav-toggle {
        display: block;
        margin-left: auto;
    }

    .offiz-subnav {
        position: static;
        width: 100%;
        box-shadow: none;
        border-radius: 6px;
        margin-top: 6px;
    }

    .offiz-tooltip {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .offiz-kv,
    .offiz-kv tbody,
    .offiz-kv tr,
    .offiz-kv td {
        display: block;
        width: 100%;
    }

    .offiz-kv tr {
        margin-bottom: 10px;
    }

    .offiz-kv td:first-child {
        border-bottom: none;
        width: 100%;
    }

    .offiz-kv td:last-child {
        border-top: none;
    }

    .offiz-login-box {
        padding: 18px;
    }
}