/* === Font === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500&display=swap');

/* === CSS Variables === */
:root {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Consolas', 'Monaco', monospace;
  --color-text-primary: #0a0a0a;
  --color-text-secondary: #6b7280;
  --color-text-tertiary: #9ca3af;
  --color-text-danger: #dc2626;
  --color-text-success: #16a34a;
  --color-text-info: #2563eb;
  --color-background-primary: #ffffff;
  --color-background-secondary: #f5f5f5;
  --color-background-info: #eff6ff;
  --color-border-secondary: #d1d5db;
  --color-border-tertiary: #e5e7eb;
  --color-border-info: #93c5fd;
  --border-radius-md: 6px;
  --border-radius-lg: 10px;
  --accent: #6d28d9;
  --accent-light: #a78bfa;
  --accent-bg: #f3f0ff;
  --accent-bg-deep: #ede9fe;
  --sidebar-width: 210px;
  --sidebar-collapsed: 56px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text-primary);
  background: #fafafa;
}

body { display: flex; overflow: hidden; }

/* ============================================
   SIDEBAR — white, minimal, violet accent
   ============================================ */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 100vh;
  background: white;
  border-right: 0.5px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  transition: width var(--transition), min-width var(--transition);
  overflow: hidden;
  z-index: 100;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); min-width: var(--sidebar-collapsed); }

/* -- Sidebar top / brand -- */
.sb-top {
  padding: 18px 14px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sb-brand { display: flex; align-items: center; gap: 9px; overflow: hidden; white-space: nowrap; }

/* sb-logo removed — using text logo now */

.sb-logo-svg { flex-shrink: 0; transition: opacity var(--transition), width var(--transition); }
.sidebar.collapsed .sb-logo-svg { opacity: 0; width: 0; overflow: hidden; }

.sb-plan { display: none; }

.sidebar-toggle {
  background: none; border: none; color: #ccc; cursor: pointer;
  padding: 4px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
  transition: color var(--transition), background var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { color: #0a0a0a; background: #f7f7f7; }

/* -- Sidebar nav -- */
.sb-nav { padding: 4px 8px; flex: 1; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; overflow-x: hidden; }

.sb-group-label {
  font-size: 10px; font-weight: 500; color: #ccc; letter-spacing: .05em;
  text-transform: uppercase; padding: 10px 8px 3px;
}
.sidebar.collapsed .sb-group-label { opacity: 0; height: 0; padding: 0; overflow: hidden; }

.sb-divider { height: 0.5px; background: #f5f5f5; margin: 6px 8px; }

.sb-item {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px;
  border-radius: 6px; cursor: pointer; color: #888; font-size: 12.5px;
  font-weight: 400; letter-spacing: -0.01em; margin-bottom: 1px;
  text-decoration: none; white-space: nowrap; transition: all var(--transition);
}
.sb-item:hover { background: #f7f7f7; color: #0a0a0a; }
.sb-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 500; }
.sb-item.active svg { opacity: 1; stroke: var(--accent); }
.sb-item.disabled { cursor: not-allowed; }
.sb-item.disabled:hover { background: transparent; color: #888; }

.sb-item svg {
  width: 14px; height: 14px; flex-shrink: 0; stroke: currentColor;
  fill: none; stroke-width: 1.5; opacity: 0.5;
}

.sb-soon { font-size: 10px; color: #ddd; margin-left: auto; font-weight: 300; transition: opacity var(--transition); }
.sidebar.collapsed .sb-soon { opacity: 0; }

.sb-item-label { transition: opacity var(--transition); }
.sidebar.collapsed .sb-item-label { opacity: 0; width: 0; overflow: hidden; }

/* Collapsed tooltips */
.sidebar.collapsed .sb-item { justify-content: center; padding: 8px; }
.sidebar.collapsed .sb-item::after {
  content: attr(data-tooltip); position: absolute; left: calc(100% + 8px); top: 50%;
  transform: translateY(-50%); background: #0a0a0a; color: white;
  padding: 5px 10px; border-radius: 6px; font-size: 11px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 200;
}
.sidebar.collapsed .sb-item { position: relative; }
.sidebar.collapsed .sb-item:hover::after { opacity: 1; }

/* -- Sidebar footer -- */
.sb-footer {
  padding: 12px 14px; border-top: 0.5px solid #f5f5f5; margin-top: auto;
}
.sb-user { display: flex; align-items: center; gap: 8px; }
.sb-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-bg-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 500; color: var(--accent); flex-shrink: 0;
}
.sb-user-info { overflow: hidden; transition: opacity var(--transition); }
.sidebar.collapsed .sb-user-info { opacity: 0; width: 0; }
.sb-user-name { font-size: 12px; font-weight: 500; color: #0a0a0a; letter-spacing: -0.01em; }
.sb-user-sub { font-size: 10px; color: #bbb; font-weight: 300; }

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content { flex: 1; height: 100vh; overflow-y: auto; padding: 0; background: white; }
.module-view { display: none; }
.module-view.active { display: block; }

/* -- Content header with gradient divider -- */
.content-header { padding: 24px 28px 0; }
.content-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.content-title { font-size: 20px; font-weight: 400; letter-spacing: -0.03em; color: #0a0a0a; }
.content-divider { height: 2px; background: linear-gradient(90deg, var(--accent) 0%, var(--accent-light) 40%, transparent 100%); margin: 0 28px; border-radius: 2px; }
.content-body-area { padding: 20px 28px; }

/* ============================================
   BDO Sub-navigation tabs — underline style
   ============================================ */
.nav { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 0.5px solid #f5f5f5; padding-bottom: 0; background: none; padding: 0; border-radius: 0; }
.nb { padding: 7px 14px; font-size: 12.5px; cursor: pointer; color: #aaa; border: none; border-bottom: 2px solid transparent; margin-bottom: -0.5px; font-family: var(--font-sans); background: none; border-radius: 0; }
.nb:hover { background: none; color: var(--color-text-primary); }
.nb.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; background: none; box-shadow: none; }

.view { display: none; }
.view.active { display: block; }

/* === Topbar === */
.topbar { padding-bottom: 1rem; margin-bottom: 1rem; border-bottom: 0.5px solid var(--color-border-tertiary); }
.topbar h2 { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 8px; }
.topbar-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.topbar-left { display: flex; align-items: center; gap: 8px; }

/* === Metrics === */
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 1rem; }
.metric { padding: 12px 14px; border-radius: 8px; border: 0.5px solid #f0f0f0; background: none; }
.metric .lbl { font-size: 10px; color: #bbb; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 5px; font-weight: 500; }
.metric .val { font-size: 22px; font-weight: 300; letter-spacing: -0.03em; color: #0a0a0a; }
.metric .val.green { color: #16a34a; }
.metric .val.amber { color: #d97706; }

/* === Buttons === */
.btn { padding: 6px 14px; border-radius: var(--border-radius-md); border: 0.5px solid var(--color-border-secondary); font-size: 12px; cursor: pointer; background: transparent; color: var(--color-text-primary); font-family: var(--font-sans); }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: #5b21b6; }
.btn-green { background: var(--accent); color: white; border-color: var(--accent); font-weight: 500; }
.btn-sm { padding: 3px 10px; font-size: 11px; }
.btn-warn { color: #854F0B; border-color: #BA7517; }
.btn-danger { color: var(--color-text-danger); border-color: transparent; }

/* === Toolbar & Search === */
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; align-items: center; }
.srch { flex: 1; min-width: 0; font-size: 12px; padding: 6px 10px; border-radius: 6px; border: 0.5px solid #e8e8e8; background: white; color: #0a0a0a; font-family: var(--font-sans); }
select.fil { font-size: 12px; padding: 6px 8px; border-radius: 6px; border: 0.5px solid #e8e8e8; background: white; color: #0a0a0a; font-family: var(--font-sans); }
select.msel { padding: 4px 8px; border-radius: 6px; border: 0.5px solid #e8e8e8; font-size: 12px; background: white; color: #0a0a0a; font-family: var(--font-sans); }

/* === Year selector === */
.rok-sel { display: flex; align-items: center; gap: 4px; }
.rok-sel button { width: 20px; height: 20px; border-radius: 4px; border: 0.5px solid #e8e8e8; background: none; cursor: pointer; font-size: 11px; color: #888; display: flex; align-items: center; justify-content: center; }
.rok-sel span { font-size: 13px; font-weight: 500; min-width: 32px; text-align: center; color: #0a0a0a; }

/* === Invoice list === */
.fv-list { max-width: 860px; }

/* === Invoice cards === */
.fv-card { padding: 11px 14px; border-radius: 8px; border: 0.5px solid #f0f0f0; margin-bottom: 4px; background: white; cursor: pointer; }
.fv-card:nth-child(even) { background: #f9f9f9; }
.fv-card:hover { border-color: #e0e0e0; }
.fv-card.st-todo { border-left: 2px solid #e8e8e8; }
.fv-card.st-done { border-left: 2px solid #16a34a; background: #fafff9; }
.fv-card.st-skip { border-left: 2px solid #f59e0b; background: #fffdf5; }
.fv-firma { font-size: 13px; font-weight: 500; color: #0a0a0a; }
.fv-meta { font-size: 11px; color: #bbb; margin-top: 2px; }
.ksef-txt { font-family: var(--font-mono); font-size: 10px; color: #ddd; margin-top: 1px; }

/* === Status badges === */
.sp { font-size: 10px; padding: 2px 7px; border-radius: 4px; font-weight: 400; }
.sp-todo { background: #f5f5f5; color: #999; }
.sp-done { background: #f0fdf4; color: #16a34a; }
.sp-skip { background: #fffbeb; color: #d97706; }

/* === Material chips === */
.chip { font-size: 10px; padding: 2px 6px; border-radius: var(--border-radius-md); font-weight: 500; }
.c-tw { background: #EEEDFE; color: #3C3489; }
.c-al { background: #FAEEDA; color: #633806; }
.c-st { background: #F1EFE8; color: #444441; }
.c-pa { background: #EAF3DE; color: #27500A; }
.c-sz { background: #E6F1FB; color: #0C447C; }
.c-dr { background: #FBEAF0; color: #72243E; }
.c-wi { background: #E1F5EE; color: #085041; }
.c-po { background: #FCEBEB; color: #791F1F; }

/* === Table === */
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th { text-align: left; padding: 7px 9px; border-bottom: 0.5px solid var(--color-border-secondary); font-weight: 500; font-size: 11px; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
td { padding: 7px 9px; border-bottom: 0.5px solid var(--color-border-tertiary); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: var(--color-background-secondary); }
.empty { text-align: center; padding: 2rem; color: var(--color-text-secondary); font-size: 13px; }

/* === Form inputs === */
input[type=text], input[type=number], input[type=date] { width: 100%; font-size: 12px; padding: 5px 7px; border-radius: var(--border-radius-md); border: 0.5px solid var(--color-border-secondary); background: var(--color-background-primary); color: var(--color-text-primary); font-family: var(--font-sans); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.1); }
select.fsel { width: 100%; font-size: 12px; padding: 5px 7px; border-radius: var(--border-radius-md); border: 0.5px solid var(--color-border-secondary); background: var(--color-background-primary); color: var(--color-text-primary); font-family: var(--font-sans); }
label.fl { font-size: 11px; color: var(--color-text-secondary); display: block; margin-bottom: 2px; }

/* === Card & Form layout === */
.card { background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary); border-radius: var(--border-radius-lg); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.form-row { display: grid; gap: 8px; margin-bottom: 8px; }
.c2 { grid-template-columns: 1fr 1fr; }
.c3 { grid-template-columns: 1fr 1fr 1fr; }
.c4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* === Sync bar === */
.sync-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 12px; color: #aaa; background: none; padding: 0; border-radius: 0; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: #22c55e; display: inline-block; }
.btn-sync { padding: 4px 12px; border-radius: 6px; border: 0.5px solid #e8e8e8; background: white; font-size: 11px; color: #666; cursor: pointer; font-family: var(--font-sans); }
.zaleglosci-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #fafafa; border: 0.5px solid #f0f0f0; border-radius: 8px; margin-bottom: 14px; font-size: 12px; color: #888; font-weight: 400; }
.alert-dot { width: 6px; height: 6px; border-radius: 50%; background: #f59e0b; display: inline-block; flex-shrink: 0; }

/* === Verification blocks === */
.poz-blok { background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary); border-radius: var(--border-radius-md); padding: 14px; margin-bottom: 10px; }
.poz-blok.pm-ok { border-left: 3px solid #3B6D11; }
.poz-blok.pm-warn { border-left: 3px solid #BA7517; }
.poz-blok.pm-skip { border-left: 3px solid #888780; opacity: 0.55; }
.poz-title { font-size: 12px; font-weight: 500; margin-bottom: 5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.poz-from { font-size: 11px; color: var(--color-text-secondary); margin-bottom: 10px; padding: 6px 8px; background: var(--color-background-secondary); border-radius: var(--border-radius-md); }
.match-badge { font-size: 10px; padding: 2px 7px; border-radius: var(--border-radius-md); }
.mb-ok { background: #C0DD97; color: #27500A; }
.mb-warn { background: #FAC775; color: #633806; }
.mb-skip { background: #E8E7E0; color: #444441; }
.poz-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 8px; align-items: start; margin-bottom: 8px; }
.poz-grid2 { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; }
.wylicz { font-size: 10px; color: var(--accent); cursor: pointer; text-decoration: underline; margin-top: 2px; display: block; }
.hint { font-size: 10px; color: var(--color-text-secondary); margin-top: 2px; }

/* === New product form in verification === */
.new-prod-form { background: var(--accent-bg); border-radius: var(--border-radius-md); padding: 12px; margin-top: 8px; border: 0.5px solid var(--accent-light); }

/* === PDF preview === */
.pdf-wrap { background: var(--color-background-secondary); border-radius: var(--border-radius-lg); border: 0.5px solid var(--color-border-tertiary); margin-bottom: 1.25rem; }
.pdf-header { padding: 9px 14px; border-bottom: 0.5px solid var(--color-border-tertiary); display: flex; align-items: center; justify-content: space-between; background: var(--color-background-primary); border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0; }
.pdf-body { padding: 14px; }
.pdf-mock { background: white; border: 0.5px solid var(--color-border-tertiary); border-radius: var(--border-radius-md); padding: 14px; color: #333; font-size: 11px; }
.pdf-mock table { color: #333; font-size: 10px; }
.pdf-mock td, .pdf-mock th { padding: 3px 5px; border: 0.5px solid #ddd; }
.pdf-mock th { background: #f5f5f5; font-weight: 500; }

/* === Approve button === */
.btn-zatwierdz { padding: 8px 20px; font-size: 13px; border-radius: var(--border-radius-md); border: none; cursor: pointer; font-family: var(--font-sans); font-weight: 500; }
.btn-zatwierdz.ready { background: #3B6D11; color: white; }
.btn-zatwierdz.not-ready { background: var(--color-background-secondary); color: var(--color-text-secondary); border: 0.5px solid var(--color-border-secondary); }

.lupa-btn { background: none; border: none; cursor: pointer; color: var(--accent); font-size: 15px; padding: 2px 5px; border-radius: var(--border-radius-md); }

/* === Month list (register) === */
.mies-list { display: flex; flex-direction: column; gap: 3px; min-width: 130px; margin-right: 1rem; }
.mies-item { padding: 6px 10px; border-radius: var(--border-radius-md); font-size: 12px; cursor: pointer; color: var(--color-text-secondary); border: 0.5px solid transparent; }
.mies-item:hover { background: var(--color-background-secondary); }
.mies-item.active { background: var(--color-text-primary); color: var(--color-background-primary); font-weight: 500; }
.mies-item.has { color: var(--color-text-primary); border-color: var(--color-border-tertiary); }
.mies-item.has::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #3B6D11; margin-left: 6px; vertical-align: middle; }
.rej-layout { display: flex; gap: 1rem; align-items: start; }
.rej-content { flex: 1; min-width: 0; }

/* === Annual summary === */
.rok-row td { font-weight: 500; border-top: 0.5px solid var(--color-border-secondary) !important; background: var(--color-background-secondary) !important; }

/* === Add invoice panel === */
.dodaj-panel { display: none; margin-bottom: 1rem; }
.dodaj-panel.open { display: block; }

/* === Misc === */
.highlight { background: #FAC775; border-radius: 2px; padding: 0 1px; }
.legend { display: flex; gap: 10px; align-items: center; font-size: 11px; color: var(--color-text-secondary); margin-bottom: 8px; flex-wrap: wrap; }
.leg-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 3px; }

/* ============================================
   Zwroty module
   ============================================ */
/* ============================================
   Dashboard / Pulpit
   ============================================ */
.dash-hero {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #c4b5fd 100%);
  padding: 28px 28px 24px;
}
.dash-hero-inner { display: flex; align-items: center; justify-content: space-between; }
.dash-welcome { font-size: 24px; font-weight: 400; color: white; letter-spacing: -0.03em; }
.dash-date { font-size: 13px; color: rgba(255,255,255,0.6); margin-top: 4px; font-weight: 300; }
.dash-hero-svg { opacity: 0.3; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dash-card {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: white; border: 0.5px solid #f0f0f0; border-radius: 10px;
  cursor: pointer; transition: all 0.2s;
}
.dash-card:hover { border-color: #6d28d9; box-shadow: 0 2px 8px rgba(109,40,217,0.08); }
.dash-card-disabled { opacity: 0.5; cursor: default; }
.dash-card-disabled:hover { border-color: #f0f0f0; box-shadow: none; }
.dash-card-icon {
  width: 42px; height: 42px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-card-body { flex: 1; min-width: 0; }
.dash-card-title { font-size: 13px; font-weight: 500; color: #0a0a0a; margin-bottom: 2px; }
.dash-card-desc { font-size: 11px; color: #bbb; font-weight: 300; }
.dash-card-arrow { flex-shrink: 0; }
.dash-card-soon { font-size: 10px; color: #ccc; flex-shrink: 0; }

/* === Module hero header === */
.module-hero {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 50%, #c4b5fd 100%);
  padding: 24px 28px 20px;
}
.module-hero-inner { display: flex; align-items: center; justify-content: space-between; }
.module-hero-left { display: flex; align-items: center; gap: 14px; }
.module-hero-icon {
  width: 42px; height: 42px; border-radius: 10px;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.module-hero-title { font-size: 20px; font-weight: 500; color: white; letter-spacing: -0.02em; }
.module-hero-sub { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 2px; font-weight: 300; }
.module-hero-muted { background: linear-gradient(135deg, #9ca3af 0%, #d1d5db 100%); }
.module-hero-brand { text-align: right; }
.module-hero-brand-name { font-size: 18px; font-weight: 700; color: rgba(255,255,255,0.35); letter-spacing: -0.04em; }
.module-hero-brand-sub { font-size: 10px; color: rgba(255,255,255,0.2); font-weight: 300; letter-spacing: .05em; }

.section-lbl { font-size: 11px; font-weight: 500; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; }
.step-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.step-icon { width: 32px; height: 32px; border-radius: 8px; background: var(--accent-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.zam-info-bar { background: #f3f0ff; border: 0.5px solid #a78bfa; border-radius: var(--border-radius-md); padding: 10px 14px; margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.zam-info-title { font-weight: 500; color: #6d28d9; font-size: 13px; margin-bottom: 2px; }
.zam-info-detail { font-size: 12px; color: var(--color-text-secondary); }
.zam-info-nr { font-size: 11px; background: #ede9fe; color: #6d28d9; padding: 2px 8px; border-radius: 4px; display: inline-block; margin-top: 4px; font-family: var(--font-mono); }
.pozycja-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--border-radius-md); border: 0.5px solid var(--color-border-tertiary); margin-bottom: 6px; }
.pozycja-row.selected { border-color: #a78bfa; background: #f3f0ff; }
.poz-nazwa { flex: 1; font-size: 13px; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: #6d28d9; cursor: pointer; flex-shrink: 0; }
.suma-zwrotu { background: var(--color-background-secondary); border-radius: var(--border-radius-md); padding: 10px 14px; margin-top: 8px; display: flex; align-items: center; justify-content: space-between; }
.suma-val { font-size: 18px; font-weight: 500; color: #6d28d9; }
.bramki-panel { background: #fafafa; border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-lg); padding: 1rem; margin-bottom: 1rem; }
.bramki-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bramki-kwota { font-size: 20px; font-weight: 500; color: #6d28d9; }
.nr-box { display: flex; align-items: center; gap: 8px; background: white; border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-md); padding: 8px 12px; margin-bottom: 12px; }
.nr-box-val { flex: 1; font-size: 14px; font-weight: 500; font-family: var(--font-mono); }
.copy-btn { padding: 4px 12px; border-radius: 6px; border: 0.5px solid var(--color-border-secondary); background: transparent; font-size: 11px; cursor: pointer; font-family: var(--font-sans); }
.copy-btn.ok { color: #16a34a; border-color: #16a34a; }
.bramki-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.bramka-card { border: 0.5px solid var(--color-border-secondary); border-radius: var(--border-radius-md); padding: 10px 8px; cursor: pointer; background: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; min-height: 44px; text-align: center; }
.bramka-card:hover { border-color: #6d28d9; color: #6d28d9; }
.email-panel { background: #f0fdf4; border: 0.5px solid #86efac; border-radius: var(--border-radius-md); padding: 10px 14px; }
.email-row { display: flex; align-items: center; gap: 8px; }
.btn-email { padding: 6px 14px; border-radius: var(--border-radius-md); border: none; background: #16a34a; color: white; font-size: 12px; font-weight: 500; cursor: pointer; font-family: var(--font-sans); }
.btn-email:disabled { background: #ccc; cursor: default; }
.email-sent { font-size: 11px; color: #16a34a; margin-top: 4px; display: none; }
.doc-preview { background: white; border: 0.5px solid var(--color-border-tertiary); border-radius: var(--border-radius-md); padding: 20px; font-size: 11px; color: #333; }
.doc-preview table { color: #333; }
.doc-preview td, .doc-preview th { border: 0.5px solid #ccc; padding: 4px 6px; }
.doc-preview th { background: #f5f5f5; font-weight: 500; }

/* === Placeholder Content === */
.placeholder-content {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: calc(100vh - 100px); color: #ddd; text-align: center; font-weight: 300;
}
.placeholder-content svg { margin-bottom: 16px; opacity: 0.3; }
.placeholder-content h2 { font-size: 20px; margin-bottom: 8px; font-weight: 400; color: var(--color-text-secondary); }

/* === Scrollbar === */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e5e5e5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #ccc; }

/* === Timesheet Module === */
.ts-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 0.5px solid var(--color-border-tertiary);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ts-badge {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
  display: inline-block;
  user-select: none;
}
.ts-chip {
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
}
#ts-tbody tr td { background: transparent !important; }
#ts-tbody .ts-ie,
#ts-tbody .ts-ie-note { background: transparent; }
.ts-ie {
  background: none;
  border: none;
  font-size: 12px;
  font-family: inherit;
  color: inherit;
  width: 54px;
  text-align: center;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
}
.ts-ie:hover { background: var(--color-background-secondary); }
.ts-ie:focus {
  outline: none;
  background: var(--color-background-primary);
  border: 0.5px solid var(--accent);
  color: var(--color-text-primary);
  width: 68px;
}
.ts-ie-note {
  background: none;
  border: none;
  font-size: 11px;
  font-family: inherit;
  color: var(--color-text-secondary);
  width: 100%;
  padding: 2px 4px;
  border-radius: 4px;
}
.ts-ie-note:hover { background: var(--color-background-secondary); }
.ts-ie-note:focus {
  outline: none;
  background: var(--color-background-primary);
  border: 0.5px solid var(--accent);
  color: var(--color-text-primary);
}
.ts-dropdown {
  display: none;
  position: absolute;
  top: 110%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-background-primary);
  border: 0.5px solid var(--color-border-secondary);
  border-radius: 8px;
  z-index: 200;
  min-width: 200px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
}
.ts-dropdown.ts-dd-open { display: block; }
.ts-ddi {
  padding: 8px 14px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ts-ddi:hover { background: var(--color-background-secondary); }

/* Modal overlay for timesheet */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.38);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: var(--color-background-primary);
  border-radius: 12px;
  padding: 22px;
  width: min(460px, 94vw);
  border: 0.5px solid var(--color-border-secondary);
  max-height: 90vh;
  overflow-y: auto;
}

/* === Print === */
@media print {
  @page { size: landscape; margin: 6mm 8mm 6mm; }
  body { display: block; background: white; font-size: 8px; }
  .sidebar { display: none !important; }
  .main-content { padding: 0; overflow: visible; height: auto; }
  .content-header, .content-divider, .module-hero, .nav, .rok-sel, .msel, .btn, .btn-sm,
  .ts-topbar, .ts-dropdown, .modal-overlay { display: none !important; }
  .content-body-area { padding: 0; }
  .doc-preview { border: none; padding: 10px 0; box-shadow: none; }
  .doc-preview table { font-size: 9px; }
  .doc-preview td, .doc-preview th { padding: 3px 5px; }
  .print-footer {
    display: block !important; position: fixed; bottom: 0; left: 0; right: 0;
    text-align: center; font-size: 8px; color: #999; padding: 4px 0;
  }
  /* Timesheet print — fit on one landscape page */
  #ts-stats { grid-template-columns: repeat(6, 1fr) !important; gap: 4px; margin-bottom: 6px; }
  #ts-stats .metric { padding: 4px 6px; }
  #ts-stats .metric .lbl { font-size: 7px; margin-bottom: 1px; }
  #ts-stats .metric .val { font-size: 11px !important; }
  #ts-stats .metric div:last-child { font-size: 7px !important; }
  #module-timesheet .card { border: 0.5px solid #ddd; padding: 0; margin-bottom: 0; }
  #ts-tbody tr td { padding: 2px 4px !important; font-size: 8px; }
  #ts-tbody .ts-ie, #ts-tbody .ts-ie-note { font-size: 8px; padding: 0; }
  #module-timesheet th { font-size: 7px; padding: 3px 4px; }
  #module-timesheet .ts-badge { font-size: 7px; padding: 1px 5px; }
  #module-timesheet .ts-chip { font-size: 7px; padding: 1px 5px; }
  #ts-ew > .card > div:last-child { display: none; } /* hide "Kliknij Rodzaj..." hint */
}

/* === Payroll / Listy plac === */
.pay-topbar { display: flex; align-items: center; gap: 8px; padding-bottom: 14px; border-bottom: 0.5px solid var(--color-border-tertiary); margin-bottom: 16px; flex-wrap: wrap; }
.pay-bc { display: flex; align-items: center; gap: 6px; font-size: 13px; flex: 1; }
.pay-bc-item { color: var(--accent); cursor: pointer; font-weight: 500; background: none; border: none; font-size: 13px; padding: 0; }
.pay-bc-item:hover { text-decoration: underline; }
.pay-bc-sep { color: var(--color-text-secondary); }
.pay-bc-cur { color: var(--color-text-primary); font-weight: 500; }

.pay-dropzone { border: 2px dashed var(--color-border-secondary); border-radius: 12px; padding: 28px 20px; text-align: center; transition: all .15s; cursor: pointer; margin-bottom: 16px; }
.pay-dropzone:hover, .pay-dropzone.drag-over { border-color: var(--accent); background: rgba(109,40,217,.03); }

.pay-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.pay-card { background: var(--color-background-primary); border: 0.5px solid var(--color-border-tertiary); border-radius: 10px; padding: 14px; cursor: pointer; transition: all .15s; position: relative; display: flex; flex-direction: column; gap: 8px; }
.pay-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109,40,217,.08); }
.pay-card-icon { font-size: 32px; line-height: 1; }
.pay-card.folder .pay-card-icon { color: var(--accent); }
.pay-card.pdf .pay-card-icon { color: #dc2626; }
.pay-card.pdf { cursor: default; }
.pay-card-name { font-size: 13px; font-weight: 500; word-break: break-word; line-height: 1.3; }
.pay-card-meta { font-size: 10px; color: var(--color-text-secondary); }
.pay-card-actions { display: none; position: absolute; top: 8px; right: 8px; gap: 4px; }
.pay-card:hover .pay-card-actions { display: flex; }

.pay-ctx { display: none; position: fixed; background: var(--color-background-primary); border: 0.5px solid var(--color-border-secondary); border-radius: 8px; z-index: 500; min-width: 160px; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.pay-ctx.open { display: block; }
.pay-ctx-item { padding: 8px 14px; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.pay-ctx-item:hover { background: var(--color-background-secondary); }
.pay-ctx-sep { height: 0.5px; background: var(--color-border-tertiary); margin: 2px 0; }
.pay-ctx-danger { color: #dc2626; }

.pay-progress { background: var(--color-background-secondary); border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; font-size: 12px; }
.pay-progress-bar { flex: 1; height: 4px; background: var(--color-border-tertiary); border-radius: 2px; overflow: hidden; }
.pay-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width .3s; }

/* === Recipes table === */
.rec-tbl { width: 100%; border-collapse: collapse; }
.rec-tbl thead th { font-size: 11px; font-weight: 500; color: var(--color-text-secondary); padding: 7px 10px; text-align: left; border-bottom: 0.5px solid var(--color-border-secondary); white-space: nowrap; position: sticky; top: 0; z-index: 10; background: var(--color-background-secondary); }
.rec-tbl tbody tr.rec-row { border-bottom: 0.5px solid var(--color-border-tertiary); cursor: pointer; }
.rec-tbl tbody tr.rec-row:hover td { background: var(--color-background-secondary); }
.rec-tbl tbody tr.rec-row.selected td { background: #f3f0ff; }
.rec-tbl td { font-size: 13px; color: var(--color-text-primary); padding: 6px 10px; vertical-align: middle; }
.rec-badge-ufi { font-size: 10px; padding: 1px 6px; border-radius: 20px; background: #fff8e1; color: #b45309; font-weight: 500; white-space: nowrap; margin-left: 6px; }
.rec-chevron { font-size: 10px; color: var(--color-text-tertiary); }
.rec-detail td { padding: 0; }
.rec-detail-inner { padding: 12px 16px 14px 52px; background: var(--color-background-secondary); border-bottom: 0.5px solid var(--color-border-secondary); }
.rec-d-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.rec-d-field label { font-size: 10px; color: var(--color-text-secondary); display: block; margin-bottom: 2px; }
.rec-d-field span { font-size: 13px; color: var(--color-text-primary); }
.rec-frag-row { display: flex; justify-content: space-between; padding: 4px 8px; background: var(--color-background-primary); border-radius: 5px; margin-bottom: 3px; font-size: 12px; }
.rec-ufi-box { display: inline-block; padding: 4px 10px; background: #fff8e1; border-radius: 6px; margin-bottom: 10px; }
.rec-ufi-box .lbl { font-size: 10px; color: #b45309; font-weight: 500; }
.rec-ufi-box .val { font-size: 12px; font-family: monospace; color: #b45309; }
.rec-folder-btn { background: none; border: none; cursor: pointer; padding: 3px 6px; border-radius: 5px; color: var(--color-text-secondary); font-size: 15px; line-height: 1; }
.rec-folder-btn:hover { background: var(--color-background-secondary); color: var(--color-text-primary); }
.rec-file-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--color-background-secondary); border-radius: 7px; margin-bottom: 6px; }
.rec-drop-zone { border: 1.5px dashed var(--color-border-secondary); border-radius: 8px; padding: 1.2rem; text-align: center; color: var(--color-text-secondary); font-size: 13px; cursor: pointer; margin-bottom: 1rem; }
.rec-drop-zone:hover { border-color: var(--accent); background: rgba(109,40,217,.03); }

/* === Sidebar accordion submenu === */
.sb-submenu { max-height: 0; overflow: hidden; transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.sb-submenu.open { max-height: 200px; }
.sb-sub { padding-left: 30px !important; font-size: 12px !important; }
.sb-arrow { font-size: 9px; margin-left: auto; transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1); display: inline-block; color: #bbb; }
.sb-submenu.open ~ .sb-item .sb-arrow,
.sb-arrow.rotated { transform: rotate(90deg); }
.sidebar.collapsed .sb-submenu { display: none; }
.sidebar.collapsed .sb-arrow { display: none; }

.pay-rename { font-size: 13px; font-weight: 500; padding: 2px 6px; border-radius: 4px; border: 0.5px solid var(--accent); width: 100%; background: var(--color-background-primary); color: var(--color-text-primary); outline: none; }
