/* MietTool.de - Hauptstylesheet */

:root {
    --sidebar-width: 260px;
    --sidebar-collapsed: 0px;
    --sidebar-bg: #1a1d21;
    --sidebar-hover: #2c3034;
    --sidebar-active: #0d6efd;
    --topbar-height: 60px;
    --body-bg: #f0f2f5;
    --card-shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--body-bg);
    margin: 0;
    min-height: 100vh;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    color: #fff;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    text-decoration: none;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
}

.sidebar-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.sidebar-brand-sub {
    font-size: 0.7rem;
    color: rgba(255,255,255,.5);
    display: block;
}

.sidebar-nav {
    list-style: none;
    padding: 0.75rem 0;
    margin: 0;
    flex: 1;
}

.sidebar-heading {
    padding: 0.75rem 1.5rem 0.4rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,.35);
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.5rem;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.sidebar-nav a:hover {
    color: #fff;
    background: var(--sidebar-hover);
}

.sidebar-nav a.active {
    color: #fff;
    background: rgba(13, 110, 253, 0.15);
    border-left-color: var(--sidebar-active);
}

.sidebar-nav a i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: rgba(255,255,255,.7);
    font-size: 0.8rem;
}

.sidebar-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--sidebar-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

.sidebar-user-name {
    font-weight: 600;
    color: #fff;
    display: block;
}

.sidebar-user-role {
    font-size: 0.7rem;
    color: rgba(255,255,255,.4);
    text-transform: capitalize;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== TOPBAR ===== */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid #e3e6ea;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    color: #1a1d21;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #555;
    cursor: pointer;
    padding: 0.25rem;
}

/* ===== PAGE CONTENT ===== */
.page-content {
    padding: 1.5rem;
    flex: 1;
}

/* ===== CARDS ===== */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    font-weight: 600;
    border-radius: 10px 10px 0 0 !important;
}

/* ===== STAT CARDS ===== */
.stat-card {
    border: none;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.12);
}

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1;
    margin: 0;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

/* ===== TABLES ===== */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead th {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6c757d;
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

.table-modern tbody td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.875rem;
}

.table-modern tbody tr:hover {
    background: #f8f9fa;
}

/* ===== BADGES ===== */
.badge-status {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35em 0.7em;
    border-radius: 6px;
}

/* ===== FORMS ===== */
.form-floating > .form-control:focus,
.form-floating > .form-select:focus {
    border-color: var(--sidebar-active);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* ===== AUTH PAGES ===== */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1c2833 0%, #2c3e50 50%, #27ae60 100%);
    padding: 2rem;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    padding: 2.5rem;
}

.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo img {
    height: 48px;
    margin-bottom: 0.75rem;
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1a1d21;
    margin: 0;
}

.auth-logo p {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0.25rem 0 0;
}

/* ===== FOOTER ===== */
.main-footer {
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: #6c757d;
    border-top: 1px solid #e3e6ea;
    background: #fff;
}

.main-footer a {
    color: #6c757d;
    text-decoration: none;
}

.main-footer a:hover {
    color: var(--sidebar-active);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,.5);
        z-index: 1035;
        display: none;
    }

    .sidebar-backdrop.show {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .btn-sidebar-toggle {
        display: block;
    }
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h5 {
    font-weight: 700;
    color: #495057;
}

/* ===== OBJEKTTYP BADGES ===== */
.objekttyp-wg { background: #d4edda; color: #155724; }
.objekttyp-wohnung { background: #cce5ff; color: #004085; }
.objekttyp-haus { background: #fff3cd; color: #856404; }
.objekttyp-garage { background: #e2e3e5; color: #383d41; }
.objekttyp-gewerbe { background: #f8d7da; color: #721c24; }

/* ===== SEARCH BOX ===== */
.search-box {
    position: relative;
    max-width: 320px;
}

.search-box .form-control {
    padding-left: 2.5rem;
    border-radius: 8px;
}

.search-box i {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}
