/* ControllHub 360 – Layout: Sidebar + Content, keine Überlappung */
* { box-sizing: border-box; }
body { margin: 0; overflow-x: hidden; }

/* ---- Sidebar (links, feste Breite) ---- */
.left-panel {
    width: 260px;
    min-width: 260px;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 1000;
    background: #29363d;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.left-panel .navbar { padding: 0; }
.left-panel .navbar-collapse { padding: 0; }
.main-menu .nav { flex-direction: column; }
.main-menu .nav > li { border-bottom: 1px solid rgba(255,255,255,0.06); }
.main-menu .nav > li > a {
    color: rgba(255,255,255,0.9);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
}
.main-menu .nav > li > a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.main-menu .nav > li.active > a { background: rgba(32,168,216,0.25); color: #fff; }
.menu-icon { margin-right: 12px; width: 22px; text-align: center; opacity: 0.9; flex-shrink: 0; }
.menu-title {
    padding: 10px 20px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.main-menu .nav > li > a .menu-icon { flex-shrink: 0; }

/* ---- Rechter Bereich (Content) – startet neben der Sidebar ---- */
.right-panel {
    margin-left: 260px;
    min-height: 100vh;
    min-width: 0;
    background: #f5f6f8;
    display: flex;
    flex-direction: column;
}
.right-panel .content { flex: 1; }

/* ---- Moderne Navbar: Header + Topnav ---- */
.header {
    position: sticky;
    top: 0;
    z-index: 102;
    background: #fff;
    height: 56px;
    min-height: 56px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    box-shadow: 0 1px 0 rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.header-right {
    display: flex;
    align-items: center;
}
.header .navbar-brand {
    display: flex;
    align-items: center;
    font-weight: 600;
    font-size: 1.0625rem;
    color: var(--text-dark, #1e293b);
    text-decoration: none;
    letter-spacing: -0.01em;
}
.header .navbar-brand:hover { color: var(--primary-blue, #0ea5e9); }
.header .navbar-brand img { max-height: 30px; width: auto; }
.menutoggle {
    padding: 0.5rem 0.6rem;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 1.15rem;
    cursor: pointer;
    line-height: 1;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}
.menutoggle:hover { background: #f1f5f9; color: #334155; }
.header .user-area .dropdown-toggle {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.6rem 0.4rem 0.5rem;
    color: #334155;
    text-decoration: none;
    border-radius: 10px;
    gap: 0.5rem;
    transition: background 0.2s, color 0.2s;
}
.header .user-area .dropdown-toggle:hover { background: #f1f5f9; color: #0f172a; }
.header-user-name { font-size: 0.9rem; font-weight: 500; margin-left: 0.15rem; }
.user-avatar { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; }
.user-area .dropdown-menu {
    position: absolute;
    right: 0;
    left: auto;
    min-width: 220px;
    z-index: 1050;
    margin-top: 0.5rem;
    padding: 0.5rem 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border: 1px solid rgba(0,0,0,0.06);
}
.user-area .dropdown-item { padding: 0.5rem 1rem; font-size: 0.9rem; }
.user-area .dropdown-item:hover { background: #f8fafc; }
.user-area .dropdown-item-text { padding: 0.5rem 1rem; font-size: 0.85rem; color: #64748b; }

/* ---- Topnav: Mandanten | Kanzlei | Mein Dashboard (modern) ---- */
.topnav-bar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0 1.25rem;
    min-height: 44px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.topnav-link {
    display: inline-block;
    padding: 0.5rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #475569;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.topnav-link:hover { color: var(--primary-blue, #0ea5e9); background: rgba(14,165,233,0.06); }
.topnav-link.active {
    color: var(--primary-blue, #0ea5e9);
    font-weight: 600;
    background: rgba(14,165,233,0.08);
    border-bottom-color: var(--primary-blue, #0ea5e9);
}
.topnav-link + .topnav-link { border-left: 1px solid #e2e8f0; }

/* ---- Breadcrumbs (unter dem Header): eine Zeile, kein Überlappen ---- */
.breadcrumbs {
    background: #fff;
    padding: 0.6rem 1rem 0.6rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    max-width: 100%;
    overflow: hidden;
}
.breadcrumbs-inner {
    width: 100%;
    max-width: 100%;
}
.breadcrumbs-inner .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: nowrap;
    margin: 0;
    width: 100%;
    max-width: 100%;
}
.breadcrumbs-inner .col-sm-4,
.breadcrumbs-inner .col-12 {
    flex: 0 1 auto;
    min-width: 0;
    padding-left: 0;
    padding-right: 0.5rem;
    overflow: hidden;
}
.breadcrumbs-inner .col-sm-8 {
    flex: 1 0 auto;
    min-width: 0;
    padding-left: 0.5rem;
    padding-right: 0;
    overflow: hidden;
}
.breadcrumbs .page-header { margin: 0 !important; float: none !important; }
.breadcrumbs .float-left,
.breadcrumbs .float-right { float: none !important; }
.breadcrumbs .page-title { margin: 0; overflow: hidden; }
.right-panel > .breadcrumbs { flex-shrink: 0; clear: both; display: block; }
.breadcrumbs .page-title h1 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0;
    color: #1e293b;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    background: none;
    list-style: none;
    gap: 0.5rem;
}
.breadcrumb li {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
}
.breadcrumb li + li::before {
    content: "\203a";
    padding: 0 0.4rem;
    color: #94a3b8;
    font-weight: 700;
    flex-shrink: 0;
}
.breadcrumb li a {
    padding: 0.35rem 0.6rem;
    color: var(--primary-blue, #0ea5e9);
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
}
.breadcrumb li a:hover {
    text-decoration: underline;
    background: #f0f9ff;
}
.breadcrumb li.active {
    padding: 0.2rem 0;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    background: none;
}
.breadcrumbs .text-right .breadcrumb {
    justify-content: flex-end;
}
.breadcrumbs-dashboard .col-sm-8,
.breadcrumbs-dashboard .breadcrumb {
    display: none;
}
.breadcrumbs-dashboard .breadcrumbs-inner .row { justify-content: flex-start; }
.content {
    padding: 1.5rem 1.75rem;
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}
.content .card,
.content .dashboard-card {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}
.content .card .card-body,
.content .dashboard-card .card-body {
    overflow-x: auto;
    min-width: 0;
}
.content .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}
.site-footer {
    padding: 1rem 1.5rem;
    background: #fff;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
    flex-shrink: 0;
}

/* ---- Dashboard-Kennzahlen (Stat-Karten) ---- */
.stat-widget-five {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}
.stat-icon.dib {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    flex-shrink: 0;
}
.stat-content .stat-text .count {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1e293b;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}
.stat-content .stat-heading {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 0.2rem;
}
.flat-color-1 { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); color: #fff; box-shadow: 0 4px 12px rgba(14,165,233,0.3); }
.flat-color-2 { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,0.3); }
.flat-color-3 { background: linear-gradient(135deg, #059669 0%, #047857 100%); color: #fff; box-shadow: 0 4px 12px rgba(5,150,105,0.3); }
.flat-color-4 { background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%); color: #fff; box-shadow: 0 4px 12px rgba(234,88,12,0.3); }
.card {
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
    background: #fff;
    overflow: hidden;
}
.card-header {
    font-weight: 600;
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid #e2e8f0;
    background: #fafbfc;
    font-size: 1rem;
    color: #1e293b;
}
.content .card .card-body { padding: 1.25rem 1.5rem; }
/* Tabellen: einheitlich lesbar */
.content .table thead th {
    font-weight: 600;
    color: #334155;
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}
.content .table tbody tr:hover { background: #f8fafc; }
.content .table td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* Leerer Zustand (keine Daten) */
.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}
.empty-state .fa, .empty-state .ti { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.5; }
.empty-state strong { color: #475569; display: block; margin-bottom: 0.35rem; }

@media (max-width: 768px) {
    .left-panel { transform: translateX(-100%); box-shadow: none; }
    .left-panel.open { transform: translateX(0); box-shadow: 4px 0 12px rgba(0,0,0,0.15); z-index: 1100; }
    .right-panel { margin-left: 0; width: 100%; }
    .header { padding: 0 0.75rem; }
    .topnav-bar { padding: 0 0.75rem; flex-wrap: wrap; min-height: auto; padding-top: 0.35rem; padding-bottom: 0.35rem; }
    .topnav-link { padding: 0.4rem 0.75rem; font-size: 0.85rem; }
}
