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

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #fff7ed 0%, #ffffff 45%, #eff6ff 100%);
    color: #1f2937;
    min-height: 100vh;
}

/* Navbar */
.navbar {
    background: #111827;
    color: #fff;
    padding: 0 2rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 12px rgba(17, 24, 39, 0.18);
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #f97316, #2563eb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: #a0aec0;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #fff;
}

/* Admin-Dropdown */
.nav-dropdown {
    position: relative;
    display: inline-block;
}
.nav-dropdown-toggle {
    cursor: pointer;
    user-select: none;
}
.nav-dropdown-toggle::after {
    content: " \25BE";
    font-size: 0.75em;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #1a1a2e;
    border: 1px solid #2d3748;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    z-index: 100;
    flex-direction: column;
    padding: 6px 0;
}
/* Unsichtbare Bruecke schliesst den Spalt zwischen Toggle und Menue,
   damit der Cursor beim Wechsel vom Toggle nach unten ins Menue
   den Hover-Zustand nicht verliert. */
.nav-dropdown-menu::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 0;
    right: 0;
    height: 10px;
}
/* Den Toggle-Klick-Bereich nach unten erweitern, ohne die Optik zu aendern. */
.nav-dropdown-toggle {
    padding: 8px 0;
}
.nav-dropdown-menu a {
    display: block;
    padding: 8px 16px;
    white-space: nowrap;
}
.nav-dropdown-menu a:hover {
    background: #2d3748;
    color: #fff;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
    display: flex;
}

.nav-user {
    color: #63b3ed;
    font-size: 0.9rem;
}

/* Info-Link mit Fragezeichen-Symbol in der Navbar */
.nav-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-info-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

/* Container */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* eTacker-Visual als Login-Rahmen
   ---------------------------------
   Quadrat (mit grossem Radius) + innenliegender gestrichelter Kreis,
   4 klickbare Eck-Buttons (PDFs / E-Mails / Prozesse / Mitarbeiter)
   und in der Mitte das eigentliche Login-Formular. */
.auth-visual {
    position: relative;
    width: 100%;
    max-width: 580px;
    margin: 3rem auto 0;
    padding: 2.25rem;
    min-height: 600px;
    border-radius: 36px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 30px 80px rgba(31, 41, 55, 0.14);
}

.auth-circle {
    position: absolute;
    inset: 110px 90px;
    border: 2px dashed rgba(37, 99, 235, 0.22);
    border-radius: 50%;
    pointer-events: none;
}

.auth-node {
    position: absolute;
    z-index: 2;
    padding: 12px 16px;
    border-radius: 16px;
    background: #fff;
    border: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.9rem;
    font-family: inherit;
    text-decoration: none;
    text-align: center;
    line-height: 1.25;
    box-shadow: 0 16px 40px rgba(31, 41, 55, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.auth-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 48px rgba(31, 41, 55, 0.16);
    filter: brightness(1.02);
}
.auth-node:active {
    transform: translateY(0);
}

.auth-node.node-pdfs       { top: 36px;    left: 28px;    color: #f97316; }
.auth-node.node-emails     { top: 36px;    right: 28px;   color: #dc2626; }
.auth-node.node-prozesse   { bottom: 36px; left: 28px;    color: #2563eb; }
.auth-node.node-mitarbeiter{ bottom: 36px; right: 28px;   color: #f97316; }

.auth-form-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% - 220px);
    max-width: 340px;
    text-align: left;
}
.auth-form-center .auth-form-title {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #111827;
    margin-bottom: 0.25rem;
    text-align: center;
}
.auth-form-center .auth-form-subtitle {
    color: #111827;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    text-align: center;
    margin-bottom: 1.25rem;
}
.auth-form-center .form-group {
    margin-bottom: 0.85rem;
}
.auth-form-center .auth-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    font-size: 0.85rem;
}

@media (max-width: 600px) {
    .auth-visual {
        min-height: auto;
        padding: 1.25rem;
    }
    .auth-circle { display: none; }
    .auth-node {
        position: static;
        display: block;
        margin: 0.4rem 0;
        text-align: center;
    }
    .auth-form-center {
        position: static;
        transform: none;
        width: 100%;
        max-width: none;
        margin: 1rem 0;
    }
}

/* Auth Card */
.auth-card {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
    padding: 2.75rem;
    max-width: 460px;
    margin: 4rem auto 0;
}

.auth-card h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.35rem;
    color: #111827;
}

.subtitle {
    color: #4b5563;
    margin-bottom: 2rem;
    font-size: 0.98rem;
    line-height: 1.55;
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.4rem;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    background: #fff;
}

.form-group input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.totp-input {
    text-align: center;
    font-size: 1.8rem !important;
    letter-spacing: 0.5rem;
    font-weight: 700;
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500 !important;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.85rem 1.6rem;
    border: none;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.1s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(90deg, #f97316, #dc2626);
    color: #fff;
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.22);
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 16px 32px rgba(220, 38, 38, 0.28);
}

.btn-secondary {
    background: #fff;
    color: #2563eb;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

.btn-secondary:hover {
    background: #f8fafc;
    border-color: rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: linear-gradient(90deg, #34d399, #059669);
    color: #fff;
    box-shadow: 0 10px 24px rgba(5, 150, 105, 0.18);
}

.btn-success:hover {
    filter: brightness(1.05);
}

.btn-danger {
    background: linear-gradient(90deg, #fb7185, #e11d48);
    color: #fff;
    box-shadow: 0 10px 24px rgba(225, 29, 72, 0.18);
}

.btn-danger:hover {
    filter: brightness(1.05);
}

.btn-small {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

/* Alerts */
.alert {
    padding: 0.95rem 1.15rem;
    border-radius: 14px;
    margin-bottom: 1rem;
    font-size: 0.92rem;
    font-weight: 500;
}

.alert-error {
    background: #fff5f5;
    color: #b91c1c;
    border: 1px solid rgba(248, 113, 113, 0.5);
}

.alert-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid rgba(52, 211, 153, 0.5);
}

.alert-info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid rgba(96, 165, 250, 0.5);
}

/* Password Display */
.password-display {
    background: #edf2f7;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}

.password-display p {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0.5rem;
}

.generated-password {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    word-break: break-all;
}

/* Info & Warning Boxes */
.info-box {
    background: #ebf8ff;
    border: 1px solid #90cdf4;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #2b6cb0;
}

.warning-box {
    background: #fffaf0;
    border: 1px solid #fbd38d;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #c05621;
}

/* QR Code */
.qr-container {
    text-align: center;
    margin: 1.5rem 0;
}

.qr-code {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.totp-manual {
    margin-top: 0.5rem;
}

.totp-manual code {
    font-family: "Consolas", "Courier New", monospace;
    background: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    word-break: break-all;
}

/* Auth Footer */
.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.auth-footer a {
    color: #2563eb;
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 600;
}

.auth-footer a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

/* Dashboard */
.dashboard {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
    padding: 2.75rem;
}

.dashboard h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    color: #111827;
}

.dashboard > p {
    color: #4b5563;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.dashboard-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.info-item {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #edf2f7;
}

.info-item .label {
    font-weight: 600;
    color: #4a5568;
    min-width: 140px;
}

/* Admin Panel */
.admin-panel {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: 26px;
    box-shadow: 0 18px 45px rgba(31, 41, 55, 0.08);
    padding: 2.25rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #111827;
}

/* User Table */
.user-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.user-table th {
    text-align: left;
    padding: 0.75rem 0.5rem;
    border-bottom: 2px solid #e2e8f0;
    color: #4a5568;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #edf2f7;
}

.user-table tr:hover td {
    background: #f7fafc;
}

.actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
}

.muted {
    color: #a0aec0;
    font-size: 0.85rem;
    font-style: italic;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-card {
        margin-top: 1rem;
        padding: 1.5rem;
    }

    .navbar {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 0.75rem;
        font-size: 0.8rem;
    }

    .user-table {
        font-size: 0.8rem;
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

/* Role-Toggle-Buttons (auf der Rollen-Seite) */
.role-toggle-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 8px 0 24px;
}
.role-toggle-form {
    display: inline-block;
    margin: 0;
}
.role-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1.5px solid #cbd5e0;
    background: #fff;
    font-weight: 700;
    font-family: inherit;
    font-size: 0.92rem;
    color: #1f2937;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.role-toggle-btn:hover:not(:disabled) {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1e3a8a;
}
.role-toggle-btn.assigned {
    border-color: #059669;
    background: #ecfdf5;
    color: #047857;
}
.role-toggle-btn.assigned:hover:not(:disabled) {
    background: #d1fae5;
    border-color: #047857;
}
.role-toggle-btn:disabled,
.role-toggle-btn.disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: #f7fafc;
    color: #718096;
    border-color: #e2e8f0;
}
.role-checkbox-mark {
    display: inline-flex;
    width: 18px;
    height: 18px;
    border: 1.5px solid #cbd5e0;
    border-radius: 4px;
    align-items: center;
    justify-content: center;
    background: #fff;
    color: transparent;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
}
.role-toggle-btn.assigned .role-checkbox-mark {
    border-color: #047857;
    background: #059669;
    color: #fff;
}
.role-toggle-btn.disabled .role-checkbox-mark {
    border-color: #cbd5e0;
}

/* Role Badges */
.role-badge {
    display: inline-block;
    background: linear-gradient(90deg, #f97316, #2563eb);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.25rem 0.7rem;
    border-radius: 999px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-user .role-badge {
    margin-left: 0.3rem;
    background: rgba(99, 179, 237, 0.18);
    color: #93c5fd;
}

/* Status Indicators */
.status-active {
    color: #276749;
    font-weight: 600;
}

.status-inactive {
    color: #c53030;
    font-weight: 600;
}

.status-pending {
    color: #c05621;
    font-weight: 600;
    font-style: italic;
}

/* Select Input */
.form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    outline: none;
}

.form-group select:focus {
    border-color: #4299e1;
}

/* Radio Labels */
.radio-label {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-weight: 500 !important;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
}

/* Section Headings in admin-panel */
.admin-panel h2 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #4a5568;
}

/* Inline Role Form */
.inline-role-form {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
}

/* Role Checkbox List (bei Sub-User anlegen) */
.role-checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.role-checkbox-list .checkbox-label {
    margin: 0 !important;
    padding: 0.4rem;
    border-radius: 6px;
    transition: background 0.15s;
}

.role-checkbox-list .checkbox-label:hover {
    background: #edf2f7;
}

.role-inactive {
    background: #a0aec0 !important;
    opacity: 0.7;
}

/* Role-Badges nebeneinander in Tabelle */
.user-table .role-badge {
    margin-right: 0.3rem;
    margin-bottom: 0.25rem;
    display: inline-block;
}

/* Read-only Inputs */
input[readonly], input:disabled, select:disabled {
    background: #f7fafc;
    color: #718096;
    cursor: not-allowed;
}

/* CM3MailsOnlineLesen – Formularraster fuer die Mail-Funktionen
   (Konto anlegen / bearbeiten / abrufen). Wirkt nur auf .form-grid,
   also ausschliesslich auf den Mail-Seiten. */
.form-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 520px;
    margin: 12px 0 4px;
}
.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.92rem;
    color: #374151;
    font-weight: 600;
}
.form-grid label.checkbox {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}
.form-grid input[type="text"],
.form-grid input[type="number"],
.form-grid input[type="password"],
.form-grid select {
    padding: 9px 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    width: 100%;
}
.form-grid label.checkbox input { width: auto; }
.form-grid button[type="submit"] {
    align-self: flex-start;
    margin-top: 8px;
    background: #f97316;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}
.form-grid button[type="submit"]:hover { background: #ea6a08; }

