/* ============================================================
   Kilchherr CRM – Design System
   ============================================================ */

:root {
    --red: #E33E44;
    --red-dark: #C42E34;
    --red-light: #FEF2F2;
    --orange: #F39200;
    --yellow: #FDB813;
    --dark: #1A1A2E;
    --text: #333333;
    --text-muted: #6B7280;
    --text-light: #9CA3AF;
    --bg: #F5F6FA;
    --surface: #FFFFFF;
    --border: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 4px 16px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --sidebar-w: 260px;
    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; -webkit-font-smoothing: antialiased; }

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: var(--red); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--red-dark); }

/* ---- Login Page ---- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FAFAFA 0%, #F5F0EB 50%, #FEF2F2 100%);
    padding: 24px;
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
    background: var(--surface);
    border-radius: 20px;
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
}

.login-brand { text-align: center; margin-bottom: 32px; }
.login-logo { max-height: 80px; margin-bottom: 12px; }
.login-tagline { font-size: 0.85rem; color: var(--text-muted); letter-spacing: 0.5px; }

.login-title { font-size: 1.5rem; font-weight: 700; color: var(--dark); margin-bottom: 4px; }
.login-subtitle { color: var(--text-muted); margin-bottom: 28px; font-size: 0.95rem; }

.login-form .form-group { margin-bottom: 18px; }
.login-footer { text-align: center; margin-top: 24px; font-size: 0.8rem; color: var(--text-light); }

/* ---- App Shell ---- */
.app-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--dark);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo { height: 36px; filter: brightness(1.1); }
.sidebar-brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 1rem; letter-spacing: 0.5px; }
.brand-tag { font-size: 0.7rem; color: var(--red); font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.65);
    font-size: 0.92rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.nav-item.active { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(227,62,68,0.3); }

.nav-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 12px 8px; }

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar {
    width: 36px; height: 36px;
    background: var(--red);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.85rem;
}
.user-details { display: flex; flex-direction: column; }
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.72rem; color: rgba(255,255,255,0.45); text-transform: capitalize; }

.logout-btn {
    color: rgba(255,255,255,0.4);
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.logout-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.logout-btn svg { width: 18px; height: 18px; }

/* ---- Mobile Header ---- */
.mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    align-items: center;
    padding: 0 16px;
    z-index: 90;
    gap: 12px;
}

.menu-toggle {
    background: none; border: none; cursor: pointer;
    padding: 8px; color: var(--text);
}
.mobile-logo { height: 28px; }
.mobile-user { margin-left: auto; font-weight: 600; font-size: 0.85rem; color: var(--text-muted); }

.sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 32px 40px;
    min-height: 100vh;
}

/* ---- Page Header ---- */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 16px;
    flex-wrap: wrap;
}

.page-title { font-size: 1.75rem; font-weight: 700; color: var(--dark); letter-spacing: -0.5px; }
.page-subtitle { color: var(--text-muted); font-size: 0.92rem; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.back-link {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}
.back-link:hover { color: var(--red); }

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }

.stat-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); }

.stat-icon {
    width: 48px; height: 48px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon-red { background: var(--red-light); color: var(--red); }
.stat-icon-orange { background: #FFF7ED; color: var(--orange); }
.stat-icon-yellow { background: #FFFBEB; color: #D97706; }
.stat-icon-neutral { background: #F3F4F6; color: var(--text-muted); }

.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--dark); display: block; letter-spacing: -0.5px; }
.stat-label { font-size: 0.82rem; color: var(--text-muted); }

/* ---- Cards ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-header h2, .card-header h3, .card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
}

.card-warning { border-left: 4px solid var(--orange); }
.card-highlight { background: linear-gradient(135deg, #FFFBEB, #FFF); border-color: #FDE68A; }

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width { grid-column: 1 / -1; }

/* ---- Tables ---- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.92rem;
}
.data-table.compact td, .data-table.compact th { padding: 8px 12px; }
.data-table tr.clickable { cursor: pointer; transition: background var(--transition); }
.data-table tr.clickable:hover { background: #FAFAFA; }
.data-table .actions { text-align: right; white-space: nowrap; }

.empty-state {
    text-align: center;
    color: var(--text-light);
    padding: 32px !important;
    font-size: 0.92rem;
}

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}
.badge-neutral { background: #F3F4F6; color: #6B7280; }
.badge-info { background: #EFF6FF; color: #2563EB; }
.badge-success { background: #ECFDF5; color: #059669; }
.badge-warning { background: #FFFBEB; color: #D97706; }
.badge-danger { background: #FEF2F2; color: #DC2626; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    line-height: 1;
}

.btn-primary { background: var(--red); color: #fff; box-shadow: 0 2px 8px rgba(227,62,68,0.25); }
.btn-primary:hover { background: var(--red-dark); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(227,62,68,0.3); }

.btn-danger { background: #DC2626; color: #fff; box-shadow: 0 2px 8px rgba(220,38,38,0.25); }
.btn-danger:hover { background: #B91C1C; color: #fff; }

.btn-secondary { background: var(--dark); color: #fff; }
.btn-secondary:hover { background: #2D2D44; color: #fff; }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: #FAFAFA; color: var(--text); border-color: #D1D5DB; }

.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-icon { background: none; border: none; color: var(--text-light); cursor: pointer; font-size: 1.2rem; padding: 4px 8px; border-radius: 4px; }
.btn-icon:hover { color: var(--red); background: var(--red-light); }

/* ---- Forms ---- */
.form-card { max-width: 900px; }
.form-grid { display: flex; flex-direction: column; gap: 20px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-section h3 { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light); }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-group { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.form-group.flex-2 { flex: 2; }

label { font-size: 0.82rem; font-weight: 600; color: var(--text); }

input, select, textarea {
    font-family: var(--font);
    font-size: 0.92rem;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(227,62,68,0.1);
}

textarea { resize: vertical; min-height: 80px; }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 8px; }

/* ---- Toolbar / Search ---- */
.toolbar { margin-bottom: 20px; }

.search-form { position: relative; max-width: 400px; }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-light); pointer-events: none; }
.search-form input { padding-left: 42px; }

.filter-form input[type="month"] { padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font); }

/* ---- Line Items ---- */
.line-items-section { margin: 24px 0; }
.line-items-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.line-items-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.line-items-table { width: 100%; border-collapse: collapse; }
.line-items-table th { background: #FAFAFA; padding: 8px 10px; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.line-items-table td { padding: 6px 8px; border-top: 1px solid var(--border-light); }
.line-items-table input { padding: 8px 10px; font-size: 0.88rem; border: 1px solid var(--border-light); }
.line-items-table input:focus { border-color: var(--red); }
.line-items-table .qty { width: 70px; }
.line-items-table .unit { width: 60px; }
.line-items-table .price { width: 100px; }
.line-total { font-weight: 600; text-align: right; white-space: nowrap; padding-right: 12px !important; }

.totals-section { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; margin: 20px 0; }
.totals-row { flex: 1; }
.totals-display { min-width: 260px; }
.total-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.92rem; color: var(--text-muted); }
.total-grand { font-size: 1.15rem; font-weight: 700; color: var(--dark); border-top: 2px solid var(--border); padding-top: 10px; margin-top: 4px; }

/* ---- Document Preview ---- */
.document-preview { max-width: 800px; }
.doc-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 2px solid var(--red); }
.doc-logo { max-height: 60px; }
.doc-meta h2 { color: var(--red); font-size: 1.3rem; }
.doc-meta p { font-size: 0.88rem; color: var(--text-muted); }
.doc-customer { margin-bottom: 20px; line-height: 1.6; }
.doc-items { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.doc-items th { text-align: left; padding: 8px; font-size: 0.75rem; text-transform: uppercase; color: var(--text-muted); border-bottom: 2px solid var(--border); }
.doc-items td { padding: 10px 8px; border-bottom: 1px solid var(--border-light); font-size: 0.9rem; }
.doc-totals { margin-left: auto; max-width: 300px; }
.doc-totals div { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.9rem; }
.doc-total-grand { font-weight: 700; font-size: 1.1rem; color: var(--red); border-top: 2px solid var(--red); padding-top: 8px; }
.doc-total-open { font-weight: 600; color: var(--orange); }
.doc-notes { margin-top: 16px; padding: 12px; background: #FAFAFA; border-radius: var(--radius-sm); font-size: 0.88rem; }

/* ---- Detail Lists ---- */
.detail-list dt { font-size: 0.75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 12px; }
.detail-list dt:first-child { margin-top: 0; }
.detail-list dd { font-size: 0.92rem; margin-top: 2px; }

.mini-list { list-style: none; }
.mini-list li { padding: 8px 0; border-bottom: 1px solid var(--border-light); font-size: 0.88rem; }
.mini-list li:last-child { border-bottom: none; }
.mini-list a { color: var(--text); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mini-list a:hover { color: var(--red); }

.link-sm { font-size: 0.82rem; font-weight: 600; color: var(--red); }

/* ---- Kalkulation ---- */
.kalkulation-bar { padding: 4px 0; }
.kalk-info { display: flex; gap: 24px; margin-bottom: 12px; flex-wrap: wrap; font-size: 0.92rem; }
.progress-bar { height: 8px; background: #E5E7EB; border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 4px; transition: width 0.5s ease; }
.progress-fill.over-budget { background: var(--red); }

.text-success { color: #059669; }
.text-danger { color: #DC2626; }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 0.88rem; margin-bottom: 16px; }
.alert-error { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.alert-success { background: #ECFDF5; color: #059669; border: 1px solid #A7F3D0; }

.payment-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-light); }

/* ---- Work Types / Project Form ---- */
.section-hint { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 12px; }
.salary-block { display: none; }
.salary-block.active { display: block; }

.emp-type-banner {
    margin-top: 20px;
    padding: 12px 16px;
    background: var(--red-light);
    border-left: 3px solid var(--red);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-size: 0.88rem;
    color: var(--text);
    line-height: 1.5;
}

.emp-config {
    display: none;
    margin-top: 16px;
    padding: 20px;
    background: #FAFAFA;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.emp-config.is-active {
    display: block;
    animation: wizardIn 0.2s ease;
}

.emp-config-head { margin-bottom: 16px; }
.emp-config-head h4 { font-size: 0.95rem; font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.emp-config-head p { font-size: 0.82rem; color: var(--text-muted); }

.salary-panel-inner {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.emp-iban-field { margin-top: 20px; }

#employmentStep[data-emp-type="temporaer"] .emp-iban-field { margin-top: 16px; }
.field-hint { font-size: 0.75rem; color: var(--text-light); margin-top: 4px; }
.field-hint:not([hidden]) { display: block; }
.field-hint[hidden], .customer-info-banner[hidden] { display: none !important; }
.form-group-sm { flex: 0 0 140px; min-width: 120px; }

/* ---- Employee Wizard ---- */
.emp-wizard { max-width: 720px; margin: 0 auto; }

.page-header-compact { margin-bottom: 20px; }

.emp-wizard-header {
    margin-bottom: 16px;
}

.emp-wizard-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.emp-wizard-counter {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.emp-wizard-counter strong {
    color: var(--red);
    font-size: 1rem;
}

.emp-wizard-step-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
}

.emp-wizard-progress-track {
    height: 4px;
    background: var(--border-light);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 16px;
}

.emp-wizard-progress-fill {
    height: 100%;
    width: 25%;
    background: linear-gradient(90deg, var(--red), #f87171);
    border-radius: 99px;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.emp-wizard-card {
    padding: 0;
    overflow: visible;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.wizard-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wizard-step {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 8px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: default;
    font-family: var(--font);
    color: var(--text-light);
    transition: all var(--transition);
}

.wizard-step:not(:disabled) { cursor: pointer; }
.wizard-step:not(:disabled):hover { border-color: #D1D5DB; color: var(--text-muted); }

.wizard-step.is-active {
    border-color: var(--red);
    background: var(--red-light);
    color: var(--red);
    box-shadow: 0 0 0 3px rgba(227,62,68,0.1);
}

.wizard-step.is-done:not(.is-active) {
    border-color: var(--border);
    color: var(--text);
    cursor: pointer;
}

.wizard-step:disabled:not(.is-active) {
    opacity: 0.45;
}

.wizard-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--border-light);
    flex-shrink: 0;
}

.wizard-step.is-active .wizard-step-num { background: var(--red); color: #fff; }
.wizard-step.is-done .wizard-step-num { background: var(--dark); color: #fff; }

.wizard-step-text { font-size: 0.78rem; font-weight: 600; }

.employee-wizard-form { padding: 32px 36px 28px; min-height: 380px; }

.wizard-panel { animation: wizardIn 0.3s ease; }

@keyframes wizardIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.wizard-panel-head { margin-bottom: 28px; }
.wizard-panel-head h2 { font-size: 1.35rem; font-weight: 700; color: var(--dark); margin-bottom: 6px; letter-spacing: -0.02em; }
.wizard-panel-head p { font-size: 0.9rem; color: var(--text-muted); }

.wizard-label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--text); margin: 20px 0 10px; }

.wizard-divider { height: 1px; background: var(--border-light); margin: 24px 0; }

.wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-light);
}

.wizard-footer-nav { display: flex; gap: 10px; }

.wizard-summary {
    background: linear-gradient(135deg, #FAFAFA, #FEF2F2);
    border: 1px solid #FECACA;
    border-radius: var(--radius-sm);
    padding: 18px 20px;
    margin-bottom: 24px;
    font-size: 0.9rem;
    line-height: 1.75;
}

.wizard-summary strong { color: var(--dark); }

.emp-type-banner {
    margin-top: 16px;
    padding: 12px 14px;
    background: var(--red-light);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text);
    line-height: 1.5;
}

.emp-type-banner[hidden] { display: none !important; }

.emp-type-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.emp-type-chip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    transition: all var(--transition);
    background: var(--surface);
    position: relative;
}

.emp-type-chip::before {
    content: '';
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    margin-top: 2px;
    transition: all var(--transition);
}

.emp-type-chip:has(input:checked)::before {
    border-color: var(--red);
    background: var(--red);
    box-shadow: inset 0 0 0 3px #fff;
}

.emp-type-chip input { position: absolute; opacity: 0; pointer-events: none; }

.emp-type-chip:has(input:checked) {
    border-color: var(--red);
    background: var(--red-light);
}

.emp-type-body { display: flex; flex-direction: column; gap: 3px; }
.emp-type-body strong { font-size: 0.9rem; color: var(--dark); }
.emp-type-body small { font-size: 0.78rem; color: var(--text-muted); line-height: 1.35; }

.emp-config {
    margin-top: 20px;
    padding: 20px;
    background: #FAFAFA;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
}

.emp-config-head { margin-bottom: 16px; }
.emp-config-head h4 { font-size: 0.88rem; font-weight: 700; color: var(--dark); margin-bottom: 2px; }
.emp-config-head p { font-size: 0.8rem; color: var(--text-muted); }

.salary-panel-inner {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.emp-iban-field { margin-top: 20px; }

.employee-wizard-form .form-row { gap: 14px; margin-bottom: 0; }
.employee-wizard-form .form-group { margin-bottom: 16px; }
.employee-wizard-form input,
.employee-wizard-form select,
.employee-wizard-form textarea {
    padding: 11px 14px;
    border-radius: 10px;
}

@media (max-width: 640px) {
    .wizard-step-text { display: none; }
    .employee-wizard-form { padding: 24px 18px; min-height: 0; }
    .emp-type-grid { grid-template-columns: 1fr; }
    .wizard-footer { flex-wrap: wrap; }
    .emp-wizard-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
}

.work-type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.work-type-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    font-size: 0.88rem;
    font-weight: 500;
}

.work-type-chip:has(input:checked) {
    border-color: var(--red);
    background: var(--red-light);
    color: var(--red-dark);
}

.work-type-chip input { accent-color: var(--red); width: 16px; height: 16px; }

.project-form-card { max-width: 960px; }

.work-types-cell { max-width: 220px; }

.row-inactive { opacity: 0.55; }

.card-info-banner {
    padding: 14px 20px;
    background: #EFF6FF;
    border-color: #BFDBFE;
    font-size: 0.88rem;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
}

.public-link-wrap a { word-break: break-all; }

.letter-textarea { font-family: 'Courier New', monospace; font-size: 0.88rem; line-height: 1.6; min-height: 400px; }

.checklist { list-style: none; padding: 0; }
.checklist li { padding: 6px 0 6px 24px; position: relative; font-size: 0.9rem; color: var(--text-muted); }
.checklist li::before { content: '✓'; position: absolute; left: 0; color: #059669; font-weight: bold; }

.alert-info { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }

.upload-form input[type="file"] { padding: 8px; }

/* ---- Toast ---- */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    color: #fff;
    font-weight: 600;
    font-size: 0.88rem;
    z-index: 1000;
    animation: slideUp 0.3s ease;
    box-shadow: var(--shadow-lg);
}
.toast-success { background: #059669; }
.toast-error { background: #DC2626; }

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid, .detail-grid { grid-template-columns: 1fr; }
    .main-content { padding: 24px; }
}

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .mobile-header { display: flex; }
    .main-content { margin-left: 0; padding: 72px 16px 24px; }
    .stats-grid, .stats-grid-3 { grid-template-columns: 1fr; }
    .form-grid-2 { grid-template-columns: 1fr; }
    .page-header { flex-direction: column; }
    .page-title { font-size: 1.4rem; }
    .form-row { flex-direction: column; }
}

@media (max-width: 480px) {
    .login-card { padding: 32px 24px; }
    .page-actions { width: 100%; }
    .page-actions .btn { flex: 1; }
}

/* ---- Autocomplete ---- */
.customer-form-modern.is-private-customer .customer-company-row {
    display: none;
}

.customer-form-modern.is-company-customer .customer-person-row .form-row {
    opacity: 0.85;
}

/* ---- Customer Form (Modern) ---- */
.customer-page {
    width: 100%;
    max-width: 960px;
}

@media (min-width: 1200px) {
    .customer-page { max-width: 1040px; }
}

.page-header-modern { margin-bottom: 24px; }

.back-link-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.customer-form-shell {
    padding: 0;
    overflow: visible;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}

.customer-form-modern {
    display: flex;
    flex-direction: column;
}

.customer-type-bar {
    padding: 24px 28px 20px;
    background: linear-gradient(180deg, #FAFBFD 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border-light);
}

.customer-type-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.segmented-control {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.segment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    cursor: pointer;
    transition: all var(--transition);
    user-select: none;
}

.segment input { position: absolute; opacity: 0; pointer-events: none; }

.segment:hover {
    border-color: #D1D5DB;
    background: #FAFAFA;
}

.segment.is-active {
    border-color: var(--red);
    background: linear-gradient(135deg, #FFF5F5 0%, #FFF 100%);
    box-shadow: 0 0 0 3px rgba(227, 62, 68, 0.08);
}

.segment-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--transition);
}

.segment.is-active .segment-icon { color: var(--red); }

.segment-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.segment-text strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1.2;
}

.segment-text small {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.2;
}

.customer-form-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.customer-panel {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-light);
}

.customer-panel:last-of-type { border-bottom: none; }

.customer-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.customer-panel-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.customer-panel-icon svg { width: 20px; height: 20px; }

.customer-panel-icon-red {
    background: var(--red-light);
    color: var(--red);
}

.customer-panel-icon-blue {
    background: #EFF6FF;
    color: #2563EB;
}

.customer-panel-icon-green {
    background: #ECFDF5;
    color: #059669;
}

.customer-panel-head h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
    margin-bottom: 2px;
    text-transform: none;
    border: none;
    padding: 0;
}

.customer-panel-head p {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.customer-panel-body .form-group { margin-bottom: 4px; }

.customer-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    background: #F0F9FF;
    border: 1px solid #BAE6FD;
    border-radius: 10px;
    font-size: 0.82rem;
    color: #0369A1;
    line-height: 1.45;
}

.customer-info-banner svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-light);
    pointer-events: none;
    transition: color var(--transition);
}

.input-icon-wrap input {
    padding-left: 42px;
    background: #FAFBFC;
    border-color: #E8EAED;
}

.input-icon-wrap input:focus {
    background: var(--surface);
}

.input-icon-wrap input:focus + .input-icon,
.input-icon-wrap:focus-within .input-icon {
    color: var(--red);
}

.customer-form-modern textarea {
    background: #FAFBFC;
    border-color: #E8EAED;
    min-height: 96px;
}

.customer-form-modern textarea:focus { background: var(--surface); }

.customer-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 28px;
    background: #FAFBFD;
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius);
}

.btn-lg {
    padding: 12px 22px;
    font-size: 0.95rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

@media (max-width: 640px) {
    .customer-type-bar,
    .customer-panel,
    .customer-form-footer { padding-left: 18px; padding-right: 18px; }

    .segmented-control { grid-template-columns: 1fr; }

    .segment { padding: 12px 14px; }

    .customer-form-footer {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    .customer-form-footer .btn { width: 100%; justify-content: center; }
}

.form-card,
.form-section,
.card { overflow: visible; }

.ac-parent { position: relative; z-index: 1; }
.ac-parent:focus-within { z-index: 50; }

.ac-list {
    position: absolute;
    z-index: 9999;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    margin: 0;
    padding: 6px;
    list-style: none;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(26, 26, 46, 0.12);
    max-height: 280px;
    overflow-y: auto;
}

.ac-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition);
}

.ac-item:hover,
.ac-item.is-active {
    background: var(--red-light);
}

.ac-empty,
.ac-loading {
    padding: 12px 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: default;
    list-style: none;
}

.ac-loading {
    color: var(--red);
}

.ac-label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--dark);
    line-height: 1.35;
}

.ac-source {
    font-size: 0.72rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ---- Live List Search ---- */
.list-page {
    width: 100%;
    max-width: none;
}

.list-shell {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    width: 100%;
}

.list-page .page-header,
.list-page .page-header-modern {
    width: 100%;
    max-width: none;
}

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px 28px;
    background: linear-gradient(180deg, #FAFBFD 0%, var(--surface) 100%);
    border-bottom: 1px solid var(--border-light);
}

.live-search {
    flex: 1 1 320px;
    min-width: 0;
    max-width: none;
}

.live-search-field {
    position: relative;
    display: flex;
    align-items: center;
}

.live-search-icon {
    position: absolute;
    left: 14px;
    width: 18px;
    height: 18px;
    color: var(--text-light);
    pointer-events: none;
    transition: color var(--transition);
}

.live-search-input {
    width: 100%;
    padding: 13px 44px 13px 42px;
    border: 1.5px solid #E8EAED;
    border-radius: 12px;
    background: var(--surface);
    font-size: 0.95rem;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.live-search-input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 4px rgba(227, 62, 68, 0.08);
}

.live-search:focus-within .live-search-icon { color: var(--red); }

.live-search-clear {
    position: absolute;
    right: 10px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 8px;
    background: #F3F4F6;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), color var(--transition);
}

.live-search-clear svg { width: 14px; height: 14px; }
.live-search-clear:hover { background: var(--red-light); color: var(--red); }

.live-search.is-loading .live-search-clear { opacity: 0.4; pointer-events: none; }

.live-search-spinner {
    position: absolute;
    right: 14px;
    width: 18px;
    height: 18px;
    border: 2px solid #E5E7EB;
    border-top-color: var(--red);
    border-radius: 50%;
    animation: liveSpin 0.7s linear infinite;
}

.live-search.is-loading .live-search-spinner { display: block !important; }

@keyframes liveSpin { to { transform: rotate(360deg); } }

.live-search-hint {
    display: block;
    margin-top: 6px;
    font-size: 0.72rem;
    color: var(--text-light);
}

.list-toolbar-meta { flex-shrink: 0; }

.live-search-count {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--red-light);
    color: var(--red-dark);
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
}

.list-table-wrap { padding: 0; }

.data-table-modern {
    width: 100%;
}

.data-table-modern th {
    padding: 12px 20px;
    font-size: 0.78rem;
}

.data-table-modern td {
    padding: 14px 20px;
    font-size: 0.95rem;
}

.data-table-modern tbody.is-updating {
    animation: listFadeIn 0.25s ease;
}

@keyframes listFadeIn {
    from { opacity: 0.4; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.list-row { cursor: pointer; transition: background var(--transition); }
.list-row:hover { background: #FAFBFC; }

.list-person {
    display: flex;
    align-items: center;
    gap: 12px;
}

.list-avatar {
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--red-light), #FFF);
    color: var(--red);
    font-size: 0.78rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #FECACA;
}

.list-avatar-employee {
    background: linear-gradient(135deg, #EFF6FF, #FFF);
    color: #2563EB;
    border-color: #BFDBFE;
}

.list-name { display: block; color: var(--dark); font-weight: 600; }
.list-name-link { text-decoration: none; }
.list-name-link:hover .list-name { color: var(--red); }

.list-sub {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 1px;
}

.list-id {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.list-link {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted var(--border);
}

.list-link:hover { color: var(--red); border-color: var(--red); }

@media (min-width: 1024px) {
    .list-page .page-title { font-size: 2rem; }

    .list-toolbar { padding: 22px 32px; }

    .live-search-input {
        padding: 14px 48px 14px 44px;
        font-size: 1rem;
    }

    .list-avatar {
        width: 42px;
        height: 42px;
        font-size: 0.85rem;
    }

    .data-table-modern th,
    .data-table-modern td {
        padding: 16px 24px;
    }
}

@media (max-width: 640px) {
    .list-toolbar { padding: 14px 16px; }
    .live-search { flex: 1 1 100%; width: 100%; }
    .list-toolbar-meta { width: 100%; }

    .data-table-modern th,
    .data-table-modern td {
        padding: 10px 12px;
        font-size: 0.88rem;
    }

    .list-avatar {
        width: 34px;
        height: 34px;
        font-size: 0.72rem;
    }

    .list-person { gap: 10px; }

    .data-table-modern .actions .btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
}

/* ---- Document Form (Offerte / Rechnung) ---- */
.document-form-page {
    width: 100%;
    max-width: none;
}

.document-form-shell {
    padding: 0;
    overflow: visible;
    width: 100%;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
}

.document-form-modern {
    display: flex;
    flex-direction: column;
}

.doc-form-panel {
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-light);
}

.doc-form-panel:last-of-type { border-bottom: none; }

.doc-form-panel-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.doc-form-panel-head h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--dark);
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.doc-form-panel-head p {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.doc-form-panel-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.doc-form-panel-icon svg { width: 20px; height: 20px; }

.doc-form-panel-icon-blue {
    background: #EFF6FF;
    color: #2563EB;
}

.doc-form-panel-icon-red {
    background: var(--red-light);
    color: var(--red);
}

.doc-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
}

.doc-form-span-2 { grid-column: span 2; }

.doc-input,
.document-form-modern select,
.document-form-modern textarea {
    background: #FAFBFC;
    border-color: #E8EAED;
}

.doc-input:focus,
.document-form-modern select:focus,
.document-form-modern textarea:focus {
    background: var(--surface);
}

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

.document-form-page .line-items-header .doc-form-panel-head {
    margin-bottom: 0;
}

.document-form-page .line-items-header .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-top: 4px;
}

.line-items-table-modern {
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}

.line-items-table-modern .line-items-table th {
    background: #F8FAFC;
    padding: 12px 14px;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.line-items-table-modern .line-items-table td {
    padding: 10px 12px;
    vertical-align: middle;
}

.line-items-table-modern .line-items-table input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-light);
    border-radius: 8px;
    background: #FAFBFC;
}

.line-items-table-modern .line-items-table input:focus {
    background: var(--surface);
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(227, 62, 68, 0.08);
}

.line-items-table-modern .line-items-table td:first-child input {
    min-width: 200px;
}

.line-items-table-modern .qty { width: 90px; min-width: 90px; }
.line-items-table-modern .unit { width: 80px; min-width: 80px; }
.line-items-table-modern .price { width: 110px; min-width: 110px; }

.line-items-table-modern .line-total {
    font-weight: 700;
    color: var(--dark);
    white-space: nowrap;
    min-width: 90px;
}

.totals-section-modern {
    display: grid;
    grid-template-columns: 1fr minmax(280px, 360px);
    gap: 28px;
    align-items: start;
    margin: 0;
}

.totals-controls .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.doc-notes-field { margin-top: 16px; }

.totals-display-modern {
    background: linear-gradient(135deg, #FAFBFD 0%, #FFF 100%);
    border: 1.5px solid var(--border-light);
    border-radius: 14px;
    padding: 20px 22px;
    min-width: 0;
}

.totals-display-modern .total-line {
    padding: 8px 0;
    font-size: 0.92rem;
}

.totals-display-modern .total-grand {
    font-size: 1.2rem;
    margin-top: 8px;
    padding-top: 14px;
    border-top: 2px solid var(--red);
    color: var(--dark);
}

.totals-display-modern .total-grand span:last-child {
    color: var(--red);
}

.document-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 28px;
    background: #FAFBFD;
    border-top: 1px solid var(--border-light);
    border-radius: 0 0 var(--radius) var(--radius);
}

@media (min-width: 1200px) {
    .doc-form-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .doc-form-span-2 {
        grid-column: span 2;
    }

    .doc-form-panel,
    .document-form-footer {
        padding-left: 32px;
        padding-right: 32px;
    }

    .line-items-table-modern .line-items-table td:first-child input {
        min-width: 320px;
    }
}

@media (max-width: 900px) {
    .totals-section-modern {
        grid-template-columns: 1fr;
    }

    .totals-display-modern {
        order: -1;
    }

    .doc-form-grid {
        grid-template-columns: 1fr;
    }

    .doc-form-span-2 {
        grid-column: span 1;
    }
}

@media (max-width: 768px) {
    .document-form-page .line-items-header {
        flex-direction: column;
        align-items: stretch;
    }

    .document-form-page .line-items-header .btn {
        width: 100%;
        justify-content: center;
        margin-top: 0;
    }

    .line-items-table-modern {
        border: none;
        background: transparent;
        overflow: visible;
    }

    .line-items-table-modern .line-items-table thead {
        display: none;
    }

    .line-items-table-modern .line-items-table,
    .line-items-table-modern .line-items-table tbody,
    .line-items-table-modern .line-items-table tr,
    .line-items-table-modern .line-items-table td {
        display: block;
        width: 100%;
    }

    .line-items-table-modern .line-item {
        background: var(--surface);
        border: 1.5px solid var(--border-light);
        border-radius: 12px;
        padding: 14px;
        margin-bottom: 12px;
        position: relative;
    }

    .line-items-table-modern .line-item td {
        border: none;
        padding: 0 0 10px;
    }

    .line-items-table-modern .line-item td:last-child {
        position: absolute;
        top: 10px;
        right: 10px;
        padding: 0;
        width: auto;
    }

    .line-items-table-modern .line-item td[data-label]::before {
        content: attr(data-label);
        display: block;
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--text-muted);
        margin-bottom: 6px;
    }

    .line-items-table-modern .line-item td[data-label="Total"] {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-top: 4px;
        margin-top: 4px;
        border-top: 1px dashed var(--border-light);
    }

    .line-items-table-modern .line-item td[data-label="Total"]::before {
        margin-bottom: 0;
    }

    .line-items-table-modern .line-total {
        font-size: 1.05rem;
    }

    .document-form-footer {
        flex-direction: column-reverse;
        align-items: stretch;
        padding: 16px;
    }

    .document-form-footer .btn {
        width: 100%;
        justify-content: center;
    }

    .doc-form-panel {
        padding: 18px 16px;
    }
}
