/* ================================================================
   SmartRent – Custom Styles  (Modern SaaS Dashboard)
   ================================================================ */

:root {
    --sr-primary:      #2563eb;
    --sr-primary-d:    #1d4ed8;
    --sr-primary-bg:   #eff6ff;
    --sr-sidebar-bg:   #0f172a;
    --sr-sidebar-w:    240px;
    --sr-topbar-h:     52px;
    --sr-radius:       10px;
    --sr-shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --sr-shadow:       0 4px 12px rgba(0,0,0,.08);
    --sr-shadow-lg:    0 10px 30px rgba(0,0,0,.12);
    --sr-text:         #0f172a;
    --sr-text-muted:   #64748b;
    --sr-border:       #e2e8f0;
    --sr-bg:           #f8fafc;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: -apple-system, 'Segoe UI', 'Inter', system-ui, sans-serif;
    background: var(--sr-bg);
    color: var(--sr-text);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

/* ── Authenticated App Layout (Flex) ───────────────────────── */
.sr-app-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Desktop Sidebar ───────────────────────────────────────── */
.sr-sidebar {
    width: var(--sr-sidebar-w);
    min-width: var(--sr-sidebar-w);
    background: var(--sr-sidebar-bg);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
    border-right: 1px solid rgba(255,255,255,.04);
}
.sr-sidebar::-webkit-scrollbar { display: none; }

.sidebar-brand {
    padding: 18px 16px 14px;
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -.3px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 8px;
    flex-shrink: 0;
}
.sidebar-brand .brand-icon {
    width: 30px;
    height: 30px;
    background: var(--sr-primary);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 0 8px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    border-radius: 7px;
    margin-bottom: 1px;
    font-size: .875rem;
    font-weight: 450;
    transition: background .15s, color .12s;
    white-space: nowrap;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.9);
}
.sidebar-nav a.active {
    background: rgba(37,99,235,.35);
    color: #fff;
    font-weight: 550;
}
.sidebar-nav a.active i { color: #93c5fd; }
.sidebar-nav a i {
    width: 16px;
    text-align: center;
    font-size: .8rem;
    color: rgba(255,255,255,.4);
    flex-shrink: 0;
    transition: color .12s;
}
.sidebar-nav a:hover i { color: rgba(255,255,255,.7); }

.sidebar-section {
    padding: 14px 12px 4px;
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,.25);
    font-weight: 600;
}
.sidebar-divider {
    border-top: 1px solid rgba(255,255,255,.06);
    margin: 8px 12px;
}

/* User footer in sidebar */
.sidebar-user {
    padding: 10px 12px;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}
.sidebar-user .user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: var(--sr-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: .8rem;
    flex-shrink: 0;
}
.sidebar-user .user-name {
    color: #fff;
    font-size: .8rem;
    font-weight: 550;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sidebar-user .user-status {
    font-size: .68rem;
}

/* ── Mobile Offcanvas Sidebar ───────────────────────────────── */
.sr-sidebar-mobile {
    background: var(--sr-sidebar-bg);
    border: none;
}
.sr-sidebar-mobile .offcanvas-header {
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: 14px 16px;
}
.sr-sidebar-mobile .offcanvas-title {
    color: #fff;
    font-weight: 700;
}

/* ── Content Wrapper ───────────────────────────────────────── */
.sr-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ── Mobile Topbar ─────────────────────────────────────────── */
.sr-topbar {
    height: var(--sr-topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--sr-border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}
.sr-topbar .topbar-brand {
    font-weight: 700;
    color: var(--sr-text);
    font-size: 1rem;
    letter-spacing: -.3px;
}

/* ── Main Content ──────────────────────────────────────────── */
.sr-main {
    flex: 1;
    padding: 0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.sr-card {
    background: #fff;
    border-radius: var(--sr-radius);
    border: 1px solid var(--sr-border);
    box-shadow: var(--sr-shadow-sm);
}
.sr-card-hover {
    transition: box-shadow .2s, transform .15s, border-color .2s;
}
.sr-card-hover:hover {
    box-shadow: var(--sr-shadow);
    border-color: #c7d7f0;
    transform: translateY(-1px);
}

/* ── Stat Cards ─────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: var(--sr-radius);
    border: 1px solid var(--sr-border);
    box-shadow: var(--sr-shadow-sm);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
}
.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.stat-value {
    font-size: 1.65rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--sr-text);
    letter-spacing: -.5px;
}
.stat-label {
    font-size: .7rem;
    color: var(--sr-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-top: 1px;
}

/* ── Offer Cards ─────────────────────────────────────────────── */
.offer-card {
    background: #fff;
    border-radius: var(--sr-radius);
    border: 1px solid var(--sr-border);
    box-shadow: var(--sr-shadow-sm);
    overflow: hidden;
    height: 100%;
    transition: box-shadow .2s, border-color .2s, transform .15s;
}
.offer-card:hover {
    box-shadow: var(--sr-shadow);
    border-color: #c7d7f0;
    transform: translateY(-2px);
}
.offer-card .portal-badge {
    font-size: .65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: .3px;
}
.offer-card .price {
    font-size: 1rem;
    font-weight: 700;
    color: #16a34a;
    letter-spacing: -.2px;
}

/* ── Profil Tab Wizard ──────────────────────────────────────── */
.profil-tabs {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
    white-space: nowrap;
}
.profil-tabs::-webkit-scrollbar { display: none; }

.profil-tabs .nav-link {
    color: var(--sr-text-muted);
    border-radius: 7px 7px 0 0;
    font-size: .82rem;
    font-weight: 500;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-bottom: none;
    white-space: nowrap;
}
@media (max-width: 1100px) {
    .profil-tabs .nav-link { padding: 8px 11px; font-size: .80rem; }
}
@media (max-width: 900px) {
    .profil-tabs .nav-link { padding: 7px 9px; font-size: .76rem; }
}
@media (max-width: 700px) {
    .profil-tabs .nav-link { padding: 6px 8px; font-size: .72rem; }
}
.profil-tabs .nav-link:hover { color: var(--sr-primary); }
.profil-tabs .nav-link.active {
    color: var(--sr-primary);
    font-weight: 600;
    background: #fff;
    border-color: var(--sr-border);
    border-bottom-color: #fff;
}
.profil-tabs .nav-link i { margin-right: 5px; font-size: .78rem; }

/* Gmail-Warn-Badge im Tab */
.tab-warn-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #f59e0b;
    color: #fff;
    border-radius: 50%;
    font-size: .6rem;
    font-weight: 700;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}

.tab-section {
    background: #fff;
    border-radius: 0 var(--sr-radius) var(--sr-radius) var(--sr-radius);
    border: 1px solid var(--sr-border);
    border-top: none;
    padding: 24px;
}
.tab-section .section-heading {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #94a3b8;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f5f9;
}

/* ── Password field indicator ───────────────────────────────── */
.pw-set-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .72rem;
    color: #16a34a;
    background: #dcfce7;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 600;
}

/* ── Bewerbungen Timeline ────────────────────────────────────── */
.bew-row {
    background: #fff;
    border-radius: var(--sr-radius);
    border: 1px solid var(--sr-border);
    padding: 12px 16px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: box-shadow .15s, border-color .15s;
}
.bew-row:hover {
    box-shadow: var(--sr-shadow);
    border-color: #c7d7f0;
}
.bew-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Dokumente Drag & Drop ──────────────────────────────────── */
.drop-zone {
    border: 2px dashed var(--sr-border);
    border-radius: var(--sr-radius);
    padding: 36px 20px;
    text-align: center;
    background: #f8fafc;
    transition: border-color .2s, background .2s;
    cursor: pointer;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--sr-primary);
    background: var(--sr-primary-bg);
}
.drop-zone .drop-icon {
    font-size: 2rem;
    color: #94a3b8;
    margin-bottom: 10px;
    display: block;
}
.drop-zone.drag-over .drop-icon { color: var(--sr-primary); }

.dok-card {
    background: #fff;
    border-radius: var(--sr-radius);
    border: 1px solid var(--sr-border);
    padding: 14px;
    transition: border-color .15s;
}
.dok-card:hover { border-color: #c7d7f0; }
.dok-type-icon { font-size: 1.4rem; }

/* ── Gmail Status Badge ─────────────────────────────────────── */
.gmail-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .78rem;
    padding: 4px 10px;
    border-radius: 99px;
    font-weight: 600;
}
.gmail-badge.connected { background: #dcfce7; color: #15803d; }
.gmail-badge.disconnected { background: #fee2e2; color: #dc2626; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    background: var(--sr-primary) !important;
    border-color: var(--sr-primary) !important;
    font-weight: 500;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--sr-primary-d) !important;
    border-color: var(--sr-primary-d) !important;
}
.btn { border-radius: 7px !important; font-size: .875rem; }
.btn-sm { font-size: .8rem !important; }

/* ── Form controls ──────────────────────────────────────────── */
.form-control, .form-select {
    border-color: var(--sr-border);
    border-radius: 7px;
    font-size: .875rem;
}
.form-control:focus, .form-select:focus {
    border-color: var(--sr-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.form-label { font-size: .82rem; font-weight: 550; color: #374151; margin-bottom: 5px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.sr-alert { border-radius: var(--sr-radius); font-size: .875rem; border: none; }
.alert-success { background: #f0fdf4; color: #15803d; }
.alert-warning { background: #fefce8; color: #854d0e; border: 1px solid #fde047; }
.alert-danger  { background: #fef2f2; color: #b91c1c; }
.alert-info    { background: #eff6ff; color: #1d4ed8; }

/* ── Page wrapper ───────────────────────────────────────────── */
.page-wrap { padding: 28px 32px; }
@media (max-width: 640px) { .page-wrap { padding: 16px; } }

/* ── Footer ─────────────────────────────────────────────────── */
.sr-footer {
    border-top: 1px solid var(--sr-border);
    background: #fff;
    padding: 14px 20px;
    font-size: .75rem;
    color: var(--sr-text-muted);
}

/* ── Badges ─────────────────────────────────────────────────── */
.badge { font-weight: 600; border-radius: 5px; }

/* ── Unauthenticated pages ──────────────────────────────────── */
.auth-topbar {
    background: #fff;
    border-bottom: 1px solid var(--sr-border);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--sr-shadow-sm);
}
.auth-topbar .brand {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--sr-text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -.3px;
}
.auth-topbar .brand .brand-icon {
    width: 28px;
    height: 28px;
    background: var(--sr-primary);
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .8rem;
    flex-shrink: 0;
}

/* ── E-Mail Tab: Schritt-Layout ─────────────────────────────── */
.email-step {
    padding: 18px 0;
    border-bottom: 1px solid var(--sr-border);
}
.email-step-last {
    border-bottom: none;
    padding-bottom: 4px;
}
.email-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.email-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--sr-primary);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    flex-shrink: 0;
}
