/* ============================================
   BiLLU Financial Solutions - Modern Finance Dashboard
   ============================================ */

:root {
    --primary: #008F8F;
    --primary-dark: #006D6D;
    --primary-light: #E0F5F5;
    --primary-50: #F0FAFA;
    --accent-bordo: #882D61;
    --accent-teal: #008F8F;
    --success: #22C55E;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #008F8F;
    --gray-50: #F5F5F5;
    --gray-100: #EEEEEE;
    --gray-200: #D9D9D9;
    --gray-300: #BDBDBD;
    --gray-500: #757575;
    --gray-700: #424242;
    --gray-900: #0B2430;
    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
    --shadow-glass: 0 8px 32px rgba(0,0,0,0.06);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; width: 100%; }

/* Navbar — Light mode (Apple-like white) */
.navbar {
    background: #ffffff;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #424242;
    padding: 0;
    border-bottom: 1px solid #D9D9D9;
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-brand { color: #0B2430; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }
.nav-menu { display: flex; align-items: center; gap: 4px; }
.nav-link {
    color: #757575;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
}
.nav-link:hover, .nav-link.active { background: #F5F5F5; color: #0B2430; }
.nav-logout { border-left: 1px solid #D9D9D9; margin-left: 8px; }
.nav-user { color: #424242; font-size: 13px; padding: 0 10px; font-weight: 500; text-decoration: none; }
.nav-user:hover { color: var(--accent-bordo); }
.nav-lang { display: flex; gap: 0; }
.nav-bell { color: #424242; }
.nav-bell:hover { color: var(--primary); background: #F5F5F5; }

/* Sidebar (all roles) — Light mode */
.sidebar-toggle {
    background: none; border: none; color: #424242; font-size: 22px;
    cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); line-height: 1;
}
.sidebar-toggle:hover { background: #F5F5F5; }
.nav-topbar-right { display: flex; align-items: center; gap: 6px; }

.app-sidebar {
    position: fixed; top: 60px; left: 0; bottom: 0;
    width: 260px;
    background: #ffffff;
    overflow-y: auto; z-index: 90;
    transform: translateX(-100%); transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid #D9D9D9;
}
.sidebar-open .app-sidebar { transform: translateX(0); }
.sidebar-overlay {
    display: none; position: fixed; inset: 0; top: 60px;
    background: rgba(0,0,0,0.3); z-index: 89;
    backdrop-filter: blur(4px);
}
.sidebar-open .sidebar-overlay { display: block; }

/* Sidebar logo section */
.sidebar-logo { padding: 16px 16px 8px; border-bottom: 1px solid #EEEEEE; margin-bottom: 8px; }
.sidebar-logo img { max-height: 32px; max-width: 160px; object-fit: contain; }
.sidebar-logo-light { display: block; }
.sidebar-logo-dark { display: none; }
[data-theme="dark"] .sidebar-logo-light { display: none; }
[data-theme="dark"] .sidebar-logo-dark { display: block; }
.sidebar-logo-text { font-size: 10px; font-weight: 600; color: #757575; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }

/* Topbar logo (replaces the sidebar one). Lives next to the burger button. */
.topbar-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; background: transparent; }
.topbar-logo img { height: 32px; width: auto; max-width: 140px; object-fit: contain; background: transparent; }
.topbar-logo-light { display: block; }
.topbar-logo-dark  { display: none; }
[data-theme="dark"] .topbar-logo-light { display: none; }
[data-theme="dark"] .topbar-logo-dark  { display: block; }

.sidebar-nav { padding: 8px 12px; }
.sidebar-group-label {
    color: var(--accent-bordo); font-size: 10px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.08em;
    padding: 20px 12px 6px 12px; margin-top: 4px;
}
.sidebar-link {
    display: flex; align-items: center; gap: 12px;
    color: #0B2430; text-decoration: none;
    padding: 10px 12px; font-size: 13px; font-weight: 500;
    transition: var(--transition);
    border-radius: var(--radius);
    margin: 1px 0;
    border-left: none;
}
.sidebar-link:hover {
    background: #F5F5F5; color: #0B2430;
}
.sidebar-link.active {
    background: rgba(0,143,143,0.08); color: var(--accent-teal);
    box-shadow: inset 0 0 0 1px rgba(0,143,143,0.15);
}
.sidebar-link svg { flex-shrink: 0; opacity: 0.5; width: 18px; height: 18px; color: #757575; }
.sidebar-link.active svg { opacity: 1; color: var(--accent-teal); }
.sidebar-link:hover svg { opacity: 0.9; color: #0B2430; }

/* App layout */
.app-main { flex: 1; padding: 28px 32px; }
.app-footer { margin-left: 0; }

/* Desktop: sidebar always visible */
@media (min-width: 1024px) {
    .app-sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-overlay { display: none; }
    .sidebar-overlay { display: none !important; }
    .app-main { margin-left: 260px; }
    .app-footer { margin-left: 260px; }
    .sidebar-toggle { display: none; }
}

/* Main content */
.main-content { flex: 1; padding: 24px 20px; }

/* Auth */
.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}
.auth-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-glass);
    padding: 44px;
    width: 100%;
    max-width: 420px;
}
.auth-title { text-align: center; color: var(--primary); font-size: 26px; margin-bottom: 8px; font-weight: 700; letter-spacing: -0.02em; }
.auth-subtitle { text-align: center; color: var(--gray-500); margin-bottom: 28px; font-size: 14px; }

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fca5a5; }

/* Forms */
.form-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    border: 1px solid var(--gray-100);
}
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--gray-700); letter-spacing: 0.01em; }
.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    background: white;
}
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,143,143,0.1); }
.form-hint { display: block; color: var(--gray-500); font-size: 12px; margin-top: 5px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-actions { display: flex; gap: 12px; margin-top: 28px; }
.inline-form { display: inline; }
.radio-group { display: flex; gap: 20px; }
.radio-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 14px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; padding: 10px 0; }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid var(--gray-200);
    background: white;
    color: var(--gray-700);
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.01em;
}
.btn:hover { background: var(--gray-50); border-color: var(--gray-300); }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: var(--accent-teal); color: white; border-color: var(--accent-teal); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(0,143,143,0.25); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #16a34a; box-shadow: 0 4px 12px rgba(34,197,94,0.25); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #b91c1c; box-shadow: 0 4px 12px rgba(220,38,38,0.25); }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-warning:hover { background: #b45309; }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); border-color: var(--gray-200); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-sm); }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 28px; }
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    text-align: left;
    border: 1px solid var(--gray-100);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 4px;
    background: var(--primary);
    border-radius: 0 4px 4px 0;
}
.stat-card.stat-warning::before { background: var(--warning); }
.stat-card.stat-success::before { background: var(--success); }
.stat-card.stat-error::before { background: var(--danger); }
.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-icon {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--primary-light);
    color: var(--primary);
}
.stat-card.stat-warning .stat-icon { background: #fef3c7; color: var(--warning); }
.stat-card.stat-success .stat-icon { background: #dcfce7; color: var(--success); }
.stat-card.stat-error .stat-icon { background: #fee2e2; color: var(--danger); }
.stat-card.stat-info .stat-icon { background: #e0f2fe; color: var(--info); }
.stat-content { flex: 1; min-width: 0; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--gray-900); line-height: 1.2; letter-spacing: -0.02em; word-break: break-word; overflow-wrap: break-word; }
.stat-label { font-size: 12px; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-top: 2px; }

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 1px solid var(--gray-100);
}
.table th {
    background: var(--gray-50);
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--gray-200);
}
.table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-700);
}
.table tbody tr { transition: background 0.15s; }
.table tbody tr:hover { background: var(--primary-50); }
.table tbody tr:last-child td { border-bottom: none; }
.table-compact td, .table-compact th { padding: 10px 12px; font-size: 13px; }
.table-footer td { font-size: 14px; background: var(--gray-50); border-top: 2px solid var(--gray-200); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.col-check { width: 40px; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.badge-success { background: #ecfdf5; color: #065f46; }
.badge-warning { background: #fffbeb; color: #92400e; }
.badge-warning-orange { background: #fff7ed; color: #c2410c; }
.badge-error { background: #fef2f2; color: #991b1b; }
.badge-info { background: #ecfeff; color: #0e7490; }
.badge-default { background: var(--gray-100); color: var(--gray-700); }

/* Sections */
.section { margin-top: 32px; }
.section h2 { font-size: 18px; margin-bottom: 18px; color: var(--gray-700); font-weight: 700; letter-spacing: -0.01em; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.section-header h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--gray-900); }

/* Batch Cards */
.batch-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    margin-bottom: 14px;
    border-left: 4px solid var(--gray-200);
    border: 1px solid var(--gray-100);
    transition: var(--transition);
}
.batch-card:hover { box-shadow: var(--shadow-md); }
.batch-card.batch-pending { border-left: 4px solid var(--warning); }
.batch-card.batch-done { border-left: 4px solid var(--success); }
.batch-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.batch-card-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.batch-info {
    background: white; border-radius: var(--radius-lg); padding: 18px 22px;
    margin-bottom: 18px; box-shadow: var(--shadow); border: 1px solid var(--gray-100);
}

/* Bulk Actions */
.bulk-actions { margin-bottom: 16px; }
.bulk-bar {
    background: white;
    padding: 14px 18px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    border: 1px solid var(--gray-100);
}

/* Action Buttons */
.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; }

/* Invoice row status */
.invoice-row.status-accepted { background: #f0fdf4; }
.invoice-row.status-accepted-unpaid { background: #fffbeb; }
.invoice-row.status-rejected { background: #fef2f2; }

/* Generic card */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 0;
    border: 1px solid var(--gray-100);
}
.card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-900);
}
.card-body {
    padding: 16px 18px;
}

/* Info & Result cards */
.info-card, .result-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 22px;
    border: 1px solid var(--gray-100);
}
.error-list { list-style: none; padding: 0; }
.error-list li { padding: 4px 0; color: var(--danger); font-size: 13px; }
.error-list li::before { content: "• "; }

/* Empty state */
.empty-state {
    text-align: center;
    padding: 56px 24px;
    color: var(--gray-500);
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-100);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    width: 90%;
    max-width: 480px;
    box-shadow: var(--shadow-md);
}
.modal-content h3 { margin-bottom: 12px; }

/* Footer */
.footer {
    background: white;
    border-top: 1px solid var(--gray-100);
    padding: 18px 0;
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    margin-top: auto;
}
.footer-links { margin-top: 6px; }
.footer-links a { color: var(--gray-500); text-decoration: none; margin: 0 8px; font-size: 12px; transition: color 0.15s; }
.footer-links a:hover { color: var(--primary); text-decoration: underline; }

/* Nav toggle (hamburger) for mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
}
.nav-logo {
    height: 32px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Impersonation bar */
.impersonation-bar {
    background: #fef3c7;
    color: #92400e;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

/* Tabs */
.tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid var(--gray-200); }
.tab-link {
    padding: 10px 20px;
    text-decoration: none;
    color: var(--gray-500);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}
.tab-link:hover { color: var(--gray-700); }
.tab-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Settings sections */
.settings-section {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--gray-100);
}
.settings-section h3 {
    font-size: 16px;
    color: var(--gray-700);
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}

/* Color inputs */
.form-color {
    width: 60px;
    height: 38px;
    padding: 2px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    cursor: pointer;
}
.color-group { display: flex; align-items: center; gap: 12px; }

/* Privacy policy textarea */
.form-textarea-lg {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

/* GUS lookup button inline */
.input-group { display: flex; gap: 8px; }
.input-group .form-input { flex: 1; }

/* Password results table */
.password-table { margin-top: 16px; }
.password-table td { font-family: monospace; }

/* Filter bar */
.filter-bar {
    background: white;
    padding: 18px 22px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    display: flex;
    gap: 14px;
    align-items: flex-end;
    flex-wrap: wrap;
    border: 1px solid var(--gray-100);
}
.filter-bar .form-group { margin-bottom: 0; }
.filter-bar .form-label { font-size: 11px; margin-bottom: 4px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

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

/* Alert info */
.alert-info { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* Desktop/mobile visibility helpers (client panel) */
.mobile-only-client { display: none; }

/* Table cell text overflow */
.table td code { word-break: break-all; }

/* Text truncation utilities */
.text-truncate {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
    vertical-align: middle;
}
.text-truncate-sm { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.text-truncate-lg { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; vertical-align: middle; }
.text-wrap { word-break: break-word; overflow-wrap: break-word; }

/* Responsive visibility helpers */
.hide-mobile { }
.show-mobile { display: none !important; }

/* Touch-friendly sizing */
.btn { min-height: 40px; }
.btn-sm { min-height: 34px; }
.btn-xs { min-height: 28px; }
.form-input, select.form-input { min-height: 42px; font-size: 16px; } /* 16px prevents iOS zoom */

/* Contact cards */
.contact-card {
    padding: 22px 24px;
    border: 1px solid var(--gray-100);
    border-radius: var(--radius-lg);
    background: white;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.contact-card:hover { box-shadow: var(--shadow-md); }
.contact-card-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--gray-100);
}
.contact-card-icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.contact-card h3 {
    font-size: 13px; color: var(--gray-500); text-transform: uppercase;
    letter-spacing: 0.06em; font-weight: 700; margin: 0;
}
.contact-card-name { font-size: 16px; font-weight: 600; color: var(--gray-900); margin-bottom: 8px; }
.contact-card-detail {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; color: var(--gray-600, var(--gray-500)); margin-bottom: 4px;
}
.contact-card-detail svg { flex-shrink: 0; opacity: 0.5; }
.contact-card-detail a { color: var(--primary); text-decoration: none; }
.contact-card-detail a:hover { text-decoration: underline; }

/* Client checkboxes for employee form */
.client-checkboxes {
    max-height: 320px; overflow-y: auto;
    border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 12px 16px; background: var(--gray-50);
}
.client-checkboxes label {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 0; font-size: 14px; cursor: pointer;
    border-bottom: 1px solid var(--gray-100);
}
.client-checkboxes label:last-child { border-bottom: none; }

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .table { font-size: 13px; }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .nav-toggle { display: block; }
    .nav-menu {
        display: none;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 8px 0;
        box-shadow: var(--shadow-md);
    }
    .nav-menu.active { display: flex; }
    .nav-link { padding: 14px 20px; border-radius: 0; font-size: 15px; }
    .nav-logout { border-left: none; margin-left: 0; border-top: 1px solid rgba(255,255,255,0.2); }
    .nav-user { padding: 10px 20px; font-size: 14px; }
    .nav-lang { padding: 0 12px; }

    /* Sidebar: hidden by default on mobile, toggled via hamburger */
    .app-sidebar { width: 280px; }
    .app-main { margin-left: 0; padding: 20px 16px; }

    .form-row { grid-template-columns: 1fr; }
    .form-inline .form-row { gap: 8px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .section-header { flex-direction: column; gap: 12px; align-items: flex-start; }
    .batch-card-header { flex-direction: column; gap: 8px; }
    .bulk-bar { flex-wrap: wrap; gap: 8px; }
    .action-buttons { flex-direction: column; gap: 6px; }
    .filter-bar { flex-direction: column; }

    .auth-card { margin: 16px; padding: 20px; }
    .container { padding: 0 12px; }
    .main-content { padding: 16px 12px; }

    /* Horizontal scroll for tables on mobile */
    .section { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 500px; }
    .table td, .table th { padding: 8px 6px; font-size: 12px; }
    .table-compact td, .table-compact th { padding: 6px 4px; font-size: 11px; }
    .data-table td, .data-table th { padding: 8px 6px; font-size: 12px; }

    /* Hide columns on mobile */
    .hide-mobile { display: none !important; }
    .show-mobile { display: initial !important; }

    /* Truncation adjustments for mobile */
    .text-truncate { max-width: 120px; }
    .text-truncate-sm { max-width: 90px; }
    .text-truncate-lg { max-width: 160px; }

    .impersonation-bar { flex-direction: column; gap: 8px; text-align: center; }

    /* Mobile-friendly buttons */
    .btn { padding: 10px 16px; font-size: 14px; }
    .section-header .btn { width: 100%; text-align: center; }
    .form-actions { gap: 8px; }

    /* Notifications */
    .notif-item { padding: 12px; }
    .notif-actions { flex-wrap: wrap; }

    /* Charts */
    .bar-chart { height: 140px; }
    .donut-chart { width: 100px; height: 100px; }

    /* Pagination */
    .pagination { flex-wrap: wrap; }

    /* Hide KSeF config on mobile for clients */
    .desktop-only-client { display: none; }
    .mobile-only-client { display: block; }

    /* Stat value scaling */
    .stat-value { font-size: 24px; }
    .stat-icon { width: 40px; height: 40px; border-radius: 10px; }
    .stat-card { padding: 16px 18px; gap: 12px; }
    .contact-card { padding: 16px 18px; }

    /* Tabs: horizontal scroll on mobile */
    .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; gap: 0; scrollbar-width: none; }
    .tabs::-webkit-scrollbar { display: none; }
    .tab-link { white-space: nowrap; flex-shrink: 0; padding: 10px 14px; font-size: 13px; }

    /* VAT balance grid: stack on mobile */
    .vat-balance-grid { grid-template-columns: 1fr !important; gap: 12px !important; }
    .vat-balance-grid > div > div:first-child { font-size: 20px !important; }

    /* Fixed panels: constrain to viewport */
    .bulk-progress, #pdfExportMenu { left: 10px; right: 10px; max-width: none; min-width: 0 !important; }

    /* Filter buttons wrap on mobile */
    .form-inline .form-group { display: flex; flex-wrap: wrap; gap: 6px; }

    /* Modal detail grids: stack on mobile */
    .modal-content .detail-dates-grid { grid-template-columns: 1fr !important; gap: 4px !important; }
    .modal-content .detail-parties-grid { grid-template-columns: 1fr !important; }
    .modal-content .detail-amounts-grid { grid-template-columns: 1fr !important; }

    /* Whitelist badge: smaller on mobile */
    .badge-whitelist-fail { font-size: 9px !important; line-height: 1.2; }

    /* PDF/bank export bars: stack on mobile */
    .export-bar-inner { flex-direction: column !important; align-items: stretch !important; gap: 8px !important; }
    .export-bar-inner .btn { width: 100%; justify-content: center; }

    /* Card component mobile adjustments */
    .card { border-radius: var(--radius-md); }
    .card-header { padding: 12px 14px; font-size: 13px; }
    .card-body { padding: 12px 14px; }

    /* Contact card email/phone: break long text */
    .contact-card-detail a { word-break: break-all; overflow-wrap: break-word; }

    /* Textarea: prevent iOS auto-zoom */
    textarea.form-control { font-size: 16px; }

    /* Donut chart legend: smaller text on mobile */
    .donut-legend-item { font-size: 12px; }
}

/* Notifications */
.notifications-list { display: flex; flex-direction: column; gap: 12px; }
.notif-item { background: #fff; border-radius: var(--radius-lg); padding: 18px 20px; box-shadow: var(--shadow); border-left: 4px solid var(--gray-200); border: 1px solid var(--gray-100); transition: var(--transition); }
.notif-item:hover { box-shadow: var(--shadow-md); }
.notif-unread { border-left: 4px solid var(--primary) !important; background: #f0f9ff; }
.notif-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.notif-title { font-weight: 600; color: var(--gray-900); margin-bottom: 4px; }
.notif-message { font-size: 13px; color: var(--gray-500); margin-bottom: 8px; }
.notif-actions { display: flex; gap: 8px; }
.notif-date { font-size: 12px; }

/* Notification bell */
.nav-bell { position: relative; display: inline-flex; align-items: center; }
.notif-badge { position: absolute; top: -4px; right: -6px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* Charts */
.charts-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; }
.chart-card { background: #fff; border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--gray-100); }
.chart-card h3 { margin-bottom: 18px; font-size: 15px; color: var(--gray-700); font-weight: 700; }

.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.bar-stack { width: 100%; max-width: 40px; display: flex; flex-direction: column; border-radius: 4px 4px 0 0; overflow: hidden; margin-top: auto; min-height: 4px; }
.bar-segment { min-height: 2px; }
.bar-accepted { background: var(--success); }
.bar-rejected { background: var(--danger); }
.bar-pending { background: var(--warning); }
.bar-label { font-size: 11px; color: var(--gray-500); margin-top: 6px; white-space: nowrap; }
.bar-value { font-size: 12px; font-weight: 600; color: var(--gray-700); }

.chart-legend { display: flex; gap: 16px; margin-top: 12px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--gray-500); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.donut-chart-container { display: flex; align-items: center; gap: 24px; }
.donut-chart { width: 140px; height: 140px; }
.donut-text { font-size: 6px; font-weight: 700; fill: var(--gray-700); }
.donut-legend { display: flex; flex-direction: column; gap: 8px; }
.donut-legend-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-700); }

@media (max-width: 768px) {
    .charts-row { grid-template-columns: 1fr; }
    .donut-chart-container { flex-direction: column; }
}

/* Dark mode toggle — light mode */
.theme-toggle { cursor: pointer; background: none; border: none; color: #0B2430; padding: 8px; font-size: 16px; line-height: 1; border-radius: 6px; transition: var(--transition); }
.theme-toggle:hover { background: #F5F5F5; color: #0B2430; }

/* Dark mode */
[data-theme="dark"] {
    --primary: #00A3A3;
    --primary-dark: #008F8F;
    --primary-light: #1A3D4A;
    --primary-50: #0D1F2A;
    --accent-bordo: #A6427B;
    --accent-teal: #00A3A3;
    --gray-50: #0B2430;
    --gray-100: #162E3A;
    --gray-200: #2D4551;
    --gray-300: #3D5561;
    --gray-500: #8899A5;
    --gray-700: #C0CDD5;
    --gray-900: #E0E0E0;
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
    --shadow-glass: 0 8px 32px rgba(0,0,0,0.4);
}
[data-theme="dark"] body { background: #0B2430; color: #D9D9D9; }
[data-theme="dark"] .navbar { background: rgba(11,36,48,0.95); backdrop-filter: blur(12px); border-bottom: 1px solid #2D4551; color: #D9D9D9; }
[data-theme="dark"] .nav-brand { color: #D9D9D9; }
[data-theme="dark"] .nav-link { color: rgba(255,255,255,0.75); }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.active { background: rgba(255,255,255,0.1); color: #fff; }
[data-theme="dark"] .nav-logout { border-left-color: #2D4551; }
[data-theme="dark"] .nav-user { color: rgba(255,255,255,0.6); }
[data-theme="dark"] .nav-user:hover { color: #00A3A3; }
[data-theme="dark"] .nav-bell { color: rgba(255,255,255,0.75); }
[data-theme="dark"] .nav-bell:hover { color: #fff; background: rgba(255,255,255,0.1); }
[data-theme="dark"] .sidebar-toggle { color: #D9D9D9; }
[data-theme="dark"] .sidebar-toggle:hover { background: rgba(255,255,255,0.1); }
[data-theme="dark"] .theme-toggle { color: rgba(255,255,255,0.85); }
[data-theme="dark"] .theme-toggle:hover { background: rgba(255,255,255,0.15); color: #fff; }
[data-theme="dark"] .app-sidebar { background: #0B2430; border-right-color: #2D4551; }
[data-theme="dark"] .sidebar-logo { border-bottom-color: #2D4551; }
[data-theme="dark"] .sidebar-logo-text { color: #8899A5; }
[data-theme="dark"] .sidebar-group-label { color: #A6427B; }
[data-theme="dark"] .sidebar-link { color: rgba(255,255,255,0.65); }
[data-theme="dark"] .sidebar-link:hover { background: rgba(255,255,255,0.07); color: rgba(255,255,255,0.95); }
[data-theme="dark"] .sidebar-link.active { background: rgba(0,163,163,0.25); color: #fff; box-shadow: inset 0 0 0 1px rgba(0,163,163,0.3); }
[data-theme="dark"] .sidebar-link svg { color: rgba(255,255,255,0.5); }
[data-theme="dark"] .sidebar-link:hover svg { color: rgba(255,255,255,0.9); }
[data-theme="dark"] .sidebar-link.active svg { color: var(--accent-teal); }
[data-theme="dark"] .auth-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .notif-item,
[data-theme="dark"] .batch-card,
[data-theme="dark"] .batch-info,
[data-theme="dark"] .info-card,
[data-theme="dark"] .result-card,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .bulk-bar,
[data-theme="dark"] .card,
[data-theme="dark"] .contact-card { background: #162E3A; color: #D9D9D9; border-color: #2D4551; }
[data-theme="dark"] .card-header { color: #D9D9D9; border-bottom-color: #2D4551; background: transparent; }
[data-theme="dark"] .card-body { color: #D9D9D9; }
[data-theme="dark"] .card .text-muted,
[data-theme="dark"] .card-body .text-muted { color: #8899A5; }

/* Logo containers MUST stay transparent in every theme so a PNG with
   alpha channel doesn't end up rendered against a white inherited bg. */
.auth-logo, .auth-logo img,
.sidebar-logo, .sidebar-logo img,
.topbar-logo, .topbar-logo img { background: transparent !important; }
[data-theme="dark"] .auth-logo,
[data-theme="dark"] .auth-logo img,
[data-theme="dark"] .sidebar-logo,
[data-theme="dark"] .sidebar-logo img,
[data-theme="dark"] .topbar-logo,
[data-theme="dark"] .topbar-logo img { background: transparent !important; }
[data-theme="dark"] .notif-unread { background: #1A3D4A; }
[data-theme="dark"] .form-input, [data-theme="dark"] .form-select, [data-theme="dark"] select.form-input { background: #0B2430; color: #D9D9D9; border-color: #2D4551; }
[data-theme="dark"] .table { background: #162E3A; border-color: #2D4551; }
[data-theme="dark"] .table th { background: #0B2430; color: #8899A5; border-color: #2D4551; }
[data-theme="dark"] .table td { border-color: #2D4551; color: #D9D9D9; }
[data-theme="dark"] .table tr:hover { background: #1A3D4A; }
[data-theme="dark"] .stat-card { background: #162E3A; border-color: #2D4551; }
[data-theme="dark"] .stat-card::before { opacity: 0.8; }
[data-theme="dark"] .stat-icon { opacity: 0.9; }
[data-theme="dark"] .stat-value { color: #E0E0E0; }
[data-theme="dark"] .footer { background: #0B2430; color: #8899A5; border-top: 1px solid #2D4551; }
[data-theme="dark"] .text-muted { color: #8899A5 !important; }
[data-theme="dark"] .alert-success { background: #064e3b; color: #6ee7b7; border-color: #065f46; }
[data-theme="dark"] .alert-error { background: #7f1d1d; color: #fca5a5; border-color: #991b1b; }
[data-theme="dark"] .alert-info { background: #0c4a6e; color: #7dd3fc; border-color: #075985; }
[data-theme="dark"] .alert-warning { background: #78350f; color: #fcd34d; border-color: #92400e; }
[data-theme="dark"] .impersonation-bar { background: #78350f; }
[data-theme="dark"] .donut-text { fill: #D9D9D9; }
[data-theme="dark"] .modal-content { background: #162E3A; color: #D9D9D9; border-color: #2D4551; }
[data-theme="dark"] .section-header { color: #D9D9D9; }
[data-theme="dark"] a { color: #00A3A3; }
[data-theme="dark"] .btn { background: #162E3A; color: #D9D9D9; border-color: #2D4551; }
[data-theme="dark"] .btn:hover { background: #1f3d4a; border-color: #3a5663; }
[data-theme="dark"] .btn-secondary { background: #162E3A; color: #D9D9D9; border-color: #2D4551; }
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-warning,
[data-theme="dark"] .btn-info { color: #ffffff; }
/* Tables in dark mode — header row + alternating rows. */
[data-theme="dark"] .table thead th { background: #0B2430; color: #D9D9D9; border-bottom-color: #2D4551; }
[data-theme="dark"] .table tbody td { border-bottom-color: #2D4551; color: #D9D9D9; }
[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,0.04); }
[data-theme="dark"] .table tbody tr td.text-muted,
[data-theme="dark"] .table tbody td .text-muted,
[data-theme="dark"] .text-muted { color: #8899A5; }
[data-theme="dark"] .section-header h1,
[data-theme="dark"] .section-header h2,
[data-theme="dark"] h1, [data-theme="dark"] h2, [data-theme="dark"] h3, [data-theme="dark"] h4, [data-theme="dark"] h5 { color: #D9D9D9; }
[data-theme="dark"] .form-label { color: #D9D9D9; }
[data-theme="dark"] .form-hint { color: #8899A5; }
[data-theme="dark"] small { color: #8899A5; }
[data-theme="dark"] .pagination a, [data-theme="dark"] .pagination span { background: #162E3A; color: #D9D9D9; border-color: #2D4551; }
[data-theme="dark"] .pagination .active { background: var(--primary); color: #fff; }

/* Responsive - Small mobile */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; gap: 8px; }
    .stat-card { padding: 12px; }
    .stat-value { font-size: 20px; }
    .form-actions { flex-direction: column; }
    .form-actions .btn { width: 100%; justify-content: center; }
    h1 { font-size: 20px; }
    h2 { font-size: 17px; }
    .batch-card { padding: 12px; }
    .btn-xs { font-size: 12px; padding: 6px 10px; }

    /* Stack notification header */
    .notif-header { flex-direction: column; gap: 4px; align-items: flex-start; }

    /* Stats grid single column */
    .vat-balance-grid > div > div:first-child { font-size: 18px !important; }

    /* Tabs even more compact */
    .tab-link { padding: 8px 12px; font-size: 12px; }
}

/* ── Invoice Comments ────────────────────────────── */
.comment-toggle { position: relative; background: none; border: none; cursor: pointer; padding: 4px; color: #666; }
.comment-toggle:hover { color: var(--primary); }
.comment-count { position: absolute; top: -4px; right: -6px; background: var(--primary); color: #fff; font-size: 10px; min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.comment-row td { background: #fafafa; padding: 12px 16px !important; }
.comment-thread { max-height: 300px; overflow-y: auto; }
.comment-bubble { padding: 8px 12px; margin-bottom: 6px; border-radius: 8px; font-size: 0.85em; }
.comment-mine { background: #e3f2fd; margin-left: 20%; }
.comment-other { background: #f5f5f5; margin-right: 20%; }
.comment-meta { font-size: 0.8em; margin-bottom: 2px; }
.comment-text { line-height: 1.4; }
.comment-loading { padding: 8px; color: #999; font-size: 0.85em; }
.btn-ghost { background: transparent; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; padding: 2px 6px; }
.btn-ghost:hover { background: #f0f0f0; }

/* Spinner animation */
@keyframes spin { to { transform: rotate(360deg); } }
.ksef-spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(0,0,0,0.15); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: middle; }

/* ── Mobile-responsive fixes for inline styles ──── */

/* Responsive grid helpers */
.responsive-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.responsive-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

@media (max-width: 768px) {
    /* Responsive grid classes collapse to single column */
    .responsive-grid-2 { grid-template-columns: 1fr !important; }
    .responsive-grid-3 { grid-template-columns: 1fr !important; }

    /* Invoice detail modal: full width + grids collapse */
    .modal-content { max-width: calc(100vw - 24px) !important; margin: 12px; }
    .modal-content [style*="grid-template-columns: 1fr 1fr 1fr"],
    .modal-content [style*="grid-template-columns:1fr 1fr 1fr"] { grid-template-columns: 1fr !important; }
    .modal-content [style*="grid-template-columns: 1fr 1fr"],
    .modal-content [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }

    /* Dashboard quick action cards — single column */
    [style*="minmax(220px, 1fr)"] { grid-template-columns: 1fr !important; }
    [style*="minmax(280px, 1fr)"] { grid-template-columns: 1fr !important; }

    /* Filter inputs — full width on mobile */
    input[style*="width:220px"] { width: 100% !important; min-width: 0 !important; }
    select[style*="min-width:200px"],
    select[style*="min-width:140px"] { min-width: 0 !important; width: 100% !important; }

    /* Action buttons wrap on mobile */
    .action-buttons-wrap { flex-wrap: wrap !important; }

    /* Bank export grid */
    .export-params-grid { grid-template-columns: 1fr !important; }
}

@media (max-width: 480px) {
    /* Full-screen modal on small phones */
    .modal-content { max-width: 100vw !important; margin: 0; border-radius: 0 !important; max-height: 100vh !important; }
}

/* ── Messages ────────────────────────────────── */
.message-thread { display:flex; flex-direction:column; gap:12px; }
.message-bubble { padding:12px 16px; border-radius:12px; max-width:85%; }
.msg-from-office { background:var(--bg-secondary, #f0f4f8); align-self:flex-start; border-bottom-left-radius:4px; }
.msg-from-client { background:var(--primary); color:#fff; align-self:flex-end; border-bottom-right-radius:4px; }
.msg-from-client a { color:#fff; text-decoration:underline; }
.message-header { display:flex; justify-content:space-between; gap:12px; margin-bottom:4px; font-size:13px; opacity:.85; }
.message-time { white-space:nowrap; }
.message-body { line-height:1.5; word-break:break-word; overflow-wrap:break-word; }
.msg-unread { background:rgba(0,143,143,.06); }
[data-theme="dark"] .msg-from-office { background:var(--bg-secondary, #162E3A); }
[data-theme="dark"] .msg-unread { background:rgba(0,163,163,.12); }

/* Sidebar badge */
.sidebar-badge { display:inline-flex; align-items:center; justify-content:center; min-width:20px; height:20px; padding:0 6px; border-radius:10px; background:var(--primary); color:#fff; font-size:11px; font-weight:700; margin-left:auto; }
.sidebar-badge-danger { background:#dc2626; }

/* ─────────────────────────────────────────────────────────
 * Client sidebar — accordion sections (HTML5 details/summary).
 *
 * The <details name="client-nav"> attribute forms an exclusive
 * group in modern browsers (Chrome 120+, Firefox 128+, Safari 17.2+):
 * opening one section closes the others automatically — zero JS.
 * Older browsers behave normally (multiple can be open).
 * ───────────────────────────────────────────────────────── */

.sidebar-section { display: block; }
.sidebar-section[open] > summary .sidebar-chevron { transform: rotate(180deg); }

/* The clickable header — matches .sidebar-link shape but with a
   chevron and slightly bolder weight to distinguish "section" from
   "leaf". Reset native disclosure marker. */
.sidebar-section-summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    font-weight: 600;
}
.sidebar-section-summary::-webkit-details-marker { display: none; }
.sidebar-section-summary::marker { content: ''; }

.sidebar-section-label { flex: 1 1 auto; }
.sidebar-chevron {
    flex-shrink: 0;
    opacity: 0.5;
    transition: transform 0.2s ease;
    margin-left: 6px;
}
.sidebar-section[open] > summary { color: #0B2430; }
.sidebar-section[open] > summary svg:first-of-type { opacity: 0.9; }

/* Children of an open section — indented + smaller-weight links. */
.sidebar-sublink {
    padding-left: 38px;
    font-size: 13.5px;
    font-weight: 400;
}
.sidebar-sublink.active {
    /* Already gets .sidebar-link.active background; reinforce the
       left border so the active leaf is unmistakable inside an
       expanded section. */
    box-shadow: inset 3px 0 0 var(--accent-teal);
}

/* Dark-mode overrides. */
[data-theme="dark"] .sidebar-section[open] > summary { color: #D9D9D9; }
[data-theme="dark"] .sidebar-section[open] > summary svg:first-of-type { opacity: 1; }
[data-theme="dark"] .sidebar-sublink { color: #8899A5; }
[data-theme="dark"] .sidebar-sublink:hover { color: #ffffff; }
[data-theme="dark"] .sidebar-sublink.active { color: var(--accent-teal); box-shadow: inset 3px 0 0 var(--accent-teal); }

/* ── Tasks ───────────────────────────────────── */
.task-overdue { background:rgba(220,38,38,.06) !important; }
[data-theme="dark"] .task-overdue { background:rgba(220,38,38,.12) !important; }
.text-danger { color:#dc2626 !important; }

.priority-low { background:#e0f2fe; color:#0369a1; }
.priority-normal { background:#fef3c7; color:#92400e; }
.priority-high { background:#fee2e2; color:#dc2626; font-weight:600; }
[data-theme="dark"] .priority-low { background:#0c4a6e; color:#7dd3fc; }
[data-theme="dark"] .priority-normal { background:#78350f; color:#fde68a; }
[data-theme="dark"] .priority-high { background:#7f1d1d; color:#fca5a5; }

.status-open { background:#dbeafe; color:#1d4ed8; }
.status-in_progress { background:#fef3c7; color:#92400e; }
.status-done { background:#d1fae5; color:#065f46; }
[data-theme="dark"] .status-open { background:#162E3A; color:#93c5fd; }
[data-theme="dark"] .status-in_progress { background:#78350f; color:#fde68a; }
[data-theme="dark"] .status-done { background:#064e3b; color:#6ee7b7; }

.stat-badge { display:flex; flex-direction:column; align-items:center; padding:12px 20px; border-radius:8px; background:var(--bg-secondary, #f8fafc); border:1px solid var(--border, #e2e8f0); min-width:90px; }
.stat-badge .stat-count { font-size:24px; font-weight:700; }
.stat-badge .stat-label { font-size:12px; color:var(--text-muted); }
.stat-open .stat-count { color:#1d4ed8; }
.stat-progress .stat-count { color:#92400e; }
.stat-done .stat-count { color:#065f46; }

.badge-sm { font-size:10px; padding:1px 5px; border-radius:8px; background:var(--primary); color:#fff; vertical-align:middle; }

/* ── Mobile: Messages & Tasks ───────────────── */
@media (max-width: 768px) {
    .message-bubble { max-width: 95% !important; }
    .message-header { flex-wrap: wrap; gap: 4px; }
    .stat-badge { min-width: 70px; padding: 8px 12px; }
    .stat-badge .stat-count { font-size: 20px; }
    .filter-select { min-width: 0 !important; width: 100%; }
    .table-responsive td, .table-responsive th { padding: 8px 6px; font-size: 13px; }
}

@media (max-width: 480px) {
    .message-bubble { max-width: 100% !important; }
    .stat-badge { min-width: 60px; padding: 6px 8px; }
    .stat-badge .stat-count { font-size: 16px; }
    .table-responsive form[style*="display:inline"] { display:block !important; margin-top:4px; }
}

/* ── Tax Payments ────────────────────────────── */
.tax-do-zaplaty { background-color: #fee2e2; color: #991b1b; }
.tax-do-przeniesienia { background-color: #dcfce7; color: #166534; }
.tax-do-zwrotu { background-color: #dbeafe; color: #1e40af; }
[data-theme="dark"] .tax-do-zaplaty { background-color: #450a0a; color: #fca5a5; }
[data-theme="dark"] .tax-do-przeniesienia { background-color: #052e16; color: #86efac; }
[data-theme="dark"] .tax-do-zwrotu { background-color: #1e3a8a; color: #93c5fd; }
.tax-amount-input { width: 120px; text-align: right; padding: 6px 8px; }
.tax-status-select { min-width: 140px; padding: 6px 8px; font-size: 13px; }
.tax-legend-box { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }

@media (max-width: 768px) {
    .tax-amount-input { width: 90px; font-size: 13px; }
    .tax-status-select { min-width: 110px; font-size: 12px; }
}
@media (max-width: 480px) {
    .tax-amount-input { width: 70px; font-size: 12px; padding: 4px 6px; }
    .tax-status-select { min-width: 90px; font-size: 11px; padding: 4px 6px; }
}

/* ── Cookie Consent Banner ──────────────────── */
.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    background: #ffffff;
    border-top: 1px solid #D9D9D9;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    padding: 0;
}
.cookie-consent-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.cookie-consent-text {
    margin: 0;
    font-size: 13px;
    color: #424242;
    line-height: 1.5;
    flex: 1;
}
.cookie-consent-text a {
    color: var(--primary);
    text-decoration: underline;
}
.cookie-consent-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

[data-theme="dark"] .cookie-consent {
    background: #162E3A;
    border-top-color: #2D4551;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .cookie-consent-text {
    color: #D9D9D9;
}
[data-theme="dark"] .cookie-consent-text a {
    color: #00A3A3;
}

@media (max-width: 640px) {
    .cookie-consent-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }
    .cookie-consent-actions {
        justify-content: flex-end;
    }
}

/* ── RODO Delete Warning ───────────────────── */
.rodo-delete-warning {
    background: rgba(220,38,38,0.02);
}
[data-theme="dark"] .rodo-delete-warning {
    background: rgba(220,38,38,0.06);
    border-color: rgba(220,38,38,0.4) !important;
}

/* Modal content — light-mode default (dark override at line ~1300). */
.modal,
.modal-content { background: #ffffff; color: #1f2937; }

/* Floating menus (PDF export, bulk-progress, dropdowns over content). */
.floating-menu { background: #ffffff; border: 1px solid var(--gray-300, #d1d5db); color: #1f2937; }
[data-theme="dark"] .floating-menu { background: #162E3A; border-color: #2D4551; color: #D9D9D9; }

/* Stat grid + cards — used by dashboards (admin, e-US, office). */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
}
.stat-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
    color: #1f2937;
}
[data-theme="dark"] .stat-card {
    background: #162E3A;
    border-color: #2D4551;
    color: #D9D9D9;
}
.stat-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
[data-theme="dark"] .stat-label { color: #8899A5; }
.stat-value { font-size: 32px; font-weight: 700; line-height: 1.1; }
/* Light-mode value tints — kept readable on white card. */
.stat-value-info    { color: #2563eb; }
.stat-value-success { color: #16a34a; }
.stat-value-error   { color: #dc2626; }
.stat-value-warning { color: #f59e0b; }
.stat-value-purple  { color: #7c3aed; }
/* Dark-mode value tints — brighter so 32px numerals stay legible
   on the deep blue card. */
[data-theme="dark"] .stat-value-info    { color: #60a5fa; }
[data-theme="dark"] .stat-value-success { color: #6ee7b7; }
[data-theme="dark"] .stat-value-error   { color: #f87171; }
[data-theme="dark"] .stat-value-warning { color: #fcd34d; }
[data-theme="dark"] .stat-value-purple  { color: #c4b5fd; }

/* Recovery codes (2FA backup codes display). */
.recovery-code { padding: 6px; background: #ffffff; color: #1f2937; border-radius: 4px; border: 1px solid #d1d5db; font-family: ui-monospace, monospace; }
[data-theme="dark"] .recovery-code { background: #0B2430; color: #D9D9D9; border-color: #2D4551; }

/* Info-style note boxes — light yellow / blue / green tints used
   inline in invoice / contract templates. */
.info-box-warning { background: #fff3cd; color: #78350f; border: 1px solid #fcd34d; }
.info-box-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.info-box-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }
[data-theme="dark"] .info-box-warning { background: #78350f; color: #fde68a; border-color: #f59e0b; }
[data-theme="dark"] .info-box-info    { background: #0c4a6e; color: #7dd3fc; border-color: #38bdf8; }
[data-theme="dark"] .info-box-success { background: #064e3b; color: #6ee7b7; border-color: #10b981; }

/* Diagnostic log textarea — used by admin/gus_diagnostic and
   admin/ceidg_diagnostic for monospace API logs. */
.diagnostic-log {
    background: #fafafa;
    color: #1f2937;
    border: 1px solid #d1d5db;
}
[data-theme="dark"] .diagnostic-log {
    background: #0B2430;
    color: #D9D9D9;
    border-color: #2D4551;
}

/* ─────────────────────────────────────────────────────────
 * Dark-mode readability patches (PR: dark-mode-fixes).
 * Components below were created without [data-theme="dark"]
 * overrides — they showed light backgrounds with dark text on
 * the dark canvas, failing WCAG AA contrast.
 *
 * Naming convention:
 *   - Dark badge bg uses the "deep tone" of the badge hue
 *     (e.g. success → #064e3b emerald-900, warning → #78350f
 *     amber-900) with the matching "light tone" for text
 *     (#6ee7b7 / #fde68a). Yields ≥4.5:1 contrast on the dark
 *     #162E3A card.
 *   - For dynamic content (user-supplied colors, charts) we
 *     brighten via filter rather than hard-coding overrides.
 * ───────────────────────────────────────────────────────── */

/* Badges — currently no dark overrides exist for the .badge-*
   variants used across invoice / batch / task views. */
[data-theme="dark"] .badge-success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge-warning { background: #78350f; color: #fde68a; }
[data-theme="dark"] .badge-error,
[data-theme="dark"] .badge-danger  { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .badge-info    { background: #0c4a6e; color: #7dd3fc; }
[data-theme="dark"] .badge-default { background: #2D4551; color: #D9D9D9; }
[data-theme="dark"] .badge         { border: 1px solid transparent; }

/* Alerts — flash messages and inline notifications. Light mode
   already has these; dark mode was only partially covered. */
[data-theme="dark"] .alert-success { background: #064e3b; color: #6ee7b7; border-color: #10b981; }
[data-theme="dark"] .alert-warning { background: #78350f; color: #fde68a; border-color: #f59e0b; }
[data-theme="dark"] .alert-error,
[data-theme="dark"] .alert-danger  { background: #7f1d1d; color: #fca5a5; border-color: #ef4444; }
[data-theme="dark"] .alert-info    { background: #0c4a6e; color: #7dd3fc; border-color: #38bdf8; }

/* Comment bubbles — used by message threads (PR-D notes,
   contracts comments, etc.). Light-mode rules sit at lines
   ~981-982; this is the missing dark counterpart. */
[data-theme="dark"] .comment-mine  { background: #0c4a6e; color: #e0f2fe; }
[data-theme="dark"] .comment-other { background: #162E3A; color: #D9D9D9; border: 1px solid #2D4551; }

/* Ghost button — used on diagnostic / log pages where the
   default btn class would be too prominent. Border + bg both
   needed dark overrides. */
[data-theme="dark"] .btn-ghost {
    border-color: #2D4551;
    background: transparent;
    color: #D9D9D9;
}
[data-theme="dark"] .btn-ghost:hover { background: rgba(255,255,255,0.08); }

/* Form inputs inside dark cards — the global rule already
   handles top-level inputs but inputs inside .form-card / .card
   would inherit white. */
[data-theme="dark"] .form-card .form-input,
[data-theme="dark"] .card .form-input,
[data-theme="dark"] textarea,
[data-theme="dark"] select.form-input,
[data-theme="dark"] input[type="text"].form-input,
[data-theme="dark"] input[type="number"].form-input,
[data-theme="dark"] input[type="email"].form-input,
[data-theme="dark"] input[type="date"].form-input,
[data-theme="dark"] input[type="url"].form-input,
[data-theme="dark"] input[type="password"].form-input,
[data-theme="dark"] input[type="file"].form-input {
    background: #0B2430;
    color: #D9D9D9;
    border-color: #2D4551;
}
[data-theme="dark"] .form-input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #647580; }
[data-theme="dark"] .form-input:focus { border-color: var(--primary, #00A3A3); }
[data-theme="dark"] .form-input[disabled],
[data-theme="dark"] .form-input[readonly] { background: #0B2430; color: #647580; opacity: 0.7; }

/* Code + pre blocks — diagnostic logs, KSeF / e-US session
   files, JSON inspectors. */
[data-theme="dark"] code,
[data-theme="dark"] pre {
    background: #0B2430;
    color: #D9D9D9;
    border: 1px solid #2D4551;
}
[data-theme="dark"] details pre { border-color: #2D4551; }

/* Modals — backgrounds + overlays. Several inline
   style="background:white" in templates need the override. */
[data-theme="dark"] .modal,
[data-theme="dark"] .modal-content,
[data-theme="dark"] [role="dialog"] { background: #162E3A; color: #D9D9D9; border-color: #2D4551; }
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,0.6); }

/* Tabs — used in client_edit (Contact / Tax / SFTP) and
   contracts module. Active tab indicator needs adjustment. */
[data-theme="dark"] .tabs { border-bottom-color: #2D4551; }
[data-theme="dark"] .tab-link { color: #8899A5; }
[data-theme="dark"] .tab-link:hover { color: #D9D9D9; }
[data-theme="dark"] .tab-link.active { color: #00A3A3; border-bottom-color: #00A3A3; }

/* Stat cards (admin / e-US dashboards) — cards have inline
   dynamic colors for the number; we brighten only the value
   text rather than overriding each color individually. */
[data-theme="dark"] .stat-card {
    background: #162E3A;
    border-color: #2D4551;
    color: #D9D9D9;
}

/* Hard-coded accent colors in inline styles — defensive global
   filter so legacy templates render brighter on dark canvas
   without per-template edits. Targeted pattern matching only. */
[data-theme="dark"] [style*="color:#2563eb"],
[data-theme="dark"] [style*="color:#1e40af"],
[data-theme="dark"] [style*="color:#2563EB"] { color: #60a5fa !important; }
[data-theme="dark"] [style*="color:#dc2626"],
[data-theme="dark"] [style*="color:#991b1b"],
[data-theme="dark"] [style*="color:#ef4444"],
[data-theme="dark"] [style*="color:#DC2626"] { color: #f87171 !important; }
[data-theme="dark"] [style*="color:#16a34a"],
[data-theme="dark"] [style*="color:#15803d"],
[data-theme="dark"] [style*="color:#166534"],
[data-theme="dark"] [style*="color:#16A34A"] { color: #86efac !important; }
[data-theme="dark"] [style*="color:#f59e0b"],
[data-theme="dark"] [style*="color:#92400e"],
[data-theme="dark"] [style*="color:#78350f"],
[data-theme="dark"] [style*="color:#F59E0B"] { color: #fcd34d !important; }
[data-theme="dark"] [style*="color:#7c3aed"],
[data-theme="dark"] [style*="color:#4338ca"],
[data-theme="dark"] [style*="color:#7C3AED"] { color: #c4b5fd !important; }
[data-theme="dark"] [style*="color:#d97706"],
[data-theme="dark"] [style*="color:#b45309"] { color: #fcd34d !important; }
[data-theme="dark"] [style*="color:#0f766e"],
[data-theme="dark"] [style*="color:#0d9488"] { color: #5eead4 !important; }
[data-theme="dark"] [style*="color:#581c87"],
[data-theme="dark"] [style*="color:#6b21a8"] { color: #d8b4fe !important; }

/* Hard-coded light backgrounds in inline styles — soften so
   they remain on-theme without being eyeball-burning. */
[data-theme="dark"] [style*="background:#f3f4f6"],
[data-theme="dark"] [style*="background:#f9fafb"],
[data-theme="dark"] [style*="background:#f5f5f5"],
[data-theme="dark"] [style*="background-color:#f3f4f6"],
[data-theme="dark"] [style*="background:#fff"] { background: #162E3A !important; }
[data-theme="dark"] [style*="background:#e5e7eb"],
[data-theme="dark"] [style*="background:#dbeafe"],
[data-theme="dark"] [style*="background:#dcfce7"],
[data-theme="dark"] [style*="background:#fef3c7"],
[data-theme="dark"] [style*="background:#fee2e2"],
[data-theme="dark"] [style*="background:#e0e7ff"],
[data-theme="dark"] [style*="background:#fff3cd"],
[data-theme="dark"] [style*="background:#fde68a"] { filter: brightness(0.45) saturate(1.2); }

/* Mono font utility for numeric data */
.font-mono { font-family: 'Roboto Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; }

/* Safe area insets for notch devices */
@supports (padding: env(safe-area-inset-bottom)) {
    .footer { padding-bottom: env(safe-area-inset-bottom); }
    .navbar { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
    .cookie-consent { padding-bottom: env(safe-area-inset-bottom); }
}

/* ──────────────────────────────────────────────────────────────
   Client dashboard — docelowy układ (Todoist: Optymalizacja UI/UX,
   task "Docelowy układ billu od strony KLIENT"). Order:
     1. greeting (H1)  2. stats grid  3. komunikacja  4. quick actions
     5. miesiąc tabbed card  6. contact cards  7. NBP rates strip
   ────────────────────────────────────────────────────────────── */
.dashboard-greeting {
    font-size: 28px; font-weight: 700; margin: 0 0 20px 0;
    color: var(--text-primary, #0B2430); letter-spacing: -0.01em;
}

/* Miesiąc card */
.dashboard-month-card {
    border: 2px solid var(--accent-teal, #008F8F);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    background: var(--card-bg, #fff);
    color: var(--text-primary, #0B2430);
}
.dashboard-month-header h3 {
    margin: 0 0 16px 0;
    font-size: 20px;
    font-weight: 700;
}
.dashboard-month-body {
    min-height: 110px;
    padding: 12px 0 24px;
}
.dashboard-month-tabs {
    display: flex; gap: 24px; flex-wrap: wrap;
    border-top: 1px solid var(--gray-200, #e5e7eb);
    padding-top: 14px; margin-top: 12px;
}
.dashboard-month-tab {
    background: transparent; border: none; padding: 4px 0;
    font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
    color: var(--gray-500, #6b7280);
    cursor: pointer; text-transform: uppercase;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
}
.dashboard-month-tab:hover { color: var(--text-primary, #0B2430); }
.dashboard-month-tab.active {
    color: var(--accent-teal, #008F8F);
    border-bottom-color: var(--accent-teal, #008F8F);
}
[data-theme="dark"] .dashboard-month-card { background: #162E3A; color: #f1f5f9; }
[data-theme="dark"] .dashboard-month-tab { color: #94a3b8; }
[data-theme="dark"] .dashboard-month-tab:hover { color: #f1f5f9; }

/* NBP strip — stopka dashboardu */
.dashboard-nbp-strip {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    padding: 14px 20px; margin: 8px 0 24px;
    background: var(--gray-50, #f9fafb);
    border-radius: 8px;
    font-size: 13px; color: var(--gray-700, #374151);
}
.dashboard-nbp-icon { display: inline-flex; color: var(--accent-teal, #008F8F); }
.dashboard-nbp-label { font-weight: 600; color: var(--gray-500, #6b7280); }
.dashboard-nbp-rate { display: inline-flex; align-items: baseline; gap: 4px; }
.dashboard-nbp-rate strong { color: var(--text-primary, #0B2430); font-weight: 600; }
.dashboard-nbp-rate small { color: var(--gray-400, #9ca3af); font-size: 11px; margin-left: 2px; }
[data-theme="dark"] .dashboard-nbp-strip { background: rgba(255,255,255,0.04); color: #cbd5e1; }
[data-theme="dark"] .dashboard-nbp-rate strong { color: #f1f5f9; }

/* ──────────────────────────────────────────────────────────────
   Client UI follow-ups (user feedback po PR #76):
   1. Logo licowane do lewej krawędzi sidebara
   2. Ujednolicone tła (białe wszędzie, oszczędniejsze ramki)
   3. Dark mode dla stat-badge na /client/tasks
   ────────────────────────────────────────────────────────────── */

/* Desktop: logo w topbarze licowane do lewej krawędzi sidebara (260px),
   żeby kolumna logo + sidebar tworzyła spójny lewy kanał. */
@media (min-width: 1024px) {
    .nav-container { max-width: none; padding: 0; }
    .nav-topbar-left {
        width: 260px;
        padding-left: 16px;
        padding-right: 12px;
        box-sizing: border-box;
    }
    .nav-topbar-right {
        padding-right: 24px;
    }
}

/* Dashboard month-card + komunikacja widget — białe tło, oszczędna ramka.
   Wewnętrzne mini-cards (Otwarte/Nierozpoczęte/Nieprzeczytane) bez szarego
   wypełnienia żeby cała sekcja wyglądała spójnie i "lekko". */
.dashboard-month-card { background: #ffffff; }
[data-theme="dark"] .dashboard-month-card { background: #162E3A; }

/* Komunikacja widget (zielona ramka) — białe tło, mini-stats też białe z
   subtle border zamiast solid background. */
div[style*="border:2px solid var(--success"][style*="border-radius:12px"] {
    background: #ffffff !important;
}
div[style*="border:2px solid var(--success"][style*="border-radius:12px"] > div > div[style*="background:var(--gray-50"] {
    background: #ffffff !important;
    border: 1px solid var(--gray-200, #e5e7eb);
}
[data-theme="dark"] div[style*="border:2px solid var(--success"][style*="border-radius:12px"] {
    background: #162E3A !important;
}
[data-theme="dark"] div[style*="border:2px solid var(--success"][style*="border-radius:12px"] > div > div[style*="background:var(--gray-50"] {
    background: rgba(255,255,255,0.04) !important;
    border-color: #2D4551;
}

/* Dark mode dla /client/tasks stat-badge — kwadraty Otwarte/W toku/Zrobione
   miały hard-coded jasne tło (--bg-secondary, #f8fafc) co dawało białe boxy
   na ciemnym layoucie. */
[data-theme="dark"] .stat-badge {
    background: rgba(255,255,255,0.04);
    border-color: #2D4551;
}
[data-theme="dark"] .stat-badge .stat-label { color: rgba(255,255,255,0.7); }
[data-theme="dark"] .stat-open .stat-count { color: #60a5fa; }
[data-theme="dark"] .stat-progress .stat-count { color: #fbbf24; }
[data-theme="dark"] .stat-done .stat-count { color: #4ade80; }
[data-theme="dark"] .stat-badge .stat-count { color: inherit; }

/* ──────────────────────────────────────────────────────────────
   Bez ramek + soft shadows (decyzja po rozmowie z Arkiem, 15.05.2026)
   Cel: lekki materialowy layout — pola jasne, tło szare/ciemne,
   ramki zastąpione box-shadow. Kontrast karta vs tło tworzy hierarchię.
   ────────────────────────────────────────────────────────────── */

/* Tło strony — wyraźnie szare zamiast prawie-białego (kontrast karty vs tło) */
body { background: #E5E7EB; }
[data-theme="dark"] body { background: #0B2430; }
.app-main { background: transparent; }

/* Wszystkie karty: białe + soft shadow zamiast ramki */
.form-card,
.stat-card,
.contact-card,
.card,
.dashboard-month-card,
.batch-card,
.batch-info,
.info-card,
.result-card,
.auth-card,
.chart-card,
.notif-item,
.empty-state,
.filter-bar,
.bulk-bar {
    border: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
}

/* Hover lift — tylko interaktywne karty (stat, contact, card) */
.stat-card:hover,
.contact-card:hover,
.card:hover {
    box-shadow: 0 2px 6px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.10);
    /* Translateelm zostaje z istniejących definicji */
}

/* stat-badge (na /client/tasks) — białe, bez ramki, lekki shadow */
.stat-badge {
    border: none !important;
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
}

/* Alerty bez ramek — kolorowe tło wystarczająco komunikuje */
.alert,
.alert-success,
.alert-error,
.alert-info,
.alert-warning { border: none !important; }

/* Dark mode: usuń border-color z dziedziczonych reguł + mocniejszy shadow */
[data-theme="dark"] .form-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .stat-badge,
[data-theme="dark"] .contact-card,
[data-theme="dark"] .card,
[data-theme="dark"] .dashboard-month-card,
[data-theme="dark"] .batch-card,
[data-theme="dark"] .batch-info,
[data-theme="dark"] .info-card,
[data-theme="dark"] .result-card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .chart-card,
[data-theme="dark"] .notif-item,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .bulk-bar {
    border-color: transparent !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.25);
}
[data-theme="dark"] .stat-badge { background: #162E3A !important; }

/* Komunikacja widget — wcześniej miał inline border:2px solid var(--success).
   Override: bez border, zostaje subtle box-shadow. */
div[style*="border:2px solid var(--success"][style*="border-radius:12px"] {
    border: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06) !important;
}
div[style*="border:2px solid var(--info"][style*="border-radius:12px"] {
    border: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06) !important;
    background: #ffffff !important;
}
[data-theme="dark"] div[style*="border:2px solid var(--info"][style*="border-radius:12px"] {
    background: #162E3A !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.25) !important;
}

/* Mini-stats wewnątrz Komunikacji (Otwarte/Nierozpoczęte/Nieprzeczytane)
   — szare tło na białej karcie żeby się odznaczały (zamiast border). */
div[style*="border:2px solid var(--success"] > div > div[style*="background:var(--gray-50"] {
    border: none !important;
    background: #F3F4F6 !important;
}
[data-theme="dark"] div[style*="border:2px solid var(--success"] > div > div[style*="background:var(--gray-50"] {
    border: none !important;
    background: rgba(0,0,0,0.2) !important;
}

/* dashboard-month-card: ramka teal całkowicie usunięta (po decyzji "bez akcentu") */
.dashboard-month-card { border: none !important; }

/* form-input bez border w karcie — zachowujemy bo input musi mieć ramkę dla UX,
   ale przyciemniamy żeby pasowała do nowego tła */
.form-input { border-color: #D1D5DB; }
[data-theme="dark"] .form-input { border-color: #2D4551; }

/* Topbar i sidebar: tła neutralne (białe) ale bez border-bottom — zastępujemy shadow */
.navbar { border-bottom: none; box-shadow: 0 1px 2px rgba(0,0,0,0.04); }
.app-sidebar { border-right: none; box-shadow: 1px 0 2px rgba(0,0,0,0.03); }
[data-theme="dark"] .navbar { border-bottom: none; box-shadow: 0 1px 2px rgba(0,0,0,0.4); }
[data-theme="dark"] .app-sidebar { border-right: none; box-shadow: 1px 0 2px rgba(0,0,0,0.4); }

/* dashboard-soft-card: wymiennik dla inline border:2px solid var(--success/info)
   na widgetach Komunikacja i ex-tax-payments. Białe tło + soft shadow,
   bez ramki — spójne ze wszystkimi kartami. */
.dashboard-soft-card {
    background: #ffffff;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);
}
.dashboard-soft-card > div > div[style*="background:var(--gray-50"] {
    background: #F3F4F6 !important;
    border: none !important;
}
[data-theme="dark"] .dashboard-soft-card {
    background: #162E3A;
    box-shadow: 0 2px 6px rgba(0,0,0,0.35), 0 8px 24px rgba(0,0,0,0.25);
}
[data-theme="dark"] .dashboard-soft-card > div > div[style*="background:var(--gray-50"] {
    background: rgba(0,0,0,0.2) !important;
}

/* Pulsujący alert: karta "Wyślij do KSeF" gdy są FV nie-wysłane
   (decyzja usera: zwrócić uwagę kolorem + animacją). */
@keyframes ksef-send-pulse {
    0%, 100% {
        box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06),
                    0 0 0 0 rgba(220, 38, 38, 0.5);
    }
    50% {
        box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.06),
                    0 0 0 8px rgba(220, 38, 38, 0);
    }
}
.ksef-send-pending-pulse {
    animation: ksef-send-pulse 1.6s ease-in-out infinite;
    border: 1px solid #fca5a5 !important;
}
[data-theme="dark"] .ksef-send-pending-pulse {
    border-color: #7f1d1d !important;
}
.ksef-send-pending-pulse:hover {
    animation-play-state: paused;
}
