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

:root {
  /* Colors */
  --blue: #4F46E5;
  --blue-dark: #4338CA;
  --blue-light: #EEF2FF;
  --blue-ring: rgba(79,70,229,0.15);
  --green: #10B981;
  --green-light: #ECFDF5;
  --amber: #F59E0B;
  --amber-light: #FFFBEB;
  --red: #EF4444;
  --red-light: #FEF2F2;
  --purple: #8B5CF6;

  /* Neutrals */
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;

  /* Semantic aliases for red/green (used via var(--danger) etc.) */
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --primary: #4F46E5;
  --primary-light: #EEF2FF;
  --border: #E2E8F0;

  /* Sidebar */
  --sidebar-bg: #1E1B4B;
  --sidebar-w: 256px;

  /* Layout */
  --topbar-h: 60px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 20px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 50px rgba(0,0,0,0.12);
  --transition: 150ms ease;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: light; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--gray-900);
  background: var(--gray-100);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }

/* ══════════════════════════════════════════════
   LOGIN PAGE
══════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: linear-gradient(135deg, var(--gray-900) 0%, #1e3a8a 60%, var(--gray-900) 100%);
  background-size: 300% 300%;
  animation: bgShift 10s ease infinite;
  position: relative;
  overflow: hidden;
}
.login-page::before,
.login-page::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37,99,235,.2) 0%, transparent 70%);
  pointer-events: none;
}
.login-page::before { width:600px; height:600px; top:-200px; right:-200px; animation: pulse 7s ease-in-out infinite; }
.login-page::after  { width:400px; height:400px; bottom:-100px; left:-100px; animation: pulse 9s ease-in-out infinite reverse; }
@keyframes bgShift { 0%,100%{background-position:0 50%} 50%{background-position:100% 50%} }
@keyframes pulse   { 0%,100%{transform:scale(1);opacity:.5} 50%{transform:scale(1.15);opacity:1} }

.login-box {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.35);
  position: relative;
  z-index: 10;
  animation: slideUp .4s ease;
}
@keyframes slideUp { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

.login-icon {
  width: 64px; height: 64px;
  background: var(--blue-light);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 0 8px rgba(37,99,235,.08);
}
.login-icon i { font-size: 2rem; color: var(--blue); }
.login-title { font-size: 1.5rem; font-weight: 800; text-align: center; color: var(--gray-900); letter-spacing: -.025em; margin-bottom: .25rem; }
.login-subtitle { text-align: center; color: var(--gray-500); font-size: .875rem; margin-bottom: 2rem; }
.login-footer { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--gray-200); text-align: center; }

/* ══════════════════════════════════════════════
   APP LAYOUT
══════════════════════════════════════════════ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  z-index: 1000;
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.08) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.sidebar-brand {
  padding: 1.125rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.brand-link {
  display: flex; align-items: center; gap: .75rem;
  color: #fff; text-decoration: none;
}
.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(99,102,241,.5);
  flex-shrink: 0;
}
.brand-icon i { font-size: 1.1rem; color: #fff; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: .875rem; font-weight: 700; color: #fff; line-height: 1.3; }
.brand-sub  { font-size: .675rem; color: rgba(255,255,255,.35); font-weight: 400; }
.sidebar-close-btn { background: none; border: none; color: rgba(255,255,255,.4); font-size: 1.1rem; cursor: pointer; padding: .25rem; }
.sidebar-close-btn:hover { color: rgba(255,255,255,.8); }

.sidebar-nav {
  padding: .75rem .75rem 0;
  flex: 1;
}
.nav-section-label {
  font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.28);
  padding: .75rem .5rem .3rem; margin: 0;
}
.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .875rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,.65);
  font-size: .8375rem; font-weight: 500;
  text-decoration: none;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}
.nav-item i { font-size: 1rem; flex-shrink: 0; }
.nav-item span { flex: 1; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: linear-gradient(135deg, var(--blue), #6366F1); color: #fff; box-shadow: 0 2px 12px rgba(79,70,229,.4); }
.nav-badge {
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.9);
  font-size: .65rem; font-weight: 700;
  padding: .15em .5em; border-radius: 10px; min-width: 20px; text-align: center;
}
.nav-item.active .nav-badge { background: rgba(255,255,255,.25); }

.sidebar-footer {
  padding: .875rem 1rem;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .625rem;
  flex-shrink: 0;
}
.sidebar-user { display: flex; align-items: center; gap: .625rem; flex: 1; min-width: 0; }
.user-avatar i { font-size: 1.75rem; color: rgba(255,255,255,.4); }
.user-info { display: flex; flex-direction: column; min-width: 0; }
.user-name   { font-size: .775rem; font-weight: 600; color: rgba(255,255,255,.85); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status { font-size: .675rem; color: rgba(255,255,255,.35); }
.logout-btn { color: rgba(255,255,255,.4); font-size: 1.1rem; padding: .375rem; border-radius: var(--radius-sm); transition: all var(--transition); }
.logout-btn:hover { background: rgba(239,68,68,.2); color: #fca5a5; }

.sidebar-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.5); z-index: 999; backdrop-filter: blur(2px);
}
.sidebar-overlay.show { display: block; }

/* ══════════════════════════════════════════════
   MAIN CONTENT AREA
══════════════════════════════════════════════ */
.main-wrap {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}
.topbar {
  height: var(--topbar-h);
  background: #fff;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-xs);
}
.topbar-toggle { background: none; border: 1px solid var(--gray-200); border-radius: var(--radius-sm); padding: .3rem .5rem; color: var(--gray-600); cursor: pointer; font-size: 1.1rem; }
.topbar-toggle:hover { background: var(--gray-100); }
.topbar-left { flex: 1; }
.topbar-title { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin: 0; letter-spacing: -.01em; }
.topbar-right { display: flex; align-items: center; gap: .75rem; }
.topbar-date { font-size: .775rem; color: var(--gray-500); display: flex; align-items: center; gap: .4rem; }
.page-content { padding: 1.75rem; flex: 1; }

/* ══════════════════════════════════════════════
   CARDS
══════════════════════════════════════════════ */
.card {
  background: #ffffff !important;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: visible;
  color: #1E293B;
  color-scheme: light;
}
.card > .card-header:first-child {
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-200);
  background: #fff;
  display: flex; align-items: center; gap: .75rem;
}
.card-header-icon {
  width: 30px; height: 30px;
  background: var(--blue-light);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--blue); font-size: .875rem; flex-shrink: 0;
}
.card-title { font-size: .875rem; font-weight: 700; color: var(--gray-900); flex: 1; margin: 0; }
.card-body { padding: 1.25rem; }
.card-footer { padding: .875rem 1.25rem; border-top: 1px solid var(--gray-200); background: var(--gray-50); }

/* ══════════════════════════════════════════════
   STAT CARDS
══════════════════════════════════════════════ */
.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-icon-blue   { background: var(--blue-light); color: var(--blue); }
.stat-icon-green  { background: var(--green-light); color: var(--green); }
.stat-icon-amber  { background: var(--amber-light); color: var(--amber); }
.stat-icon-red    { background: var(--red-light); color: var(--red); }
.stat-info {}
.stat-label { font-size: .75rem; font-weight: 500; color: var(--gray-500); margin-bottom: .25rem; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 1.375rem; font-weight: 800; color: var(--gray-900); line-height: 1.2; letter-spacing: -.02em; }
.stat-sub { font-size: .75rem; color: var(--gray-500); margin-top: .2rem; }

/* ══════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: center; gap: .875rem;
  margin-bottom: 1.5rem; flex-wrap: wrap;
}
.page-header-title { font-size: 1.375rem; font-weight: 800; color: var(--gray-900); letter-spacing: -.025em; margin: 0; }
.page-count { background: var(--gray-200); color: var(--gray-600); font-size: .7rem; font-weight: 700; padding: .2em .6em; border-radius: 20px; }
.page-header-actions { margin-left: auto; display: flex; gap: .5rem; }

/* Breadcrumb */
.breadcrumb-bar {
  display: flex; align-items: center; gap: .5rem;
  margin-bottom: 1.25rem; flex-wrap: wrap;
}
.breadcrumb-sep { color: var(--gray-400); font-size: .875rem; }
.breadcrumb-current { font-weight: 700; color: var(--gray-900); }

/* ══════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════ */
.table { font-size: .8375rem; width: 100%; border-collapse: collapse; margin: 0; }
.table thead th {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--gray-500);
  background: var(--gray-50); border-bottom: 1px solid var(--gray-200);
  padding: .875rem 1.125rem; white-space: nowrap; border-top: none;
}
.table tbody td {
  padding: .875rem 1.125rem; vertical-align: middle;
  border-bottom: 1px solid #E2E8F0; color: #1E293B !important;
  background-color: #ffffff !important;
  transition: background var(--transition);
}
.table-hover tbody tr:hover td { background-color: #fafbff !important; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover td { background: #fafbff; }
.table tbody tr.row-overdue { border-left: 3px solid var(--red); }
.table tbody tr.row-overdue td:first-child { padding-left: calc(1.125rem - 3px); }

/* ══════════════════════════════════════════════
   STATUS BADGES
══════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  font-size: .7rem; font-weight: 600; letter-spacing: .02em;
  padding: .275em .7em; border-radius: 20px; white-space: nowrap;
}
.badge-entwurf    { background:#F1F5F9; color:#475569; border:1px solid #E2E8F0; }
.badge-gesendet   { background:#DBEAFE; color:#1D4ED8; border:1px solid #BFDBFE; }
.badge-bezahlt    { background:#D1FAE5; color:#065F46; border:1px solid #A7F3D0; }
.badge-ueberfaellig { background:#FEE2E2; color:#991B1B; border:1px solid #FECACA; }
.badge-angenommen { background:#D1FAE5; color:#065F46; border:1px solid #A7F3D0; }
.badge-abgelehnt  { background:#FEF3C7; color:#92400E; border:1px solid #FDE68A; }
.badge-storniert  { background:#F3F4F6; color:#6B7280; border:1px solid #E5E7EB; }

/* ══════════════════════════════════════════════
   BUTTONS
══════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: .375rem;
  font-family: 'Inter', sans-serif;
  font-size: .8375rem; font-weight: 500;
  padding: .5rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer; transition: all var(--transition);
  text-decoration: none; white-space: nowrap;
  line-height: 1.4;
}
.btn-lg { padding: .7rem 1.375rem; font-size: .9rem; }
.btn-sm { padding: .3rem .625rem; font-size: .775rem; border-radius: 5px; }
.btn-primary { background:linear-gradient(135deg, var(--blue), #6366F1); border-color:var(--blue); color:#fff; box-shadow:0 1px 3px rgba(79,70,229,.3); }
.btn-primary:hover { background:linear-gradient(135deg, var(--blue-dark), var(--blue)); border-color:var(--blue-dark); color:#fff; box-shadow:0 4px 12px rgba(79,70,229,.4); transform:translateY(-1px); }
.btn-secondary { background:var(--gray-100); border-color:var(--gray-200); color:var(--gray-700); }
.btn-secondary:hover { background:var(--gray-200); color:var(--gray-900); }
.btn-danger { background:var(--red); border-color:var(--red); color:#fff; }
.btn-danger:hover { background:#DC2626; border-color:#DC2626; color:#fff; }
.btn-danger-soft { background:#FEE2E2; border-color:#FECACA; color:#991B1B; }
.btn-danger-soft:hover { background:#FEE2E2; color:#991B1B; }
.btn-outline-primary { background:transparent; border-color:var(--blue); color:var(--blue); }
.btn-outline-primary:hover { background:var(--blue); color:#fff; }
.btn-outline-secondary { background:transparent; border-color:var(--gray-200); color:var(--gray-600); }
.btn-outline-secondary:hover { background:var(--gray-100); color:var(--gray-900); }
.btn-outline-success { background:transparent; border-color:var(--green); color:var(--green); }
.btn-outline-success:hover { background:var(--green); color:#fff; }
.btn-outline-danger { background:transparent; border-color:var(--red); color:var(--red); }
.btn-outline-danger:hover { background:var(--red); border-color:var(--red); color:#fff; }
.btn-ghost { background:transparent; border-color:transparent; color:var(--gray-500); padding:.3rem .5rem; }
.btn-ghost:hover { background:var(--gray-100); color:var(--gray-800); }
.btn:disabled { opacity:.55; cursor:not-allowed; transform:none !important; }

/* ══════════════════════════════════════════════
   FORMS
══════════════════════════════════════════════ */
.form-label { font-size: .8rem; font-weight: 600; color: var(--gray-700); margin-bottom: .4rem; display: block; }
.required { color: var(--red); }
input, textarea, select {
  color-scheme: light !important;
  background-color: #ffffff !important;
  color: #1E293B !important;
}
.form-control, .form-select {
  font-family: 'Inter', sans-serif;
  font-size: .8375rem; color: var(--gray-900) !important;
  background: #ffffff !important; border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm); padding: .5rem .75rem;
  width: 100%; transition: all var(--transition); line-height: 1.5;
  color-scheme: light !important;
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-control::placeholder { color: var(--gray-400); }
.form-control-sm, .form-select-sm { font-size: .8rem; padding: .35rem .625rem; }
textarea.form-control { resize: vertical; }
.input-group { display: flex; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; border-left: none; }
.input-group-text {
  display: flex; align-items: center; padding: .5rem .75rem;
  background: var(--gray-50); border: 1px solid var(--gray-300);
  border-right: none; border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  color: var(--gray-500); font-size: .8375rem;
}

/* ══════════════════════════════════════════════
   POSITIONS TABLE (invoice lines)
══════════════════════════════════════════════ */
.positions-table { width: 100%; border-collapse: collapse; }
.positions-table thead th {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #fff; background: linear-gradient(90deg, var(--blue), #6366F1);
  padding: .75rem 1rem; white-space: nowrap;
}
.positions-table thead th:last-child { text-align: center; width: 48px; }
.positions-table tbody tr { border-bottom: 1px solid var(--gray-100); }
.positions-table tbody tr:nth-child(even) { background: var(--gray-50); }
.positions-table tbody tr:last-child { border-bottom: none; }
.positions-table tbody td { padding: .5rem .75rem; vertical-align: middle; }
.drag-handle { color: var(--gray-400); cursor: grab; font-size: .875rem; }
.pos-total-display { font-weight: 600; color: var(--gray-800); font-size: .875rem; text-align: right; padding-right: .5rem; }
.pos-remove-btn { background: none; border: none; color: var(--gray-400); cursor: pointer; padding: .25rem .4rem; border-radius: var(--radius-sm); transition: all var(--transition); font-size: .9rem; display: flex; align-items: center; }
.pos-remove-btn:hover { background: var(--red-light); color: var(--red); }
.btn-add-position {
  display: flex; align-items: center; gap: .5rem;
  width: 100%; padding: .875rem 1.25rem;
  background: none; border: none; border-top: 1px dashed var(--gray-200);
  color: var(--blue); font-size: .8375rem; font-weight: 600;
  cursor: pointer; text-align: left; transition: all var(--transition);
}
.btn-add-position:hover { background: var(--blue-light); }

/* Summary sidebar card */
.summary-card { position: sticky; top: calc(var(--topbar-h) + 1.75rem); }
.summary-row { display: flex; justify-content: space-between; align-items: center; padding: .35rem 0; font-size: .8375rem; color: var(--gray-600); }
.summary-divider { border-top: 2px solid var(--gray-200); margin: .5rem 0; }
.summary-total { display: flex; justify-content: space-between; align-items: center; padding: .625rem .875rem; background: var(--blue-light); border-radius: var(--radius-sm); margin-top: .5rem; }
.summary-total-label { font-size: .875rem; font-weight: 700; color: var(--blue-dark); }
.summary-total-value { font-size: 1.375rem; font-weight: 800; color: var(--blue); letter-spacing: -.02em; }

/* Kunde info box */
.kunde-info-box,
.kunde-info-preview {
  background: var(--gray-50); border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm); padding: .625rem .875rem;
  font-size: .8rem; color: var(--gray-600); margin-top: .375rem;
}

/* ══════════════════════════════════════════════
   STATUS FILTER TABS
══════════════════════════════════════════════ */
.status-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.status-tab, .status-filter-btn {
  display: inline-flex; align-items: center; gap: .375rem;
  padding: .35rem .75rem; border-radius: 20px;
  font-size: .775rem; font-weight: 500;
  background: transparent; border: 1px solid var(--gray-200);
  color: var(--gray-600); cursor: pointer; transition: all var(--transition);
  white-space: nowrap;
}
.status-tab:hover, .status-filter-btn:hover { background: var(--gray-100); color: var(--gray-900); }
.status-tab.active, .status-filter-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.status-tab .tab-count { background: rgba(0,0,0,.1); border-radius: 10px; padding: .1em .45em; font-size: .7rem; font-weight: 700; }
.status-tab.active .tab-count { background: rgba(255,255,255,.25); }

/* Search toolbar */
.toolbar { display: flex; align-items: center; gap: .75rem; padding: .875rem 1.25rem; border-bottom: 1px solid var(--gray-100); background: #fff; flex-wrap: wrap; }
.toolbar-search { position: relative; flex: 0 0 260px; }
.toolbar-search i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: .875rem; pointer-events: none; }
.toolbar-search .form-control { padding-left: 2.25rem; }
.search-wrap { position: relative; flex: 0 0 260px; }
.search-wrap i { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: .875rem; pointer-events: none; }
.search-wrap input { padding-left: 2.25rem; }

/* ══════════════════════════════════════════════
   EMPTY STATE
══════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 3.5rem 2rem; }
.empty-state-icon { width: 72px; height: 72px; background: var(--gray-100); border-radius: 20px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.25rem; }
.empty-state-icon i { font-size: 2rem; color: var(--gray-400); }
.empty-state-title { font-size: 1rem; font-weight: 700; color: var(--gray-800); margin-bottom: .375rem; }
.empty-state-text { font-size: .875rem; color: var(--gray-500); margin-bottom: 1.25rem; }

/* ══════════════════════════════════════════════
   QUICK ACTIONS
══════════════════════════════════════════════ */
.quick-action {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  color: var(--gray-700); font-size: .8375rem; font-weight: 500;
  text-decoration: none; transition: all var(--transition); margin-bottom: .5rem;
}
.quick-action:last-child { margin-bottom: 0; }
.quick-action:hover { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.quick-action i { font-size: 1.1rem; }

/* ══════════════════════════════════════════════
   STATUS DISTRIBUTION (dashboard)
══════════════════════════════════════════════ */
.status-dist-item { display: flex; align-items: center; gap: .625rem; margin-bottom: .5rem; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-dist-label { font-size: .8rem; color: var(--gray-600); flex: 1; }
.status-dist-bar { flex: 2; height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.status-dist-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.status-dist-count { font-size: .8rem; font-weight: 700; color: var(--gray-700); min-width: 24px; text-align: right; }

/* ══════════════════════════════════════════════
   AVATAR INITIALS
══════════════════════════════════════════════ */
.avatar,
.avatar-initials {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff; flex-shrink: 0;
  background: var(--blue);
}

/* Kundennummer badge */
.kunden-nr { background: var(--gray-100); color: var(--gray-600); font-size: .7rem; font-weight: 600; padding: .2em .6em; border-radius: 4px; font-family: monospace; }

/* Date overdue */
.text-overdue { color: var(--red); font-weight: 600; }
.text-overdue i { vertical-align: middle; }

/* Tabs (settings page) */
.settings-tabs { border-bottom: 2px solid var(--gray-200); margin-bottom: 1.5rem; display: flex; gap: 0; }
.settings-tab { padding: .75rem 1.25rem; font-size: .875rem; font-weight: 600; color: var(--gray-500); border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all var(--transition); white-space: nowrap; display: flex; align-items: center; gap: .5rem; }
.settings-tab:hover { color: var(--gray-800); }
.settings-tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.settings-panel { display: none; }
.settings-panel.active { display: block; }

/* System status badges */
.lib-status { display: flex; align-items: center; gap: .875rem; padding: .875rem; border: 1px solid var(--gray-200); border-radius: var(--radius); margin-bottom: .75rem; }
.lib-status-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.lib-ok   { background: var(--green-light); color: var(--green); }
.lib-fail { background: var(--red-light); color: var(--red); }
.lib-name { font-weight: 700; font-size: .875rem; color: var(--gray-900); }
.lib-hint { font-size: .775rem; color: var(--gray-500); }

/* Toast */
.toast {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  min-width: 280px; max-width: 360px;
  margin-bottom: .5rem;
}
.toast.toast-success { border-left: 3px solid var(--green); }
.toast.toast-danger  { border-left: 3px solid var(--red); }
.toast.toast-warning { border-left: 3px solid var(--amber); }
.toast.toast-info    { border-left: 3px solid var(--blue); }
.toast-body { padding: .75rem 1rem; font-size: .8375rem; }

/* Dropdown — full override, no Bootstrap dependency */
ul.dropdown-menu, ul.dropdown-menu li { list-style: none !important; list-style-type: none !important; }
.dropdown-menu {
  display: none; position: absolute; z-index: 1050;
  min-width: 170px; padding: .25rem 0;
  background: #ffffff !important; color: #1E293B !important;
  border: 1px solid #E2E8F0; border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  font-size: .8125rem; color-scheme: light;
}
.dropdown-menu.show { display: block; }
.dropdown-menu li { list-style: none !important; padding: 0; }
.dropdown-divider { height: 0; margin: .2rem 0; overflow: hidden; border-top: 1px solid #E2E8F0; }
.dropdown-item {
  display: flex !important; align-items: center; gap: .45rem;
  padding: .35rem .875rem; width: 100%;
  font-size: .8rem; font-weight: 500; color: #475569 !important;
  background: transparent !important; border: none;
  cursor: pointer; text-decoration: none !important;
  white-space: nowrap; line-height: 1.5;
  transition: background 100ms, color 100ms;
}
.dropdown-item i { width: 14px; text-align: center; font-size: .8rem; color: #94A3B8; flex-shrink: 0; }
.dropdown-item:hover, .dropdown-item:focus {
  background: #F8FAFC !important; color: #0F172A !important;
  outline: none;
}
.dropdown-item:hover i, .dropdown-item:focus i { color: #64748B; }
.dropdown-item.text-danger { color: #EF4444 !important; }
.dropdown-item.text-danger i { color: #EF4444; }
.dropdown-item.text-danger:hover { background: #FEF2F2 !important; }

/* Modals */
.modal-content {
  border-radius: var(--radius-lg); border: none;
  box-shadow: 0 25px 60px rgba(0,0,0,.2);
  background: #fff !important; color: var(--gray-900);
  color-scheme: light;
}
.modal-header { border-bottom: 1px solid var(--gray-100); padding: 1.25rem 1.5rem; background: #fff; }
.modal-body { background: #fff; color: var(--gray-800); }
.modal-footer { border-top: 1px solid var(--gray-100); padding: 1rem 1.5rem; background: #fff; }
.modal-title { font-weight: 700; font-size: 1rem; color: var(--gray-900); }
.modal .form-label { color: var(--gray-700); font-size: .875rem; font-weight: 600; }
.modal .form-control, .modal .form-select {
  background-color: #fff !important; color: var(--gray-800) !important;
  border: 1px solid var(--gray-300);
}
.modal .form-control:focus, .modal .form-select:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-ring);
}
.modal .alert-info { background: var(--blue-light); color: #1E3A8A; border: 1px solid #BFDBFE; }

/* Alerts */
.alert { border-radius: var(--radius-sm); font-size: .8375rem; padding: .75rem 1rem; }
.alert-success { background: var(--green-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger  { background: var(--red-light); color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: var(--amber-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-info    { background: var(--blue-light); color: #1E3A8A; border: 1px solid #BFDBFE; }

/* Utilities */
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.fw-400 { font-weight: 400; }
.fw-semibold { font-weight: 600; }
.text-primary-color { color: var(--blue); }
.text-muted { color: var(--gray-500) !important; }
.text-secondary { color: var(--gray-600) !important; }
.gap-col { gap: .5rem; display: flex; flex-direction: column; }
.border-top-light { border-top: 1px solid var(--gray-100); }
.ms-auto { margin-left: auto !important; }
.d-grid { display: grid !important; }
.gap-2 { gap: .5rem !important; }
.w-100 { width: 100% !important; }

/* Chart container */
.chart-wrap { position: relative; height: 180px; }

/* Logo upload area */
.logo-upload-area {
  border: 2px dashed var(--gray-300); border-radius: var(--radius);
  padding: 2rem; text-align: center; cursor: pointer;
  transition: all var(--transition); background: var(--gray-50);
}
.logo-upload-area:hover, .logo-upload-area.drag-over { border-color: var(--blue); background: var(--blue-light); }
.logo-preview { max-width: 200px; max-height: 80px; object-fit: contain; margin-bottom: 1rem; }

/* Password strength */
.pwd-strength-bar { height: 4px; background: var(--gray-200); border-radius: 2px; overflow: hidden; margin-top: .5rem; }
.pwd-strength-fill { height: 100%; border-radius: 2px; transition: width .3s ease, background .3s ease; }

/* SMTP test result */
#smtpTestResult { display: none; }

/* Animate fadein */
.animate-fadein { animation: fadeInUp .3s ease forwards; }

/* ══════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: translateX(0); }
  .sidebar-close-btn { display: block !important; }
  .main-wrap { margin-left: 0; }
  .topbar-toggle { display: flex !important; }
}
@media (max-width: 767.98px) {
  .page-content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
  .status-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: .25rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-search, .search-wrap { flex: 1; }
  .summary-card { position: static; }
}

/* ══════════════════════════════════════════════
   PRINT
══════════════════════════════════════════════ */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrap { margin-left: 0; }
  body { background: #fff; }
}

/* Animation */
@keyframes fadeInUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
.fade-in-up { animation: fadeInUp .3s ease forwards; }

/* Spinner */
.spinner-border {
  display: inline-block; width: 1rem; height: 1rem;
  border: .15em solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .65s linear infinite;
  vertical-align: middle;
}
.spinner-border-sm { width: .875rem; height: .875rem; border-width: .125em; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════
   ALIASES — bridge template class names to design system
══════════════════════════════════════════════ */

/* Stat card icon circle (dashboard uses .stat-icon-circle) */
.stat-icon-circle {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; flex-shrink: 0;
}
.stat-content { flex: 1; min-width: 0; }

/* Animation alias */
.animate-fadein-up { animation: fadeInUp .35s ease both; }

/* Status distribution aliases (dashboard) */
.status-distribution-item { display: flex; align-items: center; gap: .625rem; margin-bottom: .5rem; }
.status-distribution-label { font-size: .8rem; color: var(--gray-600); flex: 1; }
.status-distribution-bar { flex: 2; height: 6px; background: var(--gray-100); border-radius: 3px; overflow: hidden; }
.status-distribution-bar-fill { height: 100%; border-radius: 3px; transition: width .5s ease; }
.status-distribution-count { font-size: .8rem; font-weight: 700; color: var(--gray-700); min-width: 24px; text-align: right; }

/* Quick action button alias */
.quick-action-btn {
  display: flex; align-items: center; gap: .75rem;
  padding: .75rem; border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  color: var(--gray-700); font-size: .8375rem; font-weight: 500;
  text-decoration: none; transition: all var(--transition); margin-bottom: .5rem;
}
.quick-action-btn:last-child { margin-bottom: 0; }
.quick-action-btn:hover { border-color: var(--blue); background: var(--blue-light); color: var(--blue); }
.quick-action-btn i { font-size: 1.1rem; }

/* Chart container alias */
.chart-container { position: relative; }

/* Page header aliases */
.page-header { display: flex; align-items: center; gap: .875rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.page-header-left { display: flex; align-items: center; gap: .75rem; flex: 1; flex-wrap: wrap; }
.page-title { font-size: 1.375rem; font-weight: 800; color: var(--gray-900); letter-spacing: -.025em; margin: 0; }
.page-count-badge { background: var(--gray-200); color: var(--gray-600); font-size: .7rem; font-weight: 700; padding: .2em .6em; border-radius: 20px; white-space: nowrap; }

/* Status filter tabs alias */
.status-filter-tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.status-filter-tabs .count { background: rgba(0,0,0,.08); border-radius: 10px; padding: .1em .45em; font-size: .7rem; font-weight: 700; margin-left: .15em; }
.status-filter-btn.active .count { background: rgba(255,255,255,.25); }

/* Status badge cell */
.status-badge-cell { white-space: nowrap; }

/* Date overdue alias */
.date-overdue { color: var(--red); font-weight: 600; }
.date-overdue i { vertical-align: middle; }

/* Kundennummer badge alias */
.kunden-nummer-badge { background: var(--gray-100); color: var(--gray-600); font-size: .7rem; font-weight: 600; padding: .2em .6em; border-radius: 4px; font-family: monospace; }

/* Avatar circle alias */
.avatar-circle { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; color: #fff; flex-shrink: 0; background: var(--blue); }

/* Toolbar right alignment */
.toolbar-right { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

/* Nav tabs (settings page) */
.nav-tabs { border-bottom: 2px solid var(--gray-200); }
.nav-tabs .nav-link {
  padding: .625rem 1.125rem; font-size: .875rem; font-weight: 600;
  color: var(--gray-500); border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all var(--transition); display: inline-flex; align-items: center; gap: .4rem;
  border-radius: 0;
}
.nav-tabs .nav-link:hover { color: var(--gray-800); }
.nav-tabs .nav-link.active { color: var(--blue); border-bottom-color: var(--blue); background: none; }

/* text-primary Bootstrap alias */
.text-primary { color: var(--blue) !important; }
.text-danger  { color: var(--red)  !important; }
.text-success { color: var(--green)!important; }
.text-warning { color: var(--amber)!important; }

/* ══════════════════════════════════════════════
   LOGIN PAGE ALIASES (index.php class names)
══════════════════════════════════════════════ */
body.login-body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--gray-900) 0%, #1e3a8a 60%, var(--gray-900) 100%);
  background-size: 300% 300%;
  animation: bgShift 10s ease infinite;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  position: relative; overflow: hidden;
}
body.login-body::before,
body.login-body::after {
  content: ''; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(79,70,229,.25) 0%, transparent 70%);
  pointer-events: none;
}
body.login-body::before { width:600px; height:600px; top:-200px; right:-200px; animation: pulse 7s ease-in-out infinite; }
body.login-body::after  { width:400px; height:400px; bottom:-100px; left:-100px; animation: pulse 9s ease-in-out infinite reverse; }

.login-container {
  width: 100%; max-width: 440px;
  position: relative; z-index: 10;
  animation: slideUp .4s ease;
}
.login-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem 2rem;
  box-shadow: 0 25px 60px rgba(0,0,0,0.35);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-icon-wrap {
  width: 64px; height: 64px;
  background: var(--blue-light);
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow: 0 0 0 8px rgba(37,99,235,.08);
}
.login-icon-wrap i { font-size: 2rem; color: var(--blue); }

/* ══════════════════════════════════════════════
   SETTINGS PAGE ALIASES
══════════════════════════════════════════════ */

/* Form section title */
.form-section-title {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--gray-500);
  padding-bottom: .5rem; margin-bottom: .75rem;
  border-bottom: 1px solid var(--gray-100);
}

/* Library status card aliases */
.lib-status-card {
  display: flex; align-items: center; gap: .875rem;
  padding: .875rem; border: 1px solid var(--gray-200);
  border-radius: var(--radius); margin-bottom: .75rem;
}
.lib-status-card:last-child { margin-bottom: 0; }
.lib-status-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.lib-status-icon.ok      { background: var(--green-light); color: var(--green); }
.lib-status-icon.missing { background: var(--red-light);   color: var(--red);   }
.lib-status-info { flex: 1; min-width: 0; }
.lib-status-name { font-weight: 700; font-size: .875rem; color: var(--gray-900); }
.lib-status-sub  { font-size: .775rem; color: var(--gray-500); margin-top: .1rem; }

/* Password strength bar */
.pwd-strength-bar      { height: 4px; background: var(--gray-200); border-radius: 2px; overflow: hidden; }
.pwd-strength-bar-fill { height: 100%; border-radius: 2px; transition: width .3s ease, background .3s ease; }
.pwd-strength-text     { font-size: .75rem; font-weight: 500; margin-top: .3rem; min-height: 1.2em; }

/* form-text */
.form-text { font-size: .775rem; color: var(--gray-500); margin-top: .25rem; }

/* ══════════════════════════════════════════════
   MWST TOGGLE
══════════════════════════════════════════════ */
.mwst-toggle-wrap {
  display: flex; align-items: center; gap: .5rem;
  padding: .25rem .75rem .25rem .5rem;
  border-radius: 20px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
}
.mwst-toggle-label {
  font-size: .775rem; font-weight: 600; color: var(--gray-600);
  white-space: nowrap; cursor: pointer; user-select: none;
}
.form-check { display: flex; align-items: center; margin: 0; }
.form-check-input[type="checkbox"] {
  width: 2.25em; height: 1.25em; padding: 0;
  background-color: var(--gray-300);
  border: none; border-radius: 1em;
  appearance: none; -webkit-appearance: none;
  cursor: pointer; transition: background .2s ease;
  position: relative; flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23fff'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: left .15em center;
  background-size: 1em 1em;
}
.form-check-input:checked {
  background-color: var(--blue);
  background-position: right .15em center;
}
.form-check-input:focus { outline: none; box-shadow: 0 0 0 3px rgba(79,70,229,.15); }

/* Hide MwSt column when toggle is off */
.positions-table.mwst-off .mwst-col { display: none; }

/* Summary no-mwst note */
.mwst-disabled-note {
  font-size: .75rem; color: var(--gray-400); font-style: italic;
  padding: .25rem 0;
}

/* ══════════════════════════════════════════════
   INVOICE / OFFERTE VIEW (rechnung_view.php)
══════════════════════════════════════════════ */
.invoice-paper {
  max-width: 860px; margin: 0 auto;
  background: #fff; color: #222;
  padding: 2.5rem 3rem 2rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: .875rem; line-height: 1.55;
  color-scheme: light;
}

/* Header: two columns */
.invoice-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 2rem; margin-bottom: 2rem;
}

/* Left: logo + sender address below */
.invoice-sender-block { flex: 0 0 auto; max-width: 220px; }
.invoice-logo { max-height: 70px; max-width: 200px; display: block; margin-bottom: .875rem; object-fit: contain; }
.invoice-logo-text {
  font-size: 1.5rem; font-weight: 800; color: #111;
  margin-bottom: .875rem; letter-spacing: -.03em;
}
.invoice-sender-address { font-size: .8rem; color: #444; line-height: 1.6; }
.invoice-sender-address strong { color: #111; }

/* Right: Absenderzeile + Empfänger */
.invoice-recipient-block { flex: 0 0 auto; text-align: left; min-width: 200px; }
.invoice-absenderzeile {
  font-size: .7rem; color: #666;
  border-bottom: 1px solid #333;
  padding-bottom: .2rem; margin-bottom: .875rem;
  white-space: nowrap;
}
.invoice-recipient-address { font-size: .875rem; color: #222; line-height: 1.7; }
.invoice-recipient-address strong { color: #111; }

/* Horizontal rule */
.invoice-hr { border: none; border-top: 1.5px solid #222; margin: 1.5rem 0 1rem; }

/* Title row */
.invoice-title-row {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1rem;
}
.invoice-title { font-size: 1rem; font-weight: 700; color: #111; }
.invoice-page-info { font-size: .8rem; color: #666; }

/* Meta grid: two columns */
.invoice-meta-grid {
  display: flex; gap: 2rem; margin-bottom: 1.75rem;
  border-bottom: 1px solid #ddd; padding-bottom: 1rem;
}
.invoice-meta-col { flex: 1; }
.invoice-meta-row { display: flex; gap: .5rem; margin-bottom: .2rem; font-size: .8rem; }
.invoice-meta-label { color: #555; white-space: nowrap; min-width: 130px; }
.invoice-meta-value { color: #111; font-weight: 500; }

/* Positions table */
.invoice-table-wrap { overflow-x: auto; margin-bottom: 0; }
.invoice-table { width: 100%; border-collapse: collapse; font-size: .8125rem; }
.invoice-table thead tr {
  border-bottom: 2px solid #222;
}
.invoice-table thead th {
  padding: .5rem .75rem; font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; color: #333;
  background: transparent;
}
.invoice-table thead th:first-child { padding-left: 0; }
.invoice-table thead th:last-child  { padding-right: 0; }
.invoice-table tbody td {
  padding: .5rem .75rem; vertical-align: top; color: #222;
  border-bottom: 1px solid #eee;
}
.invoice-table tbody td:first-child { padding-left: 0; }
.invoice-table tbody td:last-child  { padding-right: 0; }
.invoice-table tbody tr:last-child td { border-bottom: 2px solid #222; }
.invoice-row-alt td { background: #f9f9f9; }
.invoice-table .text-center { text-align: center; }
.invoice-table .text-end    { text-align: right; }
.invoice-table .text-secondary { color: #666; }
.invoice-table .fw-600 { font-weight: 600; }

/* Totals block */
.invoice-totals-wrap { display: flex; margin-top: .75rem; margin-bottom: .5rem; }
.invoice-totals-spacer { flex: 1; }
.invoice-totals-table { min-width: 260px; }
.invoice-total-row {
  display: flex; justify-content: space-between;
  padding: .25rem 0; font-size: .8375rem; color: #333;
  border-bottom: 1px solid #eee;
}
.invoice-total-row:last-child { border-bottom: none; }
.invoice-total-row .text-secondary { color: #777; }
.invoice-grand-total {
  font-size: 1rem; font-weight: 700; color: #111;
  border-top: 2px solid #222 !important;
  border-bottom: none !important;
  padding-top: .4rem; margin-top: .1rem;
}

/* Footer info line */
.invoice-footer-info {
  display: flex; gap: 1.5rem; flex-wrap: wrap;
  font-size: .75rem; color: #666;
}
.invoice-footer-info strong { color: #333; }

@media (max-width: 640px) {
  .invoice-paper { padding: 1.5rem 1.25rem; }
  .invoice-header { flex-direction: column; gap: 1rem; }
  .invoice-meta-grid { flex-direction: column; gap: .5rem; }
  .invoice-totals-wrap { flex-direction: column; }
  .invoice-totals-table { width: 100%; }
}
