:root{
    /* GermanKasse Palette */
    --erp-primary: #4F46E5;
    --erp-primary-dark: #3730A3;
    --erp-accent: #6366F1;
    --erp-success: #22C55E;
    --erp-bg: #F7F7F5;
    --erp-surface: #FFFFFF;
    --erp-text: #1F2937;
    --erp-muted: #6B7280;
    --erp-muted-2: #9CA3AF;
    --erp-line: #E5E7EB;
    /* Sidebar Blue Tones */
    --erp-sidebar-bg: #0F172A; /* Deep Navy */
    --erp-sidebar-text: #CBD5E1;
    --erp-sidebar-hover: #1E293B;
    --erp-sidebar-active-bg: #3730A3;
    --erp-sidebar-active-text: #FFFFFF;
    --erp-sidebar-line: rgba(255, 255, 255, 0.08);
    
    /* Layout Constants */
    --erp-radius: 12px;
    --erp-radius-sm: 8px;
    --erp-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --erp-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --erp-font: 'Instrument Sans', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --erp-sidebar-w: 280px;
    --erp-sidebar-collapsed-w: 80px;
    --erp-topbar-h: 80px;
}

html,body{
    height:100%;
}

body{
    font-family:var(--erp-font);
    background-color: var(--erp-bg);
    color:var(--erp-text);
    margin: 0;
}

a{
    color:inherit;
    text-decoration:none;
}

::selection{
    background:rgba(79, 70, 229, 0.15);
    color: var(--erp-primary);
}

.erp-shell{
    min-height:100vh;
    display:grid;
    grid-template-columns:var(--erp-sidebar-w) 1fr;
}

.erp-shell[data-sidebar="collapsed"]{
    grid-template-columns:var(--erp-sidebar-collapsed-w) 1fr;
}

.erp-sidebar{
    position:sticky;
    top:0;
    height:100vh;
    background: var(--erp-sidebar-bg);
    border-right:1px solid var(--erp-sidebar-line);
    padding:20px 16px;
    display:flex;
    flex-direction:column;
    gap:20px;
    z-index: 40;
}

.erp-brand{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:12px;
    border-radius:var(--erp-radius-sm);
    background: #FFFFFF;
    border: 1px solid rgba(255,255,255,0.1);
    min-height:72px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    margin-bottom: 10px;
}

.erp-brand-logo{
    max-width:100%;
    max-height:40px;
    height:auto;
    object-fit:contain;
}

.erp-brand-logo-small {
    display: none !important;
}

.erp-shell[data-sidebar="collapsed"] .erp-brand-logo-full {
    display: none !important;
}

.erp-shell[data-sidebar="collapsed"] .erp-brand-logo-small {
    display: block !important;
    max-height: 48px;
}

@media (max-width: 991.98px) {
    .erp-shell[data-sidebar="collapsed"] .erp-brand-logo-full {
        display: block !important;
    }
    .erp-shell[data-sidebar="collapsed"] .erp-brand-logo-small {
        display: none !important;
    }
}

.erp-nav{
    flex:1;
    overflow:auto;
    padding:4px 0;
}

.erp-nav::-webkit-scrollbar{
    width:4px;
}
.erp-nav::-webkit-scrollbar-track{
    background:transparent;
}
.erp-nav::-webkit-scrollbar-thumb{
    background:rgba(255,255,255,0.1);
    border-radius:10px;
}

.erp-nav-group{
    margin-bottom: 20px;
}

.erp-nav-group-title{
    font-size:.65rem;
    letter-spacing:.1em;
    text-transform:uppercase;
    color: #64748B;
    padding:0 12px 8px;
    font-weight: 700;
}

.erp-shell[data-sidebar="collapsed"] .erp-nav-group-title{
    display:none;
}

.erp-nav-item{
    display:flex;
    align-items:center;
    gap:12px;
    padding:10px 12px;
    border-radius:var(--erp-radius-sm);
    color:var(--erp-sidebar-text);
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
}

.erp-nav-item:hover{
    background: var(--erp-sidebar-hover);
    color: #FFFFFF;
}

.erp-nav-item[aria-current="page"]{
    background: var(--erp-sidebar-active-bg);
    color: var(--erp-sidebar-active-text);
    font-weight: 600;
}

.erp-nav-icon{
    width:20px;
    height:20px;
    display:grid;
    place-items:center;
    flex:0 0 auto;
    color: inherit;
}

.erp-nav-icon svg {
    width: 18px;
    height: 18px;
}

.erp-nav-text{
    flex:1;
    min-width:0;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    font-size:.9rem;
}

.erp-shell[data-sidebar="collapsed"] .erp-nav-text{
    display:none;
}

.erp-shell[data-sidebar="collapsed"] .erp-nav-item{
    justify-content:center;
}

.erp-userbox{
    position: relative;
    padding:12px;
    border-radius:var(--erp-radius);
    border:1px solid var(--erp-sidebar-line);
    background: rgba(255,255,255,0.03);
    display:flex;
    align-items:center;
    gap:12px;
}

.erp-user-avatar{
    width:36px;
    height:36px;
    border-radius:10px;
    background: var(--erp-primary);
    display:grid;
    place-items:center;
    color: #FFFFFF;
    font-weight:700;
    font-size: 0.85rem;
}

.erp-user-meta{
    flex:1;
    min-width:0;
}

.erp-user-meta strong{
    display:block;
    font-size:.85rem;
    font-weight:600;
    color: #FFFFFF;
}

.erp-user-meta span{
    display:block;
    font-size:.75rem;
    color: #94A3B8;
}

.erp-shell[data-sidebar="collapsed"] .erp-user-meta,
.erp-shell[data-sidebar="collapsed"] .erp-userbox .erp-icon-button {
    display:none;
}

.erp-shell[data-sidebar="collapsed"] .erp-userbox {
    justify-content: center;
    border: none;
    background: transparent;
}

.erp-main{
    min-width:0;
    display:flex;
    flex-direction:column;
}

.erp-topbar{
    height:var(--erp-topbar-h);
    position:sticky;
    top:0;
    z-index:30;
    display:flex;
    align-items:center;
    gap:14px;
    padding:0 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter:blur(12px);
    border-bottom:1px solid var(--erp-line);
}

.erp-topbar-left{
    display:flex;
    align-items:center;
    gap:12px;
    min-width:0;
}

.erp-topbar-right{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:12px;
}

.erp-icon-button{
    width:40px;
    height:40px;
    border-radius:10px;
    background: transparent;
    border: 1px solid transparent;
    display:grid;
    place-items:center;
    color: var(--erp-muted);
    transition: all 0.2s ease;
}

.erp-icon-button svg {
    width: 18px;
    height: 18px;
}

.erp-icon-button:hover{
    background: var(--erp-bg);
    color: var(--erp-primary);
    border-color: var(--erp-line);
}

.erp-page{
    padding:24px;
}

.erp-page-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    margin-bottom:24px;
}

.erp-page-title{
    margin:0;
    font-size:1.5rem;
    font-weight:700;
    color: var(--erp-text);
}

.erp-page-subtitle{
    margin-top:4px;
    color:var(--erp-muted);
    font-size:.875rem;
}

.erp-section{
    border-radius:var(--erp-radius);
    border:1px solid var(--erp-line);
    background: var(--erp-surface);
    box-shadow: var(--erp-shadow-sm);
    overflow:hidden;
}

.erp-section-header{
    padding:16px 20px;
    border-bottom:1px solid var(--erp-line);
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
}

.erp-section-title{
    margin:0;
    font-size:1rem;
    font-weight:600;
    color: var(--erp-text);
}

.erp-section-body{
    padding:20px;
}

.erp-card{
    border-radius:var(--erp-radius);
    border:1px solid var(--erp-line);
    background: var(--erp-surface);
    box-shadow: var(--erp-shadow-sm);
}

.erp-card-body{
    padding:16px;
}

.erp-stat{
    display:flex;
    align-items:center;
    gap:16px;
}

.erp-icon {
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}

.erp-stat-icon{
    width:48px;
    height:48px;
    border-radius:12px;
    display:grid;
    place-items:center;
    background: rgba(79, 70, 229, 0.06);
    color: var(--erp-primary);
}

.erp-stat-icon svg {
    width: 24px;
    height: 24px;
}

.erp-stat-label{
    font-size:.75rem;
    color:var(--erp-muted);
    font-weight: 600;
    text-transform:uppercase;
    letter-spacing: 0.025em;
}

.erp-stat-value{
    font-size:1.25rem;
    font-weight:700;
    color: var(--erp-text);
    margin-top:2px;
}

.erp-badge{
    display:inline-flex;
    align-items:center;
    gap:6px;
    border-radius:6px;
    padding:4px 10px;
    font-weight:600;
    font-size:.75rem;
    background: var(--erp-bg);
    color: var(--erp-muted);
    border: 1px solid var(--erp-line);
}

.erp-badge svg {
    width: 14px;
    height: 14px;
}

.erp-badge[data-tone="gold"]{
    background: rgba(79, 70, 229, 0.08);
    color: var(--erp-primary);
    border-color: rgba(79, 70, 229, 0.2);
}

.erp-badge[data-tone="danger"]{
    background: #FEF2F2;
    color: #DC2626;
    border-color: #FEE2E2;
}

.erp-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:10px 16px;
    border-radius:var(--erp-radius-sm);
    border:1px solid var(--erp-line);
    background: var(--erp-surface);
    color:var(--erp-text);
    font-weight:600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.erp-button svg {
    width: 18px;
    height: 18px;
}

.erp-button:hover{
    background: var(--erp-bg);
    border-color: var(--erp-line-2);
}

.erp-button[data-variant="gold"]{
    background: var(--erp-primary);
    border-color: var(--erp-primary);
    color: #FFFFFF;
}

.erp-button[data-variant="gold"]:hover{
    background: var(--erp-primary-dark);
    border-color: var(--erp-primary-dark);
}

.erp-divider{
    height:1px;
    background: var(--erp-line);
}

.erp-table{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
}

.erp-table th{
    font-size:.75rem;
    text-transform:uppercase;
    color:var(--erp-muted);
    font-weight:700;
    padding:12px 16px;
    border-bottom:1px solid var(--erp-line);
    background: var(--erp-bg);
    letter-spacing: 0.05em;
}

.erp-table td{
    padding:16px;
    border-bottom:1px solid var(--erp-line);
    color: var(--erp-text);
    font-size: 0.875rem;
}

.erp-table tr:last-child td {
    border-bottom: none;
}

.erp-table tr:hover td{
    background: rgba(247, 247, 245, 0.5);
}

.erp-field{
    display:flex;
    align-items:center;
    gap:10px;
    border-radius:var(--erp-radius-sm);
    background: var(--erp-surface);
    border:1px solid var(--erp-line);
    padding:8px 12px;
}

.erp-field svg {
    width: 16px;
    height: 16px;
    color: var(--erp-muted);
}

.erp-field input, .erp-field select{
    background:transparent;
    border:0;
    outline:0;
    color:var(--erp-text);
    width:100%;
    font-size: 0.875rem;
}

.erp-field:focus-within{
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.erp-popover{
    position:absolute;
    top:calc(var(--erp-topbar-h) - 8px);
    right:24px;
    width:min(360px, calc(100vw - 48px));
    border-radius:var(--erp-radius);
    background: var(--erp-surface);
    border:1px solid var(--erp-line);
    box-shadow: var(--erp-shadow);
    overflow:hidden;
    z-index:75;
}

.erp-sidebar-popover {
    bottom: calc(100% + 12px);
    left: 0;
    right: 0;
    top: auto;
    width: auto;
    box-shadow: 0 -10px 25px -3px rgba(0, 0, 0, 0.1);
}

.erp-popover-header{
    padding:16px;
    border-bottom:1px solid var(--erp-line);
    display:flex;
    align-items:center;
    justify-content:space-between;
    background: var(--erp-bg);
}

.erp-popover-title{
    margin:0;
    font-size:.875rem;
    font-weight:700;
}

.erp-popover-body{
    padding:8px;
    max-height:400px;
    overflow:auto;
}

.erp-popover-item{
    display:flex;
    align-items:flex-start;
    gap:12px;
    padding:12px;
    border-radius:var(--erp-radius-sm);
    color:var(--erp-text);
    transition: background 0.2s ease;
}

.erp-popover-item:hover{
    background: var(--erp-bg);
}

.erp-popover-item p{
    margin:0;
    font-size: 0.875rem;
    font-weight:500;
}

.erp-popover-item small{
    display:block;
    margin-top:4px;
    color:var(--erp-muted);
    font-size: 0.75rem;
}

.erp-pipeline{
    display:grid;
    grid-template-columns:repeat(6, 1fr);
    gap:12px;
}

.erp-pipeline-step{
    border-radius:var(--erp-radius-sm);
    border:1px solid var(--erp-line);
    background: var(--erp-bg);
    padding:16px;
    position:relative;
}

.erp-pipeline-step[data-active="true"]{
    border-color: var(--erp-primary);
    background: var(--erp-surface);
    box-shadow: var(--erp-shadow-sm);
}

.erp-pipeline-step-title{
    font-size:.7rem;
    color:var(--erp-muted);
    font-weight: 700;
    text-transform:uppercase;
    letter-spacing: 0.05em;
}

.erp-pipeline-step-value{
    margin-top:8px;
    font-size:1.1rem;
    font-weight:700;
    color: var(--erp-text);
}

.erp-pipeline-step-bar{
    margin-top:12px;
    height:4px;
    border-radius:999px;
    background: var(--erp-line);
    overflow:hidden;
}

.erp-pipeline-step-bar > span{
    display:block;
    height:100%;
    border-radius:999px;
    background: var(--erp-primary);
}

.erp-mobile-overlay{
    position:fixed;
    inset:0;
    z-index:60;
    background:rgba(31, 41, 55, 0.4);
    backdrop-filter:blur(4px);
    display: none;
}

.erp-shell.mobile-sidebar-open .erp-mobile-overlay {
    display: block;
}

.erp-mobile-sidebar{
    position:fixed;
    top:0;
    left:0;
    bottom:0;
    width:min(280px, 85vw);
    z-index:70;
    box-shadow: var(--erp-shadow);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.erp-shell.mobile-sidebar-open .erp-mobile-sidebar {
    transform: translateX(0);
}

@media (max-width: 991.98px){
    .erp-shell{
        grid-template-columns:1fr;
    }
    .erp-sidebar:not(.erp-mobile-sidebar){
        display:none;
    }
    .erp-page{
        padding:20px 16px;
    }
    .erp-topbar{
        padding:0 16px;
    }
    .erp-pipeline{
        grid-template-columns:repeat(2,1fr);
    }
}
