/* ==================== Variables ==================== */
:root {
  --sidebar-width: 256px;
  --header-height: 64px;
  --color-primary: #00685f;
  --color-primary-hover: #008378;
  --color-primary-light: #f0fdfa;
  --color-sidebar: #0f172a;
  --color-sidebar-hover: #1e293b;
  --color-bg: #f7f9fb;
  --color-white: #ffffff;
  --color-text: #191c1e;
  --color-text-secondary: #545f73;
  --color-text-muted: #94a3b8;
  --color-border: rgba(188,201,198,0.3);
  --color-border-light: #f2f4f6;
  --color-danger: #ba1a1a;
  --color-success: #00685f;
  --color-purple: #8b5cf6;
  --color-blue: #3b82f6;
  --color-passiv: #b05e3d;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow: 0 4px 6px -1px rgba(226,232,240,0.4), 0 2px 4px -2px rgba(226,232,240,0.4);
  --shadow-lg: 0 20px 25px -5px rgba(226,232,240,0.5), 0 8px 10px -6px rgba(226,232,240,0.5);
  --shadow-primary: 0 10px 15px -3px rgba(0,104,95,0.2), 0 4px 6px -4px rgba(0,104,95,0.2);
}

/* ==================== Reset ==================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, -apple-system, sans-serif; color: var(--color-text); background: var(--color-bg); line-height: 1.5; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
table { width: 100%; border-collapse: collapse; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* ==================== Auth Pages ==================== */
.auth-page { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%); position: relative; }
.auth-card { background: var(--color-white); border-radius: var(--radius-xl); box-shadow: 0 20px 25px -5px rgba(15,23,42,0.08); padding: 40px; width: 100%; max-width: 420px; }
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo h1 { font-size: 24px; font-weight: 700; color: var(--color-text); letter-spacing: -0.6px; }
.auth-logo p { color: var(--color-text-secondary); font-size: 14px; letter-spacing: 1.4px; text-transform: uppercase; opacity: 0.8; }
.auth-separator { text-align: center; margin: 24px 0; position: relative; }
.auth-separator::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--color-border); }
.auth-separator span { background: var(--color-white); padding: 0 12px; position: relative; color: var(--color-text-secondary); font-size: 13px; }
.auth-logo-icon { width: 40px; height: 40px; background: #00685f; color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; margin: 0 auto 12px; }
.auth-logo p { font-size: 12px; letter-spacing: 0.15em; color: var(--color-text-secondary); }
.auth-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 13px; }
.checkbox-label { display: flex; align-items: center; gap: 6px; color: var(--color-text-secondary); cursor: pointer; }
.checkbox-label input { width: 16px; height: 16px; accent-color: var(--color-primary); }
.auth-forgot { color: #00685f; font-weight: 600; font-size: 13px; }
.auth-footer { text-align: center; font-size: 14px; color: var(--color-text-secondary); }
.auth-footer a { font-weight: 600; }
.auth-copyright { margin-top: 24px; font-size: 11px; color: var(--color-text-secondary); letter-spacing: 0.05em; }
.input-icon-wrap { position: relative; }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; opacity: 0.4; pointer-events: none; }
.input-with-icon { padding-left: 42px !important; }
.password-toggle { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 16px; cursor: pointer; padding: 4px; opacity: 0.4; transition: opacity 0.15s; }
.password-toggle:hover { opacity: 0.8; }

/* ==================== Layout ==================== */
.app-layout { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: var(--sidebar-width); background: var(--color-sidebar); color: #cbd5e1; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.sidebar-logo { padding: 20px 24px; border-bottom: none; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.sidebar-logo-icon { width: 40px; height: 40px; background: #0d9488; color: white; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sidebar-logo h2 { color: var(--color-white); font-size: 20px; font-weight: 700; letter-spacing: -0.5px; margin: 0; }
.sidebar-logo-sub { font-size: 10px; color: #2dd4bf; letter-spacing: 1px; text-transform: uppercase; }
.sidebar-nav { flex: 1; padding: 12px 12px; overflow-y: auto; }
.nav-item { display: flex; align-items: center; padding: 12px 16px; color: #94a3b8; font-size: 14px; transition: all 0.15s; border-radius: 8px; gap: 12px; }
.nav-item:hover { background: rgba(255,255,255,0.05); color: #e2e8f0; text-decoration: none; }
.nav-item.active { color: #2dd4bf; background: rgba(15,118,110,0.2); border-right: 4px solid #14b8a6; font-weight: 600; }
.nav-item.sub { padding-left: 52px; font-size: 13px; color: #94a3b8; }
.nav-item.sub:hover { color: #e2e8f0; }
.nav-item.sub.active { color: #2dd4bf; }
.nav-icon { margin-right: 12px; font-size: 16px; }
.nav-group-title { display: flex; align-items: center; padding: 10px 24px; color: #94a3b8; font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s; }
.nav-group-title:hover { background: var(--color-sidebar-hover); color: #e2e8f0; }
.nav-chevron { margin-left: auto; font-size: 12px; transition: transform 0.2s; }
.nav-group.open .nav-chevron { transform: rotate(90deg); }
.nav-group-items { display: none; }
.nav-group.open .nav-group-items { display: block; }

.sidebar-cta { padding: 12px 16px; }
.sidebar-user { padding: 16px 24px; border-top: 1px solid #334155; display: flex; align-items: center; justify-content: space-between; }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--color-primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; }
.user-name { color: #e2e8f0; font-size: 13px; font-weight: 500; }
.user-email { color: #64748b; font-size: 11px; }
.logout-btn { color: #64748b; font-size: 18px; padding: 4px; }
.logout-btn:hover { color: var(--color-danger); text-decoration: none; }

/* Main wrapper */
.main-wrapper { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }

/* Top Header */
.top-header { height: var(--header-height); background: rgba(248,250,252,0.8); backdrop-filter: blur(6px); border-bottom: 1px solid rgba(226,232,240,0.5); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 50; }
.company-selector { display: flex; align-items: center; gap: 8px; color: var(--color-text); font-weight: 500; padding: 6px 12px; border-radius: var(--radius); }
.company-selector:hover { background: var(--color-bg); text-decoration: none; }
.company-icon { font-size: 18px; }
.company-chevron { font-size: 10px; color: var(--color-text-secondary); }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-divider { color: var(--color-border); }
.header-company { color: var(--color-text-secondary); font-size: 13px; font-weight: 500; }
.header-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--color-primary); color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; text-decoration: none; }

/* Content */
.content { padding: 32px; flex: 1; }

/* ==================== Components ==================== */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.75px; color: var(--color-text); }
.page-actions { display: flex; gap: 8px; }
.page-subtitle { display: block; font-size: 11px; font-weight: 600; color: var(--color-text-secondary); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.back-link { display: block; color: var(--color-text-secondary); font-size: 13px; margin-bottom: 4px; }

/* Cards */
.card { background: var(--color-white); border-radius: var(--radius-lg); box-shadow: 0 1px 2px rgba(0,0,0,0.05); border: 1px solid rgba(188,201,198,0.1); overflow: hidden; margin-bottom: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--color-border); }
.card-header h2 { font-size: 16px; }

.form-card { background: var(--color-white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 32px; max-width: 560px; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--color-white); border-radius: var(--radius-xl); box-shadow: 0 1px 2px rgba(0,0,0,0.05); padding: 24px 24px 24px 28px; border-left: 4px solid transparent; min-height: 140px; }
.stat-card:nth-child(1) { border-left-color: #3b82f6; }
.stat-card:nth-child(2) { border-left-color: #00685f; }
.stat-card:nth-child(3) { border-left-color: #a855f7; }
.stat-card:nth-child(4) { border-left-color: #14b8a6; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 16px; }
.stat-icon.blue { background: rgba(59,130,246,0.1); }
.stat-icon.green { background: rgba(0,104,95,0.1); }
.stat-icon.purple { background: rgba(168,85,247,0.1); }
.stat-icon.teal { background: rgba(20,184,166,0.1); }
.stat-label { font-size: 14px; font-weight: 500; color: var(--color-text-secondary); margin-bottom: 8px; }
.stat-value { font-size: 30px; font-weight: 900; color: var(--color-text); letter-spacing: -0.75px; }

/* Balance grid (Sınaq Balansı) */
.balance-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.balance-grid .card:first-child { border-left: 8px solid #00685f; }
.balance-grid .card:last-child { border-left: 8px solid #b05e3d; }
.balance-grid .total-row td { border-radius: 0; }
.balance-grid .card:first-child .total-row td { background: #00685f !important; }
.balance-grid .card:last-child .total-row td { background: #b05e3d !important; }
.balance-grid .category-row td { font-size: 12px; letter-spacing: 1.2px; color: rgba(61,73,71,0.6); font-weight: 700; background: transparent; text-transform: uppercase; }
.balance-grid .table tbody td:first-child { font-family: 'Liberation Mono', 'Courier New', monospace; font-size: 12px; color: #545f73; }
.balance-grid .text-green { color: #00685f; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.balance-grid .text-red { color: #ba1a1a; font-size: 10px; font-weight: 700; text-transform: uppercase; }

/* Company grid */
.company-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.company-card { display: block; background: var(--color-white); border-radius: var(--radius-lg); box-shadow: 0 4px 6px -1px rgba(226,232,240,0.4); padding: 24px; position: relative; border-left: 4px solid transparent; transition: all 0.15s; }
.company-card:hover { box-shadow: 0 20px 25px -5px rgba(226,232,240,0.5); transform: translateY(-2px); text-decoration: none; color: inherit; }
.company-card.active { border-left-color: #00685f; box-shadow: 0 20px 25px -5px rgba(226,232,240,0.5), 0 8px 10px -6px rgba(226,232,240,0.5); }
.company-card-name { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--color-text); }
.company-card-voen { font-size: 13px; color: var(--color-text-secondary); }
.company-card-plan { margin: 8px 0; }
.company-card-stats { font-size: 12px; color: var(--color-text-secondary); padding-top: 12px; border-top: 1px solid var(--color-border); margin-top: 12px; }

/* Plan cards */
.plan-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 8px; }
.plan-card { cursor: pointer; border: 1px solid rgba(188,201,198,0.3); border-radius: var(--radius-lg); padding: 16px; text-align: center; transition: all 0.15s; background: #f2f4f6; }
.plan-card:hover { border-color: var(--color-primary); }
.plan-card.selected { border: 2px solid var(--color-primary); background: rgba(0,104,95,0.05); }
.plan-card input { display: none; }
.plan-card-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.plan-card-badge { font-size: 11px; color: var(--color-primary); font-weight: 600; }
.plan-card-desc { font-size: 12px; color: var(--color-text-secondary); margin-top: 8px; }

/* ==================== Tables ==================== */
.table { font-size: 13px; }
.table thead th { background: #f2f4f6; padding: 16px 24px; text-align: left; font-weight: 900; color: var(--color-text-secondary); font-size: 10px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #eceef0; position: sticky; top: 0; }
.table tbody td { padding: 16px 24px; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.table tbody tr:hover { background: #f0f9ff; }
.table tbody tr:nth-child(even) { background: #fafafa; }
.table tbody tr:nth-child(even):hover { background: #f0f9ff; }
.total-row td { background: var(--color-primary) !important; color: white !important; border-radius: 8px; }
.total-row td strong { color: white; }
.category-row td { background: #f1f5f9; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--color-text-secondary); padding: 6px 12px; }
.inactive-row { opacity: 0.4; text-decoration: line-through; }
.table-footer { padding: 12px 16px; font-size: 13px; color: var(--color-text-secondary); border-top: 1px solid var(--color-border); }
.table-responsive { overflow-x: auto; }
.th-group { background: #f0fdfa !important; }
.th-group-alt { background: #ede9fe !important; }

/* ==================== Forms ==================== */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; font-weight: 600; color: #545f73; margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1px solid rgba(188,201,198,0.3); border-radius: 8px;
  background: var(--color-white); transition: border-color 0.15s; height: 44px; font-size: 14px; color: #191c1e;
}
.form-group textarea { height: auto; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(0,104,95,0.1);
}
.input-disabled { background: #f1f5f9 !important; color: var(--color-text-secondary); }
.form-hint { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 8px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { grid-template-columns: 2fr 1fr 1fr; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* Filter bar */
.filter-bar { margin-bottom: 16px; }
.filter-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: var(--color-white); padding: 24px; border-radius: var(--radius-lg); box-shadow: 0 4px 12px rgba(0,0,0,0.03); }
.filter-form input, .filter-form select { padding: 9px 17px; border: 1px solid rgba(188,201,198,0.2); border-radius: var(--radius); font-size: 14px; background: #f2f4f6; }
.filter-inline { display: flex; align-items: center; gap: 8px; }
.filter-inline input { padding: 8px 12px; border: 1px solid var(--color-border); border-radius: var(--radius); }

/* ==================== Buttons ==================== */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: var(--radius-lg); font-weight: 600; font-size: 14px; border: none; cursor: pointer; transition: all 0.15s; }
.btn-primary { background: linear-gradient(165deg, #00685f, #008378); color: white; box-shadow: var(--shadow-primary); }
.btn-primary:hover { background: linear-gradient(165deg, #005a52, #00756d); text-decoration: none; color: white; }
.btn-outline { background: transparent; color: var(--color-text-secondary); border: 1px solid rgba(188,201,198,0.3); border-radius: var(--radius); }
.btn-outline:hover { background: #f8fafc; text-decoration: none; }
.btn-danger-outline { background: transparent; color: var(--color-danger); border: 1px solid var(--color-danger); }
.btn-danger-outline:hover { background: #fef2f2; text-decoration: none; }
.btn-full { width: 100%; justify-content: center; }
.btn-icon { background: none; border: none; cursor: pointer; padding: 4px; font-size: 14px; opacity: 0.5; }
.btn-icon:hover { opacity: 1; }

/* Language selector */
.lang-selector-form { display: inline-flex; gap: 2px; }
.lang-btn { background: transparent; border: 1px solid rgba(188,201,198,0.3); border-radius: var(--radius); padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); cursor: pointer; transition: all 0.15s; }
.lang-btn:hover { background: #f8fafc; color: #00685f; }
.lang-btn.active { background: #00685f; color: white; border-color: #00685f; }
.auth-lang-selector { position: absolute; top: 16px; right: 16px; display: flex; gap: 2px; margin: 0; padding: 0; }

/* ==================== Badges ==================== */
.badge { display: inline-block; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 700; }
.badge-teal { background: rgba(0,104,95,0.1); color: #00685f; }
.badge-purple { background: rgba(213,224,248,0.4); color: #545f73; }
.badge-green { background: #ecfdf5; color: #047857; border: 1px solid #d1fae5; }
.badge-small { font-size: 10px; padding: 1px 8px; }
.badge-orange { background: #ffdbce; color: #773215; }
.badge-blue { background: #d5e0f8; color: #586377; }
.badge-gray { background: #f1f5f9; color: #94a3b8; }
.badge-large { font-size: 18px; padding: 8px 16px; }

/* ==================== Alerts ==================== */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 14px; }
.alert-error { background: #fef2f2; color: var(--color-danger); border: 1px solid #fecaca; }
.balance-check { padding: 12px 20px; border-radius: var(--radius); margin-bottom: 16px; font-weight: 500; }
.balance-check.balanced { background: #d1fae5; color: #166534; }
.balance-check.unbalanced { background: #fef2f2; color: #991b1b; }

/* ==================== Modal ==================== */
.modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 200; }
.modal.open { display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
.modal-content { position: relative; background: var(--color-white); border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.15); width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto; }
.modal-small { max-width: 480px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--color-border); }
.modal-header h2 { font-size: 18px; }
.modal-close { width: 36px; height: 36px; border-radius: 50%; border: none; background: none; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.modal-close:hover { background: #f1f5f9; }
.modal-body { padding: 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--color-border); }

/* Template section in modal */
.template-section { border-top: 1px solid var(--color-border); padding-top: 16px; margin-top: 16px; }
.template-section h3 { font-size: 13px; color: var(--color-text-secondary); margin-bottom: 8px; }
.template-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tab-btn { padding: 6px 12px; border: none; border-radius: 20px; background: #f1f5f9; color: var(--color-text-secondary); font-size: 12px; cursor: pointer; }
.tab-btn.active { background: var(--color-primary); color: white; }
.template-list { max-height: 160px; overflow-y: auto; }
.template-item { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.template-item:hover { background: #f0f9ff; }
.template-arrow { color: var(--color-text-secondary); }
.template-desc { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Empty states */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state.small { padding: 30px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--color-text-secondary); margin-bottom: 16px; }

/* Account info card */
.account-info-card { display: flex; align-items: center; justify-content: space-between; background: var(--color-white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }
.account-info-left { display: flex; align-items: center; gap: 16px; }
.account-info-left h2 { font-size: 16px; margin-bottom: 4px; }
.account-info-right { display: flex; gap: 12px; }
.mini-stat { padding: 12px 16px; border-radius: var(--radius); background: #f8fafc; text-align: center; }
.mini-stat.primary { background: var(--color-primary-light); }
.mini-stat-label { font-size: 11px; color: var(--color-text-secondary); }
.mini-stat-value { font-size: 18px; font-weight: 700; }

/* Utilities */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--color-text-secondary); font-size: 12px; }
.text-zero { color: #cbd5e1; }
.text-green { color: var(--color-success); }
.text-red { color: var(--color-danger); }
.link { font-size: 13px; }
.account-code { font-family: 'Courier New', monospace; }

/* ==================== Invoice Import ==================== */
.invoice-card { background: var(--color-white); border-radius: var(--radius-lg); box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; border: 2px solid transparent; transition: border-color 0.15s; }
.invoice-card:has(.invoice-check:checked) { border-color: var(--color-primary); }
.invoice-card-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; flex-wrap: wrap; }
.invoice-card-body { padding: 0 20px 20px; }
.invoice-accounts { background: #f8fafc; border-radius: 8px; padding: 16px; }
.invoice-acc-section { }
.import-bottom-bar { position: sticky; bottom: 0; background: var(--color-white); border-top: 1px solid var(--color-border); padding: 16px 20px; display: flex; align-items: center; gap: 16px; box-shadow: 0 -2px 8px rgba(0,0,0,0.05); border-radius: var(--radius-lg); margin-top: 16px; }

/* ==================== Export Bar ==================== */
.export-bar { display: flex; align-items: center; justify-content: space-between; background: var(--color-white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 20px 24px; margin-top: 16px; border: 1px solid var(--color-border); }
.export-bar-left { display: flex; align-items: center; gap: 16px; }
.export-bar-icon { width: 48px; height: 48px; background: var(--color-primary-light); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; }

/* ==================== Searchable Select ==================== */
.searchable-select { position: relative; }
.ss-search { width: 100%; padding: 10px 12px; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-white); font-size: 14px; transition: border-color 0.15s; }
.ss-search:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(13,115,119,0.1); }
.ss-search.has-value { font-weight: 500; color: var(--color-text); }
.ss-dropdown { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--color-white); border: 1px solid var(--color-border); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.12); max-height: 220px; overflow-y: auto; z-index: 300; margin-top: 4px; }
.searchable-select.open .ss-dropdown { display: block; }
.ss-option { padding: 10px 12px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.ss-option:hover, .ss-option.highlighted { background: var(--color-primary-light); }
.ss-option.selected { background: var(--color-primary-light); font-weight: 600; }
.ss-option .badge { flex-shrink: 0; }
.ss-no-results { padding: 12px; text-align: center; color: var(--color-text-secondary); font-size: 13px; }

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

/* Grid layouts */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* Info rows */
.info-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.info-label { color: var(--color-text-secondary); }

/* Contact cards */
.contact-card { background: #f8fafc; border-radius: 8px; padding: 12px; margin-bottom: 8px; font-size: 13px; line-height: 1.8; }

/* Template grid */
.template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.template-card-large { background: var(--color-white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.template-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.template-card-body { font-size: 14px; color: var(--color-text-secondary); }

/* Chess table */
.chess-table { font-size: 12px; }
.chess-table th, .chess-table td { padding: 6px 8px; min-width: 70px; }
.chess-header { writing-mode: horizontal-tb; }
.chess-cell { background: var(--color-white); }
.chess-cell:hover { background: #f0fdfa; }
.chess-diagonal { background: #f1f5f9 !important; }
.chess-value { font-weight: 600; }
.chess-total-cell { background: #f0fdfa; }
.sticky-col { position: sticky; left: 0; background: var(--color-white); z-index: 1; }

/* Font helpers */
.font-bold { font-weight: 600; color: var(--color-text); }

/* ==================== Payroll ==================== */
.payroll-stage { display: flex; align-items: center; gap: 0; background: var(--color-white); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 24px 28px; margin-bottom: 16px; flex-wrap: wrap; }
.payroll-stage-step { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 96px; }
.payroll-stage-num { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; background: #f1f5f9; color: var(--color-text-muted); border: 2px solid #e2e8f0; transition: all 0.15s; }
.payroll-stage-label { font-size: 12px; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.6px; text-align: center; }
.payroll-stage-step.active .payroll-stage-num { background: var(--color-primary); color: var(--color-white); border-color: var(--color-primary); box-shadow: 0 0 0 4px rgba(0,104,95,0.12); }
.payroll-stage-step.active .payroll-stage-label { color: var(--color-primary); }
.payroll-stage-step.done .payroll-stage-num { background: #d1fae5; color: transparent; border-color: #6ee7b7; position: relative; }
.payroll-stage-step.done .payroll-stage-num::after { content: '✓'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #065f46; font-size: 18px; font-weight: 700; }
.payroll-stage-line { flex: 1; height: 2px; background: #e2e8f0; min-width: 24px; margin: 0 4px; align-self: flex-start; margin-top: 19px; transition: background 0.15s; }
.payroll-stage-line.done { background: #6ee7b7; }

.payroll-validation-errors { display: flex; flex-direction: column; gap: 12px; }
.payroll-validation-error { background: #fef2f2; border-left: 3px solid #ba1a1a; border-radius: var(--radius); padding: 12px 16px; }
.payroll-validation-error-name { font-weight: 600; margin-bottom: 6px; color: #991b1b; }
.payroll-validation-error ul { margin: 0; padding-left: 20px; font-size: 13px; color: #7f1d1d; }
.payroll-validation-error ul li { margin: 2px 0; }

@media (max-width: 768px) {
  .payroll-stage { padding: 16px; gap: 8px; flex-direction: column; align-items: stretch; }
  .payroll-stage-step { flex-direction: row; justify-content: flex-start; min-width: 0; }
  .payroll-stage-line { display: none; }
}

/* ==================== Tax Reports ==================== */
.tax-status-draft { background: #f1f5f9; color: #64748b; border: 1px solid #e2e8f0; }
.tax-status-submitted { background: #ffdbce; color: #773215; border: 1px solid #fed7aa; }
.tax-status-paid { background: #ecfdf5; color: #047857; border: 1px solid #d1fae5; }
.tax-line-row.calculated td { background: rgba(0,104,95,0.02); }
.tax-line-row.manual td { background: #fffbeb; }
.tax-line-row td { transition: background 0.15s; }

/* ==================== Responsive ==================== */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .balance-grid { grid-template-columns: 1fr; }
  .company-grid { grid-template-columns: repeat(2, 1fr); }
  .plan-cards { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-wrapper { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .company-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
  .filter-form { flex-direction: column; }
  .page-header { flex-direction: column; align-items: flex-start; }
}
