/* ===========================================
   designBauelemente Verwaltungssystem — style.css
   Mobile-first | CSS Custom Properties
   Struktur: akroval-de, Corporate Design: designBauelemente
   =========================================== */

/* --- Lokale Schriftarten (DSGVO-konform) --- */
@font-face {
  font-family: 'Helvetica CE';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/HelveticaCE-Medium.otf') format('opentype');
}
@font-face {
  font-family: 'Helvetica CE';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/HelveticaCE-Bold.otf') format('opentype');
}

/* --- Custom Properties --- */
:root {
  --color-primary:    #044c5a;
  --color-primary-dark: #033844;
  --color-text-dark:  #303032;
  --color-text:       #5c5c5c;
  --color-surface:    #f0f6f7;
  --color-bg:         #ffffff;
  --color-border:     #d0dfe1;
  --color-white:      #ffffff;
  --color-success:    #2d7a3a;
  --color-error:      #c0392b;
  --color-warning:    #b07d00;

  --font-main: 'Helvetica CE', 'Helvetica Neue', Helvetica, Arial, system-ui, sans-serif;

  --container-max: 1600px;
  --container-pad: 1.25rem;
  --header-h:      64px;

  --radius:       3px;
  --radius-modal: 6px;
  --shadow-card:  0 2px 12px rgba(4, 76, 90, 0.07);
  --shadow-modal: 0 8px 40px rgba(4, 76, 90, 0.18);

  --transition: 140ms ease;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--color-text);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
}

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

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

ul { list-style: none; }

/* --- Skip Link (Barrierefreiheit) --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius);
  z-index: 9999;
  font-size: 0.875rem;
  font-weight: 500;
}
.skip-link:focus { top: 1rem; }

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}
@media (hover: hover) {
  .btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
  }
}
.btn-primary:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}
@media (hover: hover) {
  .btn-secondary:hover {
    background-color: var(--color-border);
  }
}

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

.btn-xs {
  padding: 0.2rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: none;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--color-text);
  transition: color var(--transition), background-color var(--transition);
}
@media (hover: hover) {
  .btn-icon:hover {
    background-color: var(--color-surface);
    color: var(--color-primary);
  }
}
.btn-icon:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.btn-icon.btn-danger:hover {
  color: var(--color-error);
}
.btn-icon.btn-docs.has-dokumente {
  color: #c89000;
}
.btn-icon.btn-docs.has-dokumente:hover {
  color: #a07000;
}
.btn-icon.icon-synced {
  color: #2d7a4f;
  cursor: default;
}
.btn-icon.icon-synced:hover {
  color: #2d7a4f;
  background-color: transparent;
}

/* ===========================================
   HEADER
   =========================================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--header-h);
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  transition: box-shadow var(--transition);
}
.site-header.scrolled {
  box-shadow: 0 2px 16px rgba(4, 76, 90, 0.1);
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.logo {
  height: 44px;
  width: auto;
}

/* ── Navigation ── */
.main-nav > ul {
  display: flex;
  gap: 0.25rem;
  align-items: center;
}

.has-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-dark);
  border-radius: var(--radius);
  transition: color var(--transition), background-color var(--transition);
}
@media (hover: hover) {
  .nav-dropdown-toggle:hover {
    color: var(--color-primary);
    background-color: var(--color-surface);
  }
}
.nav-dropdown-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.dropdown-arrow {
  transition: transform var(--transition);
}
.nav-dropdown-toggle[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 180px;
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 0.25rem 0;
  z-index: 300;
}
.dropdown-menu.is-open { display: block; }

.dropdown-menu a {
  display: block;
  padding: 0.55rem 1rem;
  font-size: 0.875rem;
  color: var(--color-text-dark);
  transition: background-color var(--transition), color var(--transition);
}
@media (hover: hover) {
  .dropdown-menu a:hover {
    background-color: var(--color-surface);
    color: var(--color-primary);
  }
}
.dropdown-menu a.is-active {
  color: var(--color-primary);
  font-weight: 700;
}

/* ── Hamburger ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
}
.nav-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Logout ── */
.logout-form { margin-left: auto; flex-shrink: 0; }
.btn-logout {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.8125rem;
  color: var(--color-text);
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), background-color var(--transition);
}
@media (hover: hover) {
  .btn-logout:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background-color: var(--color-surface);
  }
}

/* ===========================================
   MAIN CONTENT
   =========================================== */
.main-content {
  padding-top: calc(var(--header-h) + 1.5rem);
  padding-bottom: 3rem;
  min-height: 100vh;
}

.page-container {
  padding-top: 0;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.summe-label {
  font-size: 0.8125rem;
  color: var(--color-text);
}
.summe-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* ===========================================
   TABELLE
   =========================================== */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

.auftraege-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  min-width: 1200px;
}

.auftraege-table th {
  position: sticky;
  top: 0;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.6rem;
  white-space: nowrap;
  border-bottom: 2px solid var(--color-primary-dark);
  z-index: 10;
}

.auftraege-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

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

.auftraege-table tbody tr:hover td {
  background-color: #f5fafc;
}


.badge-13b {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  background: #ffe066;
  color: #7a5c00;
  border: 1px solid #e0c040;
  white-space: nowrap;
}

/* Status-Badges */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.status-aktiv        { background: #e6f4ea; color: var(--color-success); border: 1px solid #b2ddb8; }
.status-abgeschlossen{ background: #e8eaf6; color: #3949ab; border: 1px solid #c5cae9; }
.status-storniert    { background: #fde8e8; color: var(--color-error); border: 1px solid #f5bcbc; }

.transfer-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(4, 76, 90, 0.08);
  color: #044c5a;
  border: 1px solid rgba(4, 76, 90, 0.22);
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 4px;
}
.voraus-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(176, 95, 0, 0.08);
  color: #b05f00;
  border: 1px solid rgba(176, 95, 0, 0.22);
  white-space: nowrap;
  vertical-align: middle;
  margin-left: 4px;
}

/* Neue Zeile (tfoot) */
.new-row td {
  background-color: var(--color-surface);
  border-top: 2px solid var(--color-primary);
}

/* Spinner an number-Inputs ausblenden */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* Kalender-Icon im date-Input ausblenden */
input[type="date"]::-webkit-calendar-picker-indicator { display: none; }

/* Inline-Inputs in Tabellenzellen */
.cell-input {
  width: 100%;
  padding: 0.3rem 0.4rem;
  font-family: var(--font-main);
  font-size: 0.8125rem;
  color: var(--color-text-dark);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: border-color var(--transition), background-color var(--transition);
  min-width: 60px;
}
.cell-input:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-bg);
  box-shadow: 0 0 0 2px rgba(4, 76, 90, 0.12);
}
.cell-input[type="date"] { min-width: 120px; }
.cell-number { text-align: right; }
.cell-select { cursor: pointer; }

.cell-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Editable-Span (bestehende Zeilen) */
td .editable-cell {
  display: block;
  width: 100%;
  min-height: 24px;
  padding: 0.2rem 0.3rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: text;
  transition: border-color var(--transition), background-color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
td .editable-cell:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-bg);
  box-shadow: 0 0 0 2px rgba(4, 76, 90, 0.12);
  white-space: normal;
}

/* Spaltenbreiten */
.col-id           { width: 40px; text-align: center; color: var(--color-text); }
.cell-id          { text-align: center; font-size: 0.75rem; color: var(--color-text); }
.col-datum        { width: 56px; }
.col-anr          { width: 155px; }
.col-kunde        { width: 580px; }
.col-bez          { width: 426px; }
.col-netto        { width: 105px; }
.col-brutto       { width: 105px; }
.col-13b          { width: 50px; text-align: center; }
.col-lieferant    { width: 70px; }
.col-montage      { width: 70px; }
.col-ausfuehrender{ width: 55px; }
.col-bemerkung    { width: 160px; }
.col-status       { width: 110px; }
.col-docs         { width: 50px; text-align: center; }
.col-actions      { width: 62px; text-align: center; white-space: nowrap; }
.col-13b-cell     { text-align: center; }

.empty-hint {
  text-align: center;
  padding: 2rem;
  color: var(--color-text);
}

/* ===========================================
   FORMULAR-MELDUNGEN
   =========================================== */
.form-message {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.form-message.is-visible { display: block; }
.form-message--success { background: #e6f4ea; border-left: 4px solid var(--color-success); color: var(--color-success); }
.form-message--error   { background: #fde8e8; border-left: 4px solid var(--color-error); color: var(--color-error); }

/* ===========================================
   LOGIN
   =========================================== */
.login-page {
  background-color: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-wrapper {
  width: 100%;
  max-width: 400px;
  padding: 1rem;
}

.login-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  padding: 2rem 2rem 2.5rem;
}

.login-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.login-logo img {
  height: 60px;
  width: auto;
}

.login-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: 1.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.form-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-dark);
}
.form-group input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-main);
  font-size: 0.9375rem;
  color: var(--color-text-dark);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  appearance: none;
}
.form-group input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(4, 76, 90, 0.12);
}
.form-group input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: none;
  background: none;
  appearance: auto;
  cursor: pointer;
  flex-shrink: 0;
}

/* ===========================================
   MODAL
   =========================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(48, 48, 50, 0.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay[hidden] { display: none; }

.modal-card {
  background: var(--color-bg);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}
.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
  transition: color var(--transition);
}
@media (hover: hover) {
  .modal-close:hover { color: var(--color-primary); }
}

.modal-body {
  padding: 1rem 1.25rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

.dok-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.dok-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.dok-name {
  flex: 1;
  font-size: 0.8125rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dok-download {
  color: var(--color-primary);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.dok-rename-input {
  font-size: 0.8125rem;
  font-family: var(--font-main);
  border: 1px solid var(--color-primary);
  border-radius: 3px;
  padding: 1px 5px;
  width: 150px;
  outline: none;
}
.dok-rename-ext {
  font-size: 0.8125rem;
  color: var(--color-text);
  margin-left: 2px;
}

.dok-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}
.dok-type-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 3px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.dok-type-pdf  { background: #fde8e8; color: #c0392b; }
.dok-type-docx,
.dok-type-doc  { background: #dbeafe; color: #1d4ed8; }
.dok-type-xlsx,
.dok-type-xls  { background: #dcfce7; color: #166534; }

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.25rem 1rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  color: var(--color-text);
  margin-bottom: 0.75rem;
}
.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--color-primary);
  background-color: var(--color-surface);
  color: var(--color-primary);
}
.drop-zone p { font-size: 0.875rem; margin: 0; }
.drop-zone-link {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}
.drop-zone-hint {
  font-size: 0.75rem;
  color: var(--color-text);
}

.upload-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
.upload-progress-track {
  flex: 1;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.15s ease;
}
.upload-progress-label {
  font-size: 0.75rem;
  color: var(--color-text);
  white-space: nowrap;
  min-width: 36px;
  text-align: right;
}

.dok-upload-status {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-text);
  min-height: 1.2em;
}

/* ===========================================
   RESPONSIVE — Mobil
   =========================================== */
@media (max-width: 767px) {
  :root { --header-h: 56px; }

  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: 0.5rem var(--container-pad) 1rem;
    box-shadow: 0 6px 16px rgba(4, 76, 90, 0.09);
  }
  .main-nav.is-open { display: block; }

  .main-nav > ul {
    flex-direction: column;
    align-items: flex-start;
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background: transparent;
    padding-left: 1rem;
  }

  .logout-form { display: none; }
}

/* ===========================================
   ARCHIV — Jahres-Header
   =========================================== */
.archiv-jahr-header td {
  background: var(--color-surface);
  border-top: 2px solid var(--color-primary);
  padding: 0.45rem 0.6rem;
  white-space: nowrap;
}
.archiv-jahr-label {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--color-primary);
  margin-right: 1.5rem;
  letter-spacing: 0.02em;
}
.archiv-jahr-summe {
  font-size: 0.8125rem;
  color: var(--color-text-dark);
}

/* ===========================================
   ACCESSIBILITY
   =========================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* ===========================================
   SOCIAL MEDIA
   =========================================== */

.sm-subtitle {
  font-size: 0.875rem;
  color: var(--color-text);
  margin-top: 0.25rem;
}

.sm-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-modal);
  box-shadow: var(--shadow-card);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sm-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.25rem;
}

/* Typ-Toggle */
.sm-type-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.sm-type-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-dark);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

.sm-type-btn.is-active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

/* Plattform-Toggle */
.sm-platform-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sm-platform-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text-dark);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: background-color var(--transition), color var(--transition), border-color var(--transition), opacity var(--transition);
}

.sm-platform-btn.is-active {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
}

.sm-platform-btn:not(.is-active) {
  opacity: 0.55;
}

/* Drop-Zone */
.sm-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2rem 1rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: border-color var(--transition), background-color var(--transition);
  color: var(--color-text);
  margin-bottom: 1rem;
}

.sm-drop-zone:hover,
.sm-drop-zone.drag-over {
  border-color: var(--color-primary);
  background: var(--color-surface);
  color: var(--color-primary);
}

.sm-drop-icon   { margin-bottom: 0.25rem; opacity: 0.6; }
.sm-drop-text   { font-size: 0.875rem; margin: 0; }
.sm-drop-link   { color: var(--color-primary); font-weight: 500; text-decoration: underline; cursor: pointer; }
.sm-drop-hint     { font-size: 0.75rem; color: var(--color-text); margin: 0; }
.sm-drop-optional { font-size: 0.75rem; color: var(--color-text-muted, #888); }

/* Mobile-Upload-Button (nur <= 767px) */
.sm-mobile-upload { display: none; margin-bottom: 1rem; }

/* Thumbnail-Vorschau (Mehrfach) */
.sm-preview-thumb[hidden] { display: none; }
.sm-thumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sm-thumb-item {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sm-thumb-item img {
  display: block;
  height: 120px;
  width: auto;
  max-width: 160px;
  object-fit: cover;
}

.sm-thumb-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 120px;
  width: 140px;
  padding: 0.5rem;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  word-break: break-all;
  text-align: center;
  background: #f5f5f5;
}

.sm-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(48,48,50,0.7);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Label / Textarea / Input */
.sm-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text-dark);
  margin-bottom: 0.35rem;
}

.sm-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--color-text-dark);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  resize: vertical;
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 1rem;
}

.sm-textarea:focus,
.sm-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(4, 76, 90, 0.12);
}

.sm-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--color-text-dark);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  margin-bottom: 1rem;
  appearance: none;
}

.sm-process-btn { margin-top: 0.25rem; }

/* Fortschrittsbalken */
.sm-progress-wrap {
  margin-bottom: 1.5rem;
}

.sm-progress-phase {
  font-size: 0.875rem;
  color: var(--color-text-dark);
  margin-bottom: 0.5rem;
  font-weight: 500;
  min-height: 1.4em;
  transition: color var(--transition);
}

.sm-progress-track {
  width: 100%;
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.3rem;
}

.sm-progress-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.4s ease;
  width: 0%;
}

.sm-progress-pct {
  font-size: 0.75rem;
  color: var(--color-text);
  text-align: right;
}

/* Vorschau-Grid */
.sm-preview-grid[hidden] { display: none; }
.sm-preview-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: start;
}

.sm-preview-image-wrap {
  position: relative;
  flex-shrink: 0;
}

.sm-result-img {
  display: block;
  max-height: 400px;
  width: auto;
  max-width: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  object-fit: contain;
}

/* Bild-Navigation */
.sm-img-nav-row[hidden] { display: none; }
.sm-img-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.sm-img-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-dark);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.sm-img-nav-btn:hover:not(:disabled) {
  background: var(--color-bg);
  border-color: var(--color-primary, #333);
}
.sm-img-nav-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.sm-img-counter {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-text);
  min-width: 3rem;
  text-align: center;
}

.sm-img-label {
  display: block;
  text-align: center;
  font-size: 0.75rem;
  color: var(--color-text);
  margin-top: 0.35rem;
}

.sm-caption-textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--color-text-dark);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  resize: vertical;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.sm-caption-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(4, 76, 90, 0.12);
}

.sm-caption-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.sm-divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1rem 0;
}

.sm-publish-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Protokoll-Tabelle */
.sm-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  min-width: 600px;
}

.sm-log-table th {
  background: var(--color-primary);
  color: var(--color-white);
  font-weight: 700;
  text-align: left;
  padding: 0.55rem 0.75rem;
  white-space: nowrap;
}

.sm-log-table td {
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}

.sm-log-table tbody tr:last-child td { border-bottom: none; }
.sm-log-table tbody tr:hover td { background: #f5fafc; }

.sm-log-caption {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-text);
}

.sm-log-link {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: underline;
}

/* Status-Badges (Protokoll) */
.sm-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.sm-badge-published  { background: #e6f4ea; color: var(--color-success); border: 1px solid #b2ddb8; }
.sm-badge-publishing { background: #e8eaf6; color: #3949ab; border: 1px solid #c5cae9; }
.sm-badge-preview    { background: #fff8e1; color: #b07d00; border: 1px solid #ffe082; }
.sm-badge-processing { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.sm-badge-failed     { background: #fde8e8; color: var(--color-error); border: 1px solid #f5bcbc; }
.sm-badge-cancelled  { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }
.sm-badge-idle       { background: var(--color-surface); color: var(--color-text); border: 1px solid var(--color-border); }

/* Protokoll — klickbare Zeilen & Lösch-Button */
.sm-log-row:hover td { background: var(--color-hover, #f5f5f5); }

.sm-delete-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: var(--color-text);
  opacity: 0.45;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
}
.sm-delete-btn:hover { opacity: 1; color: var(--color-error); }

/* Detail-Modal */
.sm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.sm-modal-backdrop[hidden] { display: none; }

.sm-modal {
  background: var(--color-surface, #fff);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sm-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 1px solid var(--color-border);
}

.sm-modal-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
}

.sm-modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-text);
  padding: 0 4px;
  opacity: 0.6;
}
.sm-modal-close:hover { opacity: 1; }

.sm-modal-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sm-modal-gallery {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sm-modal-gallery .sm-modal-img {
  flex: 1 1 120px;
  max-width: 200px;
}

.sm-modal-img {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.sm-modal-dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 0;
  font-size: 0.875rem;
}
.sm-modal-dl dt { font-weight: 500; color: var(--color-text-dark); }
.sm-modal-dl dd { margin: 0; }

.sm-modal-caption {
  white-space: pre-wrap;
  font-family: var(--font-main);
  font-size: 0.8125rem;
  background: var(--color-bg, #f9f9f9);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  margin: 0;
  line-height: 1.6;
}

.sm-story-notice {
  background: #fff8e1;
  color: #7a5800;
  border: 1px solid #ffe082;
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  font-size: 0.875rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.sm-story-notice[hidden] { display: none; }
.sm-story-notice p { margin: 0; }
.sm-story-notice .sm-story-download-btn { align-self: flex-start; }
.sm-story-notice .sm-story-download-btn[hidden] { display: none; }

/* Abbrechen-Button */
.sm-cancel-row {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
}
.btn-cancel {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 0.875rem;
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-cancel:hover { background: #fde8e8; color: var(--color-error); border-color: #f5bcbc; }

/* Modal-Footer */
.sm-modal-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  margin-top: 0.75rem;
}

/* Modal-Aktionsbuttons */
.sm-modal-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
  margin-top: 0.75rem;
}

.sm-modal-error {
  background: #fde8e8;
  color: var(--color-error);
  border: 1px solid #f5bcbc;
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  font-size: 0.875rem;
}

/* ===========================================
   SOCIAL MEDIA — Responsive Mobile
   =========================================== */
@media (max-width: 767px) {
  .sm-drop-zone      { display: none; }
  .sm-mobile-upload  { display: flex; }

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

  .sm-result-img {
    max-width: 100%;
    max-height: 280px;
    width: 100%;
    object-fit: contain;
  }

  .sm-publish-actions,
  .sm-caption-actions { flex-direction: column; }

  .sm-publish-actions .btn,
  .sm-caption-actions .btn { width: 100%; justify-content: center; }
}

/* ===========================================
   ENERGIE (Strom & Gas) — Controlling
   =========================================== */

/* ── Saldo-Kacheln ─────────────────────────────────────────────────────────── */
.energie-kacheln {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.energie-kachel {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, 6px);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.energie-kachel--gesamt {
  border-color: var(--color-primary, #2563eb);
  border-width: 2px;
}

.kachel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  margin-bottom: 0.25rem;
}

.kachel-icon--gas      { background: rgba(239,68,68,0.1);  color: rgb(239,68,68); }
.kachel-icon--strom    { background: rgba(234,179,8,0.1);  color: rgb(234,179,8); }
.kachel-icon--wasser   { background: rgba(59,130,246,0.1); color: rgb(59,130,246); }
.kachel-icon--abwasser { background: rgba(156,163,175,0.1); color: #9ca3af; }
.abwasser-kachel       { max-width: 480px; }

.kachel-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text, #1e293b);
}

.kachel-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.kachel-sub {
  color: var(--color-muted, #64748b);
}

.kachel-val {
  font-variant-numeric: tabular-nums;
}

.kachel-saldo {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 0.4rem;
  font-variant-numeric: tabular-nums;
}

.saldo--guthaben    { color: #16a34a; }
.saldo--nachzahlung { color: #dc2626; }

.kachel-tarif {
  font-size: 0.75rem;
  color: var(--color-muted, #64748b);
  margin-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Sektionen ─────────────────────────────────────────────────────────────── */
.energie-section {
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  color: var(--color-text, #1e293b);
}

/* ── Formulare ─────────────────────────────────────────────────────────────── */
.energie-form {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, 6px);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 140px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted, #64748b);
}

.form-group input,
.form-group select {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, 4px);
  font-size: 0.875rem;
  background: var(--color-bg, #f8fafc);
  color: var(--color-text, #1e293b);
  width: 100%;
}

.form-group--wide {
  flex: 1;
  min-width: 200px;
}

.form-group--action {
  align-self: flex-end;
}

.form-group .optional {
  font-size: 0.7rem;
  color: var(--color-muted, #94a3b8);
}

.field-hint {
  font-size: 0.7rem;
  color: var(--color-muted, #94a3b8);
  margin-top: 0.15rem;
}

.form-error {
  margin-top: 0.5rem;
  color: var(--color-error, #dc2626);
  font-size: 0.85rem;
  background: #fde8e8;
  border: 1px solid #fecaca;
  border-radius: var(--radius, 4px);
  padding: 0.4rem 0.6rem;
}

/* ── Tabellen ──────────────────────────────────────────────────────────────── */
.energie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.energie-table th {
  background: var(--color-surface-alt, #f1f5f9);
  text-align: left;
  padding: 0.5rem 0.6rem;
  font-weight: 600;
  color: var(--color-muted, #64748b);
  border-bottom: 2px solid var(--color-border, #e2e8f0);
  white-space: nowrap;
}

.energie-table td {
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid var(--color-border, #e2e8f0);
  vertical-align: middle;
}

.energie-table tr:hover td {
  background: var(--color-surface-alt, #f8fafc);
}

.col-right { text-align: right; font-variant-numeric: tabular-nums; }

.col-actions {
  width: 72px;
  text-align: right;
  white-space: nowrap;
}

.empty-row {
  text-align: center;
  color: var(--color-muted, #94a3b8);
  padding: 2rem 0 !important;
  font-style: italic;
}

.betrag--ausgang { color: #dc2626; font-weight: 600; }
.betrag--eingang { color: #16a34a; font-weight: 600; }

.vorgangsliste-summe-row td {
  border-top: 2px solid var(--color-primary);
  font-weight: 700;
  background: var(--color-surface);
}
.vorgangsliste-summe-betrag {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}
.vorgangsliste-summe-pos  { color: var(--color-success); }
.vorgangsliste-summe-neg  { color: var(--color-error); }
.vorgangsliste-summe-null { color: var(--color-text); }

/* ── Diagramme ─────────────────────────────────────────────────────────────── */
.chart-filter {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.chart-filter-btn {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--color-muted, #64748b);
  transition: all 0.15s;
}

.chart-filter-btn:hover,
.chart-filter-btn.is-active {
  background: var(--color-primary, #2563eb);
  border-color: var(--color-primary, #2563eb);
  color: #fff;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.chart-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: var(--radius, 6px);
  padding: 1rem;
}

.chart-card--wide {
  grid-column: 1 / -1;
}

.chart-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-muted, #64748b);
  margin-bottom: 0.75rem;
}

.chart-container {
  position: relative;
  height: 240px;
}

.chart-container--tall {
  height: 300px;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .energie-kacheln {
    grid-template-columns: 1fr 1fr;
  }

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

  .chart-card--wide {
    grid-column: 1;
  }

  .form-row {
    flex-direction: column;
  }

  .form-group {
    min-width: 100%;
  }

  .energie-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ── Tarif-Status-Badges ─────────────────────────────────────────────────── */
.tarif-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tarif-status--aktiv {
  background: rgba(34, 197, 94, 0.15);
  color: #15803d;
}
.tarif-status--inaktiv {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}
.tarif-row--aktiv {
  background: rgba(34, 197, 94, 0.04);
}

/* ===========================================
   REDESIGN-ERGÄNZUNGEN
   =========================================== */

/* Canvas-Hintergrund */
#grid-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* Benutzerdefinierter Cursor */
#cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: #044c5a;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
}
#cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(4, 76, 90, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
}

/* Content-Layer über dem Canvas */
.main-content,
main,
.container,
nav,
header {
  position: relative;
  z-index: 1;
}

/* Seitenhintergrund */
body { background-color: #f0f2f3; }

/* Monospace-Zahlen */
.cell-id,
.cell-number,
.summe-value,
.cell-input[data-field="datum"],
.cell-input[data-field="auftragsnummer"],
.editable-cell[data-field="datum"] {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-variant-numeric: tabular-nums;
}

/* Netto/Brutto-Inputs: kompaktere Darstellung für Monospace-Zahlen */
.auftraege-table .cell-number.cell-input {
  font-size: 0.75rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

/* Tabellen-Zeilen Hover */
.auftraege-table tbody tr {
  transition: background 0.15s ease;
}
.auftraege-table tbody tr:hover td {
  background: rgba(4, 76, 90, 0.03);
}

/* Status-Badges schärfer */
.status-badge {
  border-radius: 2px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 600;
}

/* Mobile: Cursor zurücksetzen, Canvas ist deaktiviert */
@media (max-width: 767px) {
  body { cursor: auto; }
  #cursor-dot,
  #cursor-ring { display: none; }
}

/* ── Zeiterfassung — KPI-Karten ──────────────────────────────────────────── */
.ze-kpi-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.ze-kpi-card {
  flex: 1;
  min-width: 160px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.9rem 1.1rem;
  background: var(--color-surface);
  transition: background 0.2s, border-color 0.2s;
}

.ze-kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-bottom: 0.3rem;
}

.ze-kpi-value {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text-dark);
  font-variant-numeric: tabular-nums;
}

/* ── Zeiterfassung — Notizbox ─────────────────────────────────────────────── */
.ze-notiz-wrap {
  position: relative;
}

.ze-notiz-textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--color-text-dark);
  resize: vertical;
  background: var(--color-bg);
  box-sizing: border-box;
}

.ze-notiz-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.ze-notiz-status {
  font-size: 0.75rem;
  margin-top: 0.3rem;
  min-height: 1rem;
}

/* ── Zeiterfassung — Tabelle mit Scroll und Sticky-Header ───────────────── */
.ze-table-scroll {
  max-height: 400px;
  overflow-y: auto;
}

.ze-table-scroll .energie-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background-color: var(--color-surface-alt, #f1f5f9);
}

@media (max-width: 600px) {
  .ze-kpi-row { flex-direction: column; }
}

/* ── Liquidität: Bestätigt-Accordion ── */
.vorgaenge-bestaetigt-section {
  margin-top: 1.25rem;
}

.vorgaenge-bestaetigt-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--color-primary);
  padding: 0.4rem 0;
  user-select: none;
}

.vorgaenge-bestaetigt-toggle:hover {
  opacity: 0.8;
}

.vorgaenge-bestaetigt-body {
  display: none;
  margin-top: 0.75rem;
}

.vorgaenge-bestaetigt-body.open {
  display: block;
}


/* ── Einstellungen-Zahnrad ── */
.btn-einstellungen {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--color-primary);
  padding: 0.25rem 0.4rem;
  line-height: 1;
  border-radius: var(--radius);
  transition: transform 0.35s ease;
}
.btn-einstellungen:hover {
  transform: rotate(60deg);
}

/* ── Einstellungen-Accordion ────────────────────────────────────────────── */
.sm-settings-section {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
}
.sm-settings-summary {
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--color-primary);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
}
.sm-settings-summary::-webkit-details-marker { display: none; }
.sm-settings-summary::before {
  content: '▶';
  font-size: 0.6rem;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
details[open] > .sm-settings-summary::before {
  transform: rotate(90deg);
}
.sm-settings-body {
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--color-border);
}
.sm-settings-badge {
  font-size: 0.7rem;
  font-weight: 500;
  background: var(--color-surface);
  color: var(--color-text-muted, #888);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-left: auto;
}

/* ── Info-Modal Abschnitte ──────────────────────────────────────────────── */
.info-section { margin-bottom: 1rem; }
.info-section:last-child { margin-bottom: 0; }
.info-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.info-section p {
  font-size: 0.875rem;
  color: var(--color-text);
  line-height: 1.55;
  margin: 0;
}
