:root {
  --accent: #da3a3d;
  --accent-strong: #c53033;
  --accent-soft: rgba(218, 58, 61, 0.25);

  --bg: #202020;
  --bg-elevated: #262626;
  --bg-elevated-soft: #2e2e2e;

  --border-subtle: #3a3a3a;

  --text-main: #ffffff;
  --text-muted: #bfbfbf;
  --text-soft: #8a8a8a;

  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 20px 44px rgba(2, 12, 22, 0.45);
  --transition-fast: 0.18s ease-out;
  --danger: #e84a4a;
}

body[data-brand="electrician"] {
  --accent: #69c9ff;
  --accent-strong: #2aa9ff;
  --accent-soft: rgba(105, 201, 255, 0.22);
  --bg: #08121c;
  --bg-elevated: #102131;
  --bg-elevated-soft: #163147;
  --border-subtle: #24435c;
  --text-muted: #c6d6e4;
  --text-soft: #86a4bd;
}

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

img {
  max-width: 100%;
  height: auto;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(218, 58, 61, 0.16), transparent 28%),
    linear-gradient(180deg, #181818 0%, #202020 100%);
  color: var(--text-main);
}

body[data-brand="electrician"] {
  background:
    radial-gradient(circle at top right, rgba(105, 201, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #07121d 0%, #0b1724 100%);
}

/* Layout */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */

.sidebar {
  width: 270px;
  background:
    linear-gradient(180deg, rgba(32, 32, 32, 0.98), rgba(28, 28, 28, 0.98)),
    radial-gradient(circle at top, rgba(218, 58, 61, 0.12), transparent 30%);
  border-right: 1px solid rgba(218, 58, 61, 0.18);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* Logo */

.logo-wrap {
  width: 100%;
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(218, 58, 61, 0.08));
  border: 1px solid rgba(218, 58, 61, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.logo-wrap img {
  width: 100%;
  max-height: 128px;
  object-fit: contain;
}

body[data-brand="electrician"] .sidebar {
  background:
    linear-gradient(180deg, rgba(11, 28, 47, 0.98), rgba(7, 19, 31, 0.98)),
    radial-gradient(circle at top, rgba(105, 201, 255, 0.12), transparent 30%);
  border-right: 1px solid rgba(105, 201, 255, 0.18);
}

body[data-brand="electrician"] .logo-wrap {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(105, 201, 255, 0.08));
  border: 1px solid rgba(105, 201, 255, 0.18);
}

body[data-brand="electrician"] .nav-item:hover {
  background: rgba(105, 201, 255, 0.12);
}

body[data-brand="electrician"] .sidebar-footer {
  border-top: 1px solid rgba(105, 201, 255, 0.14);
}

body[data-brand="electrician"] .role-btn {
  border: 1px solid var(--border-subtle);
  background: rgba(8, 18, 28, 0.9);
}

body[data-brand="electrician"] .user-chip {
  background: rgba(16, 33, 49, 0.88);
  border: 1px solid rgba(105, 201, 255, 0.16);
}

body[data-brand="electrician"] .user-chip:hover {
  background: rgba(22, 49, 71, 0.96);
}

body[data-brand="electrician"] .btn.ghost {
  background: rgba(105, 201, 255, 0.1);
  border: 1px solid rgba(105, 201, 255, 0.2);
  color: #e8f5ff;
}

body[data-brand="electrician"] .btn.ghost:hover {
  background: rgba(105, 201, 255, 0.2);
}

body[data-brand="electrician"] .offers-table-row:hover td {
  background: rgba(105, 201, 255, 0.08);
}

body[data-brand="electrician"] .offers-table-row-active td {
  background: rgba(105, 201, 255, 0.16);
}

body[data-brand="electrician"] .kpi-label,
body[data-brand="electrician"] .dashboard-tab-label {
  color: #dff4ff;
}

body[data-brand="electrician"] .kpi-footer,
body[data-brand="electrician"] .dashboard-tab-footer {
  color: #caebff;
}

body[data-brand="electrician"] input:focus,
body[data-brand="electrician"] select:focus,
body[data-brand="electrician"] textarea:focus {
  box-shadow: 0 0 0 1px rgba(105, 201, 255, 0.36);
}

body[data-brand="electrician"] .offer-alert {
  border: 1px solid rgba(105, 201, 255, 0.35);
  background: rgba(105, 201, 255, 0.12);
  color: #d9f2ff;
}

body[data-brand="electrician"] .dashboard-tab {
  background: radial-gradient(circle at 10% 0, var(--accent), #0f5f96);
}

body[data-brand="electrician"] .check-card {
  border: 1px solid rgba(105, 201, 255, 0.18);
  background: rgba(105, 201, 255, 0.08);
}

/* Navigation */

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition-fast), color var(--transition-fast),
    transform var(--transition-fast);
}

.nav-item.small {
  font-size: 0.82rem;
  padding: 7px 10px;
}

.nav-item i {
  width: 18px;
}

.nav-item:hover {
  background: #2a2a2a;
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-item.active {
  background: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

/* Sidebar Footer */

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid #3a3a3a;
  padding-top: 10px;
}

.small-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: var(--text-soft);
  letter-spacing: 0.14em;
}

/* optional - aktuell im HTML kaum genutzt */
.role-toggle {
  margin-top: 6px;
  display: flex;
  gap: 6px;
}

.role-btn {
  flex: 1;
  border-radius: 999px;
  border: 1px solid #3a3a3a;
  background: #202020;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 6px 10px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.role-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Main */

.main {
  flex: 1;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Topbar */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-left h1 {
  margin: 0;
  font-size: 1.4rem;
}

.topbar-subtitle {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-date {
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* User Chip / Profile Button */

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #292929;
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid #3a3a3a;
  cursor: pointer;
  transition: var(--transition-fast);
}

.user-chip:hover {
  background: #333333;
}

.avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.user-name {
  font-size: 0.9rem;
  color: var(--accent);

}

.user-role {
  font-size: 0.75rem;
  color: var(--text-soft);
}

/* Views */

.views {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
  flex: 1;
  min-height: 0;
}

.view {
  display: none;
  min-height: 0;
}

.view-active {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

/* Section header */

.section-header h2 {
  margin: 0 0 4px 0;
  font-size: 1.2rem;
}

.section-header p {
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* Cards */

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-header span {
  color: #ffffff;
}

.card-body {
  font-size: 0.85rem;
}

/* Grid */

.grid {
  display: grid;
  row-gap: 22px;
  column-gap: 22px;
}

/* Spalten dürfen wirklich schrumpfen */
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}


/* 3 Karten in einer Reihe für das KPI-Grid */
.grid-4 {
  grid-template-columns: repeat(3, 1fr);
}

/* KPI Cards */


.kpi-label {
  font-size: 0.8rem;
  color: #ffdddd;
}

.kpi-value {
  margin-top: 4px;
  font-size: 1.6rem;
  font-weight: 700;
}

.kpi-footer {
  margin-top: 10px;
  font-size: 0.8rem;
  color: #ffdcdc;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Forms */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.form-grid > * {
  min-width: 0;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 0.82rem;
  gap: 5px;
  min-width: 0;
}

.visit-form-intro {
  margin-bottom: 12px;
}

.visit-form-grid textarea {
  min-height: 120px;
}

.visit-structured-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(84, 166, 244, 0.16);
  background: rgba(8, 22, 34, 0.72);
}

.visit-structured-header {
  display: grid;
  gap: 4px;
}

.visit-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.visit-tag-btn {
  background: rgba(28, 28, 28, 0.96);
}

.visit-tag-btn.is-active {
  background: linear-gradient(135deg, #1f96e6, #54c0ff);
  color: #fff;
  border-color: rgba(84, 166, 244, 0.75);
}

.visit-structured-grid,
.visit-context-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visit-requirement-actions {
  display: flex;
  justify-content: flex-start;
}

.visit-requirements-list {
  display: grid;
  gap: 8px;
}

.visit-requirement-empty {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(84, 166, 244, 0.28);
  background: rgba(11, 27, 40, 0.52);
}

.visit-requirement-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #2b3f50;
  background: rgba(9, 20, 31, 0.82);
}

.visit-requirement-copy {
  display: grid;
  gap: 4px;
}

.visit-requirement-meta {
  color: #8ec7ff;
  font-size: 0.78rem;
}

.visit-requirement-notes {
  color: var(--text-soft);
  font-size: 0.8rem;
  white-space: pre-line;
}

.visit-requirement-remove {
  flex: 0 0 auto;
}

#visit-ai-summary {
  min-height: 180px;
  background: rgba(4, 12, 20, 0.96);
}

.visit-form-helper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(84, 166, 244, 0.22);
  background: rgba(17, 42, 63, 0.42);
  color: #bcdcff;
  font-size: 0.78rem;
}

.visit-form-helper i {
  margin-top: 2px;
  color: #7bc3ff;
}

.visit-form-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}

input,
select,
textarea {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: rgba(6, 16, 26, 0.92);
  color: #ffffff;
  padding: 7px 9px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(218, 58, 61, 0.4);
  outline: none;
}

/* Buttons */

.btn {
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 9px 15px;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast),
    border-color var(--transition-fast), background var(--transition-fast),
    color var(--transition-fast);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(18, 18, 18, 0.92));
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn:active {
  transform: translateY(0);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(218, 58, 61, 0.28), 0 12px 28px rgba(0, 0, 0, 0.24);
}

.btn.primary {
  background: linear-gradient(135deg, #ef4d4f, var(--accent-strong));
  border-color: rgba(255, 210, 210, 0.2);
  color: white;
  box-shadow: 0 14px 28px rgba(197, 48, 51, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #ff6466, #db3e42);
  border-color: rgba(255, 225, 225, 0.26);
}

.btn.is-success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-color: rgba(170, 255, 199, 0.18);
  color: #fff;
}

.btn.is-success:hover {
  background: linear-gradient(135deg, #1bb453, #169447);
}

.btn.danger {
  background: linear-gradient(135deg, #f05555, #d93e3e);
  border-color: rgba(255, 201, 201, 0.18);
  color: #ffffff;
}

.btn.danger:hover {
  background: linear-gradient(135deg, #ff6666, #d63636);
}

.btn.ghost {
  background: linear-gradient(180deg, rgba(218, 58, 61, 0.12), rgba(42, 14, 15, 0.92));
  border: 1px solid rgba(218, 58, 61, 0.28);
  color: #ffe8e8;
}

.btn.ghost:hover {
  background: linear-gradient(180deg, rgba(218, 58, 61, 0.2), rgba(52, 18, 19, 0.96));
  border-color: rgba(255, 176, 176, 0.24);
}

.visit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.visit-offer-btn {
  white-space: nowrap;
}

/* Tables */

.table-wrapper {
  max-height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.offers-table-row td {
  cursor: pointer;
  transition: background 0.15s ease;
}

.offers-table-row-electrician td {
  border-bottom-color: rgba(35, 117, 195, 0.34);
}

.customers-table-row-electrician td {
  border-bottom-color: rgba(35, 117, 195, 0.34);
}

.offers-table-row:hover td {
  background: #242424;
}

.offers-table-row-active td {
  background: rgba(218, 58, 61, 0.14);
}

th,
td {
  padding: 6px 8px;
  border-bottom: 1px solid #303030;
}

th {
  text-align: left;
  color: var(--text-soft);
  background: rgba(6, 16, 26, 0.92);
}

.offer-mail-status {
  text-align: center;
  width: 42px;
}

.offer-signature-cell {
  min-width: 132px;
}

.offer-mail-icon {
  font-size: 0.9rem;
  opacity: 0.9;
}

.offer-mail-icon.is-sent {
  color: #22c55e;
}

.offer-mail-icon.is-pending {
  color: var(--text-muted);
}

.offer-signature-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 112px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.offer-signature-status.is-signed {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.32);
}

.offer-signature-status.is-pending {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.3);
}

.offer-signature-status.is-empty {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.24);
}

.offer-number-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offer-origin-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(35, 117, 195, 0.16);
  border: 1px solid rgba(84, 166, 244, 0.5);
  color: #8ec7ff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: normal;
}

.hours-photos-cell {
  min-width: 120px;
}

.hours-photo-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.hours-photo-list a {
  display: inline-flex;
}

.hours-photo-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid #333;
}

.hours-row-sent td {
  background: rgba(34, 197, 94, 0.12);
  animation: hoursRowFlash 2.2s ease-out 1;
}

@keyframes hoursRowFlash {
  0% { background: rgba(34, 197, 94, 0.38); }
  100% { background: transparent; }
}

/* Today List */

.today-item {
  --schedule-accent: #f0aa46;
  --schedule-accent-soft: rgba(240, 170, 70, 0.14);
  background: linear-gradient(180deg, var(--schedule-accent-soft), #1c1c1c);
  border-radius: 12px;
  padding: 8px;
  border: 1px solid var(--schedule-accent-border, #333);
  margin-bottom: 6px;
}

.today-item-main {
  display: flex;
  justify-content: space-between;
}

.today-item-sub {
  font-size: 0.8rem;
  color: var(--text-soft);
}

/* Help Section */

.help-list {
  padding-left: 20px;
}

.muted {
  color: var(--text-soft);
  font-size: 0.78rem;
}

/* Notifications */

#notification-container {
  position: fixed;
  right: 16px;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.notification {
  min-width: 260px;
  max-width: 320px;
  background: #1c1c1c;
  border-radius: 14px;
  border: 1px solid #333;
  padding: 10px 12px;
  display: flex;
  gap: 10px;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28);
}

.notification-clickable {
  cursor: pointer;
}

.notification-info {
  border-color: rgba(56, 189, 248, 0.35);
}

.notification-success {
  border-color: rgba(74, 222, 128, 0.35);
}

.notification-warning {
  border-color: rgba(251, 191, 36, 0.35);
}

.notification-error {
  border-color: rgba(248, 113, 113, 0.35);
}

.notification-action {
  border-color: rgba(218, 58, 61, 0.4);
}

.notification-icon {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notification-icon i {
  color: var(--accent);
}

.notification-info .notification-icon {
  background: rgba(56, 189, 248, 0.12);
}

.notification-info .notification-icon i {
  color: #38bdf8;
}

.notification-success .notification-icon {
  background: rgba(74, 222, 128, 0.12);
}

.notification-success .notification-icon i {
  color: #4ade80;
}

.notification-warning .notification-icon {
  background: rgba(251, 191, 36, 0.12);
}

.notification-warning .notification-icon i {
  color: #fbbf24;
}

.notification-error .notification-icon {
  background: rgba(248, 113, 113, 0.12);
}

.notification-error .notification-icon i {
  color: #f87171;
}

.notification-body {
  display: flex;
  flex-direction: column;
}

.notification-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.notification-text {
  font-size: 0.78rem;
  color: var(--text-soft);
}

/* Login Meldungen */

.login-status {
  margin-top: 6px;
  font-size: 0.8rem;
  color: #4ade80;
}

.login-error {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--danger);
}

/* Mitarbeiter-Tabelle: selektierte Zeile */

tr.employee-selected {
  background: #333333;
}

/* Delete-Button in Mitarbeiter-Tabelle */

.emp-delete-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  background: transparent;
  color: #fca5a5;
  transition: var(--transition-fast);
}

.emp-delete-btn:hover {
  background: rgba(232, 74, 74, 0.15);
  color: #fecaca;
}

/* Topbar Burger Button */

.topbar-menu-btn {
  display: none;
  border: none;
  background: transparent;
  color: var(--text-main);
  padding: 6px 8px;
  border-radius: 10px;
  margin-right: 8px;
  cursor: pointer;
  font-size: 1rem;
}

/* Sidebar Backdrop (Mobile) */

#sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
  z-index: 900;
}

#sidebar-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

/* Zustand: Sidebar geöffnet */

.sidebar.sidebar-open {
  transform: translateX(0);
}

/* Topbar Logo (Mobile) */

.topbar-title-wrap {
  display: flex;
  flex-direction: column;
}

.topbar-logo-mobile {
  display: none;
}

/* Hours-Section */

.hours-summary {
  margin-top: 10px;
  display: flex;
  gap: 16px;
}

.hours-total {
  font-size: 1.4rem;
  font-weight: 600;
}

/* Offer Summary */

.offer-summary {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.offer-summary > div {
  background: #1c1c1c;
  border-radius: var(--radius-md);
  border: 1px solid #333;
  padding: 8px 10px;
}

.offer-summary div > div {
  font-weight: 600;
  margin-top: 4px;
}

.offer-items-hint {
  margin: 0 0 10px 0;
}

.costing-shell {
  background:
    radial-gradient(circle at top right, rgba(218, 58, 61, 0.16), transparent 34%),
    linear-gradient(145deg, #262626, #202020);
}

.costing-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.costing-tab {
  border: 1px solid #444;
  background: #1c1c1c;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.costing-tab:hover {
  background: #262626;
  color: #fff;
}

.costing-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.costing-panel {
  display: none;
  margin-top: 12px;
}

.costing-panel.active {
  display: block;
}

.costing-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.costing-focus-card {
  border: 1px solid #333;
  border-radius: 18px;
  background: #1c1c1c;
  padding: 14px;
  min-height: 100%;
}

.costing-focus-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 6px;
}

.costing-focus-card p {
  margin: 0 0 10px 0;
}

.costing-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.costing-kpi {
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.costing-kpi span,
.costing-kpi small {
  color: var(--text-soft);
}

.costing-kpi strong {
  font-size: 1.45rem;
}

.offers-workspace-card {
  margin-bottom: 16px;
}

.offers-workspace-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.offers-workspace-copy {
  display: grid;
  gap: 4px;
}

.offers-workspace-eyebrow {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-soft);
}

#offer-workspace-title {
  font-size: 1.05rem;
}

.offers-workspace-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.offers-workspace-actions .btn {
  min-height: 44px;
  padding-inline: 16px;
}

.offers-workspace-actions .btn.is-active {
  border-color: rgba(224, 67, 54, 0.55);
  background: linear-gradient(180deg, rgba(224, 67, 54, 0.22), rgba(224, 67, 54, 0.12));
  box-shadow: 0 10px 24px rgba(224, 67, 54, 0.14);
  color: #ffffff;
}

.offers-workspace-actions .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.offer-editor-shell,
.offers-list-shell,
.offer-products-shell {
  display: grid;
  gap: 16px;
  scroll-margin-top: 24px;
}

#view-offers[data-offer-workspace="list"] .offer-editor-shell {
  display: none;
}

#view-offers[data-offer-workspace="editor"] .offers-list-shell {
  display: none;
}

#view-offers[data-offer-workspace="list"] .offer-products-shell,
#view-offers[data-offer-workspace="editor"] .offer-products-shell {
  display: none;
}

#view-offers[data-offer-workspace="products"] .offer-editor-shell,
#view-offers[data-offer-workspace="products"] .offers-list-shell {
  display: none;
}

.offers-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  column-gap: 22px;
  align-items: start;
}

.offers-main,
.offers-aside {
  min-width: 0;
}

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

.offer-card-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-left: auto;
}

.offer-editor-state-label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(80, 121, 175, 0.4);
  background: rgba(11, 23, 40, 0.72);
  color: #dbe8ff;
  font-size: 0.78rem;
  line-height: 1.2;
}

#offer-header-back-btn {
  min-height: 40px;
  white-space: nowrap;
}

.offer-summary-card {
  position: static;
  align-self: start;
}

.offer-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.offer-meta > div {
  background: #1c1c1c;
  border-radius: var(--radius-md);
  border: 1px solid #333;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.offer-meta span {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.offer-meta strong {
  font-size: 0.9rem;
}

.offer-alert {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(218, 58, 61, 0.4);
  background: rgba(218, 58, 61, 0.12);
  color: #ffdcdc;
  font-size: 0.78rem;
  display: flex;
  gap: 8px;
  align-items: center;
}

.offer-alert strong {
  color: #ffffff;
}

.offer-alert.is-warning {
  border-color: rgba(218, 58, 61, 0.4);
  background: rgba(218, 58, 61, 0.12);
  color: #ffdcdc;
}

.offer-alert.is-info {
  border-color: rgba(53, 120, 229, 0.4);
  background: rgba(53, 120, 229, 0.12);
  color: #d9e7ff;
}

.offer-alert.is-success {
  border-color: rgba(44, 140, 80, 0.4);
  background: rgba(44, 140, 80, 0.14);
  color: #dcffe7;
}

.offer-alert.is-error {
  border-color: rgba(218, 58, 61, 0.4);
  background: rgba(218, 58, 61, 0.12);
  color: #ffdcdc;
}

.offer-meta-stats {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.offer-meta-stats > div {
  background: #161616;
  border-radius: var(--radius-md);
  border: 1px dashed #333;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}

.offer-meta-stats span {
  color: var(--text-soft);
}

.offer-meta-stats strong {
  font-size: 0.85rem;
}

.offer-summary-card .offer-summary {
  grid-template-columns: 1fr;
}

.offer-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.offer-actions .btn {
  width: 100%;
  justify-content: center;
}

.offer-conditions {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #333;
  display: grid;
  gap: 10px;
}

.offer-conditions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .offers-workspace-body {
    align-items: stretch;
  }

  .offers-workspace-actions {
    width: 100%;
    justify-content: stretch;
  }

  .offers-workspace-actions .btn {
    flex: 1 1 180px;
  }

  .offer-card-header-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .offers-workspace-actions .btn,
  #offer-header-back-btn {
    width: 100%;
    justify-content: center;
  }

  .offer-card-header-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .offer-editor-state-label {
    justify-content: center;
    text-align: center;
  }
}

.offer-conditions-body .form-grid {
  margin-top: 0;
}

.offer-payment-editor {
  display: grid;
  gap: 12px;
}

.offer-payment-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.offer-payment-editor-body {
  display: grid;
  gap: 10px;
}

.offer-payment-rows {
  display: grid;
  gap: 10px;
}

.offer-payment-row {
  display: grid;
  grid-template-columns: minmax(0, 160px) minmax(0, 140px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
}

.offer-payment-row-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.offer-payment-row-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(218, 58, 61, 0.14);
  color: #fca5a5;
  font-size: 0.82rem;
  font-weight: 700;
}

.offer-payment-trigger-field {
  grid-column: auto;
}

.offer-payment-remove {
  align-self: end;
}

.offer-payment-final {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

#offer-payment-hint.is-error {
  color: #fca5a5;
}

.offer-item-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.offer-item-optional-toggle {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(218, 58, 61, 0.18);
  border-radius: 12px;
  background: rgba(218, 58, 61, 0.06);
}

.offer-item-optional-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
}

.offer-item-optional-toggle span {
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--text-soft);
}

.offer-item-desc-main {
  font-weight: 600;
}

.offer-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.offer-item-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
}

.offer-item-badge.is-optional {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.28);
}

.offer-item-desc-note {
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-soft);
  white-space: pre-line;
}

.offer-item-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  justify-content: flex-end;
}

.offer-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}

.offer-item-row-optional td {
  background: rgba(245, 158, 11, 0.06);
}

.offer-pos-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.offer-pos-number {
  display: inline-block;
  min-width: 1.5rem;
}

.offer-row-drag {
  cursor: grab;
}

.offer-row-drag:active {
  cursor: grabbing;
}

#offer-items-body tr.is-dragging {
  opacity: 0.45;
}

#offer-items-body tr.is-drop-before td {
  border-top: 2px solid var(--accent);
}

#offer-items-body tr.is-drop-after td {
  border-bottom: 2px solid var(--accent);
}

.offers-tools {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.offers-tools-search {
  position: relative;
  flex: 1 1 240px;
  min-width: 220px;
}

.offers-tools-search i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-soft);
  font-size: 0.8rem;
}

.offers-tools-search input {
  width: 100%;
  padding-left: 28px;
}

/* Wochenplan – Kalender-Ansicht */

.schedule-week-tabs {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr)); /* 7 gleich breite Spalten */
  gap: 8px;
  margin-bottom: 12px;
}
.schedule-week-tab {
  background: #1c1c1c;
  border-radius: var(--radius-md);
  border: 1px solid #333;
  padding: 6px 8px;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.3;
}

.schedule-week-tab span {
  display: block;
}

.schedule-theme-electrician {
  --schedule-accent: #4ba9ff;
  --schedule-accent-soft: rgba(75, 169, 255, 0.16);
  --schedule-accent-border: rgba(75, 169, 255, 0.34);
}

.schedule-theme-builder {
  --schedule-accent: #f0aa46;
  --schedule-accent-soft: rgba(240, 170, 70, 0.14);
  --schedule-accent-border: rgba(240, 170, 70, 0.28);
}

.schedule-theme-painter {
  --schedule-accent: #7bd88f;
  --schedule-accent-soft: rgba(123, 216, 143, 0.14);
  --schedule-accent-border: rgba(123, 216, 143, 0.28);
}

.schedule-theme-plumbing {
  --schedule-accent: #58d6c3;
  --schedule-accent-soft: rgba(88, 214, 195, 0.14);
  --schedule-accent-border: rgba(88, 214, 195, 0.28);
}

.schedule-theme-executive {
  --schedule-accent: #6ec4ff;
  --schedule-accent-soft: rgba(110, 196, 255, 0.14);
  --schedule-accent-border: rgba(110, 196, 255, 0.3);
}

.schedule-executive-card {
  border: 1px solid rgba(110, 196, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(110, 196, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #171717 0%, #121212 100%);
}

.schedule-executive-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
}

.schedule-admin-pool {
  border-radius: 18px;
  border: 1px solid rgba(110, 196, 255, 0.22);
  background: rgba(255,255,255,0.02);
  padding: 12px;
}

.schedule-admin-pool h3 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
}

.schedule-admin-pool #schedule-admin-pool-list,
.schedule-executive-board {
  display: grid;
  gap: 10px;
}

.schedule-admin-pool #schedule-admin-pool-list {
  min-height: 110px;
  padding: 4px;
  border-radius: 18px;
  border: 1px dashed rgba(110, 196, 255, 0.24);
  background: rgba(255,255,255,0.02);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.schedule-admin-pool #schedule-admin-pool-list.is-drop-target {
  border-color: #6ec4ff;
  background: rgba(110, 196, 255, 0.12);
}

.schedule-teams-card {
  border: 1px solid #2b2b2b;
  background:
    radial-gradient(circle at top left, rgba(240, 170, 70, 0.08), transparent 28%),
    linear-gradient(180deg, #171717 0%, #121212 100%);
}

.schedule-teams-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.schedule-teams-note {
  margin: 0 0 14px;
}

.company-roles-card {
  border: 1px solid rgba(110, 196, 255, 0.28);
  background:
    radial-gradient(circle at top right, rgba(110, 196, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #171717 0%, #121212 100%);
}

.company-roles-summary {
  color: #8fd9ff;
  font-size: 0.8rem;
  font-weight: 700;
}

.company-roles-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.company-role-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.18);
  padding: 14px;
  display: grid;
  gap: 11px;
}

.company-role-card.is-filled {
  border-color: rgba(91, 214, 150, 0.42);
  background: linear-gradient(145deg, rgba(91, 214, 150, 0.1), rgba(0, 0, 0, 0.18) 55%);
}

.company-role-card.is-open {
  border-color: rgba(255, 161, 82, 0.42);
  background: linear-gradient(145deg, rgba(255, 161, 82, 0.1), rgba(0, 0, 0, 0.18) 55%);
}

.company-role-card.is-drop-target {
  border-color: #8fd9ff;
  background: linear-gradient(145deg, rgba(110, 196, 255, 0.2), rgba(0, 0, 0, 0.18) 55%);
  box-shadow: 0 0 0 2px rgba(110, 196, 255, 0.18);
}

.company-role-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.company-role-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: inline-grid;
  place-items: center;
  color: #8fd9ff;
  background: rgba(110, 196, 255, 0.13);
}

.company-role-card h3 {
  margin: 0;
  color: #fff;
  font-size: 0.92rem;
}

.company-role-card p {
  margin: 4px 0 0;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.4;
}

.company-role-status {
  font-size: 0.72rem;
  font-weight: 700;
}

.company-role-status.is-filled {
  color: #79e3aa;
}

.company-role-status.is-open {
  color: #ffb16f;
}

.company-role-assignees {
  display: grid;
  gap: 6px;
}

.company-role-assignee {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid rgba(91, 214, 150, 0.23);
  border-radius: 9px;
  background: rgba(91, 214, 150, 0.08);
}

.company-role-assignee strong,
.company-role-assignee small {
  display: block;
}

.company-role-assignee strong {
  font-size: 0.76rem;
}

.company-role-assignee small {
  margin-top: 1px;
  color: var(--text-soft);
  font-size: 0.68rem;
}

.company-role-assignee-remove {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(255, 124, 124, 0.42);
  border-radius: 7px;
  background: rgba(157, 38, 38, 0.18);
  color: #ffd4d4;
  cursor: pointer;
}

.company-role-assignee-remove:hover,
.company-role-assignee-remove:focus-visible {
  border-color: #ff9292;
  background: rgba(157, 38, 38, 0.4);
  outline: none;
}

.company-role-card label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.73rem;
}

.company-role-external-directory {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(110, 196, 255, 0.18);
  border-radius: 14px;
  background: rgba(110, 196, 255, 0.05);
}

.company-role-drag-directory {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px dashed rgba(110, 196, 255, 0.32);
  border-radius: 14px;
  background: rgba(110, 196, 255, 0.035);
}

.company-role-drag-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.company-role-drag-person {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(110, 196, 255, 0.3);
  border-radius: 10px;
  background: rgba(110, 196, 255, 0.1);
  cursor: grab;
  user-select: none;
}

.company-role-drag-person:active,
.company-role-drag-person.is-dragging {
  cursor: grabbing;
  opacity: 0.52;
}

.company-role-drag-person > i {
  color: #8fd9ff;
}

.company-role-drag-person strong,
.company-role-drag-person small {
  display: block;
}

.company-role-drag-person strong {
  font-size: 0.77rem;
}

.company-role-drag-person small {
  margin-top: 1px;
  color: var(--text-soft);
  font-size: 0.68rem;
}

.company-role-external-head strong,
.company-role-external-head span {
  display: block;
}

.company-role-external-head span {
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.75rem;
}

.company-role-external-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 9px;
  margin-top: 10px;
}

.company-role-external-form label {
  display: grid;
  gap: 5px;
  color: var(--text-soft);
  font-size: 0.73rem;
}

.company-role-external-contacts {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.company-role-external-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.16);
}

.company-role-external-contact strong,
.company-role-external-contact span {
  display: block;
}

.company-role-external-contact span {
  margin-top: 2px;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.company-role-external-remove {
  flex: 0 0 auto;
  padding: 5px 8px;
  font-size: 0.72rem;
}

@media (max-width: 720px) {
  .company-role-external-form {
    grid-template-columns: 1fr;
  }
}

.schedule-teams-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.schedule-teams-empty {
  min-height: 160px;
  border: 1px dashed #3a3a3a;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  color: var(--text-soft);
}

.schedule-teams-empty strong,
.schedule-teams-empty span {
  display: block;
}

.schedule-teams-empty strong {
  color: #ffffff;
  margin-bottom: 6px;
}

.schedule-team-card {
  --schedule-accent: #f0aa46;
  --schedule-accent-soft: rgba(240, 170, 70, 0.14);
  --schedule-accent-border: rgba(240, 170, 70, 0.28);
  border: 1px solid var(--schedule-accent-border);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    linear-gradient(135deg, var(--schedule-accent-soft), rgba(18, 18, 18, 0) 45%);
  padding: 14px;
  display: grid;
  gap: 12px;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.18);
}

.schedule-team-card-header {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}

.schedule-team-title-wrap {
  min-width: 0;
  flex: 1;
}

.schedule-team-name-input,
.schedule-team-name-readonly {
  width: 100%;
  background: transparent;
  color: #ffffff;
  border: 0;
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.schedule-team-name-input {
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding-bottom: 6px;
}

.schedule-team-name-input:focus {
  outline: none;
  border-bottom-color: var(--schedule-accent);
}

.schedule-team-meta {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-soft);
  font-size: 0.74rem;
}

.schedule-team-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.schedule-team-drag {
  min-width: 74px;
  border-radius: 14px;
  border: 1px dashed var(--schedule-accent-border);
  background: rgba(255,255,255,0.03);
  color: #ffffff;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: grab;
  user-select: none;
  font-size: 0.75rem;
}

.schedule-team-drag:active,
.schedule-team-drag.is-dragging {
  cursor: grabbing;
}

.schedule-team-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-team-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f2f2f2;
  font-size: 0.72rem;
}

.schedule-team-dropzone {
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.1);
  background: rgba(8, 8, 8, 0.18);
  padding: 12px;
  display: grid;
  gap: 10px;
  transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.schedule-team-dropzone.is-empty {
  min-height: 112px;
  place-content: start;
}

.schedule-team-dropzone.is-drop-target {
  border-color: var(--schedule-accent);
  background: var(--schedule-accent-soft);
  transform: translateY(-1px);
}

.schedule-team-dropzone-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.schedule-team-dropzone-placeholder {
  color: var(--text-soft);
  font-size: 0.82rem;
  line-height: 1.4;
}

.schedule-team-members {
  display: grid;
  gap: 8px;
}

.schedule-team-card-footer {
  color: var(--text-soft);
  font-size: 0.74rem;
  line-height: 1.4;
}

.schedule-layout {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr);
  gap: 16px;
  align-items: flex-start;
}

.schedule-employee-pool {
  background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
  border-radius: 20px;
  border: 1px solid #2d2d2d;
  padding: 14px;
  position: sticky;
  top: 90px;
}

.schedule-employee-pool h3 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
}

.schedule-employee-pool #schedule-employee-pool-list {
  display: grid;
  gap: 8px;
  min-height: 120px;
  padding: 4px;
  border-radius: 18px;
  border: 1px dashed rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.schedule-employee-pool #schedule-employee-pool-list.is-drop-target {
  border-color: #6ec4ff;
  background: rgba(75, 169, 255, 0.1);
}

.schedule-pool-empty {
  color: var(--text-soft);
  font-size: 0.8rem;
  line-height: 1.45;
  padding: 8px 6px;
}

.schedule-person-chip {
  --schedule-accent: #f0aa46;
  --schedule-accent-soft: rgba(240, 170, 70, 0.14);
  --schedule-accent-border: rgba(240, 170, 70, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--schedule-accent-border);
  background: linear-gradient(180deg, var(--schedule-accent-soft), rgba(255,255,255,0.03));
  cursor: grab;
  user-select: none;
}

.schedule-person-chip.is-head {
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), 0 10px 20px rgba(0,0,0,0.12);
}

.schedule-person-chip.is-dragging,
.schedule-person-chip:active {
  cursor: grabbing;
}

.schedule-person-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.schedule-person-text strong,
.schedule-person-text span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.schedule-person-text strong {
  font-size: 0.86rem;
  color: #ffffff;
}

.schedule-person-text span {
  font-size: 0.73rem;
  color: rgba(255,255,255,0.72);
}

.schedule-person-remove {
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.74);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.schedule-person-remove:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
}

.schedule-week-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.schedule-day-column {
  background: linear-gradient(180deg, #1a1a1a 0%, #141414 100%);
  border-radius: 20px;
  border: 1px solid #2d2d2d;
  display: flex;
  flex-direction: column;
  min-height: 240px;
  overflow: hidden;
}

.schedule-day-header {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 0.82rem;
  font-weight: 700;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.schedule-day-body {
  flex: 1;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.schedule-day-body.is-drop-target {
  background: rgba(75, 169, 255, 0.08);
}

.schedule-day-empty {
  min-height: 88px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--text-soft);
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.4;
  padding: 14px 12px;
}

.schedule-entry-pill {
  --schedule-accent: #f0aa46;
  --schedule-accent-soft: rgba(240, 170, 70, 0.14);
  --schedule-accent-border: rgba(240, 170, 70, 0.28);
  border-radius: 16px;
  border: 1px solid var(--schedule-accent-border);
  background: linear-gradient(180deg, var(--schedule-accent-soft), rgba(255,255,255,0.03));
  padding: 10px 11px;
  font-size: 0.76rem;
  cursor: pointer;
}

.schedule-entry-pill .pill-team {
  font-size: 0.71rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.72);
  margin-bottom: 5px;
}

.schedule-entry-pill .pill-main {
  font-weight: 600;
  color: #ffffff;
}

.schedule-entry-pill .pill-sub {
  color: rgba(255,255,255,0.72);
  font-size: 0.72rem;
  line-height: 1.35;
}

.schedule-entry-pill .pill-time {
  margin-top: 7px;
  font-size: 0.72rem;
  color: #ffffff;
}

.schedule-table-team {
  display: grid;
  gap: 3px;
  padding: 4px 0;
}

.schedule-table-team strong {
  color: #ffffff;
  font-size: 0.82rem;
}

.schedule-table-team span {
  color: var(--text-soft);
  font-size: 0.72rem;
}

/* Profil-Modal */

#profile-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1100;
}

#push-optin-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1200;
}

.profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.profile-modal-content {
  position: relative;
  max-width: 640px;
  margin: 60px auto;
  padding: 8px;
}

.push-optin-content {
  position: relative;
  max-width: 520px;
  margin: 90px auto;
  padding: 8px;
}

.profile-modal-content .card {
  margin-bottom: 0;
}

.push-optin-content .card {
  margin-bottom: 0;
}

.admin-backup-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.profile-push-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.profile-push-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 8px;
}

.admin-backup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.appointments-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
  gap: 18px;
  margin-bottom: 18px;
  align-items: start;
}

.appointment-calendar-card,
.appointment-agenda-card {
  min-height: 100%;
}

.appointment-calendar-card {
  position: sticky;
  top: 18px;
  background:
    radial-gradient(circle at top left, rgba(218, 58, 61, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  border: 1px solid rgba(218, 58, 61, 0.16);
}

.appointment-form-card {
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  border: 1px solid rgba(255, 209, 102, 0.12);
}

.appointment-agenda-card {
  background:
    radial-gradient(circle at top right, rgba(218, 58, 61, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  border: 1px solid rgba(218, 58, 61, 0.14);
}

.appointments-side-stack {
  display: grid;
  gap: 18px;
}

.appointment-form-card .card-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.appointment-form-wide {
  grid-column: 1 / -1;
}

.appointment-submit-btn {
  grid-column: 1 / -1;
  justify-content: center;
}

.appointment-calendar-toolbar {
  align-items: center;
  border-bottom: 1px solid rgba(218, 58, 61, 0.12);
  background: linear-gradient(90deg, rgba(218, 58, 61, 0.12), rgba(218, 58, 61, 0.02));
}

.appointment-calendar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.appointment-calendar-monthbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.appointment-calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.appointment-calendar-weekdays span {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f2c7c7;
  background: rgba(218, 58, 61, 0.08);
  border: 1px solid rgba(218, 58, 61, 0.08);
  padding: 8px 6px;
  border-radius: 12px;
}

.appointment-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.appointment-calendar-day {
  min-height: 128px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.015)),
    var(--bg-elevated);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.appointment-calendar-day:hover {
  transform: translateY(-1px);
  border-color: rgba(218, 58, 61, 0.42);
  box-shadow: 0 16px 28px rgba(2, 12, 22, 0.24);
}

.appointment-calendar-day.is-outside {
  opacity: 0.45;
}

.appointment-calendar-day.is-today {
  border-color: rgba(255, 209, 102, 0.56);
  background:
    radial-gradient(circle at top, rgba(255, 209, 102, 0.12), transparent 58%),
    var(--bg-elevated);
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.18);
}

.appointment-calendar-day.is-selected {
  border-color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(218, 58, 61, 0.28), transparent 60%),
    linear-gradient(180deg, rgba(218, 58, 61, 0.08), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated-soft);
  box-shadow:
    0 18px 34px rgba(2, 12, 22, 0.28),
    inset 0 0 0 1px rgba(218, 58, 61, 0.18);
}

.appointment-calendar-dayhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.appointment-calendar-daynum {
  font-size: 1rem;
  font-weight: 800;
  color: #fff4f4;
}

.appointment-calendar-count {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(218, 58, 61, 0.95), rgba(255, 128, 130, 0.95));
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(218, 58, 61, 0.24);
}

.appointment-calendar-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.appointment-calendar-event {
  padding: 7px 9px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(218, 58, 61, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.76rem;
  line-height: 1.35;
  color: #f8f0f0;
}

.appointment-calendar-event strong,
.appointment-agenda-card strong {
  display: block;
}

.appointment-calendar-more {
  font-size: 0.76rem;
  color: var(--text-soft);
}

.appointment-agenda-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.appointment-agenda-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(218, 58, 61, 0.2);
  color: #d7b7b7;
  background: rgba(218, 58, 61, 0.04);
}

.appointment-agenda-item {
  border-radius: 18px;
  border: 1px solid rgba(218, 58, 61, 0.14);
  background:
    radial-gradient(circle at top right, rgba(218, 58, 61, 0.18), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.appointment-agenda-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.appointment-agenda-time {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(218, 58, 61, 0.12);
  color: #ffd4d4;
  font-size: 0.78rem;
  font-weight: 700;
  border: 1px solid rgba(218, 58, 61, 0.12);
}

.appointment-agenda-subline {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.appointment-agenda-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.appointment-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #eadede;
  font-size: 0.76rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.appointment-form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.appointment-picker-block {
  display: grid;
  gap: 12px;
  margin-top: -4px;
}

.appointment-selected-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 22px;
}

.appointment-selected-empty {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.appointment-selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px 7px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(218, 58, 61, 0.16), rgba(255, 209, 102, 0.12));
  border: 1px solid rgba(218, 58, 61, 0.14);
  color: #fff5f5;
  font-size: 0.82rem;
}

.appointment-selected-chip button {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.appointment-employee-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.appointment-employee-card {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  padding: 12px;
  text-align: left;
  cursor: pointer;
  transition: transform var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.appointment-employee-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 209, 102, 0.34);
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.12), transparent 62%),
    var(--bg-elevated-soft);
}

.appointment-employee-card.is-selected {
  border-color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(218, 58, 61, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(218, 58, 61, 0.08), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated-soft);
  box-shadow: inset 0 0 0 1px rgba(218, 58, 61, 0.16);
}

.appointment-employee-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

.appointment-employee-card span {
  display: block;
  font-size: 0.76rem;
  color: var(--text-soft);
}

.appointment-picker-empty {
  grid-column: 1 / -1;
  padding: 16px;
  border: 1px dashed rgba(255, 209, 102, 0.24);
  border-radius: 16px;
  color: #d8c8a5;
  text-align: center;
  background: rgba(255, 209, 102, 0.04);
}

body[data-brand="electrician"] .appointment-calendar-day:hover {
  border-color: rgba(105, 201, 255, 0.32);
}

body[data-brand="electrician"] .appointment-calendar-card {
  background:
    radial-gradient(circle at top left, rgba(105, 201, 255, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  border: 1px solid rgba(105, 201, 255, 0.16);
}

body[data-brand="electrician"] .appointment-form-card {
  background:
    radial-gradient(circle at top right, rgba(134, 228, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  border: 1px solid rgba(105, 201, 255, 0.12);
}

body[data-brand="electrician"] .appointment-agenda-card {
  background:
    radial-gradient(circle at top right, rgba(105, 201, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  border: 1px solid rgba(105, 201, 255, 0.14);
}

body[data-brand="electrician"] .appointment-calendar-toolbar {
  border-bottom: 1px solid rgba(105, 201, 255, 0.12);
  background: linear-gradient(90deg, rgba(105, 201, 255, 0.12), rgba(105, 201, 255, 0.02));
}

body[data-brand="electrician"] .appointment-calendar-weekdays span {
  color: #dff6ff;
  background: rgba(105, 201, 255, 0.08);
  border-color: rgba(105, 201, 255, 0.08);
}

body[data-brand="electrician"] .appointment-calendar-day.is-today {
  border-color: rgba(105, 201, 255, 0.36);
  background:
    radial-gradient(circle at top, rgba(105, 201, 255, 0.12), transparent 58%),
    var(--bg-elevated);
  box-shadow: inset 0 0 0 1px rgba(105, 201, 255, 0.18);
}

body[data-brand="electrician"] .appointment-calendar-day.is-selected {
  border-color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(105, 201, 255, 0.24), transparent 60%),
    linear-gradient(180deg, rgba(105, 201, 255, 0.08), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated-soft);
  box-shadow:
    0 18px 34px rgba(2, 12, 22, 0.28),
    inset 0 0 0 1px rgba(105, 201, 255, 0.16);
}

body[data-brand="electrician"] .appointment-calendar-count {
  background: linear-gradient(135deg, rgba(42, 169, 255, 0.95), rgba(134, 228, 255, 0.92));
  color: #fff;
}

body[data-brand="electrician"] .appointment-agenda-item {
  background:
    radial-gradient(circle at top right, rgba(105, 201, 255, 0.2), transparent 62%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated);
  border-color: rgba(105, 201, 255, 0.16);
}

body[data-brand="electrician"] .appointment-agenda-empty {
  border-color: rgba(105, 201, 255, 0.22);
  color: #c2e8f5;
  background: rgba(105, 201, 255, 0.04);
}

body[data-brand="electrician"] .appointment-agenda-time {
  background: rgba(105, 201, 255, 0.12);
  color: #def7ff;
  border-color: rgba(105, 201, 255, 0.12);
}

body[data-brand="electrician"] .appointment-employee-card:hover {
  border-color: rgba(105, 201, 255, 0.28);
  background:
    radial-gradient(circle at top right, rgba(105, 201, 255, 0.12), transparent 62%),
    var(--bg-elevated-soft);
}

body[data-brand="electrician"] .appointment-employee-card.is-selected {
  border-color: var(--accent);
  background:
    radial-gradient(circle at top right, rgba(105, 201, 255, 0.22), transparent 60%),
    linear-gradient(180deg, rgba(105, 201, 255, 0.08), rgba(255, 255, 255, 0.01)),
    var(--bg-elevated-soft);
}

body[data-brand="electrician"] .appointment-employee-card strong {
  color: #ffffff;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.24);
}

body[data-brand="electrician"] .appointment-selected-chip {
  background: linear-gradient(135deg, rgba(105, 201, 255, 0.18), rgba(134, 228, 255, 0.1));
  border-color: rgba(105, 201, 255, 0.14);
  color: #effbff;
}

body[data-brand="electrician"] .appointment-picker-empty {
  border-color: rgba(105, 201, 255, 0.22);
  color: #c0e9f6;
  background: rgba(105, 201, 255, 0.04);
}

/* Angebotsvorschau */

.offer-preview-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.85rem;
}

.offer-preview-header {
  display: flex;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid #333;
  padding-bottom: 10px;
}

.offer-preview-logo img {
  width: 120px;
  height: auto;
  object-fit: contain;
}

.offer-preview-meta h3 {
  margin: 0 0 6px 0;
  font-size: 1.1rem;
}

.offer-preview-meta p {
  margin: 2px 0;
}

.offer-preview-intro {
  margin-top: 6px;
}

.offer-preview-intro p {
  margin: 0;
}

.offer-preview-extras {
  display: grid;
  gap: 8px;
}

.offer-preview-block {
  background: #1c1c1c;
  border-radius: var(--radius-md);
  border: 1px solid #333;
  padding: 8px 10px;
  font-size: 0.8rem;
}

.offer-preview-block strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text-soft);
}

.offer-preview-block p {
  margin: 0;
  white-space: pre-line;
}

.offer-optional-preview-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.offer-optional-preview-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #141414;
  border: 1px solid #2f2f2f;
}

.offer-optional-preview-card strong {
  margin-bottom: 0;
  color: #fff;
}

.offer-optional-preview-card span {
  white-space: nowrap;
  font-weight: 700;
  color: #fff;
}

.offer-preview-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.offer-preview-photo-card {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #333;
  display: block;
  background: #111;
}

.offer-preview-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.offer-preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.offer-preview-table th,
.offer-preview-table td {
  padding: 5px 6px;
  border-bottom: 1px solid #333;
}

.offer-preview-table th {
  background: #1c1c1c;
  color: var(--text-soft);
}

.offer-preview-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.offer-preview-summary div {
  background: #1c1c1c;
  border-radius: var(--radius-md);
  border: 1px solid #333;
  padding: 8px 10px;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.offer-preview-summary span {
  color: var(--text-soft);
}

.offer-preview-summary strong {
  font-size: 0.9rem;
}

.offer-preview-footer {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-preview-footer p {
  margin: 0;
}

.offer-materials {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #333;
  display: grid;
  gap: 10px;
}

.offer-optional-packages {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #333;
  display: grid;
  gap: 10px;
}

.offer-materials-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.offer-materials label {
  margin: 0;
}

.offer-optional-packages-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.offer-optional-packages-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.offer-optional-packages-actions {
  grid-column: 1 / -1;
}

.offer-optional-package-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.offer-materials-photos {
  display: grid;
  gap: 8px;
}

.offer-materials-photos-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.85rem;
}

.offer-photos-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-photo-card {
  position: relative;
  width: 84px;
  height: 84px;
}

.offer-photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #333;
}

.offer-photo-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #444;
  background: #111;
  color: #fff;
  font-size: 12px;
  line-height: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.car-layout-grid {
  grid-template-columns: minmax(0, 1fr);
}

.car-checkin-card .card-body {
  display: grid;
  gap: 16px;
}

.car-checkin-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 210, 0.18);
  background: linear-gradient(135deg, rgba(239, 77, 79, 0.18), rgba(126, 28, 30, 0.78));
  color: #ffe9e9;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.car-worker-checkin-shell {
  display: grid;
  gap: 16px;
}

.car-worker-checkin-top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 16px;
  align-items: stretch;
}

.car-worker-checkin-top h3 {
  margin: 6px 0 8px;
  font-size: 1.4rem;
  line-height: 1.15;
}

.car-worker-checkin-top p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.car-worker-eyebrow {
  color: #ffb4b4;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.car-log-progress,
.car-log-step-block,
.car-log-selected-summary,
.car-log-step-card,
.car-log-photo-preview,
.car-worker-recent-logs {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(14, 14, 14, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 12px 24px rgba(0, 0, 0, 0.16);
}

.car-log-progress {
  padding: 16px 18px;
  display: grid;
  gap: 12px;
  min-height: 100%;
}

.car-log-progress-copy {
  display: grid;
  gap: 4px;
}

.car-log-progress-title {
  font-size: 1rem;
  font-weight: 700;
}

.car-log-progress-detail {
  color: var(--text-soft);
  line-height: 1.5;
}

.car-log-progress-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.car-log-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4d4f, #ff8b72);
  box-shadow: 0 0 18px rgba(239, 77, 79, 0.26);
}

.car-log-progress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.car-log-message {
  display: none;
  padding: 14px 16px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.55;
}

.car-log-message.is-ok,
.car-log-message.is-missing {
  display: block;
}

.car-log-message.is-ok {
  background: linear-gradient(180deg, rgba(18, 98, 56, 0.42), rgba(12, 34, 23, 0.92));
  border: 1px solid rgba(74, 222, 128, 0.22);
  color: #cbffe0;
}

.car-log-message.is-missing {
  background: linear-gradient(180deg, rgba(135, 31, 34, 0.42), rgba(40, 12, 14, 0.92));
  border: 1px solid rgba(248, 113, 113, 0.22);
  color: #ffe2e2;
}

.car-log-step-block {
  padding: 16px 18px;
  display: grid;
  gap: 12px;
}

.car-log-step-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.car-log-hidden-select {
  display: none !important;
}

.car-log-vehicle-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.car-vehicle-pill,
.car-vehicle-pill-empty {
  min-width: 0;
  border-radius: 18px;
}

.car-vehicle-pill {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(18, 18, 18, 0.96));
  padding: 14px 16px;
  color: #ffffff;
  min-width: 210px;
  display: grid;
  gap: 4px;
  text-align: left;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

.car-vehicle-pill:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(255, 215, 215, 0.2);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.2);
}

.car-vehicle-pill:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.car-vehicle-pill.is-selected {
  border-color: rgba(255, 170, 170, 0.3);
  background: linear-gradient(180deg, rgba(239, 77, 79, 0.18), rgba(44, 13, 15, 0.96));
  box-shadow: 0 16px 30px rgba(150, 33, 36, 0.24);
}

.car-vehicle-pill.is-complete {
  border-color: rgba(74, 222, 128, 0.18);
}

.car-vehicle-pill-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.car-vehicle-pill-subtitle,
.car-vehicle-pill-status,
.car-vehicle-pill-empty {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.car-vehicle-pill-status {
  color: #ffd0d0;
}

.car-vehicle-pill.is-complete .car-vehicle-pill-status {
  color: #9ff0be;
}

.car-vehicle-pill-empty {
  padding: 14px 16px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 10, 0.5);
}

.car-log-selected-summary {
  padding: 16px 18px;
  display: grid;
  gap: 14px;
}

.car-selected-empty {
  color: var(--text-soft);
  line-height: 1.5;
}

.car-selected-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.car-selected-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.car-selected-caption,
.car-selected-note {
  color: var(--text-soft);
  line-height: 1.5;
}

.car-selected-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.car-selected-meta-card {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(6, 16, 26, 0.56);
  border: 1px solid rgba(108, 142, 173, 0.18);
  display: grid;
  gap: 4px;
}

.car-selected-meta-card span {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.car-selected-meta-card strong {
  font-size: 0.95rem;
}

.car-log-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.car-log-step-card {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.car-log-step-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.car-log-step-head strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.95rem;
}

.car-log-step-head small {
  color: var(--text-soft);
}

.car-log-step-number {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4d4f, #c53033);
  box-shadow: 0 10px 20px rgba(197, 48, 51, 0.24);
}

.car-log-photo-field {
  display: grid;
  gap: 10px;
}

.car-log-file-input {
  display: grid;
  gap: 10px;
  justify-items: flex-start;
}

.car-log-photo-action {
  min-height: 48px;
  padding-inline: 18px;
}

.car-log-submit-bar {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  align-items: start;
}

.car-log-submit-btn {
  min-height: 52px;
  padding-inline: 22px;
}

.car-log-submit-bar .hours-submit-status {
  min-height: 22px;
}

.car-log-footer {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
}

.car-log-photo-preview {
  min-height: 180px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.car-log-photo-preview:empty::before {
  content: "A pré-visualização da foto aparece aqui.";
  color: var(--text-soft);
  line-height: 1.5;
}

.car-log-photo-thumb {
  width: 168px;
  height: 168px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.26);
}

.car-worker-recent-logs {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.car-recent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
}

.car-recent-header span:last-child {
  color: var(--text-soft);
}

.car-recent-list {
  display: grid;
  gap: 10px;
}

.car-recent-item {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(6, 16, 26, 0.54);
  border: 1px solid rgba(108, 142, 173, 0.16);
  display: grid;
  gap: 4px;
}

.car-recent-title {
  font-weight: 700;
}

.car-recent-meta,
.car-recent-empty {
  color: var(--text-soft);
  line-height: 1.45;
}

.car-status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.car-status-chip.is-ok {
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(74, 222, 128, 0.2);
  color: #9ff0be;
}

.car-status-chip.is-missing {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.2);
  color: #ffd1d1;
}

.car-status-chip.is-muted {
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(148, 163, 184, 0.18);
  color: #d0d6df;
}

.car-status-chip.is-partial {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.2);
  color: #ffd892;
}

@media (max-width: 1100px) {
  .car-worker-checkin-top,
  .car-log-footer {
    grid-template-columns: 1fr;
  }

  .car-selected-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .car-log-form {
    grid-template-columns: 1fr !important;
  }

  .car-log-submit-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .car-checkin-card .card-header,
  .car-selected-hero,
  .car-log-progress-footer,
  .car-recent-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .car-log-step-head {
    align-items: flex-start;
  }

  .car-vehicle-pill {
    width: 100%;
    min-width: 0;
  }

  .car-selected-meta {
    grid-template-columns: 1fr;
  }

  .car-log-step-card,
  .car-log-progress,
  .car-log-step-block,
  .car-log-selected-summary,
  .car-worker-recent-logs,
  .car-log-photo-preview {
    padding: 14px;
  }

  .car-worker-checkin-top h3 {
    font-size: 1.18rem;
  }
}

.offer-extras {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #333;
  display: grid;
  gap: 10px;
}

.offer-extras-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
}

.offer-extras-body .form-grid {
  margin-top: 0;
}

.offer-section-row td {
  background: #161616;
  color: var(--text-soft);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
  padding: 8px 10px;
}

.offer-section-row .offer-section-title {
  display: inline-block;
}

.offer-section-row .offer-section-action {
  float: right;
}

/* Responsive */

@media (max-width: 1024px) {
  .costing-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .schedule-employee-pool {
    position: static;
  }

  .schedule-week-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .offer-preview-summary {
    grid-template-columns: 1fr;
  }

  .offer-summary-card {
    position: static;
  }
}

@media (max-width: 840px) {
  .costing-tabs {
    justify-content: flex-start;
  }

  .costing-kpi-grid {
    grid-template-columns: 1fr;
  }

  /* Sidebar als ausklappbares Menü von links */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 260px;
    transform: translateX(-100%);
    transition: transform var(--transition-fast);
    z-index: 1000;
  }

  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  .main {
    padding: 12px 10px;
    max-width: 100%;
  }

  /* Topbar: links Burger, Mitte Logo, rechts nur Avatar */
  .topbar-left {
    flex: 1;
  }

  .topbar-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .topbar-title-wrap {
    display: none;
  }

  .topbar-logo-mobile {
    display: flex;
    flex: 1;
    justify-content: center;
  }

  .topbar-logo-mobile img {
    height: 40px;
    width: auto;
  }

  .topbar-date {
    display: none;
  }

  .user-meta {
    display: none;
  }

  .user-chip {
    padding: 6px;
    border-radius: 999px;
  }

  /* Login-View soll fast den ganzen Screen füllen */
  #view-login {
    min-height: calc(100vh - 70px);
    padding-top: 12px;
  }

  /* NUR wenn die View aktiv ist, anzeigen & als Flex layouten */
  #view-login.view-active {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }

  #view-login .section-header h2 {
    text-align: center;
    font-size: 1.4rem;
    margin: 4px 0 12px;
  }

  #view-login .card {
    flex: 0;
    max-width: 420px;
    margin: 0 auto 24px;
    padding: 20px 18px 24px;
    border-radius: 22px;
  }

  #view-login .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  /* Grids einspaltig */
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  /* Tabellen besser mobil scrollen */
  .table-wrapper {
    max-height: none;
    overflow-x: auto;
  }

  .offer-summary {
    grid-template-columns: 1fr;
  }

  .schedule-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-executive-layout,
  .schedule-layout {
    grid-template-columns: 1fr;
  }

  .appointments-admin-layout {
    grid-template-columns: 1fr;
  }

  .appointment-calendar-card {
    position: static;
  }

  .appointment-employee-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .schedule-teams-header {
    align-items: stretch;
  }

  .schedule-teams-header .btn {
    width: 100%;
    justify-content: center;
  }

  .profile-modal-content {
    margin: 40px 8px;
  }
}

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

  .appointment-calendar-grid,
  .appointment-calendar-weekdays {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .appointment-form-card .card-body {
    grid-template-columns: 1fr;
  }

  .appointment-employee-picker {
    grid-template-columns: 1fr;
  }
}
/* Edit-Modal für Wochenplan-Einträge */

#schedule-edit-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1100;
}

.schedule-edit-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.schedule-edit-content {
  position: relative;
  max-width: 420px;
  margin: 80px auto;
  padding: 8px;
}

@media (max-width: 840px) {
  .schedule-edit-content {
    margin: 40px 8px;
  }
}
/* Wochenplan – Kalender-Ansicht */

.schedule-week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.schedule-week-label {
  flex: 1;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}

.btn.icon-only {
  padding: 6px 9px;
  border-radius: 999px;
}
/* --- MOBILE FINETUNING LOGIN & TOPBAR --- */
@media (max-width: 840px) {

  /* Topbar: Logo + Icons größer */
  .topbar-menu-btn {
    font-size: 1.3rem;
    padding: 8px 10px;
    border-radius: 12px;
  }

  .avatar-circle {
    width: 36px;
    height: 36px;
  }

  .avatar-circle i {
    font-size: 1rem;
  }

  .topbar-logo-mobile img {
    height: 50px;
    width: auto;
  }

  #view-login .card {
    flex: 0;                      /* nicht mehr strecken */
    max-width: 420px;
    margin: 0 auto 24px;
    padding: 20px 18px 24px;
    border-radius: 22px;
  }

  #view-login .card-header {
    justify-content: center;
    margin-bottom: 16px;
    padding-top: 2px;
  }

  #view-login .card-header span {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
  }

  #view-login .card-body {
    flex: 0;                      /* kein Vollbild mehr */
    display: block;
  }

  /* Formular: einspaltig, schöne Größen */
  #login-form.form-grid {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  #login-form label {
    font-size: 0.9rem;
  }

  #view-login input[type="text"],
  #view-login input[type="password"] {
    font-size: 1rem;
    padding: 11px 12px;
    border-radius: 12px;
  }

  /* Buttons: breite App-Buttons */
  #view-login .btn.primary#btn-login {
    width: 100%;
    justify-content: center;
    padding: 11px 16px;
    font-size: 0.95rem;
    margin-top: 8px;
  }

  #view-login #btn-logout {
    margin-top: 16px !important;
    width: 100%;
    justify-content: center;
    font-size: 0.85rem;
  }

  /* Status-/Fehlertexte */
  #view-login .login-status,
  #view-login .login-error {
    font-size: 0.82rem;
    margin-top: 10px;
  }
}
/* Painel: current figures, work queue and today's plan. */
#dashboard-admin-overview, #dashboard-stats { margin-bottom: 20px; }
.painel-toolbar, .painel-refresh, .painel-kpi-label, .painel-finance-note { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.painel-toolbar { margin-bottom: 18px; align-items: flex-end; }
.painel-toolbar h3 { margin: 5px 0 0; font-size: 1.45rem; text-transform: capitalize; }
.painel-eyebrow { color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; }
.painel-refresh { flex-wrap: wrap; justify-content: flex-end; font-size: .76rem; }
.painel-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
#view-dashboard .painel-kpi { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 18px; min-width: 0; border: 1px solid var(--border-subtle); box-shadow: none; }
.painel-kpi > span, .painel-kpi-label { min-height: 32px; font-size: .83rem; color: var(--text-muted); }
.painel-kpi > strong { font-size: clamp(1.25rem, 1.7vw, 1.9rem); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; letter-spacing: -.025em; }
.painel-kpi small { font-size: .72rem; color: var(--text-muted); line-height: 1.5; }
.painel-kpi em { display: inline-block; color: #f5ce86; font-size: .64rem; font-style: normal; margin-left: 4px; }
#view-dashboard .painel-kpi-result { background: linear-gradient(135deg, rgba(218,58,61,.09), transparent), var(--bg-elevated); }
#view-dashboard .is-positive { color: #77e0a5; }
#view-dashboard .is-negative { color: #ff9898; }
.painel-finance-note { align-items: flex-start; margin: 12px 2px 0; }
.painel-finance-note p { margin: 0; color: var(--text-muted); font-size: .74rem; line-height: 1.6; max-width: 95ch; }
.painel-link { background: transparent; border: 0; padding: 5px 0; color: var(--text-main); font: inherit; font-size: .76rem; cursor: pointer; text-align: left; }
.painel-link:hover { color: #ffaaa9; text-decoration: underline; }
#view-dashboard button:focus-visible, #view-dashboard summary:focus-visible { outline: 2px solid #f6b75b; outline-offset: 4px; }
.painel-columns, #view-dashboard .painel-lower-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
#view-dashboard .painel-card { margin: 0; min-width: 0; padding: 0; overflow: hidden; box-shadow: none; }
.painel-card .card-header { padding: 16px 18px; gap: 10px; flex-wrap: wrap; }
.painel-card .card-body { padding: 0 18px 16px; }
.painel-card .card-header > span { font-size: .96rem; font-weight: 600; }
.painel-card .card-header small { font-size: .7rem; }
.painel-task { display: flex; align-items: center; width: 100%; gap: 13px; padding: 14px 0; color: var(--text-main); border: 0; border-bottom: 1px solid var(--border-subtle); background: none; cursor: pointer; text-align: left; font: inherit; }
.painel-task:last-child { border-bottom: 0; }
.painel-task:hover { background: rgba(255,255,255,.025); }
.painel-task-count { display: grid; place-items: center; flex: 0 0 38px; height: 38px; background: rgba(246,183,91,.12); color: #f6c982; border-radius: 10px; font-weight: 700; }
.painel-task-count.is-clear { color: var(--text-muted); background: rgba(255,255,255,.04); }
.painel-task-copy { flex: 1; min-width: 0; }
.painel-task-copy strong { display: block; font-size: .83rem; font-weight: 500; }
.painel-task-copy small { display: block; font-size: .71rem; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.painel-site-totals { display: flex; align-items: baseline; gap: 8px; font-size: .78rem; color: var(--text-muted); padding: 0 0 10px; }
.painel-site-totals strong { font-size: 1.5rem; color: var(--text-main); }
.painel-site-totals span:last-child { margin-left: auto; text-align: right; }
.painel-site { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border-subtle); }
.painel-site > div { min-width: 0; }
.painel-site .painel-link { font-size: .82rem; overflow-wrap: anywhere; }
.painel-site small { display: block; color: var(--text-muted); font-size: .7rem; }
.painel-site > span { font-size: .76rem; white-space: nowrap; }
#view-dashboard .painel-team { display: flex; align-items: center; gap: 24px; margin: 18px 0 0; padding: 17px 18px; box-shadow: none; }
.painel-team > div:first-child { margin-right: auto; }
.painel-team small { display: block; margin-top: 5px; font-size: .68rem; color: var(--text-muted); }
.painel-team strong { display: block; font-size: 1.3rem; }
.painel-team div > span:not(.painel-eyebrow) { color: var(--text-muted); font-size: .72rem; }
.painel-chart-wrap { height: 235px; position: relative; }
.painel-chart-table { margin-top: 12px; font-size: .75rem; }
.painel-chart-table summary { cursor: pointer; padding: 8px 0; color: var(--text-muted); }
.painel-agenda-item { display: grid; grid-template-columns: 95px minmax(0,1fr); gap: 10px; border-bottom: 1px solid var(--border-subtle); padding: 12px 0; }
.painel-agenda-item time { color: #f5ce86; font-size: .74rem; }
.painel-agenda-item strong { font-size: .82rem; font-weight: 500; }
.painel-agenda-item p { color: var(--text-muted); font-size: .72rem; line-height: 1.5; margin: 5px 0 0; overflow-wrap: anywhere; }
#view-dashboard .painel-empty { padding: 20px 0; margin: 0; font-size: .8rem; line-height: 1.6; color: var(--text-muted); }
#dashboard-load-status.is-error, #dash-balance-hint.is-error { color: #ffaaa9; }
@media (max-width: 1200px) { .painel-kpis { grid-template-columns: repeat(2,minmax(0,1fr)); } .painel-team { flex-wrap: wrap; } .painel-team > div:first-child { flex-basis: 100%; } }
@media (max-width: 840px) {
  .painel-toolbar { align-items: flex-start; flex-direction: column; }
  .painel-refresh { justify-content: flex-start; }
  .painel-columns, #view-dashboard .painel-lower-grid { grid-template-columns: minmax(0,1fr); }
  .painel-finance-note { flex-direction: column; gap: 5px; }
  .painel-kpis { gap: 8px; }
  #view-dashboard .painel-kpi { padding: 13px; gap: 8px; }
  .painel-kpi > span, .painel-kpi-label { font-size: .75rem; }
  #view-dashboard .painel-team { gap: 18px; }
  .painel-kpi small { font-size: .68rem; }
  #worker-hours-section .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 360px) { .painel-kpis { grid-template-columns: minmax(0,1fr); } }

/* --- MOBILE FINETUNING: GRIDS / CARDS --- */
@media (max-width: 840px) {
  /* Allgemeine Karten-Abstände */
  .card {
    margin-bottom: 14px;
  }

  /* Alle 2er/3er-Grids auf 1 Spalte */
  .grid,
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    row-gap: 12px;
  }

  /* Formulare in Cards einspaltig */
  .card .form-grid {
    grid-template-columns: 1fr;
  }

  /* Buttons in Formularen schön breit */
  .card .form-grid .btn.primary,
  .card .form-grid button[type="submit"] {
    justify-content: center;
  }

  .visit-form-actions {
    flex-direction: column;
  }

  .visit-structured-grid,
  .visit-context-grid {
    grid-template-columns: 1fr;
  }

  .visit-quick-tags {
    flex-direction: column;
  }

  .visit-form-actions .btn,
  .visit-actions .btn,
  .visit-requirement-actions .btn,
  .visit-tag-btn {
    width: 100%;
    justify-content: center;
  }
}
/* --- MOBILE FIXES: kein Abschneiden rechts, saubere Abstände --- */
@media (max-width: 840px) {
  /* Der gesamte App-Container darf nicht breiter als der Screen werden */
  .app-shell {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  /* Hauptbereich mit gleichem Innenabstand links/rechts */
  .main {
    padding: 12px 14px 18px; /* oben, links/rechts, unten */
  }

  /* Karten füllen die Breite innerhalb des Main-Bereichs,
     aber nicht darüber hinaus */
  .card {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0 0 14px;  /* nur unten Abstand */
  }

  /* Mitarbeiter-View: beide Cards einspaltig und mittig */
  #view-employees .grid.grid-2 {
    grid-template-columns: 1fr;
    justify-items: stretch;
    row-gap: 14px;
  }

  #view-employees .grid.grid-2 > .card {
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
  }

  /* Tabellen dürfen die Seite nicht breiter ziehen */
  .table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  .table-wrapper table {
    width: 100%;
    max-width: 100%;
  }
}


html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top right, #2b2b2b, #202020);
  color: var(--text-main);
  max-width: 100%;
  overflow-x: hidden; /* horizontales Scrollen aus */
}
/* --- MOBILE FIX: Mitarbeiter-Ansicht (Form + Tabelle) --- */
@media (max-width: 840px) {
  /* Grid der Mitarbeiter-View: einspaltig untereinander */
  #view-employees .grid.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 14px;
  }

  /* Karten in der Mitarbeiter-View dürfen nie breiter als der Screen sein */
  #view-employees .card {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
  }

  /* Tabellen-Karte: Inhalt soll scrollen, nicht die ganze Seite */
  #view-employees .card-body.table-wrapper {
    padding: 0;
  }

  #view-employees .table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;   /* horizontal scrollen innerhalb der Karte */
  }

  #view-employees .table-wrapper table {
    width: 100%;
    max-width: 100%;
  }
}
/* --- SPEZIAL-FIX: Mitarbeiter & Angebote Layout --- */

/* Bis 1024px: Form + rechts daneben als Einspalter untereinander */
@media (max-width: 1024px) {
  #view-employees .grid.grid-2,
  #view-offers .offers-layout {
    display: grid;
    grid-template-columns: 1fr;
    column-gap: 0;
    row-gap: 14px;
  }

  #view-employees .grid.grid-2 > .card,
  #view-offers .offers-layout .card {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin: 0 0 12px;
  }
}

/* Allgemein: Tabellen in diesen Views sollen innen scrollen,
   nicht die Seite nach rechts rausziehen */
@media (max-width: 1024px) {
  #view-employees .table-wrapper,
  #view-offers .table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
  }

  #view-employees .table-wrapper table,
  #view-offers .table-wrapper table {
    width: 100%;
    max-width: 100%;
  }
}
/* --- LAYOUT FIX: Mitarbeiter & Angebote --- */

/* 2 Spalten: beide dürfen schrumpfen, ziehen nichts nach rechts raus */
#view-employees .grid.grid-2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

/* Karten innerhalb des Grids dürfen kleiner als ihr Inhalt werden */
#view-employees .grid.grid-2 > .card,
#view-offers .offers-layout .card {
  min-width: 0;
}

/* Auf kleineren Screens die beiden Karten untereinander */
@media (max-width: 900px) {
  #view-employees .grid.grid-2,
  #view-offers .offers-layout {
    grid-template-columns: 1fr;
  }
}
/* --- Worker-Hours Card --- */

#worker-hours-section {
  margin-top: 1.5rem;
}

.hours-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.hours-header-title {
  font-weight: 600;
  font-size: 1rem;
}

.hours-header-subtitle {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

.hours-duration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hours-duration-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hours-duration-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
}

.hours-site-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.hours-site-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.hours-site-panel-header strong {
  display: block;
  margin-bottom: 4px;
}

.hours-site-allocations {
  display: grid;
  gap: 10px;
}

.hours-site-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(150px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
}

.hours-site-row .hours-duration-grid {
  gap: 8px;
}

.hours-site-remove {
  min-width: 44px;
  justify-content: center;
}

.hours-site-panel-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.hours-site-panel-footer.is-valid #hours-site-total {
  color: #22c55e;
}

.hours-site-panel-footer.is-invalid #hours-site-total {
  color: #f87171;
}

.hours-site-allocation-list {
  display: grid;
  gap: 4px;
}

.hours-sites-cell {
  min-width: 220px;
}

.hours-site-allocation-item {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: baseline;
}

.hours-site-allocation-name {
  font-weight: 600;
}

.hours-site-allocation-time {
  color: var(--text-soft);
  font-size: 0.8rem;
}

#worker-hours-section .hours-duration-grid select {
  padding: 9px 10px;
  font-size: 1rem;
}

#worker-hours-section .form-grid #btn-add-hours {
  grid-column: 1 / -1;
  width: 100%;
  justify-content: center;
}

.hours-submit-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 18px;
  font-size: 0.8rem;
  color: var(--text-soft);
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hours-submit-status.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.hours-submit-status.is-pending {
  color: #fbbf24;
}

.hours-submit-status.is-success {
  color: #22c55e;
}

.hours-submit-status.is-error {
  color: #f87171;
}

.hours-submit-status.is-success i {
  animation: hoursStatusPop 0.5s ease;
}

@keyframes hoursStatusPop {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Timer-Block */

.hours-timer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hours-timer-meta {
  text-align: right;
}

.hours-timer-display {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 600;
}

.hours-timer-status {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.1rem;
}

.hours-timer-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Timer-Buttons */

.timer-btn-start {
  background: #16a34a;
  color: #fff;
  border: none;
}

.timer-btn-start:hover {
  background: #15803d;
}

.timer-btn-stop {
  background: #ef4444;
  color: #fff;
  border: none;
}

.timer-btn-stop:hover {
  background: #dc2626;
}

/* Stunden-Übersicht */

.hours-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.2rem 0 0.8rem;
}

.hours-summary-card {
  flex: 0 0 auto;
  min-width: 180px;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #1c1c1c;
  border: 1px solid #333;
}

.hours-summary-card .muted {
  font-size: 0.75rem;
}

.hours-total {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.hours-credit {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Mobile: Timer untereinander */

@media (max-width: 768px) {
  .hours-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hours-timer {
    width: 100%;
    justify-content: space-between;
  }

  .hours-timer-meta {
    text-align: left;
  }

  .hours-timer-buttons {
    flex-direction: row;
  }
}

/* Profil-Logout-Button in Rot */

#profile-logout-btn {
  background: #ef4444;
  color: #fff;
  border: none;
}

#profile-logout-btn:hover {
  background: #dc2626;
}
/* ===========================
   WORKER HOURS – DASHBOARD
   =========================== */

#worker-hours-section {
  margin-top: 1.5rem;
}

/* Header mit Titel links, Timer rechts */
#worker-hours-section .card-header.hours-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
}

.hours-header-title {
  font-weight: 600;
  font-size: 1rem;
}

.hours-header-subtitle {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Timer-Block rechts oben */
.hours-timer {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hours-timer-meta {
  text-align: right;
}

.hours-timer-meta .muted {
  font-size: 0.75rem;
}

.hours-timer-display {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.4rem;
  font-weight: 600;
}

.hours-timer-status {
  font-size: 0.8rem;
  color: #9ca3af;
  margin-top: 0.1rem;
}

.hours-timer-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

/* Timer-Buttons (eigenes Styling, damit du die globalen .btn-Klassen nicht zerstörst) */

.btn.timer-btn-start,
.btn.timer-btn-stop {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  border-radius: 999px;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Grün = Start */
.btn.timer-btn-start {
  background: #16a34a;
  color: #fff;
}

.btn.timer-btn-start:hover {
  background: #15803d;
}

/* Rot = Stop */
.btn.timer-btn-stop {
  background: #ef4444;
  color: #fff;
}

.btn.timer-btn-stop:hover {
  background: #dc2626;
}

/* Kleine "Info-Karten" für Stunden & Guthaben */

.hours-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.2rem 0 0.8rem;
}

.hours-summary-card {
  flex: 0 0 auto;
  min-width: 180px;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background: #1c1c1c;
  border: 1px solid #333;
}

.hours-summary-card .muted {
  font-size: 0.75rem;
}

.hours-total {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

.hours-credit {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 0.25rem;
}

/* Tabelle im Stundenbereich etwas enger machen */
#worker-hours-section .table-wrapper table th,
#worker-hours-section .table-wrapper table td {
  font-size: 0.85rem;
}

/* Mobile-Layout für Timer & Header */

@media (max-width: 768px) {
  #worker-hours-section .card-header.hours-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hours-site-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .hours-site-row {
    grid-template-columns: 1fr;
  }

  .hours-timer {
    width: 100%;
    justify-content: space-between;
  }

  .hours-timer-meta {
    text-align: left;
  }

  .hours-timer-buttons {
    flex-direction: row;
  }
}

/* ===========================
   PROFIL-LOGOUT (ROT)
   =========================== */

#profile-logout-btn {
  background: #ef4444;
  color: #fff;
  border: none;
}

#profile-logout-btn:hover {
  background: #dc2626;
}
/* =======================================
   DARK MODE FORMULAR-FIELDS (global)
   ======================================= */

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="email"],
textarea,
select {
  background: #262626 !important;
  border: 1px solid #ffffff !important;
  color: #e5e7eb !important;
  border-radius: 8px !important;
  padding: 10px 12px !important;
  font-size: 0.9rem !important;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  transition: all 0.2s ease;
}

/* Placeholder */
input::placeholder,
textarea::placeholder {
  color: #ffffff !important;
  opacity: 0.8;
}

/* Hover */
input:hover,
textarea:hover,
select:hover {
  border-color: #ffffff !important;
}

/* Fokus */
input:focus,
textarea:focus,
select:focus {
  border-color: #ef4444 !important;     /* Rot passend zu deinem Theme */
  box-shadow: 0 0 0 1px #ef4444;
  outline: none;
}

/* Dropdown Pfeil */
select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='7' viewBox='0 0 10 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23aaa' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  appearance: none;
  padding-right: 32px !important;
}

/* Textareas */
textarea {
  resize: vertical;
  min-height: 80px;
}
/* Standard: Desktop – Tabs ausblenden */
.schedule-week-tabs {
  display: none;
}

/* Mobile: Tabs einblenden */
@media (max-width: 840px) {
  .schedule-week-tabs {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 10px;
  }
}
/* Größe des Buchhaltungs-Charts reduzieren */
.card-body #accountingChart {
    max-height: 220px !important;
    height: 220px !important;
}
#pdf-preview-modal,
#pdf-preview-modal #pdf-preview-backdrop,
#pdf-preview-modal .pdf-preview-content {
  box-sizing: border-box;
}

#pdf-preview-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1200;
}
.pdf-modal-backdrop,
#pdf-preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
}
.pdf-modal-content,
.pdf-preview-content {
  position: relative;
  width: min(1100px, calc(100% - 24px));
  margin: 12px auto;
  padding: 8px;
  height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
}

.pdf-preview-content .card-header {
  flex: 0 0 auto;
}

.pdf-preview-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
}

.pdf-preview-hint {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

#pdf-preview-frame {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: #fff;
}
/* Nur Mitarbeiter-Tabelle */
#view-employees .table-wrapper {
  flex: 1;
  max-height: none;      /* <<< ENTSCHEIDEND */
  overflow-y: auto;
}
.btn.btn-small{
    padding:6px 10px;
    min-height:34px;
    border:1px solid rgba(255,255,255,.12);
    background:#1c1c1c;
    color:#fff;
    border-radius:8px;
    cursor:pointer;
    font-size:12px;
  }
.btn.btn-small[disabled]{opacity:.6;cursor:not-allowed;}
.hours-edit-input{
  width: 72px;
  padding: 4px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  color: #fff;
  font-size: 12px;
}
.hours-edit-input:focus{
  outline: 2px solid rgba(74,222,128,0.5);
  outline-offset: 1px;
}
.hours-summary-bar{
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

.hsb-top{
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}

.hsb-left{
  min-width: 260px;
}

.hsb-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hsb-bonus-controls{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:flex-end;
  padding:10px;
  border:1px solid rgba(255,255,255,0.08);
  border-radius:10px;
  background:rgba(255,255,255,0.02);
}

.hsb-bonus-toggle{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:12px;
  font-weight:600;
  color:rgba(255,255,255,0.92);
}

.hsb-bonus-toggle input[type="checkbox"]{
  width:16px;
  height:16px;
  accent-color:#ef4444;
}

.hsb-bonus-note-wrap{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:11px;
  opacity:0.85;
  min-width:220px;
  flex:1 1 260px;
}

.hsb-bonus-note-wrap input{
  margin-top:0;
}

.hours-bonus-status{
  width:100%;
  min-height:16px;
  font-size:12px;
  line-height:1.2;
  opacity:0.85;
}

.hours-global-actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
  justify-content:flex-end;
  margin: 0 0 10px 0;
}

.hours-global-mail-status{
  font-size:12px;
  line-height:1.2;
  opacity:0.85;
  min-height: 16px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hsb-title{
  font-weight: 700;
  font-size: 14px;
}

.hsb-sub{
  margin-top: 2px;
  font-size: 12px;
  opacity: 0.75;
}

.hsb-note{
  max-width: 920px;
  line-height: 1.35;
}

.hsb-metrics{
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.hsb-item{
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  padding: 8px 10px;
  min-width: 0;
}

.hsb-item .hsb-label{
  font-size: 11px;
  opacity: 0.75;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.hsb-item .hsb-value{
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.28;
}

.hsb-strong .hsb-value{
  font-size: 14px;
  font-weight: 800;
}

.hsb-icon-ok{ color: #4ade80; }
.hsb-icon-no{ color: #f97373; }

/* Inquiries detail layout */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* Accounting Tabs */
.accounting-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.accounting-tab {
  border: 1px solid #2e2e2e;
  background: #1c1c1c;
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.accounting-tab:hover {
  transform: translateY(-1px);
  color: #ffffff;
}

.accounting-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: var(--shadow-soft);
}

.accounting-tab-panel {
  display: none;
}

.accounting-tab-panel.active {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

#view-accounting {
  gap: 0;
}

#view-accounting .card {
  margin-bottom: 16px;
}

#view-accounting #accounting-hours-card .card-body,
#view-accounting #accounting-absence-card .card-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#view-accounting .accounting-filter-grid {
  gap: 12px;
}

#view-accounting .accounting-filter-grid + * {
  margin-top: 10px;
}

#view-accounting .accounting-filter-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

#view-accounting .accounting-filter-grid--5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#view-accounting .accounting-summary-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#view-accounting .accounting-table-scroll {
  overflow: auto;
}

#view-accounting .accounting-table-scroll--large {
  height: clamp(340px, 46dvh, 620px);
  max-height: 62dvh;
}

#view-accounting .hours-absence-row td {
  background: rgba(190, 45, 45, 0.2) !important;
  border-color: rgba(255, 120, 120, 0.35);
  color: #ffd6d6;
}

#view-accounting .hours-absence-controls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

#view-accounting .hours-absence-controls select {
  min-width: 170px;
}

#view-accounting .accounting-table-scroll--medium {
  height: clamp(220px, 30dvh, 360px);
  max-height: 38dvh;
}

#view-accounting .accounting-table-scroll--spaced {
  margin-top: 12px;
}

.statistics-today-spend {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin: 14px 0;
  padding: 16px 18px;
  border: 1px solid rgba(255, 130, 130, 0.36);
  border-radius: 14px;
  background: linear-gradient(115deg, rgba(170, 37, 37, 0.28), rgba(92, 22, 22, 0.16));
}

.statistics-today-spend span,
.statistics-today-spend small {
  display: block;
}

.statistics-today-spend strong {
  display: block;
  margin: 3px 0;
  color: #ffd6d6;
  font-size: 1.8rem;
}

.statistics-today-spend-breakdown {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.statistics-today-spend-breakdown span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffe3e3;
  font-size: 0.8rem;
}

.statistics-expense-calendar-card {
  margin: 14px 0 18px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(4, 13, 24, 0.52);
}

.statistics-expense-calendar-head strong,
.statistics-expense-calendar-head span {
  display: block;
}

.statistics-expense-calendar-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.84rem;
}

.statistics-expense-calendar-weekdays,
.statistics-expense-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.statistics-expense-calendar-weekdays {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 0.75rem;
  text-align: center;
}

.statistics-expense-calendar-day {
  display: flex;
  min-height: 86px;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
}

button.statistics-expense-calendar-day {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.statistics-expense-calendar-day.is-empty {
  border-color: transparent;
  background: transparent;
}

.statistics-expense-calendar-day.has-expenses {
  border-color: rgba(255, 124, 124, 0.35);
  background: rgba(157, 38, 38, 0.2);
}

button.statistics-expense-calendar-day.has-expenses:hover,
button.statistics-expense-calendar-day.has-expenses:focus-visible {
  border-color: #f7c873;
  background: rgba(157, 38, 38, 0.34);
  outline: none;
}

.statistics-expense-calendar-day.is-today {
  box-shadow: inset 0 0 0 1px #f7c873;
}

.statistics-expense-calendar-amount {
  color: #ffd2d2;
  font-size: 0.84rem;
  font-weight: 800;
}

.statistics-expense-calendar-day small {
  color: #d1d9e5;
  font-size: 0.68rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

#statistics-cost-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
}

.statistics-cost-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
}

.statistics-cost-detail-content {
  position: relative;
  width: min(680px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  margin: 12px auto;
  overflow: auto;
}

.statistics-cost-detail-content .card {
  margin: 0;
}

.statistics-cost-detail-header {
  align-items: flex-start;
}

.statistics-cost-detail-header small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 400;
}

.statistics-cost-detail-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.statistics-cost-detail-list {
  display: grid;
  gap: 9px;
}

.statistics-cost-detail-entry {
  padding: 11px 12px;
  border: 1px solid rgba(255, 124, 124, 0.2);
  border-radius: 10px;
  background: rgba(157, 38, 38, 0.12);
}

.statistics-cost-detail-entry-head,
.statistics-cost-detail-component {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.statistics-cost-detail-entry-head > div {
  min-width: 0;
}

.statistics-cost-detail-entry-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
}

.statistics-cost-detail-entry-head > strong {
  color: #ffd2d2;
  white-space: nowrap;
}

.statistics-cost-detail-components {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.statistics-cost-detail-component {
  color: var(--text-soft);
  font-size: 0.82rem;
}

.statistics-cost-detail-component strong {
  color: var(--text);
  white-space: nowrap;
}

@media (max-width: 720px) {
  .statistics-today-spend {
    align-items: flex-start;
    flex-direction: column;
  }

  .statistics-today-spend-breakdown {
    justify-content: flex-start;
  }

  .statistics-expense-calendar-day {
    min-height: 66px;
    padding: 5px;
  }

  .statistics-expense-calendar-day small {
    display: none;
  }

  .statistics-cost-detail-entry-head,
  .statistics-cost-detail-component {
    gap: 8px;
  }
}

.statistics-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.statistics-toolbar-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.statistics-upload-row {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.statistics-bank-import-panel {
  margin-bottom: 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.12)),
    rgba(15, 15, 15, 0.88);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.statistics-bank-import-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}

.statistics-bank-import-head strong {
  font-size: 0.88rem;
}

.statistics-bank-dropzone {
  position: relative;
  margin-top: 6px;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 16px;
  border: 1px dashed #666;
  background: rgba(7, 16, 26, 0.92);
  overflow: hidden;
  transition: var(--transition-fast);
}

.statistics-bank-dropzone.drag-active {
  border-color: var(--accent);
  background: rgba(218, 58, 61, 0.08);
  box-shadow: 0 0 0 1px rgba(218, 58, 61, 0.28);
}

.statistics-bank-dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.statistics-bank-dropzone-copy {
  padding: 18px 16px;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.45;
  pointer-events: none;
}

.statistics-bank-file-list {
  margin-top: 8px;
  font-size: 0.76rem;
  line-height: 1.5;
  white-space: pre-line;
  color: var(--text-soft);
}

.statistics-bank-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

#view-statistics .statistics-bank-grid,
#view-bank-expenses .statistics-bank-grid {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(0, 2.05fr) !important;
  align-items: start;
  gap: 18px;
}

#view-statistics .statistics-bank-grid > .card,
#view-bank-expenses .statistics-bank-grid > .card {
  min-width: 0;
  margin-bottom: 0;
}

.statistics-bank-entry-card,
.statistics-bank-table-card {
  height: 100%;
}

.statistics-bank-card-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.statistics-bank-section-copy {
  margin: 0;
  max-width: 72ch;
  line-height: 1.55;
}

.statistics-bank-table-card .card-header {
  align-items: flex-start;
  gap: 14px;
}

.statistics-bank-summary {
  white-space: nowrap;
  font-size: 0.76rem;
  line-height: 1.35;
}

.statistics-bank-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.statistics-bank-kpi {
  display: grid;
  gap: 6px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.statistics-bank-kpi span,
.statistics-bank-kpi small {
  color: rgba(255, 255, 255, 0.66);
}

.statistics-bank-kpi strong {
  font-size: 1.2rem;
  line-height: 1.1;
  color: #fff;
}

.statistics-bank-kpi.is-open strong {
  color: #ffb0b2;
}

.statistics-bank-kpi.is-assigned strong {
  color: #97f0b7;
}

.statistics-bank-kpi.is-general strong {
  color: #ffd08a;
}

.statistics-bank-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(150px, 0.8fr) minmax(150px, 0.8fr) auto;
  gap: 12px;
  align-items: end;
}

.statistics-bank-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.statistics-bank-filter-actions .btn {
  min-height: 42px;
  padding-inline: 16px;
  border-radius: 14px;
  white-space: nowrap;
}

.statistics-bank-filter-actions #statistics-bank-filter-open-only {
  background: linear-gradient(135deg, rgba(218, 58, 61, 0.24), rgba(76, 24, 25, 0.96));
}

.statistics-bank-filter-actions #statistics-bank-filter-show-all,
.statistics-bank-filter-actions #statistics-bank-filter-reset {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(13, 21, 30, 0.94));
  border-color: rgba(218, 58, 61, 0.22);
  color: #fff1f1;
}

.statistics-bank-filter-actions #statistics-bank-filter-show-all:hover,
.statistics-bank-filter-actions #statistics-bank-filter-reset:hover {
  border-color: rgba(255, 185, 185, 0.28);
}

.statistics-bank-filter-actions .btn.active {
  background: linear-gradient(135deg, #ef4d4f, #c53033);
  border-color: rgba(255, 211, 211, 0.24);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(197, 48, 51, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.statistics-bank-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.statistics-bank-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.statistics-bank-row td {
  vertical-align: middle;
  transition: background 140ms ease, border-color 140ms ease;
}

.statistics-bank-row.is-open td {
  background: rgba(218, 58, 61, 0.05);
}

.statistics-bank-row.is-assigned td {
  background: rgba(38, 138, 82, 0.045);
}

.statistics-bank-row.is-general td {
  background: rgba(203, 142, 36, 0.05);
}

.statistics-bank-row.is-open td:first-child {
  box-shadow: inset 4px 0 0 rgba(218, 58, 61, 0.7);
}

.statistics-bank-row.is-assigned td:first-child {
  box-shadow: inset 4px 0 0 rgba(38, 138, 82, 0.7);
}

.statistics-bank-row.is-general td:first-child {
  box-shadow: inset 4px 0 0 rgba(203, 142, 36, 0.74);
}

.statistics-bank-date-cell,
.statistics-bank-amount-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.statistics-bank-date-cell {
  color: #f5d9d9;
}

.statistics-bank-amount-cell {
  font-weight: 700;
  color: #ffffff;
}

.statistics-bank-amount-cell.is-incoming {
  color: #7ee0a1;
}

.statistics-bank-amount-cell.is-outgoing {
  color: #ffb2b2;
}

.statistics-bank-title {
  font-weight: 600;
  color: #ffffff;
}

.statistics-bank-note {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.statistics-bank-assignment-note {
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.statistics-bank-assignment-note.is-open {
  color: #ffb0b2;
}

.statistics-bank-assignment-note.is-assigned {
  color: #97f0b7;
}

.statistics-bank-assignment-note.is-general {
  color: #ffd08a;
}

.statistics-bank-inline-select {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(7, 16, 26, 0.88);
  color: #ffffff;
}

.statistics-bank-source-cell,
.statistics-bank-site-cell,
.statistics-bank-category-cell {
  min-width: 0;
}

.statistics-bank-source-select {
  min-width: 104px;
}

.statistics-bank-site-select {
  min-width: 160px;
}

.statistics-bank-category-select {
  min-width: 128px;
}

.statistics-bank-status-cell {
  white-space: nowrap;
  width: 126px;
}

.statistics-bank-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.statistics-bank-status-pill.is-assigned {
  background: rgba(38, 138, 82, 0.16);
  color: #97f0b7;
  border-color: rgba(38, 138, 82, 0.34);
}

.statistics-bank-status-pill.is-general {
  background: rgba(203, 142, 36, 0.16);
  color: #ffd08a;
  border-color: rgba(203, 142, 36, 0.34);
}

.statistics-bank-status-pill.is-open {
  background: rgba(218, 58, 61, 0.14);
  color: #ffb0b2;
  border-color: rgba(218, 58, 61, 0.3);
}

.statistics-bank-action-cell {
  width: 72px;
  text-align: center;
}

.statistics-bank-row-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.statistics-bank-quick-btn {
  width: 100%;
  min-height: 38px;
  padding-inline: 12px;
  border-radius: 14px;
  justify-content: flex-start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.statistics-bank-row-actions .statistics-bank-quick-btn:first-child {
  background: linear-gradient(135deg, rgba(203, 142, 36, 0.24), rgba(62, 39, 7, 0.94));
  border-color: rgba(255, 210, 138, 0.24);
  color: #ffe2ad;
}

.statistics-bank-row-actions .statistics-bank-quick-btn:first-child:hover {
  background: linear-gradient(135deg, rgba(203, 142, 36, 0.34), rgba(74, 46, 7, 0.98));
}

.statistics-bank-row-actions .statistics-bank-quick-btn + .statistics-bank-quick-btn {
  background: linear-gradient(135deg, rgba(73, 139, 214, 0.22), rgba(16, 31, 49, 0.96));
  border-color: rgba(132, 192, 255, 0.22);
  color: #d8edff;
}

.statistics-bank-row-actions .statistics-bank-quick-btn + .statistics-bank-quick-btn:hover {
  background: linear-gradient(135deg, rgba(73, 139, 214, 0.32), rgba(19, 37, 58, 0.98));
}

.statistics-bank-delete-btn {
  width: 52px;
  min-width: 52px;
  min-height: 38px;
  padding-inline: 0;
  border-radius: 14px;
  justify-content: center;
  background: linear-gradient(135deg, #ee4749, #cd3537);
  border-color: rgba(255, 202, 202, 0.22);
  box-shadow: 0 10px 24px rgba(197, 48, 51, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.statistics-bank-delete-btn:hover {
  background: linear-gradient(135deg, #ff5d5f, #d93638);
}

.statistics-bank-delete-btn i {
  font-size: 0.84rem;
}

.statistics-bank-table th:nth-child(1),
.statistics-bank-table td:nth-child(1) {
  width: 86px;
}

.statistics-bank-table th:nth-child(2),
.statistics-bank-table td:nth-child(2) {
  width: 118px;
}

.statistics-bank-table th:nth-child(4),
.statistics-bank-table td:nth-child(4) {
  width: 225px;
}

.statistics-bank-table th:nth-child(5),
.statistics-bank-table td:nth-child(5) {
  width: 174px;
}

.statistics-bank-table th:nth-child(6),
.statistics-bank-table td:nth-child(6) {
  width: 96px;
}

.statistics-bank-table th:nth-child(7),
.statistics-bank-table td:nth-child(7) {
  width: 124px;
}

@media (max-width: 1120px) {
  #view-statistics .statistics-bank-grid,
  #view-bank-expenses .statistics-bank-grid {
    grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.78fr) !important;
  }

  .statistics-bank-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statistics-bank-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  #view-statistics .statistics-bank-grid,
  #view-bank-expenses .statistics-bank-grid {
    grid-template-columns: 1fr !important;
  }

  .statistics-bank-summary {
    white-space: normal;
  }

  .statistics-bank-kpis,
  .statistics-bank-filters {
    grid-template-columns: 1fr;
  }

  .statistics-bank-filter-actions,
  .statistics-bank-row-actions {
    justify-content: stretch;
  }

  .statistics-bank-row-actions > .btn {
    width: 100%;
  }

  .statistics-bank-table {
    min-width: 920px;
    table-layout: auto;
  }
}

.statistics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.statistics-stat {
  padding: 14px;
  border: 1px solid #2d2d2d;
  background: #171717;
}

.statistics-stat-label {
  color: var(--text-soft);
  font-size: 0.82rem;
  margin-bottom: 8px;
}

.statistics-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.statistics-meta {
  margin-top: 14px;
}

.statistics-modern-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.statistics-modern-kpi {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.12));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
  padding: 16px;
}

.statistics-modern-kpi::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  background: rgba(218, 58, 61, 0.12);
}

.statistics-modern-kpi-label {
  display: block;
  color: #f0c2c2;
  font-size: 0.78rem;
  margin-bottom: 10px;
}

.statistics-modern-kpi-value {
  display: block;
  font-size: 1.7rem;
  line-height: 1.05;
  font-weight: 800;
  margin-bottom: 8px;
}

.statistics-modern-kpi-meta {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.statistics-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.statistics-cost-chart-wrap {
  width: min(100%, 380px);
  margin: 0 auto;
}

.statistics-highlight-card {
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.statistics-highlight-card span {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.statistics-highlight-card strong {
  font-size: 1.02rem;
}

.statistics-breakdown-card {
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 18px;
  padding: 14px;
}

.statistics-breakdown-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--text-soft);
  font-size: 0.76rem;
}

.statistics-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.statistics-breakdown-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.statistics-breakdown-bar {
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,0.05);
}

.statistics-breakdown-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #da3a3d, #f97316);
}

.statistics-employee-list {
  display: grid;
  gap: 14px;
}

.statistics-employee-row {
  display: grid;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.16));
}

.statistics-employee-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 16px;
  align-items: stretch;
}

.statistics-employee-main {
  min-width: 0;
}

.statistics-employee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.statistics-employee-name-wrap {
  min-width: 0;
}

.statistics-employee-name {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.statistics-employee-role {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-soft);
}

.statistics-employee-mode {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #f5d0d0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.statistics-employee-mode.is-net {
  background: rgba(218, 58, 61, 0.14);
  border-color: rgba(218, 58, 61, 0.28);
  color: #ffd7d7;
}

.statistics-employee-toggle {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.statistics-employee-toggle:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}

.statistics-employee-toggle i {
  transition: transform var(--transition-fast);
}

.statistics-employee-row.is-open .statistics-employee-toggle i {
  transform: rotate(180deg);
}

.statistics-employee-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.statistics-employee-preview-item {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.18);
}

.statistics-employee-preview-label {
  display: block;
  color: var(--text-soft);
  font-size: 0.72rem;
  margin-bottom: 6px;
}

.statistics-employee-preview-value {
  display: block;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
}

.statistics-employee-preview-meta {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.statistics-employee-lines {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.statistics-employee-details {
  display: none;
}

.statistics-employee-row.is-open .statistics-employee-details {
  display: block;
}

.statistics-employee-line {
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.18);
}

.statistics-employee-line-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.statistics-employee-line-label {
  color: var(--text-soft);
  font-size: 0.76rem;
}

.statistics-employee-line-value {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
}

.statistics-employee-line-meta {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.statistics-employee-side {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(218, 58, 61, 0.16);
  background: radial-gradient(circle at top right, rgba(218, 58, 61, 0.16), rgba(0,0,0,0.08) 58%);
}

.statistics-employee-total-label,
.statistics-employee-side-label {
  color: #f0c2c2;
  font-size: 0.74rem;
}

.statistics-employee-total-value {
  margin-top: 6px;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 800;
  color: #fff;
}

.statistics-employee-side-value {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.statistics-employee-empty {
  padding: 18px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.08);
  color: var(--text-soft);
  background: rgba(255,255,255,0.02);
}

.statistics-import-meta {
  margin-bottom: 12px;
}

.statistics-import-files {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.statistics-import-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(0,0,0,0.12));
}

.statistics-import-file-copy {
  min-width: 0;
}

.statistics-import-file-copy strong {
  display: block;
  color: #ffffff;
  margin-bottom: 4px;
}

.statistics-import-file-copy span {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.statistics-import-file-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.statistics-import-file-empty {
  padding: 14px;
  border-radius: 16px;
  border: 1px dashed rgba(255,255,255,0.08);
  color: var(--text-soft);
  background: rgba(255,255,255,0.02);
}

.statistics-stat-value.is-negative {
  color: #ff8a80;
}

.statistics-stat-value.is-positive {
  color: #86efac;
}

@media (max-width: 900px) {
  .statistics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statistics-modern-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .statistics-employee-summary {
    grid-template-columns: 1fr;
  }

  .statistics-employee-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .statistics-grid {
    grid-template-columns: 1fr;
  }

  .statistics-modern-grid,
  .statistics-highlight-grid {
    grid-template-columns: 1fr;
  }

  .statistics-breakdown-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .statistics-employee-lines {
    grid-template-columns: 1fr;
  }

  .statistics-employee-preview {
    grid-template-columns: 1fr;
  }

  .statistics-employee-head {
    flex-wrap: wrap;
  }
}

.table-hint {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-soft);
}
/* Contabilidade – Abschluss/Summary-Bar unter Stunden-Tabelle */
.hours-final-bar{
  margin-top: 12px;
  background: #1c1c1c;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 12px 14px;
}

.hours-final-bar .hsb-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.hours-final-bar .hsb-item{
  background: #181818;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 10px 10px;
  font-size: 0.82rem;
}

.file-input {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.file-input input[type="file"] {
  display: none;
}

.file-input-label {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.hours-final-bar .hsb-label{
  color: var(--text-soft);
  font-size: 0.75rem;
  margin-bottom: 4px;
}

.hours-final-bar .hsb-value{
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hours-final-bar .hsb-ok{
  color: #4ade80;
}
.hours-final-bar .hsb-no{
  color: #f97373;
}

@media (max-width: 1024px){
  .hours-final-bar .hsb-grid{
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px){
  .hours-final-bar .hsb-grid{
    grid-template-columns: 1fr;
  }
}
/* 2-spaltiges Layout (dein Wunsch) */
#view-employees .grid.grid-2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

/* Wenn im Grid nur 1 Card existiert -> 100% Breite */
#view-employees .grid.grid-2:not(:has(> .card:nth-child(2))) {
  grid-template-columns: 1fr !important;
}

@media (max-width: 840px) {
  .form-grid,
  .form-grid[style],
  .form-grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }

  .form-grid > * {
    min-width: 0;
  }

  .offer-preview-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

.offer-preview-logo img {
  width: 100px;
}

.check-card {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 12px !important;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(218, 58, 61, 0.16);
  background: rgba(218, 58, 61, 0.06);
}

.check-card span {
  display: block;
  line-height: 1.45;
}

.check-card input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin: 0;
  padding: 0;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(8, 18, 28, 0.96));
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.34);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.check-card input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: linear-gradient(180deg, #ff7a7c, #da3a3d);
  transform: scale(0);
  transition: transform var(--transition-fast);
}

.check-card input[type="checkbox"]:checked {
  border-color: rgba(255, 132, 134, 0.75);
  box-shadow: 0 0 0 3px rgba(218, 58, 61, 0.14);
}

.check-card input[type="checkbox"]:checked::after {
  transform: scale(1);
}

.check-card input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(218, 58, 61, 0.22);
}

.employee-settings-group {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(8, 18, 28, 0.92)),
    rgba(10, 16, 24, 0.9);
}

.employee-settings-header {
  display: grid;
  gap: 2px;
  padding: 2px 2px 6px;
}

.employee-settings-header strong {
  font-size: 0.9rem;
  color: #fff;
}

.employee-settings-header span {
  font-size: 0.76rem;
  color: var(--text-soft);
  line-height: 1.4;
}

.employee-check-card {
  min-width: 0;
  font-size: 0.86rem;
}

#employee-form .employee-form-submit {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 52px;
  border-radius: 16px;
  margin-top: 4px;
  justify-content: center;
}

.offer-product-grid {
  align-items: end;
}

.offer-product-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.offer-product-actions .btn {
  justify-content: center;
}

.offer-product-market-status[data-tone="success"] {
  color: #8fe3b0;
}

.offer-product-market-status[data-tone="warning"] {
  color: #ffd17a;
}

.offer-product-market-status[data-tone="error"] {
  color: #ff9a9c;
}

.offer-product-source {
  display: grid;
  gap: 3px;
  min-width: 150px;
}

.offer-product-source small {
  color: var(--text-soft);
  font-size: 0.72rem;
}

.offer-product-source a {
  color: #87d3ff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.offer-market-results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(117, 191, 234, 0.32);
  border-radius: 14px;
  background: rgba(28, 54, 70, 0.26);
}

.offer-market-results-heading > div,
.offer-market-result-detail {
  display: grid;
  gap: 4px;
}

.offer-market-results-heading span,
.offer-market-result-detail span,
.offer-market-result-detail small {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.offer-market-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-market-tab {
  min-width: 0;
  max-width: 240px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(8, 18, 28, 0.72);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.offer-market-tab.is-active {
  border-color: rgba(117, 191, 234, 0.8);
  background: rgba(45, 122, 164, 0.3);
}

.offer-market-tab strong,
.offer-market-tab span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offer-market-tab span {
  margin-top: 2px;
  color: #aee0fa;
  font-size: 0.78rem;
}

.offer-market-result-detail {
  padding: 12px;
  border-radius: 10px;
  background: rgba(8, 18, 28, 0.5);
}

.offer-market-result-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.offer-travel-calculator {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding: 18px;
  border: 1px solid rgba(117, 191, 234, 0.27);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(36, 115, 157, 0.18), rgba(15, 24, 35, 0.88)),
    rgba(10, 16, 24, 0.86);
}

.offer-travel-calculator-head,
.offer-travel-calculator-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.offer-travel-calculator-head > div,
.offer-travel-calculator-result > div {
  display: grid;
  gap: 3px;
}

.offer-travel-calculator-head span,
.offer-travel-calculator-result span {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.offer-travel-calculator-result strong {
  color: #fff;
}

.offer-travel-calculator-grid {
  align-items: end;
}

.offer-preview-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

  .offer-preview-table table {
    min-width: 560px;
  }

  .offer-meta,
  .offer-meta-stats,
  .offer-actions {
    grid-template-columns: 1fr;
  }

  .offer-optional-packages-grid {
    grid-template-columns: 1fr;
  }

  .offer-payment-row {
    grid-template-columns: 1fr;
  }

  .offer-optional-preview-card {
    flex-direction: column;
  }

  .profile-modal-content,
  .pdf-modal-content,
  .pdf-preview-content {
    width: calc(100% - 12px);
    margin: 6px auto;
    height: calc(100dvh - 12px);
  }

  #pdf-preview-frame {
    height: 100% !important;
  }
}

@media (max-width: 900px) {
  #view-employees .grid.grid-2,
  #view-offers .offers-layout {
    grid-template-columns: 1fr !important;
  }

  #view-employees .grid.grid-2 > .card,
  #view-offers .offers-layout .card {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 420px) {
  .table-wrapper table {
    font-size: 0.72rem;
  }

  th,
  td {
    padding: 5px 6px;
  }
}

@media (max-width: 840px) {
  input[type="date"],
  input[type="month"] {
    font-size: 0.85rem !important;
    padding: 8px 10px !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  #view-accounting .accounting-table-scroll--large,
  #view-accounting .accounting-table-scroll--medium {
    height: auto;
    max-height: none;
  }
}

@supports (-webkit-touch-callout: none) {
  input[type="date"],
  input[type="month"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block;
    -webkit-appearance: none;
    appearance: none;
  }
}

.site-profit-shell {
  margin-bottom: 26px;
  padding: 22px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(218, 58, 61, 0.22), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 179, 71, 0.12), transparent 24%),
    linear-gradient(145deg, rgba(12, 18, 28, 0.98), rgba(20, 26, 36, 0.94));
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.28);
}

.site-profit-hero {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
}

.site-profit-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(220px, 0.9fr);
  gap: 16px;
}

.site-profit-spotlight-art,
.site-profit-spotlight-meta,
.site-profit-kpi,
.site-profit-card,
.site-profit-panel,
.site-profit-warning-box {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
}

.site-profit-spotlight-art {
  padding: 22px;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.site-profit-spotlight-art strong {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.95;
  color: #fff7ef;
}

.site-profit-spotlight-art span:last-child {
  color: rgba(255, 255, 255, 0.72);
  max-width: 26ch;
}

.site-profit-spotlight-pill {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffd9d9;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-profit-spotlight-meta {
  padding: 18px;
  border-radius: 24px;
  display: grid;
  gap: 12px;
}

.site-profit-spotlight-meta div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.site-profit-spotlight-meta div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.site-profit-spotlight-meta span,
.site-profit-kpi-label,
.site-profit-preview-item span,
.site-profit-progress-meta span,
.site-profit-card-side span,
.site-profit-panel-head span,
.site-profit-entry-row span,
.site-profit-team-row span,
.site-profit-customer {
  color: rgba(255, 255, 255, 0.66);
}

.site-profit-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.site-profit-kpi {
  padding: 18px;
  border-radius: 22px;
  display: grid;
  gap: 6px;
}

.site-profit-kpi-value {
  font-size: 1.45rem;
  color: #ffffff;
}

.site-profit-warning-box {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  color: #fff2df;
  background: rgba(218, 58, 61, 0.12);
}

.site-profit-list {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.site-profit-card {
  border-radius: 24px;
  padding: 20px;
  overflow: hidden;
}

.site-profit-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.site-profit-card-main h3 {
  margin: 6px 0 4px;
  font-size: 1.4rem;
  color: #fff;
}

.site-profit-card-main p {
  margin: 0;
  color: rgba(255, 255, 255, 0.68);
}

.site-profit-card-side {
  min-width: 170px;
  padding: 16px;
  border-radius: 20px;
  text-align: right;
  background: rgba(255, 255, 255, 0.05);
}

.site-profit-card-side strong,
.site-profit-preview-item strong,
.site-profit-progress-meta strong,
.site-profit-team-row strong,
.site-profit-entry-row strong,
.site-profit-panel-head strong {
  color: #fff;
}

.site-profit-card-side strong {
  display: block;
  margin-top: 8px;
  font-size: 1.5rem;
}

.site-profit-card-side.is-positive strong,
.site-profit-spotlight-meta strong.is-positive {
  color: #7df2b3;
}

.site-profit-card-side.is-negative strong,
.site-profit-spotlight-meta strong.is-negative {
  color: #ff8a8a;
}

.site-profit-card-side.is-neutral strong,
.site-profit-spotlight-meta strong.is-neutral {
  color: #ffe39b;
}

.site-profit-card-badges,
.site-profit-warnings,
.site-profit-cost-columns,
.site-profit-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-profit-status,
.site-profit-customer,
.site-profit-warning-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.06);
}

.site-profit-status.is-live {
  background: rgba(82, 198, 129, 0.18);
  color: #95f2bc;
}

.site-profit-status.is-done {
  background: rgba(115, 172, 255, 0.18);
  color: #b5d2ff;
}

.site-profit-status.is-queued {
  background: rgba(255, 189, 92, 0.18);
  color: #ffd799;
}

.site-profit-warning-pill {
  background: rgba(218, 58, 61, 0.16);
  color: #ffd5d6;
}

.site-profit-progress {
  margin-top: 18px;
}

.site-profit-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.site-profit-progress-track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #da3a3d, #ffb55b);
}

.site-profit-progress-meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.site-profit-preview {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.site-profit-preview-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 5px;
}

.site-profit-preview-item strong {
  font-size: 1.14rem;
}

.site-profit-preview-item strong.is-positive,
.site-profit-budget-item strong.is-positive {
  color: #7df2b3;
}

.site-profit-preview-item strong.is-negative,
.site-profit-budget-item strong.is-negative {
  color: #ff8a8a;
}

.site-profit-preview-item strong.is-neutral,
.site-profit-budget-item strong.is-neutral {
  color: #ffe39b;
}

.site-profit-preview-item strong.is-warning,
.site-profit-budget-item strong.is-warning {
  color: #fcd34d;
}

.site-profit-preview-item small,
.site-profit-card-side small {
  color: rgba(255, 255, 255, 0.54);
}

.site-profit-card-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.site-profit-cost-columns span {
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
}

.site-profit-toggle {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.site-profit-card.is-open .site-profit-toggle i {
  transform: rotate(180deg);
}

.site-profit-toggle i {
  transition: transform 0.2s ease;
}

.site-profit-details {
  display: none;
  margin-top: 20px;
}

.site-profit-card.is-open .site-profit-details {
  display: block;
}

.site-profit-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.site-profit-detail-grid-lower {
  margin-top: 16px;
}

.site-profit-panel {
  border-radius: 22px;
  padding: 18px;
}

.site-profit-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 14px;
}

.site-profit-settings-form,
.site-profit-cost-form,
.site-profit-material-quote-form,
.site-profit-invoice-plan-form,
.site-profit-cost-commitment-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.site-profit-settings-form label,
.site-profit-cost-form label,
.site-profit-material-quote-form label,
.site-profit-invoice-plan-form label,
.site-profit-cost-commitment-form label {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.9rem;
}

.site-profit-settings-form input,
.site-profit-settings-form textarea,
.site-profit-cost-form input,
.site-profit-cost-form select,
.site-profit-material-quote-form input,
.site-profit-material-quote-form select,
.site-profit-invoice-plan-form input,
.site-profit-invoice-plan-form select,
.site-profit-cost-commitment-form input,
.site-profit-cost-commitment-form select {
  width: 100%;
}

.site-profit-panel-span {
  grid-column: 1 / -1;
}

.site-profit-budget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.site-profit-budget-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 5px;
}

.site-profit-budget-item strong {
  font-size: 1.14rem;
}

.site-profit-budget-item small {
  color: rgba(255, 255, 255, 0.54);
  line-height: 1.45;
}

.site-profit-budget-summary {
  margin-top: 14px;
  padding: 14px;
  border-radius: 18px;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.site-profit-budget-summary strong {
  color: #fff;
}

.site-profit-budget-summary span {
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.45;
}

.site-profit-budget-summary.is-positive {
  border-color: rgba(34, 197, 94, 0.26);
  background: rgba(34, 197, 94, 0.08);
}

.site-profit-budget-summary.is-negative {
  border-color: rgba(239, 68, 68, 0.26);
  background: rgba(239, 68, 68, 0.08);
}

.site-profit-budget-summary.is-neutral {
  border-color: rgba(245, 158, 11, 0.22);
  background: rgba(245, 158, 11, 0.08);
}

.site-profit-budget-note {
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.66);
  line-height: 1.45;
}

.site-profit-quote-status {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
}

.site-profit-quote-status.is-budget {
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}

.site-profit-quote-status.is-ordered {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.site-profit-quote-status.is-alternative {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
}

.site-profit-quote-status.is-rejected {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

.site-profit-quote-status.is-positive {
  background: rgba(34, 197, 94, 0.14);
  color: #86efac;
}

.site-profit-quote-status.is-warning {
  background: rgba(245, 158, 11, 0.14);
  color: #fcd34d;
}

.site-profit-quote-status.is-neutral {
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}

.site-profit-quote-status.is-muted {
  background: rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
}

.site-profit-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.site-profit-finance-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 5px;
}

.site-profit-finance-item strong {
  font-size: 1.05rem;
}

.site-profit-team-list,
.site-profit-entry-list {
  display: grid;
  gap: 10px;
}

.site-profit-team-row,
.site-profit-entry-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.site-profit-team-row div,
.site-profit-entry-row div {
  display: grid;
  gap: 4px;
}

.site-profit-entry-actions {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
}

.site-profit-empty,
.site-profit-empty-inline {
  padding: 20px;
  border-radius: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.66);
  border: 1px dashed rgba(255, 255, 255, 0.12);
}

.site-ops-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
}

.site-ops-toolbar-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.site-form-meta {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.site-form-meta strong {
  display: block;
  color: #fff;
  margin-bottom: 4px;
}

.site-form-meta span {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.site-ops-toolbar label {
  display: grid;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.site-ops-search {
  min-width: min(320px, 100%);
}

.site-ops-focus-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.site-ops-focus-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 12px;
}

.site-ops-focus-card.is-negative {
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.08);
}

.site-ops-focus-card.is-warning,
.site-ops-focus-card.is-muted {
  border-color: rgba(245, 158, 11, 0.22);
}

.site-ops-focus-head,
.site-ops-focus-actions,
.site-ops-focus-metrics {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.site-ops-focus-card h3 {
  margin: 0;
  color: #fff;
  font-size: 1.05rem;
}

.site-ops-focus-card p,
.site-ops-focus-reason {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.site-ops-focus-metrics > div {
  display: grid;
  gap: 4px;
}

.site-ops-focus-metrics span,
.site-ops-focus-progress {
  font-size: 0.75rem;
  color: var(--muted);
}

.site-ops-focus-metrics strong {
  font-size: 0.98rem;
}

.site-ops-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-ops-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: #f8fafc;
  white-space: nowrap;
}

.site-ops-chip.is-positive {
  background: rgba(34, 197, 94, 0.12);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.28);
}

.site-ops-chip.is-negative {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.28);
}

.site-ops-chip.is-warning {
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
  border-color: rgba(245, 158, 11, 0.28);
}

.site-ops-chip.is-neutral,
.site-ops-chip.is-muted {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.22);
}

.site-ops-stack {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.site-ops-value {
  font-weight: 700;
  font-size: 0.82rem;
}

.site-ops-value.is-positive {
  color: #16a34a;
}

.site-ops-value.is-negative {
  color: #dc2626;
}

.site-ops-value.is-neutral {
  color: #cbd5e1;
}

.site-ops-sub {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.35;
}

.site-ops-row.is-negative td:first-child,
.site-ops-row.is-warning td:first-child {
  position: relative;
}

.site-ops-row.is-negative td:first-child::before,
.site-ops-row.is-warning td:first-child::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 3px;
  border-radius: 999px;
}

.site-ops-row.is-negative td:first-child::before {
  background: #dc2626;
}

.site-ops-row.is-warning td:first-child::before {
  background: #f59e0b;
}

@media (max-width: 1100px) {
  .site-profit-hero,
  .site-profit-spotlight,
  .site-profit-detail-grid {
    grid-template-columns: 1fr;
  }

  .site-profit-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .site-profit-shell {
    padding: 16px;
    border-radius: 22px;
  }

  .site-form-meta,
  .site-ops-focus-head,
  .site-ops-focus-actions,
  .site-ops-focus-metrics {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-ops-toolbar,
  .site-ops-summary {
    align-items: stretch;
    justify-content: flex-start;
  }

  .site-ops-focus-grid {
    grid-template-columns: 1fr;
  }

  .site-profit-summary,
  .site-profit-settings-form,
  .site-profit-cost-form,
  .site-profit-material-quote-form,
  .site-profit-invoice-plan-form,
  .site-profit-cost-commitment-form,
  .site-profit-preview,
  .site-profit-budget-grid,
  .site-profit-finance-grid {
    grid-template-columns: 1fr;
  }

  .site-profit-card-head,
  .site-profit-card-footer,
  .site-profit-panel-head,
  .site-profit-team-row,
  .site-profit-entry-row,
  .site-profit-progress-meta {
    flex-direction: column;
  }

  .site-profit-card-side {
    min-width: 0;
    text-align: left;
  }

  .site-profit-entry-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Tools */

.tools-shell {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.tools-hero-header small {
  display: block;
  margin-top: 6px;
  max-width: 760px;
  line-height: 1.5;
}

.tools-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.tools-kpi-card {
  padding: 18px;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(218, 58, 61, 0.12), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(20, 20, 20, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tools-kpi-card span,
.tools-kpi-card small {
  display: block;
}

.tools-kpi-card span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.78rem;
  letter-spacing: 0.01em;
}

.tools-kpi-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.tools-kpi-card small {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.58);
}

.tools-top-grid {
  align-items: start;
}

#view-tools .card,
#view-tools .card-body,
#view-tools label,
#view-tools input,
#view-tools select,
.tools-top-grid > .card,
.tools-scan-panel,
.tools-transfer-scan-panel,
.tools-inventory-list,
.tools-inventory-card,
.tools-history-item,
.tools-scanner-stage,
.tools-transfer-scan-grid,
.tools-form-grid,
.tools-transfer-grid {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.tools-scan-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.tools-scan-copy p {
  margin: 8px 0 0;
}

.tools-scanner-stage {
  position: relative;
  width: 100%;
  min-height: 250px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at center, rgba(218, 58, 61, 0.12), transparent 60%),
    linear-gradient(180deg, rgba(5, 14, 22, 0.98), rgba(12, 12, 12, 0.98));
}

.tools-scanner-stage video {
  display: none;
  width: 100%;
  height: 100%;
  min-height: 250px;
  object-fit: cover;
}

.tools-scanner-fallback {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  min-height: 250px;
  background: transparent;
  overflow: hidden;
}

.tools-scanner-fallback:not([hidden]) {
  display: block;
}

.tools-scanner-fallback,
.tools-scanner-fallback * {
  max-width: 100%;
  box-sizing: border-box;
}

.tools-scanner-fallback video,
.tools-scanner-fallback canvas {
  width: 100% !important;
  height: 100% !important;
  min-height: 250px;
  object-fit: cover;
  border-radius: 0;
}

.tools-scanner-fallback > div {
  width: 100%;
  height: 100%;
}

.tools-scanner-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.74);
  text-align: center;
  padding: 24px;
}

.tools-scanner-placeholder i {
  font-size: 2rem;
  color: #ff8f91;
}

.tools-scanner-overlay {
  position: absolute;
  inset: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(218, 58, 61, 0.28);
}

.tools-scanner-actions,
.tools-card-actions,
.tools-assign-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tools-scanner-actions .btn,
.tools-transfer-scan-actions .btn,
.tools-assign-buttons .btn,
.tools-card-actions .btn {
  min-width: 0;
}

.tools-inline-status {
  min-height: 20px;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.tools-inline-status[data-state="success"] {
  color: #9df0bd;
}

.tools-inline-status[data-state="warning"] {
  color: #ffd08a;
}

.tools-inline-status[data-state="danger"] {
  color: #ffb0b2;
}

.tools-form-grid,
.tools-transfer-grid {
  align-items: end;
}

.tools-photo-input {
  align-items: center;
}

.tools-photo-input .file-input-label {
  flex: 1 1 220px;
  overflow-wrap: anywhere;
}

.tools-photo-preview {
  grid-column: 1 / -1;
  min-height: 160px;
  padding: 14px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(6, 16, 26, 0.42);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}

.tools-photo-preview:empty::before {
  content: "A foto da ferramenta aparece aqui antes de guardar.";
  color: rgba(255, 255, 255, 0.56);
  line-height: 1.5;
}

.tools-photo-thumb {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.tools-transfer-copy {
  margin-bottom: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.tools-transfer-scan-panel {
  margin-bottom: 16px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(218, 58, 61, 0.1), transparent 48%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(14, 14, 14, 0.94));
}

.tools-transfer-scan-copy p {
  margin: 6px 0 0;
}

.tools-transfer-scan-grid {
  margin-top: 14px;
  align-items: end;
}

.tools-transfer-scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tools-assignments-wrap {
  margin-top: 18px;
}

.tools-assignments-table th,
.tools-assignments-table td {
  white-space: nowrap;
}

.tools-inventory-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.tools-inventory-header small {
  display: block;
  margin-top: 6px;
}

.tools-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tools-filter-bar input,
.tools-filter-bar select {
  min-width: 220px;
}

.tools-inventory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tools-inventory-card {
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(24, 24, 24, 0.96)),
    radial-gradient(circle at top left, rgba(218, 58, 61, 0.08), transparent 46%);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.2);
}

.tools-inventory-card.is-highlighted {
  border-color: rgba(255, 176, 176, 0.34);
  box-shadow: 0 0 0 1px rgba(218, 58, 61, 0.24), 0 20px 36px rgba(197, 48, 51, 0.18);
}

.tools-card-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.tools-card-visual {
  display: flex;
  gap: 14px;
  min-width: 0;
  flex: 1 1 auto;
}

.tools-card-photo-frame {
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(6, 16, 26, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tools-card-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tools-card-photo-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.56);
  text-align: center;
  padding: 10px;
}

.tools-card-photo-placeholder i {
  color: #ff8f91;
}

.tools-card-copy {
  min-width: 0;
}

.tools-card-code {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(6, 16, 26, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #d7ebff;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tools-card-title {
  margin: 10px 0 4px;
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.tools-card-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.tools-card-location {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.tools-card-location i {
  color: #ff8f91;
}

.tools-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  max-width: 100%;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
}

.tools-status-badge.is-available {
  color: #9df0bd;
  background: rgba(38, 138, 82, 0.16);
  border-color: rgba(38, 138, 82, 0.32);
}

.tools-status-badge.is-assigned {
  color: #ffd3b1;
  background: rgba(218, 97, 58, 0.16);
  border-color: rgba(218, 97, 58, 0.28);
}

.tools-status-badge.is-mixed {
  color: #ffe19d;
  background: rgba(217, 149, 33, 0.16);
  border-color: rgba(245, 183, 76, 0.28);
}

.tools-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.tools-card-meta-box {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tools-card-meta-box span,
.tools-card-meta-box small {
  display: block;
}

.tools-card-meta-box span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tools-card-meta-box strong {
  display: block;
  margin-top: 8px;
  font-size: 0.96rem;
  overflow-wrap: anywhere;
}

.tools-card-meta-box small {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.58);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.tools-card-actions {
  margin-top: 16px;
}

.tools-history-list {
  display: grid;
  gap: 12px;
}

.tools-history-item {
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tools-history-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.tools-history-action {
  color: #ffe0e0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tools-history-time,
.tools-history-meta,
.tools-history-note {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.82rem;
}

.tools-history-title {
  display: block;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.tools-history-note {
  margin-top: 8px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.tools-empty-state {
  padding: 22px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
}

@media (max-width: 1100px) {
  .tools-kpi-grid,
  .tools-inventory-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  #view-tools .card {
    padding: 12px;
  }

  #view-tools .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  #view-tools .grid.grid-2,
  .tools-top-grid,
  .tools-kpi-grid,
  .tools-inventory-list,
  .tools-card-grid {
    grid-template-columns: 1fr;
  }

  .tools-inventory-header,
  .tools-history-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .tools-filter-bar,
  .tools-scanner-actions,
  .tools-card-actions,
  .tools-assign-buttons,
  .tools-transfer-scan-actions {
    width: 100%;
  }

  .tools-scanner-actions .btn,
  .tools-transfer-scan-actions .btn,
  .tools-assign-buttons .btn,
  #tool-save-btn {
    flex: 1 1 220px;
    justify-content: center;
  }

  .tools-transfer-scan-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .tools-form-grid > *,
  .tools-transfer-grid > *,
  .tools-transfer-scan-grid > * {
    grid-column: 1 / -1;
  }

  .tools-filter-bar input,
  .tools-filter-bar select {
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .tools-scanner-stage,
  .tools-scanner-stage video,
  .tools-scanner-fallback,
  .tools-scanner-fallback video,
  .tools-scanner-fallback canvas {
    min-height: 210px;
  }

  .tools-scanner-stage {
    min-height: clamp(190px, 58vw, 240px);
    border-radius: 18px;
  }

  .tools-scanner-overlay {
    inset: 12px;
    border-radius: 16px;
  }

  .tools-kpi-card {
    padding: 16px;
  }

  .tools-kpi-card strong {
    font-size: 1.7rem;
  }

  .tools-photo-preview {
    min-height: 120px;
    padding: 12px;
  }

  .tools-photo-thumb {
    width: 100%;
    max-width: 220px;
    height: auto;
    aspect-ratio: 1 / 1;
  }

  .tools-card-top {
    flex-direction: column;
  }

  .tools-card-visual {
    flex-direction: column;
  }

  .tools-card-photo-frame {
    width: 100%;
    height: min(220px, 62vw);
    flex-basis: auto;
  }

  .tools-card-actions .btn,
  .tools-scanner-actions .btn,
  .tools-assign-buttons .btn,
  .tools-transfer-scan-actions .btn,
  #tool-save-btn {
    width: 100%;
    flex-basis: 100%;
  }

  .tools-assignments-table {
    min-width: 760px;
  }
}

@media (max-width: 480px) {
  #view-tools .card {
    padding: 10px;
    margin-bottom: 14px;
  }

  .tools-shell {
    gap: 16px;
  }

  .tools-scanner-stage,
  .tools-scanner-stage video,
  .tools-scanner-fallback,
  .tools-scanner-fallback video,
  .tools-scanner-fallback canvas {
    min-height: clamp(180px, 62vw, 220px);
  }

  .tools-scanner-placeholder {
    padding: 16px;
    gap: 8px;
    font-size: 0.8rem;
  }

  .tools-scanner-placeholder i {
    font-size: 1.6rem;
  }

  .tools-transfer-scan-panel,
  .tools-inventory-card,
  .tools-history-item {
    padding: 14px;
    border-radius: 16px;
  }

  .tools-card-grid {
    gap: 10px;
  }

  .tools-card-meta-box {
    padding: 12px;
  }
}

/* Final tablet pass for offers/orcamentos: keep all panels visible without layout clipping. */
@media (max-width: 1180px) {
  #view-offers .offers-workspace-body {
    align-items: stretch;
  }

  #view-offers .offers-workspace-actions {
    width: 100%;
    justify-content: flex-start;
  }

  #view-offers .offers-workspace-actions .btn {
    flex: 1 1 210px;
  }

  #view-offers .offers-layout {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  #view-offers .offers-main,
  #view-offers .offers-aside,
  #view-offers .offers-layout .card,
  #view-offers .card-body,
  #view-offers .offer-card-header-row,
  #view-offers .offer-card-header-actions {
    min-width: 0;
  }

  #view-offers .offer-card-header-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  #view-offers .offer-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-offers .offer-item-grid > label[style*="grid-column"],
  #view-offers .offer-item-grid > div[style*="grid-column"],
  #view-offers .offer-optional-packages-grid > label[style*="grid-column"],
  #view-offers .offer-optional-packages-grid > div[style*="grid-column"] {
    grid-column: 1 / -1 !important;
  }

  #view-offers .offer-item-optional-toggle,
  #view-offers .offer-item-actions,
  #view-offers .offer-optional-packages-actions {
    grid-column: 1 / -1;
  }

  #view-offers .offer-item-actions,
  #view-offers .offer-product-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #view-offers .offer-item-actions .btn,
  #view-offers .offer-product-actions .btn {
    width: 100%;
  }

  #view-offers .offer-optional-packages-grid,
  #view-offers .offer-payment-row,
  #view-offers .offer-payment-final {
    grid-template-columns: 1fr;
  }

  #view-offers .offer-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-offers .offer-meta-stats,
  #view-offers .offer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #view-offers .offer-materials-header,
  #view-offers .offer-materials-photos-header,
  #view-offers .offer-optional-packages-header,
  #view-offers .offer-conditions-header,
  #view-offers .offers-tools {
    align-items: stretch;
  }

  #view-offers .offers-tools-search,
  #view-offers #offers-status-filter,
  #view-offers #offers-clear-filters {
    flex: 1 1 220px;
  }

  #view-offers .table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  #view-offers #offer-items-table {
    min-width: 900px;
  }

  #view-offers #offer-optional-packages-table,
  #view-offers #offer-products-card table {
    min-width: 640px;
  }

  #view-offers #offers-list-shell table,
  #view-offers #offers-archive-card table {
    min-width: 980px;
  }

  #view-offers .offer-preview-table table {
    min-width: 720px;
  }
}

@media (max-width: 840px) {
  #view-offers .offer-actions,
  #view-offers .offer-meta,
  #view-offers .offer-meta-stats,
  #view-offers .offer-item-grid {
    grid-template-columns: 1fr !important;
  }

  #view-offers .offers-tools,
  #view-offers .offer-product-actions,
  #view-offers .offer-travel-calculator-head,
  #view-offers .offer-travel-calculator-result,
  #view-offers .offer-market-result-detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  /* Spalten-Layout: Basis 220 px darf nicht zur Höhe werden. */
  #view-offers .offers-tools > * {
    flex: 0 0 auto;
  }

  #view-offers .offer-card-header-actions,
  #view-offers .offer-materials-header,
  #view-offers .offer-materials-photos-header,
  #view-offers .offer-optional-packages-header,
  #view-offers .offer-conditions-header {
    flex-direction: column;
    align-items: stretch;
  }

  #view-offers .offers-workspace-actions .btn,
  #view-offers #offer-header-back-btn,
  #view-offers .offer-actions .btn,
  #view-offers .offer-materials-header .btn,
  #view-offers .offer-materials-photos-header .btn,
  #view-offers .offer-conditions-header .btn,
  #view-offers .offer-product-actions .btn,
  #view-offers .offer-travel-calculator-head .btn,
  #view-offers .offer-travel-calculator-result .btn,
  #view-offers .offer-market-result-detail-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 1180px) {
  #view-costing .grid.grid-2 {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  #view-costing .card,
  #view-costing .card-body,
  #view-costing .costing-focus-card,
  #view-costing .costing-panel,
  #view-costing .costing-shell {
    min-width: 0;
  }

  #view-costing .costing-tabs {
    justify-content: flex-start;
  }

  #view-costing .costing-tab {
    flex: 1 1 180px;
    text-align: center;
  }

  #view-costing .costing-actions {
    align-items: stretch;
  }

  #view-costing .costing-actions .btn {
    flex: 1 1 220px;
    justify-content: center;
  }

  #view-costing .table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  #view-costing #costing-panel-overview .table-wrapper table,
  #view-costing #costing-panel-items .table-wrapper table {
    min-width: 860px;
  }

  #view-costing #costing-panel-forecast .table-wrapper table {
    min-width: 760px;
  }
}

@media (max-width: 840px) {
  #view-costing .costing-tabs,
  #view-costing .costing-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #view-costing .costing-tab,
  #view-costing .costing-actions .btn {
    width: 100%;
    flex: 0 0 auto;
  }

  #view-costing .costing-kpi-grid,
  #view-costing .offer-summary {
    grid-template-columns: 1fr;
  }
}

/* Accounting overview: compact absence list and live monthly results. */
.hours-absences-details { margin-top: 12px; border: 1px solid rgba(255,120,120,.3); border-radius: 10px; }
.hours-absences-details > summary { cursor: pointer; padding: 12px 14px; color: #ffd6d6; font-weight: 600; }
.hours-absences-details[hidden] { display: none; }
.accounting-monthly-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.accounting-monthly-controls input { width: 95px; }
.accounting-monthly-chart-wrap { position: relative; min-height: 240px; }
.accounting-result-negative { color: #f87171; }
.accounting-result-positive { color: #4ade80; }

/* TOConline annual overview: invoicing and recorded payments are distinct measures. */
.accounting-finance-totals { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin:16px 0 22px; }
.accounting-finance-totals > div { padding:16px; border:1px solid var(--border-color,#38434f); border-radius:12px; background:var(--card-bg,#19222e); min-width:0; }
.accounting-finance-totals span { display:block; color:var(--text-muted,#9ca3af); font-size:12px; margin-bottom:9px; }
.accounting-finance-totals strong { display:block; font-size:clamp(18px,2vw,25px); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.accounting-income-chart-wrap { position:relative; height:330px; min-width:0; margin-bottom:26px; }
.accounting-finance-table { max-width:100%; overflow-x:auto; }
.accounting-finance-table table { min-width:930px; font-variant-numeric:tabular-nums; }
.accounting-finance-table th:not(:first-child), .accounting-finance-table td:not(:first-child) { text-align:right; white-space:nowrap; }
.accounting-finance-table tfoot { font-weight:700; border-top:2px solid #556271; }
.accounting-month-link { border:0; background:transparent; padding:4px 0; font:inherit; color:#9ddad4; text-decoration:underline; text-underline-offset:3px; cursor:pointer; }
.accounting-month-note { display:block; font-size:10px; color:var(--text-muted,#9ca3af); margin-top:4px; }
.accounting-month-link:focus-visible, .accounting-finance-table:focus-visible { outline:2px solid #f4bd6a; outline-offset:3px; }
@media(max-width:850px) { .accounting-finance-totals { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media(max-width:450px) { .accounting-finance-totals { gap:8px; } .accounting-finance-totals > div { padding:12px; } .accounting-income-chart-wrap { height:350px; } }

.accounting-profit-focus { margin:18px 0 26px; padding:22px; border:1px solid #536172; border-radius:16px; background:#1b2530; }
.accounting-profit-head { display:flex; justify-content:space-between; align-items:center; gap:14px; flex-wrap:wrap; }
.accounting-profit-head h2 { margin:0; font-size:21px; }
.accounting-profit-head label { display:flex; align-items:center; gap:9px; }
.accounting-profit-head select { padding:10px; border-radius:8px; background:#19212a; color:#f1f5f9; border:1px solid #657280; }
.accounting-profit-main { display:flex; flex-direction:column; align-items:flex-start; gap:9px; margin:24px 0; }
.accounting-profit-main > strong { font-size:clamp(30px,4vw,48px); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.accounting-profit-focus.has-profit .accounting-profit-main > strong { color:#7ce3b7; }
.accounting-profit-focus.has-loss .accounting-profit-main > strong { color:#ff9999; }
.accounting-profit-badge { font-size:12px; background:#443a26; color:#f3d398; padding:5px 9px; border-radius:6px; }
.accounting-profit-formula { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; }
.accounting-profit-formula span { display:block; color:#bbc7d2; font-size:12px; line-height:1.4; margin-bottom:9px; }
.accounting-profit-formula strong { font-size:18px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.accounting-profit-note { font-size:12px; line-height:1.6; color:#decda9; margin-top:18px; }
.accounting-profit-year { font-size:13px; border-top:1px solid #44515e; padding-top:14px; }
@media(max-width:700px) { .accounting-profit-focus { padding:16px; } .accounting-profit-formula { grid-template-columns:repeat(2,minmax(0,1fr)); } .accounting-profit-head h2 { font-size:19px; } }
