/* BizPanel — Light (Style 1) + Dark (Style 3) */

:root,
[data-effective-theme="light"] {
    --bg: #ffffff;
    --bg-secondary: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-2: #8b5cf6;
    --accent-soft: rgba(59, 130, 246, 0.1);
    --success: #10b981;
    --error: #ef4444;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --sidebar-width: 64px;
    --sidebar-expanded: 240px;
    --header-height: 64px;
    --radius: 8px;
    --font: 'Inter', 'Vazirmatn', system-ui, sans-serif;
}

[data-effective-theme="dark"] {
    --bg: #0a0a0b;
    --bg-secondary: #111113;
    --card: #141416;
    --border: #27272a;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --accent: #8b5cf6;
    --accent-2: #06b6d4;
    --accent-soft: rgba(139, 92, 246, 0.15);
    --success: #34d399;
    --error: #f87171;
    --shadow: none;
}

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

html, body {
    height: 100%;
    font-family: var(--font);
    background: var(--bg-secondary);
    color: var(--text);
    line-height: 1.5;
}

body.rtl { font-family: 'Vazirmatn', 'Inter', system-ui, sans-serif; }

a { color: var(--accent); text-decoration: none; }
a:hover { opacity: 0.85; }

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

body.rtl .app-shell { flex-direction: row-reverse; }

.app-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin-inline-start: var(--sidebar-width);
    transition: margin 0.2s ease;
}

body.sidebar-expanded .app-main {
    margin-inline-start: var(--sidebar-expanded);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--card);
    border-inline-end: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width 0.2s ease;
}

body.sidebar-expanded .sidebar {
    width: var(--sidebar-expanded);
}

.sidebar-top {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    border-bottom: 1px solid var(--border);
    min-height: var(--header-height);
}

.sidebar-toggle, .sidebar-collapse {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-toggle:hover, .sidebar-collapse:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.sidebar-toggle svg, .sidebar-collapse svg { width: 20px; height: 20px; }

body.rtl .sidebar-collapse svg { transform: scaleX(-1); }

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    overflow: hidden;
    white-space: nowrap;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.brand-text {
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

body.sidebar-expanded .brand-text { opacity: 1; }

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: all 0.15s ease;
    position: relative;
    white-space: nowrap;
}

.nav-item:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.nav-item.active {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 500;
}

[data-effective-theme="dark"] .nav-item.active {
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.3);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent), var(--accent-2));
}

body.rtl .nav-item.active::before {
    border-radius: 3px 0 0 3px;
    inset-inline-start: auto;
    inset-inline-end: 0;
}

.nav-icon svg { width: 20px; height: 20px; flex-shrink: 0; }

.nav-label {
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

body.sidebar-expanded .nav-label { opacity: 1; }

.sidebar-collapse {
    margin: 8px;
    border-top: 1px solid var(--border);
    padding-top: 16px;
}

/* Header */
.app-header {
    height: var(--header-height);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
}

.header-end {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tenant Switcher */
.tenant-switcher { position: relative; }

.tenant-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

.tenant-btn svg { width: 16px; height: 16px; }
.tenant-btn .chevron { width: 14px; height: 14px; opacity: 0.5; }

.tenant-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-end: 0;
    min-width: 200px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 200;
    overflow: hidden;
}

.tenant-switcher.open .tenant-dropdown { display: block; }

.tenant-option {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
}

.tenant-option:hover { background: var(--accent-soft); }
.tenant-option.active { color: var(--accent); font-weight: 500; }

/* Locale & Theme */
.locale-switch, .theme-switch {
    display: flex;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.locale-switch a, .theme-switch button {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.locale-switch a.active, .theme-switch button.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.theme-switch button svg { width: 14px; height: 14px; display: block; }

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    color: var(--text-muted);
    cursor: pointer;
}

.icon-btn svg { width: 18px; height: 18px; display: block; }

/* User Menu */
.user-menu { position: relative; }

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 10px 4px 4px;
    cursor: pointer;
    color: var(--text);
    font-family: inherit;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.user-name { font-size: 13px; }

.user-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-end: 0;
    min-width: 140px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 200;
}

.user-menu.open .user-dropdown { display: block; }

.user-dropdown a {
    display: block;
    padding: 10px 14px;
    color: var(--text);
    font-size: 13px;
}

.user-dropdown a:hover { background: var(--accent-soft); }

/* Content */
.app-content {
    padding: 24px 28px 40px;
    flex: 1;
    max-width: 1400px;
    width: 100%;
}

/* Breadcrumb & page header */
.breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-current { color: var(--text); font-weight: 500; }
.breadcrumb-sep { opacity: 0.4; }

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

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

.page-heading {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.page-subheading {
    color: var(--text-muted);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Module tabs */
.module-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: fit-content;
    max-width: 100%;
    overflow-x: auto;
}

.module-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: all 0.15s;
}

.module-tab:hover { color: var(--text); background: var(--card); }
.module-tab.active {
    background: var(--card);
    color: var(--accent);
    box-shadow: var(--shadow);
}

/* Layout grids */
.content-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
}

.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1100px) {
    .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .kpi-grid-4 { grid-template-columns: 1fr; }
}

/* Enhanced cards */
.card-elevated {
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
}

[data-effective-theme="dark"] .card-elevated {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.kpi-card-accent {
    background: linear-gradient(135deg, var(--accent-soft), transparent);
    border-color: rgba(59, 130, 246, 0.2);
}

.kpi-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.kpi-icon.income { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.kpi-icon svg { width: 18px; height: 18px; }

.kpi-meta { font-size: 12px; color: var(--text-muted); }

.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-muted { color: var(--text-muted); }

/* Tags & amounts */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: color-mix(in srgb, var(--tag-color) 12%, transparent);
    color: var(--tag-color);
}

.amount-cell { font-weight: 600; font-variant-numeric: tabular-nums; }
.amount-cell.positive { color: var(--success); }
.amount-cell.negative { color: var(--error); }

/* Accounts list */
.account-list { padding: 8px 0 !important; }

.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}

.account-row:last-child { border-bottom: none; }

.account-name { font-weight: 500; font-size: 14px; display: block; }
.account-type { font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.account-balance { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Buttons */
.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover { background: var(--border); }

.btn-ghost {
    background: transparent;
    color: var(--accent);
    border: none;
    padding: 6px 10px;
}

.btn-ghost:hover { background: var(--accent-soft); }

/* Quick actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.quick-action-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg-secondary);
    color: var(--text);
    transition: all 0.15s;
}

.quick-action-card:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.quick-action-title { font-weight: 600; font-size: 14px; }
.quick-action-link { font-size: 12px; color: var(--accent); }

/* Module placeholder */
.module-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
}

.module-placeholder-card {
    text-align: center;
    max-width: 400px;
    padding: 48px 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.module-placeholder-icon {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    background: color-mix(in srgb, var(--module-color) 15%, transparent);
    color: var(--module-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.module-placeholder-icon svg { width: 32px; height: 32px; }

.module-placeholder-card h2 { font-size: 20px; margin-bottom: 8px; }
.module-placeholder-card p { color: var(--text-muted); margin-bottom: 16px; }

.module-placeholder-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 20px;
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-trial { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

/* Header polish */
.app-header {
    backdrop-filter: blur(12px);
    background: color-mix(in srgb, var(--card) 92%, transparent);
}

[data-effective-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #0f0f11 0%, #141416 100%);
}

/* Responsive */
.welcome-banner {
    margin-bottom: 24px;
}

.welcome-banner h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 4px;
}

.welcome-banner p { color: var(--text-muted); font-size: 14px; }

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-grid-1 { grid-template-columns: minmax(200px, 280px); }

.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

[data-effective-theme="dark"] .kpi-card {
    background: linear-gradient(145deg, #141416, #1a1a1f);
}

.kpi-label {
    font-size: 13px;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 24px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.kpi-change {
    font-size: 12px;
    font-weight: 500;
}

.kpi-change.positive { color: var(--success); }
.kpi-change.negative { color: var(--error); }

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 { font-size: 16px; font-weight: 600; }

.card-body { padding: 20px; }

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 20px;
}

.empty-state-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.inline-delete-form {
    display: inline;
}

.btn.text-error {
    color: var(--error);
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 90;
}

body.sidebar-backdrop-open .sidebar-backdrop {
    display: block;
}

body.sidebar-mobile-open .sidebar {
    z-index: 100;
}

/* Table */
.table-wrap { overflow-x: auto; padding: 0; }

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th {
    text-align: start;
    padding: 12px 16px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.data-table tbody tr:hover { background: var(--accent-soft); }

.data-table-compact td { padding: 10px 16px; }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--accent-soft);
    color: var(--accent);
}

.badge-active { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-trial { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-suspended { background: rgba(239, 68, 68, 0.15); color: var(--error); }
.badge-paid,
.badge-completed { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-pending,
.badge-draft,
.badge-planning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge-filed,
.badge-on_hold { background: rgba(59, 130, 246, 0.15); color: var(--accent); }
.badge-expired,
.badge-inactive { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); }

.text-sm { font-size: 12px; }

/* Forms */
.form-card { max-width: 640px; }

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

@media (max-width: 600px) {
    .app-form .form-row { grid-template-columns: 1fr; }
}

.app-form select,
.app-form input[type="date"],
.app-form input[type="number"],
.app-form input[type="text"],
.app-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.app-form select:focus,
.app-form input:focus,
.app-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.page-header .btn { flex-shrink: 0; }

.settings-meta {
    margin: 20px 0;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.settings-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.settings-meta-row + .settings-meta-row {
    border-top: 1px solid var(--border);
}

/* Progress bar */
.progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
    min-width: 80px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.module-tag {
    display: inline-block;
    padding: 2px 8px;
    margin: 2px;
    border-radius: 4px;
    font-size: 11px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Auth */
.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.auth-wrapper { width: 100%; max-width: 420px; padding: 24px; }

.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: var(--shadow);
}

[data-effective-theme="dark"] .auth-card {
    background: linear-gradient(145deg, #141416, #1a1a1f);
}

.auth-brand { text-align: center; margin-bottom: 28px; }

.brand-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 12px;
}

.auth-brand h1 { font-size: 20px; margin-bottom: 4px; }
.auth-brand p { color: var(--text-muted); font-size: 14px; }

.auth-form h2 { font-size: 18px; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #fff;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-block { width: 100%; }

.demo-hint {
    margin-top: 16px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.auth-footer { margin-top: 20px; text-align: center; }
.auth-locale a { font-size: 13px; color: var(--text-muted); padding: 0 6px; }
.auth-locale a.active { color: var(--accent); font-weight: 600; }

.coming-soon-icon svg {
    width: 48px;
    height: 48px;
    color: var(--accent);
    margin-bottom: 12px;
}

.coming-soon h4 { margin-bottom: 8px; }

/* Module sub-navigation */
.module-subnav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding-bottom: 4px;
    margin-bottom: 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.module-subnav::-webkit-scrollbar { display: none; }

.module-subnav-item {
    flex-shrink: 0;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    white-space: nowrap;
    transition: all 0.15s;
}

.module-subnav-item:hover {
    color: var(--text);
    border-color: var(--accent);
}

.module-subnav-item.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    border-color: transparent;
}

/* CEO dashboard */
.ceo-kpi-grid {
    margin-bottom: 20px;
}

.kpi-grid-4 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.text-success { color: var(--success); }
.text-error { color: var(--error); }

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

[data-effective-theme="dark"] .alert-warning {
    color: #fbbf24;
}

.budget-alerts div + div { margin-top: 4px; }

/* Cashflow chart */
.cashflow-chart { display: flex; flex-direction: column; gap: 8px; }

.cashflow-row {
    display: grid;
    grid-template-columns: 90px 1fr 80px;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.cashflow-date { color: var(--text-muted); font-size: 12px; }

.cashflow-bar-wrap {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.cashflow-bar {
    height: 100%;
    border-radius: 4px;
    min-width: 2px;
}

.cashflow-bar.positive { background: var(--success); }
.cashflow-bar.negative { background: var(--error); }

.cashflow-value { text-align: end; font-weight: 500; font-size: 12px; }

.account-list { display: flex; flex-direction: column; gap: 10px; }

.account-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.account-row:last-child { border-bottom: none; }

.account-info { display: flex; flex-direction: column; gap: 2px; }
.account-name { font-weight: 500; }
.account-type { font-size: 12px; color: var(--text-muted); }
.account-balance { font-weight: 600; }

/* Notifications */
.notification-menu { position: relative; }

.notification-btn { position: relative; }

.notification-badge {
    position: absolute;
    top: 2px;
    inset-inline-end: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--error);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    width: min(320px, 90vw);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 200;
}

.notification-menu.open .notification-dropdown { display: block; }

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    font-weight: 600;
}

.notification-dropdown-body {
    max-height: 280px;
    overflow-y: auto;
}

.notification-dropdown-item {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.notification-dropdown-item:last-child { border-bottom: none; }

.notification-list { list-style: none; }

.notification-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}

.notification-item:last-child { border-bottom: none; }

.notification-time { font-size: 12px; display: block; margin-top: 4px; }

.kanban-board-6 { display: grid; grid-template-columns: repeat(6, minmax(140px, 1fr)); gap: 10px; margin-top: 20px; overflow-x: auto; }
.kanban-dropzone.drag-over { background: var(--primary-soft, rgba(99,102,241,0.1)); min-height: 60px; }
.health-green { background: #16a34a; color: #fff; }
.health-yellow { background: #ca8a04; color: #fff; }
.health-red { background: #dc2626; color: #fff; }
.project-subnav { margin-bottom: 16px; flex-wrap: wrap; }
@media (max-width: 900px) { .kanban-board-6 { grid-template-columns: repeat(3, 1fr); } }


.header-search input {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-secondary);
    color: var(--text);
    font-size: 13px;
    min-width: 160px;
}

.search-results-list { list-style: none; padding: 12px 16px; }
.search-results-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.search-results-list li:last-child { border-bottom: none; }

.org-node { padding: 6px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.checkbox-grid, .permissions-fieldset { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; }

.user-edit-details summary { cursor: pointer; list-style: none; }
.user-edit-details[open] summary { margin-bottom: 8px; }

.badge-transfer { background: var(--accent-soft); color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
    .app-main { margin-inline-start: 0; }
    .sidebar { transform: translateX(-100%); }
    body.rtl .sidebar { transform: translateX(100%); }
    body.sidebar-mobile-open .sidebar { transform: translateX(0); width: var(--sidebar-expanded); }
    body.sidebar-mobile-open .nav-label, body.sidebar-mobile-open .brand-text { opacity: 1; }
    .user-name { display: none; }
    .page-title { font-size: 16px; }
    .app-content { padding: 16px; }
    .kpi-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .cashflow-row { grid-template-columns: 70px 1fr 60px; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .header-search { display: none; }
}
