/* =============================================================
   mwp-sa.css – MWP Superadmin
   EINZIGE CSS-Datei für den gesamten SA-Bereich
   Keine Abhängigkeit von admin.css
   ============================================================= */

/* ── FONTS ── */
@font-face {
    font-family: 'Poppins';
    src: url('https://andi24.de/assets/webfonts/Poppins-Regular.woff2') format('woff2');
    font-weight: 400; font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('https://andi24.de/assets/webfonts/Poppins-SemiBold.woff2') format('woff2');
    font-weight: 600; font-display: swap;
}
@font-face {
    font-family: 'Poppins';
    src: url('https://andi24.de/assets/webfonts/Poppins-Bold.woff2') format('woff2');
    font-weight: 700; font-display: swap;
}

/* ── VARIABLEN ── */
:root {
    --sa-accent:     #6ab2cf;
    --sa-accent-dk:  #4a9ab8;
    --sa-dark:       #1e293b;
    --sa-darker:     #0f172a;
    --sa-sidebar-w:  240px;
    --sa-bg:         #f1f5f9;
    --ff:            'Poppins', system-ui, sans-serif;
}

/* ── RESET ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--ff);
    font-size: 15px;
    line-height: 1.7;
    color: #4a4a4a;
    background: var(--sa-bg);
}
a { text-decoration: none; color: inherit; transition: all .2s; }
ul { list-style: none; }
img { max-width: 100%; }

/* ── LOGIN ── */
body.adm-login {
    background: var(--sa-darker);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.adm-login-box {
    background: #fff;
    border-radius: 20px;
    padding: 48px 44px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.adm-login-logo {
    font-family: var(--ff);
    font-size: 36px;
    font-weight: 900;
    color: var(--sa-accent);
    letter-spacing: 4px;
    text-align: center;
    margin-bottom: 4px;
}
.adm-login-sub {
    text-align: center;
    font-size: 11px;
    color: #bbb;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 32px;
}
.adm-login-back { text-align: center; margin-top: 20px; font-size: 13px; color: #94a3b8; }
.adm-login-back a { color: #94a3b8; }
.adm-login-back a:hover { color: var(--sa-accent); }
.adm-attempts { font-size: 12px; color: #e07000; text-align: center; margin-bottom: 12px; }

/* ── FORM ELEMENTS ── */
.adm-form-group { display: flex; flex-direction: column; gap: 6px; }
.adm-form-group label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #64748b; }
.adm-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--ff);
    color: #1e293b;
    background: #fff;
    outline: none;
    transition: border-color .2s;
}
.adm-input:focus { border-color: var(--sa-accent); }
.adm-input-wrap { position: relative; }
.adm-input-wrap .adm-input { padding-right: 44px; }
.adm-pw-toggle {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; font-size: 16px; padding: 4px; opacity: .5;
}
.adm-pw-toggle:hover { opacity: 1; }

/* ── BUTTONS ── */
.adm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--ff);
    border: 1.5px solid transparent;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}
.adm-btn-sa {
    background: var(--sa-accent);
    color: var(--sa-darker);
    border-color: var(--sa-accent);
}
.adm-btn-sa:hover { background: var(--sa-accent-dk); border-color: var(--sa-accent-dk); color: #fff; }
.adm-btn-full { width: 100%; justify-content: center; }

.adm-btn-xs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: #475569;
    border: none;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
    font-family: var(--ff);
}
.adm-btn-xs:hover { background: var(--sa-accent); color: #fff; }
.adm-btn-accent { background: var(--sa-accent) !important; color: #fff !important; border-color: var(--sa-accent) !important; }
.adm-btn-accent:hover { background: var(--sa-accent-dk) !important; }

/* ── ALERTS ── */
.adm-alert {
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
}
.adm-alert-error   { background: rgba(220,60,60,.08);  color: #c03030; border: 1px solid rgba(220,60,60,.2); }
.adm-alert-success { background: rgba(60,160,60,.08);  color: #2a7a2a; border: 1px solid rgba(60,160,60,.2); }
.hw-admin-alert { padding: 14px 18px; border-radius: 10px; font-size: 14px; margin-bottom: 20px; }
.hw-admin-alert-error   { background: rgba(220,60,60,.08);  color: #c03030; border: 1px solid rgba(220,60,60,.2); }
.hw-admin-alert-success { background: rgba(60,160,60,.08);  color: #2a7a2a; border: 1px solid rgba(60,160,60,.2); }

/* ── LAYOUT ── */
.hw-admin-wrap { display: flex; min-height: 100vh; }

/* ── SIDEBAR ── */
.hw-admin-sidebar {
    width: var(--sa-sidebar-w);
    background: var(--sa-dark);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}
.hw-admin-sidebar-logo {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.sa-sidebar-brand {
    font-family: var(--ff);
    font-size: 15px;
    color: var(--sa-accent);
    font-weight: 700;
    display: block;
}
.sa-sidebar-sub {
    display: block;
    font-size: 9px;
    color: rgba(255,255,255,.35);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 2px;
}
.hw-admin-nav {
    padding: 16px 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.hw-admin-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 24px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.55);
    transition: all .2s;
    border-left: 3px solid transparent;
}
.hw-admin-nav a:hover { color: #fff; background: rgba(255,255,255,.05); }
.hw-admin-nav a.active {
    color: var(--sa-accent);
    border-left-color: var(--sa-accent);
    background: rgba(106,178,207,.08);
}
.hw-admin-nav a i { font-size: 15px; width: 18px; flex-shrink: 0; }
.hw-admin-nav-logout {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.4) !important;
}
.hw-admin-nav-logout:hover { color: #ef4444 !important; background: rgba(239,68,68,.10) !important; }
.sa-sidebar-badge {
    margin-left: auto;
    background: var(--sa-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.hw-admin-hamburger { display: none; }

/* ── MAIN CONTENT ── */
.hw-admin-main {
    flex: 1;
    margin-left: var(--sa-sidebar-w);
    padding: 32px 36px;
    min-height: 100vh;
    background: var(--sa-bg);
}
.hw-admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
}
.hw-admin-header h1 { font-size: 22px; font-weight: 700; color: #1e293b; margin: 0; }

/* ── STAT CARDS ── */
.hw-admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.hw-admin-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 22px 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 2px solid transparent;
}
.hw-admin-stat-link {
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.hw-admin-stat-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,.10);
    border-color: var(--sa-accent);
}
.hw-admin-stat-card--alert { border-color: #f97316; }
.hw-admin-stat-card--alert .hw-admin-stat-num { color: #f97316; }
.hw-admin-stat-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    background: rgba(106,178,207,.10);
    color: var(--sa-accent);
    margin-bottom: 4px;
}
.hw-admin-stat-num { font-size: 28px; font-weight: 700; color: #1e293b; line-height: 1; }
.hw-admin-stat-label { font-size: 12px; color: #94a3b8; font-weight: 500; }

/* ── CARDS ── */
.hw-admin-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    margin-bottom: 24px;
    overflow: hidden;
}
.hw-admin-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
}
.hw-admin-card-title { font-size: 15px; font-weight: 700; color: #1e293b; margin: 0; }

/* ── TABLE ── */
.adm-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adm-table th {
    text-align: left; padding: 12px 16px;
    font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px;
    color: #94a3b8; background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}
.adm-table td { padding: 14px 16px; border-bottom: 1px solid #f1f5f9; color: #334155; vertical-align: middle; }
.adm-table tbody tr:hover { background: #f8fafc; }
.adm-table tbody tr:last-child td { border-bottom: none; }

/* ── BRANCHE BADGES ── */
.sa-branche-badge {
    display: inline-flex; align-items: center;
    font-size: 10px; font-weight: 700; letter-spacing: .5px;
    text-transform: uppercase; padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.sa-branche-restaurant { background: #fef3c7; color: #92400e; }
.sa-branche-handwerk   { background: #fff7ed; color: #c2410c; }
.sa-branche-arzt       { background: #eff6ff; color: #1d4ed8; }
.sa-branche-kanzlei    { background: #f5f3ff; color: #6d28d9; }
.sa-branche-wellness   { background: #fdf4ff; color: #86198f; }
.sa-branche-zahnarzt   { background: #ecfdf5; color: #065f46; }

/* ── PLAN BADGES ── */
.sa-plan-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    letter-spacing: .5px; text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
}
.sa-plan-starter { background: #f1f5f9; color: #64748b; }
.sa-plan-pro     { background: #dbeafe; color: #1d4ed8; }
.sa-plan-premium { background: #fef9c3; color: #854d0e; }

/* ── STATUS BADGES ── */
.sa-status-badge {
    display: inline-flex; align-items: center;
    font-size: 10px; font-weight: 700; letter-spacing: .5px;
    text-transform: uppercase; padding: 3px 10px; border-radius: 20px; white-space: nowrap;
}
.sa-status-badge--neu          { background: #fff7ed; color: #c2410c; }
.sa-status-badge--bearbeitung  { background: #eff6ff; color: #1d4ed8; }
.sa-status-badge--erledigt     { background: #f0fdf4; color: #15803d; }
.sa-status-badge--abgelehnt    { background: #fef2f2; color: #b91c1c; }

/* ── STATUS DOT ── */
.sa-status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; flex-shrink: 0; }
.sa-status-aktiv   { background: #22c55e; }
.sa-status-inaktiv { background: #ef4444; }

/* ── TENANT ROWS ── */
.sa-tenant-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 100px;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    gap: 12px;
    transition: background .15s;
}
.sa-tenant-row:last-child { border-bottom: none; }
.sa-tenant-row:hover { background: #f8fafc; }
.sa-tenant-header {
    background: #f8fafc; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: .8px; color: #94a3b8;
    border-bottom: 1px solid #e2e8f0; cursor: default;
}
.sa-tenant-header:hover { background: #f8fafc; }
.sa-tenant-name { font-weight: 700; color: #1e293b; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.sa-tenant-slug { font-size: 11px; color: #94a3b8; font-family: monospace; margin-top: 2px; }
.sa-tenant-actions { display: flex; gap: 5px; justify-content: flex-end; }
.sa-tenant-stats-mini { display: flex; gap: 12px; font-size: 12px; color: #94a3b8; align-items: center; }
.sa-tenant-stats-mini span { display: flex; align-items: center; gap: 4px; }
.sa-highlight { color: #f97316 !important; font-weight: 700; }

/* ── NACHRICHTEN ── */
.sa-nachricht-row {
    padding: 20px 24px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .15s;
}
.sa-nachricht-row:last-child { border-bottom: none; }
.sa-nachricht-row:hover { background: #f8fafc; }
.sa-nachricht-neu { background: #fffbf5; }
.sa-nachricht-meta {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 12px; margin-bottom: 8px; flex-wrap: wrap;
}
.sa-nachricht-absender { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #1e293b; }
.sa-nachricht-email { font-size: 12px; color: var(--sa-accent); font-weight: 400; }
.sa-nachricht-info { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.sa-nachricht-datum { font-size: 11px; color: #94a3b8; }
.sa-nachricht-betreff { font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.sa-nachricht-text { font-size: 13px; color: #64748b; line-height: 1.6; margin-bottom: 12px; max-width: 680px; }
.sa-nachricht-actions { display: flex; gap: 8px; align-items: center; }
.sa-neu-dot { width: 8px; height: 8px; border-radius: 50%; background: #f97316; flex-shrink: 0; }

/* ── ANFRAGE DETAILS ── */
.sa-anfrage-details { display: flex; gap: 16px; font-size: 12px; color: #64748b; margin-bottom: 8px; flex-wrap: wrap; }
.sa-anfrage-details span { display: flex; align-items: center; gap: 5px; }

/* ── STATUS SELECT ── */
.sa-status-select {
    font-size: 12px; padding: 5px 10px;
    border: 1px solid #e2e8f0; border-radius: 20px;
    background: #f8fafc; color: #475569; cursor: pointer; font-family: var(--ff); outline: none;
}
.sa-status-select:hover { border-color: var(--sa-accent); }

/* ── FILTER TABS ── */
.sa-filter-tabs { display: flex; gap: 6px; }
.sa-tab-count {
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(249,115,22,.15); color: #f97316;
    font-size: 10px; font-weight: 700; padding: 0 6px;
    border-radius: 20px; margin-left: 4px; min-width: 18px;
}

/* ── COUNT BADGE ── */
.sa-count-badge {
    display: inline-flex; align-items: center; justify-content: center;
    background: #f1f5f9; color: #64748b; font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 20px; margin-left: 8px; vertical-align: middle;
}

/* ── EMPTY STATE ── */
.sa-empty {
    padding: 48px; text-align: center; color: #94a3b8; font-size: 14px;
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.sa-empty i { font-size: 32px; opacity: .3; }

/* ── MODAL ── */
.sa-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(15,23,42,.65);
    z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.sa-modal-overlay[hidden] { display: none; }
.sa-modal { background: #fff; border-radius: 16px; width: 100%; max-width: 560px; box-shadow: 0 24px 64px rgba(0,0,0,.25); overflow: hidden; }
.sa-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid #f1f5f9; }
.sa-modal-title { font-size: 16px; font-weight: 700; color: #1e293b; margin: 0; }
.sa-modal-close { background: none; border: none; cursor: pointer; font-size: 18px; color: #94a3b8; padding: 4px; line-height: 1; }
.sa-modal-close:hover { color: #1e293b; }
.sa-modal-body { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.sa-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 8px; }
.adm-textarea { resize: vertical; min-height: 140px; font-family: var(--ff); line-height: 1.6; }

/* ── TABS (Einstellungen) ── */
.sa-tabs { display: flex; border-bottom: 2px solid #e2e8f0; margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; gap: 0; }
.sa-tabs::-webkit-scrollbar { display: none; }
.sa-tab {
    padding: 10px 20px; font-size: 13px; font-weight: 600; color: #94a3b8;
    cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent;
    margin-bottom: -2px; white-space: nowrap; font-family: var(--ff); transition: color .15s, border-color .15s;
}
.sa-tab:hover { color: #475569; }
.sa-tab.active { color: var(--sa-accent); border-bottom-color: var(--sa-accent); }
.sa-tab-panel { display: none; }
.sa-tab-panel.active { display: block; }

/* ── SA CARDS (Einstellungen) ── */
.sa-card { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 1px solid #e2e8f0; }
.sa-card-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: #94a3b8; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid #f1f5f9; }
.sa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sa-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.sa-grid-full { grid-column: 1 / -1; }
.sa-field { display: flex; flex-direction: column; gap: 5px; }
.sa-field label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #475569; }
.sa-field small { font-size: 11px; color: #94a3b8; }

/* ── USER TABELLE ── */
.sa-user-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 20px; }
.sa-user-table th { text-align: left; padding: 10px 14px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: #94a3b8; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.sa-user-table td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.sa-user-table tbody tr:last-child td { border-bottom: none; }
.sa-user-table tbody tr:hover td { background: #f8fafc; }

/* ── STICKY SAVE BAR ── */
.sa-save-bar {
    position: sticky; bottom: 0;
    background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
    border-top: 1px solid #e2e8f0; padding: 14px 24px;
    display: flex; align-items: center; justify-content: flex-end; gap: 12px;
    margin: 0 -24px -24px; border-radius: 0 0 12px 12px; z-index: 10;
}

/* ── BACK LINK ── */
.adm-back-link { color: #94a3b8; font-size: 13px; }
.adm-back-link:hover { color: var(--sa-accent); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .hw-admin-sidebar { width: 60px; }
    .hw-admin-sidebar-logo, .hw-admin-nav a span, .sa-sidebar-sub, .sa-sidebar-badge { display: none; }
    .hw-admin-nav a { justify-content: center; padding: 14px; border-left: none; }
    .hw-admin-nav a.active { border-left: none; border-bottom: 2px solid var(--sa-accent); }
    .hw-admin-main { margin-left: 60px; padding: 20px 16px; }
    :root { --sa-sidebar-w: 60px; }
    .sa-tenant-row { grid-template-columns: 1fr 1fr; }
    .sa-tenant-row > *:nth-child(3), .sa-tenant-row > *:nth-child(4) { display: none; }
    .sa-grid { grid-template-columns: 1fr; }
    .sa-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    :root { --sa-sidebar-w: 0px; }
    .hw-admin-sidebar {
        width: 100%; height: 56px; position: fixed; top: 0; left: 0; right: 0;
        flex-direction: row; align-items: center; z-index: 200; overflow: visible;
    }
    .hw-admin-sidebar-logo {
        padding: 0 16px; border-bottom: none; flex: 1; display: flex;
        align-items: center; justify-content: space-between;
    }
    .sa-sidebar-sub { display: none; }
    .hw-admin-nav {
        display: none; position: fixed; top: 56px; left: 0; right: 0;
        background: var(--sa-dark); padding: 8px 0 16px; z-index: 199;
        box-shadow: 0 8px 24px rgba(0,0,0,.3);
    }
    .hw-admin-nav.open { display: flex; }
    .hw-admin-nav a { border-left: none; padding: 14px 20px; color: rgba(255,255,255,.75); font-size: 15px; }
    .hw-admin-nav a span { display: inline !important; }
    .hw-admin-nav a.active { border-left: 3px solid var(--sa-accent); border-bottom: none; color: #fff; }
    .hw-admin-main { margin-left: 0; margin-top: 56px; padding: 16px 14px; }
    .hw-admin-header { flex-wrap: wrap; gap: 8px; }
    .hw-admin-header h1 { font-size: 20px; }
    .hw-admin-stats { grid-template-columns: 1fr 1fr; }
    .hw-admin-hamburger {
        display: flex; align-items: center; justify-content: center;
        width: 44px; height: 56px; cursor: pointer; flex-shrink: 0;
        background: none; border: none; color: rgba(255,255,255,.7); font-size: 22px;
    }
    .sa-grid-3 { grid-template-columns: 1fr; }
}