/* ============================================================
   BFPOS CRM - Design System
   Extracted from mobile mockups (BF Solutions GmbH).
   ============================================================ */

:root {
  /* --- Brand colors --- */
  --brand-green: #10b981;
  --brand-green-dark: #059669;
  --brand-green-light: #d1fae5;

  /* --- Accent colors (status & KPI top bars) --- */
  --accent-blue: #2563eb;
  --accent-blue-light: #dbeafe;
  --accent-red: #ef4444;
  --accent-red-light: #fee2e2;
  --accent-orange: #f59e0b;
  --accent-orange-light: #fef3c7;
  --accent-purple: #8b5cf6;
  --accent-purple-light: #ede9fe;
  --accent-teal: #14b8a6;
  --accent-navy: #1e3a8a;
  --accent-mastercard: #eb001b;

  /* --- Surfaces --- */
  --bg-page: #f5f6f8;
  --bg-card: #ffffff;
  --bg-header: #0b1220;
  --bg-input: #ffffff;
  --bg-soft: #f9fafb;
  --bg-elevated: #ffffff;

  /* --- Text --- */
  --text-primary: #0b1220;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  --text-on-dark-secondary: #9ca3af;

  /* --- Borders --- */
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --border-dark: #1f2937;

  /* --- Radius --- */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;

  /* --- Shadows --- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);

  /* --- Spacing scale --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;

  /* --- Typography --- */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* --- Layout --- */
  --header-h: 56px;
  --nav-h: 64px;
  --container-max: 720px;

  /* --- Transitions --- */
  --t-fast: 120ms ease;
  --t-base: 200ms ease;
}

/* ============================================================
   Reset & base
   ============================================================ */

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ============================================================
   Layout
   ============================================================ */

.app-shell {
  min-height: 100vh;
  padding-top: var(--header-h);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-5);
}

.page-header {
  margin-bottom: var(--sp-5);
}

.page-header h1 {
  font-size: 28px;
  margin-bottom: var(--sp-1);
}

.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 15px;
}

/* ============================================================
   Top header (BFPOS CRM)
   ============================================================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg-header);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--sp-4);
  z-index: 50;
}

.header__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.header__brand .brand-bf {
  font-weight: 800;
}

.header__brand .brand-pos {
  font-weight: 500;
  color: #d1d5db;
}

.header__brand .brand-sub {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--text-on-dark-secondary);
  text-transform: uppercase;
  margin-left: var(--sp-3);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.header__admin-link {
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  transition: background var(--t-fast);
}
.header__admin-link:hover { background: rgba(255,255,255,0.08); }

.header .avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  background: var(--brand-green);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex: none;
}

/* --- Desktop top navigation (tabs in the dark header bar) --- */
.header__nav {
  display: none; /* shown >=900px; bottom nav handles mobile */
  align-items: center;
  gap: 0;
  margin: 0 auto 0 var(--sp-4);
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.header__nav::-webkit-scrollbar { display: none; }
.header__nav-link {
  position: relative;
  padding: 0 9px;
  height: var(--header-h);
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-on-dark-secondary);
  transition: color var(--t-fast);
}
.header__nav-link:hover { color: #fff; }
.header__nav-link.is-active { color: #fff; }
.header__nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 0;
  height: 2px;
  background: var(--brand-green);
  border-radius: var(--r-pill);
}

/* --- Search pill (opens Cmd+K modal) --- */
.header__search-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px 0 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.65);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.header__search-trigger:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.22);
}
.header__kbd {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.7);
}

/* --- User cluster (avatar + name + logout) --- */
.header__user {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.header__user-name {
  display: none; /* shown >=900px */
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.header__logout-form { display: none; margin: 0; } /* shown >=900px */
.header__logout {
  background: none;
  border: 0;
  color: var(--text-on-dark-secondary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: background var(--t-fast), color var(--t-fast);
}
.header__logout:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* --- Global header search --- */
.header__search {
  position: relative;
  flex: 1;
  max-width: 360px;
  margin: 0 var(--sp-4);
}
.header__search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--r-md);
  padding: 8px 12px;
  color: #fff;
  font-size: 14px;
  outline: none;
}
.header__search-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.header__search-input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--brand-green);
}
.header__search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 60;
}
.header__search-results:empty { display: none; }
.search-empty {
  padding: var(--sp-4) var(--sp-5);
  color: var(--text-secondary);
  font-size: 14px;
  text-align: center;
}
.search-meta {
  padding: var(--sp-2) var(--sp-5);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.search-group__label {
  padding: var(--sp-3) var(--sp-5) 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-weight: 700;
}
.search-item {
  display: block;
  position: relative;
  padding: var(--sp-3) var(--sp-5);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
}
.search-item:last-child { border-bottom: 0; }
.search-item:hover { background: var(--bg-soft); }
.search-item__title { font-weight: 700; font-size: 14px; }
.search-item__sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.search-item__badge { position: absolute; top: var(--sp-3); right: var(--sp-5); }

[x-cloak] { display: none !important; }

/* --- Notification bell + dropdown --- */
.notif { position: relative; }
.notif-bell {
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  position: relative;
  transition: background var(--t-fast);
}
.notif-bell:hover { background: rgba(255,255,255,0.08); }
.notif-bell__badge { position: absolute; top: 4px; right: 4px; }
.notif-badge {
  background: var(--accent-red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: var(--r-pill);
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
  display: inline-block;
}
.notif-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 360px;
  max-width: calc(100vw - var(--sp-5) * 2);
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  max-height: 70vh;
  overflow-y: auto;
  z-index: 60;
}
.notif-panel__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.notif-mark-all {
  font-size: 12px;
  color: var(--brand-green);
  font-weight: 600;
}
.notif-mark-all:hover { text-decoration: underline; }
.notif-empty {
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.notif-item {
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: 0; }
.notif-item button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  text-align: left;
  cursor: pointer;
}
.notif-item--unread button { background: rgba(16, 185, 129, 0.04); }
.notif-item button:hover { background: var(--bg-soft); }
.notif-item__icon {
  width: 28px; height: 28px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
  flex-shrink: 0;
}
.notif-item__icon--green { background: var(--brand-green-light); color: var(--brand-green-dark); }
.notif-item__icon--orange { background: var(--accent-orange-light); color: #b45309; }
.notif-item__icon--red { background: var(--accent-red-light); color: #b91c1c; }
.notif-item__icon--neutral { background: var(--bg-soft); color: var(--text-secondary); }
.notif-item__body { flex: 1; min-width: 0; }
.notif-item__title { font-weight: 600; font-size: 13px; }
.notif-item__sub { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.notif-item__time { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* --- Bulk action sticky bar (shared by Firmen/Angebote/Tasks lists) --- */
.bulk-checkbox input { width: 18px; height: 18px; cursor: pointer; }
.bulk-bar {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  left: 0; right: 0;
  background: var(--bg-header);
  color: #fff;
  padding: var(--sp-3) var(--sp-5);
  box-shadow: 0 -8px 24px rgba(0,0,0,0.15);
  z-index: 30;
}
.bulk-bar__form { max-width: var(--container-max); margin: 0 auto; }
.bulk-bar__divider { width: 1px; height: 24px; background: rgba(255,255,255,0.15); }
.bulk-bar__select {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 13px;
  padding: 6px 10px;
}
.bulk-bar__select option { background: var(--bg-header); color: #fff; }

@media (max-width: 720px) {
  .header__search { max-width: none; margin: 0 var(--sp-2); }
  .header__brand .brand-sub { display: none; }
}

/* ============================================================
   Bottom navigation (mobile-first tabs)
   ============================================================ */

.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  z-index: 40;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  position: relative;
  text-align: center;
  padding: 4px 0;
}

.nav-item__icon {
  width: 22px;
  height: 22px;
  stroke-width: 2;
}

.nav-item.is-active {
  color: var(--brand-green);
  font-weight: 700;
}

.nav-item.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 25%;
  right: 25%;
  height: 2px;
  background: var(--brand-green);
  border-radius: var(--r-pill);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  transition: background var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--brand-green);
  color: #fff;
}

.btn--primary:hover {
  background: var(--brand-green-dark);
}

.btn--secondary {
  background: #1f2937;
  color: #fff;
}

.btn--danger {
  background: var(--accent-red);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn--full {
  width: 100%;
}

.btn--pill {
  border-radius: var(--r-pill);
}

/* ============================================================
   Cards
   ============================================================ */

.card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

.card--flat {
  box-shadow: none;
}

.card--padless {
  padding: 0;
  overflow: hidden;
}

/* Card with colored accent top bar (KPI / status cards). */
.kpi-card {
  background: var(--bg-card);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--kpi-color, var(--brand-green));
}

.kpi-card--green {
  --kpi-color: var(--brand-green);
}
.kpi-card--blue {
  --kpi-color: var(--accent-blue);
}
.kpi-card--red {
  --kpi-color: var(--accent-red);
}
.kpi-card--orange {
  --kpi-color: var(--accent-orange);
}
.kpi-card--purple {
  --kpi-color: var(--accent-purple);
}
.kpi-card--navy {
  --kpi-color: var(--accent-navy);
}

.kpi-card__label {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: var(--sp-2);
}

.kpi-card__value {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-1);
}

.kpi-card__sub {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================================
   Grid helpers
   ============================================================ */

.grid {
  display: grid;
  gap: var(--sp-4);
}

.grid--2 {
  grid-template-columns: 1fr 1fr;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.row--between {
  justify-content: space-between;
}

/* ============================================================
   Badges / pills / status dots
   ============================================================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--text-secondary);
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--text-secondary);
}

.badge--green {
  background: var(--brand-green-light);
  color: var(--brand-green-dark);
}
.badge--green::before {
  background: var(--brand-green);
}

.badge--orange {
  background: var(--accent-orange-light);
  color: #b45309;
}
.badge--orange::before {
  background: var(--accent-orange);
}

.badge--blue {
  background: var(--accent-blue-light);
  color: #1e3a8a;
}
.badge--blue::before {
  background: var(--accent-blue);
}

.badge--purple {
  background: var(--accent-purple-light);
  color: #6d28d9;
}
.badge--purple::before {
  background: var(--accent-purple);
}

.badge--red {
  background: var(--accent-red-light);
  color: #b91c1c;
}
.badge--red::before {
  background: var(--accent-red);
}

.badge--neutral {
  background: #f3f4f6;
  color: #4b5563;
}

/* Filter pills (Alle / Entwurf / Gesendet) */
.pills {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  scrollbar-width: none;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.pill.is-active {
  background: var(--bg-header);
  color: #fff;
  border-color: var(--bg-header);
}

/* Status dot (small color circle next to records) */
.dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--text-muted);
  display: inline-block;
}

.dot--green {
  background: var(--brand-green);
}
.dot--blue {
  background: var(--accent-blue);
}
.dot--red {
  background: var(--accent-red);
}
.dot--orange {
  background: var(--accent-orange);
}
.dot--purple {
  background: var(--accent-purple);
}

/* ============================================================
   Forms
   ============================================================ */

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
}

.form-field label,
.label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-secondary);
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: 15px;
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--brand-green);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.input--dark {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.input--dark::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

/* Search input with icon */
.search {
  position: relative;
}

.search .input {
  padding-left: 38px;
}

.search::before {
  content: '⌕';
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
}

/* ============================================================
   List items (Firma list, Email list, Task list)
   ============================================================ */

.list-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.list-item__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--sp-3);
}

.list-item__title {
  font-weight: 700;
  font-size: 16px;
  color: var(--text-primary);
}

.list-item__sub {
  color: var(--text-secondary);
  font-size: 13px;
}

.list-item__amount {
  color: var(--brand-green);
  font-weight: 700;
  font-size: 15px;
}

/* ============================================================
   Tables
   ============================================================ */

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 14px;
  text-align: left;
}

.table thead th {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  border-bottom: 1px solid var(--border);
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--brand-green-dark);
}

/* ============================================================
   Tabs (page-level secondary nav)
   ============================================================ */

.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
}

.tab {
  flex: 1;
  padding: var(--sp-3) var(--sp-2);
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  font-size: 14px;
  cursor: pointer;
}

.tab.is-active {
  color: var(--text-primary);
  border-bottom-color: var(--brand-green);
}

/* ============================================================
   Section heading with number badge (Angebote sections)
   ============================================================ */

.section-h {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.section-h__num {
  width: 28px;
  height: 28px;
  border-radius: var(--r-pill);
  background: var(--bg-header);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.section-h__title {
  font-size: 16px;
  font-weight: 700;
}

.section-h__rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   Auth screen (login) - dark gradient
   ============================================================ */

.auth-shell {
  min-height: 100vh;
  background: linear-gradient(180deg, #0b1220 0%, #0f172a 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-8) var(--sp-5);
  color: #fff;
}

.auth-brand {
  text-align: center;
  margin-bottom: var(--sp-8);
}

.auth-brand__logo {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: var(--sp-2);
}

.auth-brand__logo .pos {
  font-weight: 500;
  color: #d1d5db;
}

.auth-brand__sub {
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--text-on-dark-secondary);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--r-xl);
  padding: var(--sp-8);
}

.auth-card h2 {
  color: #fff;
  font-size: 22px;
  margin-bottom: var(--sp-2);
}

.auth-card .muted {
  color: var(--text-on-dark-secondary);
  font-size: 14px;
  margin-bottom: var(--sp-6);
}

.auth-card .form-field label {
  color: var(--text-on-dark-secondary);
}

.auth-footer {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.auth-footer__label {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-dark-secondary);
  margin-bottom: var(--sp-3);
}

.auth-footer__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.auth-chip {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.auth-chip:hover {
  background: rgba(255, 255, 255, 0.1);
}

.auth-version {
  margin-top: var(--sp-8);
  font-size: 12px;
  color: var(--text-on-dark-secondary);
  text-align: center;
}

/* ============================================================
   Utility
   ============================================================ */

.muted {
  color: var(--text-secondary);
}
.text-sm {
  font-size: 13px;
}
.text-lg {
  font-size: 18px;
}
.text-bold {
  font-weight: 700;
}
.text-right {
  text-align: right;
}
.text-green {
  color: var(--brand-green);
}
.text-red {
  color: var(--accent-red);
}
.text-blue {
  color: var(--accent-blue);
}

.mt-1 { margin-top: var(--sp-1); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }

.mb-1 { margin-bottom: var(--sp-1); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }

.hidden { display: none; }

/* Mobile first - na sirim ekranima container je veci ali nav ostaje bottom za sad */
@media (min-width: 900px) {
  :root {
    --container-max: 1100px;
  }
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--2-desktop {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid--3-desktop {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4-desktop {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   Ivan-inspired UI polish (added 2026-06-22)
   ============================================================ */

/* Wider container variant for data-heavy pages (Hardware, Expenses, Reports). */
.container--wide { max-width: 1200px; }

/* Filter chip / pill: rounded toggle for status / category filters. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--t-fast);
  font-family: inherit;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip--active { background: var(--brand-green-light); color: var(--brand-green-dark); border-color: var(--brand-green); }
.chip--blue.chip--active { background: var(--accent-blue-light); color: #1e3a8a; border-color: var(--accent-blue); }
.chip--orange.chip--active { background: var(--accent-orange-light); color: #b45309; border-color: var(--accent-orange); }
.chip--red.chip--active { background: var(--accent-red-light); color: #b91c1c; border-color: var(--accent-red); }
.chip--purple.chip--active { background: var(--accent-purple-light); color: #6d28d9; border-color: var(--accent-purple); }
.chip__count { opacity: 0.7; font-weight: 600; }

/* Filter bar - horizontal scrollable on mobile. */
.filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: var(--sp-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}
.filter-bar::-webkit-scrollbar { display: none; }

/* Action chip: tiny colored button for inline actions (approve/reject/paid). */
.action-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-md);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  font-family: inherit;
  background: var(--bg-soft);
  color: var(--text-secondary);
  transition: opacity var(--t-fast);
}
.action-chip:hover { opacity: 0.85; }
.action-chip--green { background: var(--brand-green-light); color: var(--brand-green-dark); }
.action-chip--blue { background: var(--accent-blue-light); color: #1e3a8a; }
.action-chip--red { background: var(--accent-red-light); color: #b91c1c; }
.action-chip--orange { background: var(--accent-orange-light); color: #b45309; }

/* Section card with numbered header (Proposal-style sections). */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-4);
  box-shadow: var(--shadow-sm);
}
.section-card__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.section-card__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--text-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.section-card__title { font-size: 14px; font-weight: 700; color: var(--text-primary); flex: 1; }
.section-card__body { padding: var(--sp-5); }

/* Polished list rows for entities (Hardware, Expenses, Companies). */
.list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.list-row:last-child { border-bottom: none; }
.list-row:hover { background: var(--bg-soft); }
.list-row__icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 2px; }
.list-row__sub { font-size: 12px; color: var(--text-secondary); }
.list-row__amount { font-size: 18px; font-weight: 900; color: var(--text-primary); text-align: right; letter-spacing: -0.02em; }

/* Greeting block (Home dashboard). */
.greeting {
  margin-bottom: var(--sp-6);
}
.greeting__hello {
  font-size: 28px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin-bottom: 4px;
}
.greeting__date { font-size: 14px; color: var(--text-secondary); }

/* Quick-action button (Home dashboard). */
.quick-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all var(--t-fast);
}
.quick-action:hover { background: var(--bg-soft); border-color: var(--border-strong); }
.quick-action--primary {
  background: var(--brand-green);
  color: #fff;
  border-color: var(--brand-green);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}
.quick-action--primary:hover { background: var(--brand-green-dark); border-color: var(--brand-green-dark); }

/* Improved KPI cards on desktop - bigger numbers, premium feel. */
@media (min-width: 900px) {
  .kpi-card { padding: 18px 20px; }
  .kpi-card__value { font-size: 28px; }
}

/* Pipeline-style horizontal scroll bars (Forecast charts area). */
.scroll-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--sp-2);
}

/* ============================================================
   Cmd+K Global Search Modal
   ============================================================ */
.cmdk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  justify-content: center;
  padding: 80px 24px 24px;
}
@media (max-width: 600px) { .cmdk-overlay { padding: 40px 14px 14px; } }

.cmdk-modal {
  background: var(--bg-card);
  border-radius: 14px;
  width: 100%;
  max-width: 640px;
  max-height: 75vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  overflow: hidden;
}
.cmdk-input-wrap {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.cmdk-icon { font-size: 18px; opacity: 0.6; }
.cmdk-input {
  flex: 1;
  border: none;
  padding: 6px 0;
  font-size: 15px;
  outline: none;
  font-family: inherit;
  color: var(--text-primary);
  background: transparent;
}
.cmdk-esc {
  padding: 3px 8px;
  background: var(--bg-soft);
  border: none;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: monospace;
}
.cmdk-results { flex: 1; overflow-y: auto; }
.cmdk-hint {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============================================================
   Mobile bottom nav "Mehr" drawer
   ============================================================ */
.mehr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 48;
}
.mehr-drawer {
  position: fixed;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  background: var(--bg-card);
  z-index: 49;
  border-top: 1px solid var(--border);
  border-radius: 20px 20px 0 0;
  padding-bottom: var(--sp-2);
  box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
}
.mehr-drawer__label {
  padding: 12px 16px 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.mehr-drawer__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 0 12px 12px;
}
.mehr-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  transition: all var(--t-fast);
}
.mehr-tile:hover {
  border-color: var(--brand-green);
  background: var(--brand-green-light);
  color: var(--brand-green-dark);
}
.mehr-tile__icon { font-size: 18px; }

@media (min-width: 900px) {
  .mehr-drawer { display: none; }
  .mehr-overlay { display: none; }
}

/* ============================================================
   Desktop chrome: top tab-nav replaces the mobile bottom nav.
   ============================================================ */
@media (min-width: 900px) {
  .header__nav { display: flex; }
  .header__user-name { display: inline; }
  .header__logout-form { display: block; }
  /* Bottom nav is mobile-only once the top tabs are visible. */
  .nav-bottom { display: none; }
  .app-shell { padding-bottom: var(--sp-6); }
}

/* On narrow screens collapse the search pill to just its icon. */
@media (max-width: 640px) {
  .header__search-trigger span,
  .header__kbd { display: none; }
  .header__search-trigger { padding: 0; width: 34px; justify-content: center; }
}

/* ============================================================
   Home: pipeline overview bars + two-column layout
   ============================================================ */
.home-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-4);
}
@media (min-width: 1000px) {
  .home-cols { grid-template-columns: 1.5fr 1fr; align-items: start; }
}

.pipe-row { margin-bottom: var(--sp-3); }
.pipe-row:last-child { margin-bottom: 0; }
.pipe-row__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.pipe-row__name { font-size: 13px; font-weight: 700; color: var(--text-primary); }
.pipe-row__val { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.pipe-bar {
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  overflow: hidden;
}
.pipe-bar__fill { height: 100%; border-radius: var(--r-pill); transition: width var(--t-slow); }
.pipe-bar__fill--neutral { background: #cbd5e1; }
.pipe-bar__fill--blue    { background: var(--accent-blue); }
.pipe-bar__fill--purple  { background: var(--accent-purple); }
.pipe-bar__fill--orange  { background: var(--accent-orange); }
.pipe-bar__fill--navy    { background: var(--accent-navy); }
.pipe-bar__fill--green   { background: var(--brand-green); }
.pipe-bar__fill--red     { background: var(--accent-red); }

/* ============================================================
   Admin menu (gear dropdown in header, admin-only)
   ============================================================ */
.admin-menu { position: relative; }
.admin-menu__btn {
  width: 36px; height: 36px;
  border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
  transition: background var(--t-fast);
}
.admin-menu__btn:hover { background: rgba(255,255,255,0.08); }
.admin-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: var(--sp-2);
  z-index: 60;
}
.admin-menu__label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3) var(--sp-1);
}
.admin-menu__item {
  display: block;
  padding: 9px var(--sp-3);
  border-radius: var(--r-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: background var(--t-fast);
}
.admin-menu__item:hover { background: var(--bg-soft); color: var(--brand-green-dark); }

/* ============================================================
   Angebot editor (Phase 4): repeaters, hardware grid, gastro tiers
   ============================================================ */
.repeater-row {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin-bottom: 8px;
}
.repeater-x {
  background: none; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: 18px; line-height: 1;
  padding: 0 4px; flex-shrink: 0;
}
.repeater-x:hover { color: var(--accent-red); }
.hw-grid {
  display: grid;
  grid-template-columns: 1.6fr 1.4fr 1fr 60px 100px 28px;
  gap: 8px;
  align-items: center;
}
@media (max-width: 760px) { .hw-grid { grid-template-columns: 1fr 1fr; } }

.gastro-tier {
  text-align: left;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  cursor: pointer;
  background: var(--bg-card);
  font-family: inherit;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.gastro-tier:hover { border-color: var(--border-strong); }
.gastro-tier.is-active { border-color: var(--brand-green); background: var(--brand-green-light); }
.gastro-tier__badge {
  font-size: 10px; font-weight: 800; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--brand-green-dark); margin-bottom: 4px;
}
.gastro-tier__label { font-size: 14px; font-weight: 700; color: var(--text-primary); }

/* Firma CM1 editor grids */
.acq-grid { display:grid; grid-template-columns: 1.2fr 1.3fr 1.4fr 1.2fr 28px; gap:8px; align-items:center; }
.pm-grid  { display:grid; grid-template-columns: 1.3fr 1fr 1fr 1.2fr 1fr 28px; gap:8px; align-items:center; }
@media (max-width: 760px) { .acq-grid, .pm-grid { grid-template-columns: 1fr 1fr; } }

/* ---- Forecast (interactive /mehr) ---- */
.fc-slider input[type=range] {
  -webkit-appearance: none; appearance: none; height: 6px; border-radius: 4px;
  background: var(--brand-green-light); outline: none; cursor: pointer;
}
.fc-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px;
  border-radius: 50%; background: var(--brand-green); border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.fc-slider input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--brand-green);
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.table--compact th, .table--compact td { padding: 6px 10px; font-size: 13px; }
