/* ===========================================================================
   PelycanDesk — design system
   Brand: Pelycan teal (#00a6a6) + warm yellow accent (#f4dc34).
   Type: Space Grotesk (headings) + Inter (body) + JetBrains Mono (numbers),
   self-hosted (no external CDN) to match www.pelycan.de.
   =========================================================================== */

/* Self-hosted variable fonts (latin subset, woff2). */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/inter.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 300 700; font-display: swap; src: url('/assets/fonts/spacegrotesk.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/assets/fonts/jetbrainsmono.woff2') format('woff2'); }
@font-face { font-family: 'Hanken Grotesk'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/assets/fonts/hankengrotesk.woff2') format('woff2'); }

:root {
  /* "Brand" is now the warm yellow accent (was teal). Brand-700 is a readable
     gold for text/links on light backgrounds; -050/-100 are light yellow tints. */
  --brand: #f4dc34;
  --brand-600: #eccf1f;
  --brand-700: #b89500;
  --brand-050: #fdf8e1;
  --brand-100: #f6ecaf;

  --ink: #11201f;
  --ink-2: #33514f;
  --muted: #6b7e7d;
  --muted-2: #8fa19f;

  --page: #eceef3;          /* light-grey backdrop the app card floats on */
  --bg: #eceef3;
  --bg-grad: none;
  --surface: #ffffff;
  --surface-2: #f5f6f9;
  --border: #e6e8ef;
  --border-2: #eef0f5;

  /* Frosted-glass surfaces (Crextio-inspired): translucent so the warm content
     gradient tints through; paired with backdrop-blur on cards/menus/modals.
     --glass = big cards (more see-through), --glass-strong = overlays/menus
     (more opaque for legible text). */
  --glass: rgba(255, 255, 255, 0.55);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(255, 255, 255, 0.68);
  /* Soft, mostly-neutral wash behind the content — just a hint of warmth, far
     less yellow than before. */
  --content-grad: linear-gradient(146deg, #f8f8f6 0%, #f4f3ee 55%, #efece2 100%);
  --shadow-glass: 0 10px 34px rgba(96, 92, 70, 0.09);

  /* Dark sidebar */
  --side-bg: #15171c;
  --side-bg-2: #1d2026;
  --side-ink: #c8cdd7;
  --side-muted: #79808f;
  --side-active: #f4dc34;

  --accent: #f4dc34;        /* warm yellow — primary highlight */
  --accent-600: #eccf1f;
  --accent-700: #c9a800;    /* readable yellow for text/borders on light bg */

  --danger: #df4233;
  --danger-bg: #fdeceb;
  --success: #18996a;
  --success-bg: #e6f4ee;
  --warning: #c98a16;

  /* Chart series */
  --c-income: #f4c52e;
  --c-expense: #c4cad6;
  --c-paid: #18996a;
  --up: #18996a;
  --down: #df4233;

  --shadow-sm: 0 1px 2px rgba(30, 40, 80, 0.05);
  --shadow: 0 6px 20px rgba(30, 40, 80, 0.06);
  --shadow-lg: 0 14px 40px rgba(30, 40, 80, 0.12);
  --shadow-card: 0 18px 50px rgba(25, 33, 61, 0.10);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --font: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", sans-serif;
  --font-head: 'Hanken Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --header-h: 64px;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font-family: inherit; }
::selection { background: var(--brand-100); }

/* ----------------------------- Typography -------------------------------- */
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; }
.section-title { font-family: var(--font-head); letter-spacing: -0.01em; }
.crumb.current { font-family: var(--font-head); letter-spacing: -0.01em; }
.modal-head h3 { font-family: var(--font-head); }
/* Numbers: bold Space Grotesk with tabular figures (clean, not monospace). */
.kpi-val { font-family: var(--font-head); font-weight: 700; letter-spacing: -0.02em; font-feature-settings: 'tnum' 1; }
.mono { font-family: var(--font-mono); }

.hidden { display: none !important; }
.spin { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------- Buttons ----------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s,
    transform 0.05s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 17px; height: 17px; }

/* Monochrome buttons: primary = anthracite (matches the sidebar), neutral-grey hovers. */
.btn-primary { background: var(--side-bg); color: #fff; }
.btn-primary:hover { background: var(--side-bg-2); }
.btn-primary:focus-visible { outline: 3px solid rgba(21, 23, 28, 0.18); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--muted-2); color: var(--ink); background: var(--surface-2); }

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(0.94); }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--ink-2);
  cursor: pointer;
  display: inline-flex;
}
.btn-icon:hover { background: var(--surface-2); color: var(--ink); }

/* ----------------------------- Inputs ------------------------------------ */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.input, .select, textarea.input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid #a9bcbb;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, textarea.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-050);
}
.hint { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.nf-private { display: flex; align-items: center; gap: 8px; margin: 12px 0 2px; font-size: 14px; cursor: pointer; }
.nf-private input { width: 16px; height: 16px; flex: none; accent-color: var(--side-bg); }

/* The login screen is dark-themed (anthracite, no teal): give its inputs a
   neutral focus ring instead of the teal brand ring used inside the app. */
.auth .input:focus {
  border-color: var(--side-bg-2);
  box-shadow: 0 0 0 3px rgba(21, 23, 28, 0.14);
}

/* ----------------------------- Auth screen ------------------------------- */
.auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-aside {
  background: linear-gradient(155deg, var(--side-bg-2), var(--side-bg) 68%, #0e1014);
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
/* Subtle warm-yellow glow (brand accent) instead of the retired teal. */
.auth-aside::after {
  content: "";
  position: absolute;
  right: -140px;
  bottom: -140px;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 220, 52, 0.10), transparent 70%);
}
.auth-aside .brand-mark { width: 168px; filter: brightness(0) invert(1); }
.auth-aside h1 { font-size: 30px; line-height: 1.2; margin: 0 0 14px; font-weight: 700; }
.auth-aside p { font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, 0.86); max-width: 420px; }
.auth-features { display: flex; flex-direction: column; gap: 14px; margin-top: 28px; }
.auth-feature { display: flex; gap: 12px; align-items: center; font-size: 15px; }
.auth-feature svg { width: 22px; height: 22px; flex: none; opacity: 0.92; }

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand-mark { width: 150px; margin-bottom: 28px; display: none; }
.auth-card h2 { font-size: 24px; margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); margin: 0 0 26px; font-size: 14.5px; }
.auth-switch { margin-top: 20px; font-size: 14px; color: var(--muted); text-align: center; }
.auth-error {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #f6cfcb;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  margin-bottom: 16px;
}

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-card .brand-mark { display: block; }
}

/* ----------------------------- App shell --------------------------------- */
.app { display: none; height: 100%; }
/* One rounded card floating on the grey page: dark sidebar + dark top bar form
   the frame; the content sits in a light, rounded panel tucked inside. */
.app.show {
  display: flex;
  height: calc(100% - 28px);
  margin: 14px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--side-bg);
  box-shadow: var(--shadow-card);
}
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: var(--side-bg); }

.header {
  height: var(--header-h);
  flex: none;
  background: var(--side-bg);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 22px;
  z-index: 30;
}
.header .brand-mark { height: 30px; }
/* Mobile-only header controls — hidden on desktop, shown in the <=860px drawer
   mode. Scoped under .header so they beat .icon-btn's display:inline-flex, which
   is defined later in the file. */
.header .nav-toggle { display: none; }
/* The brand logo (teal + dark ink) renders crisp white on the dark top bar. */
.header .header-brand { display: none; height: 26px; width: auto; filter: brightness(0) invert(1); }
.nav-backdrop { display: none; }
.header .search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.header .search input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 14px;
}
.header .search input::placeholder { color: var(--side-muted); }
.header .search input:focus { outline: none; border-color: var(--side-active); background: rgba(255, 255, 255, 0.12); box-shadow: 0 0 0 3px rgba(244,220,52,.18); }

/* Header user block + icon actions (top-right, ArisInfra-style) */
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; flex: none;
}
.icon-btn:hover { background: #fff; color: var(--ink); border-color: var(--border); }
.icon-btn svg { width: 18px; height: 18px; }
.user-block { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 999px; cursor: pointer; }
.user-block:hover { background: var(--surface-2); }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-name { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.user-role { font-size: 11.5px; color: var(--muted); }
@media (max-width: 720px) { .user-meta { display: none; } }
/* Dark top bar: the header controls render light on the anthracite bar. */
.header .icon-btn { background: rgba(255, 255, 255, 0.07); border-color: rgba(255, 255, 255, 0.12); color: var(--side-ink); }
.header .icon-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.header .user-name { color: #fff; }
.header .user-role { color: var(--side-muted); }
.header .user-block:hover { background: rgba(255, 255, 255, 0.08); }
.header .search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--side-muted);
}
.header .spacer { flex: 1; }

/* Notification bell + dropdown panel */
.notif-btn { position: relative; }
.notif-badge {
  position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 0 0 2px var(--side-bg);
}
.notif-panel {
  position: fixed; z-index: 220; width: 360px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border-2); font-weight: 700; font-size: 14px; }
.notif-readall { border: none; background: none; color: var(--brand-700); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.notif-readall:hover { text-decoration: underline; }
.notif-list { max-height: 62vh; overflow-y: auto; }
.notif-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: none; background: none; padding: 11px 14px; cursor: pointer; border-bottom: 1px solid var(--border-2); }
.notif-item:hover { background: var(--surface-2); }
.notif-item:last-child { border-bottom: none; }
.notif-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; background: transparent; }
.notif-item.unread { background: rgba(244, 220, 52, 0.07); }
.notif-item.unread .notif-dot { background: var(--accent-700); }
.notif-tx { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.notif-msg { font-size: 13.5px; color: var(--ink); line-height: 1.35; }
.notif-time { font-size: 11.5px; color: var(--muted); }
.notif-empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }

.user-menu { position: relative; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--side-bg);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar:hover { border-color: var(--accent-600); }

.body { flex: 1; display: flex; min-height: 0; }

/* Dark sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--side-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sidebar-brand {
  flex: none;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
/* Logo is teal + dark ink; render it crisp white on the dark sidebar. */
.sidebar-brand .brand-mark { display: block; width: 72%; height: auto; filter: brightness(0) invert(1); }
.nav-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px 18px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--side-ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}
.nav-item svg { width: 18px; height: 18px; color: var(--side-muted); }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }
.nav-item:hover svg { color: #fff; }
.nav-item.active { background: rgba(244, 220, 52, 0.08); color: var(--side-active); font-weight: 600; }
.nav-item.active svg { color: var(--side-active); }
.nav-sep { height: 1px; background: rgba(255, 255, 255, 0.07); margin: 14px 8px; }
.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--side-muted);
  font-weight: 700;
  padding: 6px 12px;
  margin-top: 6px;
}
.nav-scroll > .nav-label:first-child { margin-top: 0; }
/* Buttons living inside the dark sidebar (upload) */
.sidebar .btn-secondary { background: rgba(255, 255, 255, 0.07); color: #fff; border-color: rgba(255, 255, 255, 0.12); }
.sidebar .btn-secondary:hover { background: rgba(255, 255, 255, 0.12); }
.sidebar .btn-secondary svg { color: #fff; }

.storage-box {
  margin-top: auto;
  padding: 14px 12px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.storage-box .row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--side-muted); margin-bottom: 8px; }
.bar { height: 7px; background: rgba(255, 255, 255, 0.12); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.3s; }

/* Main content — a light, rounded panel inset within the dark frame (sidebar +
   top bar), so the content reads as a card tucked under the dark header. */
.content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--content-grad);
  border-radius: var(--radius-lg);
  margin: 0 12px 12px 0;
}
.toolbar {
  flex: none;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  row-gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-2);
}
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: 15px; flex-wrap: wrap; min-width: 0; }
.breadcrumb .crumb { color: var(--muted); cursor: pointer; padding: 3px 6px; border-radius: 6px; font-weight: 500; }
.breadcrumb .crumb:hover { background: var(--surface-2); color: var(--brand-700); }
.breadcrumb .crumb.current { color: var(--ink); font-weight: 700; cursor: default; }
.breadcrumb .sep { color: var(--muted-2); }
.toolbar .spacer { flex: 1; }

/* Compact filter/sort selects in the files toolbar (fixed width, never grow). */
.tb-select { flex: 0 0 auto; width: 168px; padding: 7px 30px 7px 11px; font-size: 13px; }
.view-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.view-toggle button { border: none; background: var(--surface); padding: 7px 10px; cursor: pointer; color: var(--muted); display: inline-flex; }
.view-toggle button.active { background: var(--side-bg); color: #fff; }
.view-toggle svg { width: 17px; height: 17px; }

.scroll-area { flex: 1; overflow-y: auto; padding: 22px 28px 60px; position: relative; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; margin: 6px 0 14px; }

/* Grid view */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.12s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card .thumb {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.card .thumb svg { width: 26px; height: 26px; }
/* Image/video preview thumbnails (a cover banner inside the card padding) */
.card .thumb.thumb-preview { width: 100%; height: 116px; border-radius: 10px; margin-bottom: 12px; overflow: hidden; position: relative; background: var(--surface-2); }
.card .thumb.thumb-preview img, .card .thumb.thumb-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
/* PDF page thumbnails: show the recognizable top (logo/title) on a white page */
.card .thumb.thumb-preview img.thumb-pdf, .list .cell-name .ic.ic-preview img.thumb-pdf { object-position: top; background: #fff; }
.thumb-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.thumb-play svg { width: 32px; height: 32px; color: #fff; filter: drop-shadow(0 1px 4px rgba(0,0,0,.65)); }
.list .cell-name .ic.ic-preview { overflow: hidden; }
.list .cell-name .ic.ic-preview img, .list .cell-name .ic.ic-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.list .cell-name .ic.ic-preview .thumb-play svg { width: 16px; height: 16px; }
/* File-info modal */
.file-info { display: flex; flex-direction: column; }
.fi-row { display: flex; justify-content: space-between; gap: 18px; padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.fi-row:last-child { border-bottom: 0; }
.fi-k { color: var(--muted); flex: none; }
.fi-v { font-weight: 600; text-align: right; word-break: break-word; }

/* Connect-as-drive (WebDAV) modal */
.drive-connect { font-size: 14px; line-height: 1.5; }
.drive-url-row { display: flex; gap: 8px; align-items: center; margin: 14px 0 6px; }
.drive-url-row .input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.drive-url-row .btn { flex: none; }
.drive-steps { margin: 12px 0 6px; padding-left: 20px; }
.drive-steps li { margin: 7px 0; }
.drive-steps code.drive-url, .drive-connect code.drive-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--brand-050, #fbf6cf); color: var(--brand-700, #b89500); padding: 1px 6px; border-radius: 6px; font-size: 12.5px; word-break: break-all; }
.drive-note { color: var(--muted); font-size: 12.5px; margin-top: 10px; }

/* Trash (Papierkorb) modal */
.trash-list { display: flex; flex-direction: column; gap: 2px; max-height: 60vh; overflow: auto; }
.trash-row { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.trash-row:last-child { border-bottom: 0; }
.trash-ic { flex: none; display: inline-flex; color: var(--muted); }
.trash-name { font-weight: 600; flex: 1; min-width: 0; word-break: break-word; }
.trash-meta { color: var(--muted); font-size: 12px; flex: none; white-space: nowrap; }
.trash-row .btn { flex: none; }
.trash-empty { color: var(--muted); text-align: center; padding: 28px 0; }
.card .name { font-size: 14px; font-weight: 600; word-break: break-word; line-height: 1.35; margin-bottom: 4px; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .kebab { position: absolute; top: 10px; right: 8px; opacity: 0; }
.card:hover .kebab { opacity: 1; }
.card .badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-700);
  background: var(--brand-050);
  padding: 2px 7px;
  border-radius: 999px;
  margin-top: 8px;
}

/* List view — a floating frosted card */
.list {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.list th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.35);
  border-bottom: 1px solid var(--border-2);
}
.list td { padding: 13px 16px; border-bottom: 1px solid var(--border-2); font-size: 14px; vertical-align: middle; }
.list tbody tr:last-child td { border-bottom: none; }
.list tr { cursor: pointer; }
.list tbody tr:hover { background: rgba(255, 255, 255, 0.5); }
.list .cell-name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.list .cell-name .ic { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.list .cell-name .ic svg { width: 19px; height: 19px; }
.list .col-actions { text-align: right; width: 50px; }
.list td.muted { color: var(--muted); }

/* Drop overlay */
.dropzone-overlay {
  position: absolute;
  inset: 12px;
  border: 2.5px dashed var(--brand);
  border-radius: var(--radius-lg);
  background: rgba(0, 166, 166, 0.06);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--brand-700);
  font-size: 18px;
  font-weight: 700;
  z-index: 20;
  pointer-events: none;
}
.dropzone-overlay svg { width: 48px; height: 48px; }
.scroll-area.dragging .dropzone-overlay { display: flex; }

/* Empty state */
.empty { text-align: center; color: var(--muted); padding: 70px 20px; }
.empty svg { width: 60px; height: 60px; color: var(--border); margin-bottom: 14px; }
.empty h3 { color: var(--ink-2); margin: 0 0 6px; font-size: 17px; }
.empty p { margin: 0; font-size: 14px; }

/* File type colors */
.t-folder { background: #fff3d6; color: #c98a16; }
.t-doc { background: #e4eefc; color: #2c6ecb; }
.t-image { background: #e9f3ec; color: #2f9e63; }
.t-pdf { background: #fdeaea; color: #d8463a; }
.t-video { background: #efeafb; color: #7a4ed1; }
.t-audio { background: #fceef6; color: #c44b8f; }
.t-archive { background: #efece6; color: #8a7b5e; }
.t-code { background: var(--brand-050); color: var(--brand-700); }
.t-default { background: #eef2f2; color: var(--muted); }

/* ----------------------------- Dropdown menu ----------------------------- */
.menu {
  position: fixed;
  z-index: 200;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 184px;
}
.menu button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 11px;
  border: none;
  background: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: left;
}
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--danger); }
.menu button.danger:hover { background: var(--danger-bg); }
.menu button svg { width: 16px; height: 16px; color: var(--muted); }
.menu button.danger svg { color: var(--danger); }
.menu .sep { height: 1px; background: var(--border-2); margin: 5px 4px; }

/* ----------------------------- Modal ------------------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 25, 42, 0.44);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 24px;
  -webkit-backdrop-filter: blur(11px);
  backdrop-filter: blur(11px);
}
/* Frosted-glass popup: a translucent warm pane with a strong blur, a bright
   glass edge (light border + inset top highlight) and deep soft shadow. */
.modal {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.82) 0%, rgba(249, 248, 243, 0.66) 100%);
  -webkit-backdrop-filter: blur(42px) saturate(185%);
  backdrop-filter: blur(42px) saturate(185%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 26px;
  box-shadow: 0 34px 90px rgba(16, 20, 38, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.16s cubic-bezier(.2, .8, .2, 1);
}
.modal.wide { max-width: 760px; }
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(120, 120, 130, 0.12);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot {
  padding: 16px 24px;
  border-top: 1px solid rgba(120, 120, 130, 0.12);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.22);
}

/* Editor modal */
.editor-modal { max-width: 920px; width: 100%; height: 86vh; max-height: 86vh; }
.editor-area {
  flex: 1;
  width: 100%;
  border: none;
  resize: none;
  padding: 20px 24px;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  outline: none;
}
.editor-status { font-size: 13px; color: var(--muted); margin-right: auto; }

/* Preview modal */
.preview-body { padding: 0; background: #1b2423; display: flex; align-items: center; justify-content: center; min-height: 320px; }
.preview-body img, .preview-body video { max-width: 100%; max-height: 78vh; display: block; }
.preview-body iframe { width: 100%; height: 78vh; border: none; background: #fff; }

/* Share rows */
.share-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-2);
}
.share-row .who { flex: 1; min-width: 0; }
.share-row .who .n { font-size: 14px; font-weight: 600; }
.share-row .who .e { font-size: 12.5px; color: var(--muted); }
/* Colleague picker row (select colleague + permission + share button). */
.share-pick { display: flex; gap: 8px; margin-bottom: 14px; }
.share-pick #shUser { flex: 1; min-width: 0; }
.share-pick #shPerm { width: 130px; flex: none; }
.share-pick .btn { flex: none; }
@media (max-width: 560px) {
  .share-pick { flex-wrap: wrap; }
  .share-pick #shUser { flex: 1 1 100%; }
  .share-pick #shPerm { flex: 1; width: auto; }
}
.link-box {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.link-box input { flex: 1; font-size: 13px; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--radius-sm); margin-bottom: 18px; }
.tabs button { flex: 1; border: none; background: none; padding: 8px; border-radius: 6px; font-size: 13.5px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs button.active { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }

.pill {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.pill.admin { background: var(--brand-050); color: var(--brand-700); }
.pill.user { background: var(--surface-2); color: var(--muted); }
.pill.on { background: #e7f6ee; color: var(--success); }
.pill.off { background: var(--danger-bg); color: var(--danger); }
.pill.view { background: #eef2f2; color: var(--muted); }
.pill.edit { background: var(--brand-050); color: var(--brand-700); }

/* ----------------------------- Toasts ------------------------------------ */
.toasts { position: fixed; bottom: 22px; right: 22px; z-index: 300; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--ink);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slidein 0.2s ease-out;
  max-width: 360px;
}
.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }
.toast svg { width: 18px; height: 18px; flex: none; }
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Upload progress tray */
.upload-tray {
  position: fixed;
  bottom: 22px;
  left: 22px;
  width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 280;
  overflow: hidden;
}
.upload-tray .head { padding: 12px 16px; font-weight: 700; font-size: 14px; border-bottom: 1px solid var(--border-2); display: flex; justify-content: space-between; }
.upload-tray .item { padding: 10px 16px; font-size: 13px; }
.upload-tray .item .n { display: flex; justify-content: space-between; margin-bottom: 6px; }
.upload-tray .item .n .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 210px; }

/* Tables for admin */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 12px 10px; border-bottom: 1px solid var(--border-2); font-size: 14px; }

/* Loading skeleton */
.loading { display: flex; align-items: center; justify-content: center; padding: 60px; color: var(--muted); gap: 10px; }

/* Public share page */
.share-page { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.share-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}
.share-card .top { background: linear-gradient(150deg, var(--brand-700), var(--brand)); padding: 28px; text-align: center; }
.share-card .top .brand-mark { height: 34px; filter: brightness(0); }
.share-card .inner { padding: 28px; text-align: center; }
.share-card .file-ic { width: 64px; height: 64px; border-radius: 14px; margin: 0 auto 16px; display: flex; align-items: center; justify-content: center; }
.share-card .file-ic svg { width: 34px; height: 34px; }
.share-card h2 { margin: 0 0 4px; font-size: 19px; word-break: break-word; }
.share-card .sz { color: var(--muted); font-size: 14px; margin-bottom: 22px; }
/* Public folder-link browser */
.pub-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; font-size: 13px; margin-bottom: 14px; }
.pub-crumb { border: none; background: none; color: var(--brand-700); font-weight: 600; cursor: pointer; padding: 3px 5px; border-radius: 6px; font-family: inherit; }
.pub-crumb:hover { background: var(--surface-2); }
.pub-crumb.current { color: var(--ink); cursor: default; }
.pub-breadcrumb .sep { color: var(--muted-2); }
.pub-list { display: flex; flex-direction: column; text-align: left; border: 1px solid var(--border-2); border-radius: var(--radius-sm); overflow: hidden; }
.pub-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border-2); background: none; border-left: none; border-right: none; border-top: none; width: 100%; text-align: left; font: inherit; cursor: default; }
.pub-row:last-child { border-bottom: none; }
.pub-row .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.pub-row .sz { margin: 0; font-size: 12.5px; color: var(--muted); flex: none; }
.pub-row .ic { flex: none; display: inline-flex; color: var(--muted); }
.pub-row svg { width: 18px; height: 18px; }
button.pub-row { cursor: pointer; }
button.pub-row:hover { background: var(--surface-2); }

/* ----------------------------- Business suite ---------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; }
.kpi {
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 20px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow);
  transition: box-shadow 0.2s, transform 0.12s;
}
.kpi-link { cursor: pointer; }
.kpi-link:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.dash-cols { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 1024px) { .dash-cols { grid-template-columns: 1fr; gap: 20px; } }
.overdue { color: var(--danger); font-weight: 600; }
.kpi-ic { width: 48px; height: 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; flex: none; }
.kpi-ic svg { width: 22px; height: 22px; }
.kpi-val { font-size: 24px; font-weight: 700; line-height: 1.1; }
.kpi-label { font-size: 13px; color: var(--muted); margin-top: 3px; }

/* ----------------------------- Dashboard (ArisInfra-style) --------------- */
.greeting { margin: 2px 0 22px; }
.greeting h1 { font-size: 26px; margin: 0 0 4px; font-weight: 500; }
.greeting h1 b { font-weight: 800; }
.greeting .sub { color: var(--muted); font-size: 14px; margin: 0; }

/* Dashboard quick-access: my tickets / recent files / recent projects */
.dash-quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; align-items: stretch; }
@media (max-width: 1080px) { .dash-quick { grid-template-columns: 1fr; } }
.dash-quick .panel { padding: 16px 16px 10px; }
.dash-quick .panel-head { margin-bottom: 10px; }
.qa-list { display: flex; flex-direction: column; }
.qa-item { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: 0; border-radius: 9px; padding: 9px 8px; cursor: pointer; color: var(--ink); transition: background .12s; }
.qa-item:hover { background: var(--brand-050); }
.qa-item svg { width: 19px; height: 19px; flex: none; color: var(--brand-700); }
.qa-tx { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.qa-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-sub { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Hero KPI cards: sparkline + trend delta + big value */
.kpi-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(208px, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-hero { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .12s; }
.kpi-hero.kpi-link { cursor: pointer; }
.kpi-hero.kpi-link:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.kpi-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.spark { width: 96px; height: 34px; display: block; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 700; }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
.delta.flat { color: var(--muted-2); }
.delta svg { width: 13px; height: 13px; }
.kpi-hero-val { font-size: 23px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; font-feature-settings: 'tnum' 1; }
.kpi-hero-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* Quick-stat shortcut chips */
.qstat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 26px; }
.qstat { display: flex; align-items: center; gap: 11px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 12px 14px; cursor: pointer; transition: box-shadow .15s, transform .12s; }
.qstat:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.qstat-ic { width: 38px; height: 38px; border-radius: 11px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--brand-700); }
.qstat-ic svg { width: 18px; height: 18px; }
.qstat-tx { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.qstat-val { font-size: 17px; font-weight: 800; font-feature-settings: 'tnum' 1; }
.qstat-label { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qstat.warn .qstat-ic { background: var(--danger-bg); color: var(--danger); }

/* Chart + data panels */
.chart-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; margin-bottom: 24px; align-items: stretch; }
@media (max-width: 1080px) { .chart-row { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }

/* ---- Frosted-glass cards (Crextio look): translucent warm surfaces with a soft
   blur + light edge, floating on the cream content gradient. Placed after every
   card class so it overrides their flat-white backgrounds. ------------------- */
.card, .kpi-hero, .qstat, .panel {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  backdrop-filter: blur(20px) saturate(135%);
}
.card, .kpi-hero, .panel { border-radius: 20px; }
.card:hover, .kpi-hero.kpi-link:hover, .qstat:hover { box-shadow: 0 16px 40px rgba(132, 110, 28, 0.16); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.panel-link { font-size: 13px; font-weight: 600; color: var(--brand-700); cursor: pointer; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-axis { fill: var(--muted-2); font-size: 10px; font-family: var(--font); }
.chart-gridline { stroke: var(--border-2); stroke-width: 1; }

.dash-panels { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; align-items: stretch; }
@media (max-width: 1080px) { .dash-panels { grid-template-columns: 1fr; } }
.panel .list { margin: 0; }
.panel .list th:first-child, .panel .list td:first-child { padding-left: 4px; }
.panel .list th:last-child, .panel .list td:last-child { padding-right: 4px; }

/* Receivables / upcoming avatar list */
.recv-item { display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--border-2); cursor: pointer; width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; }
.recv-item:last-child { border-bottom: none; }
.recv-item:hover { background: var(--surface-2); }
.recv-av { width: 38px; height: 38px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; background: var(--accent); color: #1b1b1b; font-weight: 800; font-size: 13px; overflow: hidden; }
.recv-av.src-deadline { background: var(--danger-bg); color: var(--danger); }
.recv-av svg { width: 17px; height: 17px; }
.recv-av img { width: 100%; height: 100%; object-fit: cover; }
.recv-tx { flex: 1; min-width: 0; }
.recv-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recv-sub { font-size: 12px; color: var(--muted); }
.recv-sub.overdue { color: var(--danger); font-weight: 600; }
.recv-amt { font-size: 12px; font-weight: 700; flex: none; color: var(--muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 14px; }
.form-grid .span2, .form-grid3 .span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid, .form-grid3 { grid-template-columns: 1fr; } }

.input.sm, .select.sm { padding: 6px 8px; font-size: 13px; box-shadow: none; }
table.inv-items th { font-size: 11px; padding: 6px; }
table.inv-items td { padding: 5px 6px; border-bottom: 1px solid var(--border-2); }

.inv-totals { display: flex; flex-direction: column; gap: 2px; }
.tot-row { display: flex; justify-content: space-between; gap: 24px; font-size: 14px; padding: 5px 0; }
.tot-row.grand { border-top: 2px solid var(--border); margin-top: 4px; padding-top: 9px; font-size: 17px; font-weight: 800; color: var(--brand-700); }

/* Printable invoice */
.invoice-sheet {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 44px; max-width: 820px; color: var(--ink);
}
.inv-head { display: flex; justify-content: space-between; gap: 30px; margin-bottom: 26px; }
.inv-sender { font-size: 10px; color: var(--muted); border-bottom: 1px solid var(--border-2); padding-bottom: 5px; margin-bottom: 16px; }
.inv-to { font-size: 14px; line-height: 1.55; }
.inv-company { font-size: 12px; color: var(--ink-2); line-height: 1.6; text-align: right; white-space: nowrap; }
.inv-company-name { font-weight: 800; font-size: 16px; color: var(--brand-700); margin-bottom: 4px; }
.inv-title { font-size: 22px; margin: 6px 0 16px; }
.inv-meta { display: flex; gap: 28px; flex-wrap: wrap; font-size: 13.5px; margin-bottom: 22px; }
.inv-meta span { color: var(--muted); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; }
table.inv-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.inv-table th { font-size: 11px; text-transform: uppercase; color: var(--muted); text-align: left; border-bottom: 2px solid var(--border); padding: 8px 6px; }
.inv-table td { padding: 9px 6px; border-bottom: 1px solid var(--border-2); font-size: 14px; vertical-align: top; }
.inv-table .r { text-align: right; }
.invoice-sheet .inv-totals { max-width: 320px; margin-left: auto; }
.inv-notes { margin-top: 16px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; }
.inv-footer { margin-top: 30px; border-top: 1px solid var(--border-2); padding-top: 12px; font-size: 11.5px; color: var(--muted); white-space: pre-wrap; }

/* Tasks (Aufgaben) checklist */
.task-list { display: flex; flex-direction: column; gap: 7px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.task-row input[type="checkbox"] { width: 18px; height: 18px; flex: none; cursor: pointer; accent-color: var(--brand); }
.task-main { flex: 1; min-width: 0; cursor: pointer; }
.task-title { font-weight: 600; }
.task-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-meta .overdue { color: var(--danger); font-weight: 700; }

/* ============================= Mobile / tablet ============================
   Below 860px the fixed dark sidebar becomes an off-canvas drawer opened by a
   hamburger in the header, the app card goes full-bleed, and dense layouts
   (toolbars, modals, tables, calendar) reflow for touch. */
@media (max-width: 860px) {
  /* App card fills the screen — no floating margin/radius on small screens. */
  .app.show { margin: 0; height: 100%; border-radius: 0; }

  /* Sidebar slides in from the left as a drawer above the content. */
  .sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 272px; max-width: 82vw;
    z-index: 120;
    transform: translateX(-100%);
    transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: translateX(0); }

  /* Dimmed backdrop behind the open drawer; tap to close. */
  .nav-backdrop {
    display: block;
    position: fixed; inset: 0;
    z-index: 110;
    background: rgba(15, 17, 22, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.26s ease;
  }
  .app.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  /* Header: hamburger + compact brand replace the (now hidden) sidebar logo. */
  .header .nav-toggle { display: inline-flex; }
  .header .header-brand { display: block; }
  .header { gap: 10px; padding: 0 14px; }
  .header .search { display: none; }
  .header .spacer { flex: 1; }

  /* Content fills the width on phones; only the top corners round under the bar. */
  .content { margin: 0; border-radius: var(--radius) var(--radius) 0 0; }

  /* Tighter chrome + let action rows wrap instead of overflowing. */
  .toolbar { padding: 12px 16px; flex-wrap: wrap; gap: 10px; row-gap: 12px; }
  .scroll-area { padding: 16px 16px 56px; }

  /* Modals go near-full-screen with breathing room and wrapping footers. */
  .overlay { padding: 12px; }
  .modal, .modal.wide { max-width: 100%; max-height: 92vh; }
  .modal-head, .modal-body, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .modal-foot { flex-wrap: wrap; }
  .editor-modal { height: 92vh; max-height: 92vh; }

  /* Wide tables scroll horizontally rather than breaking the layout. */
  .admin-table { display: block; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }
  .invoice-sheet { padding: 22px 16px; }
}

/* Phones: single-column grids, larger touch targets, denser calendar. */
@media (max-width: 560px) {
  .scroll-area { padding: 14px 12px 52px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .kpi-grid, .kpi-hero-grid, .qstat-grid, .tk-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid3 { grid-template-columns: 1fr; }
  .modal-foot .btn { flex: 1; justify-content: center; }
  /* Calendar grid stays 7-wide but shrinks to fit a phone. */
  .cal-day-label { font-size: 10px; }
  .cal-daynum { font-size: 12px; }
  .cal-cell { min-height: 76px; padding: 3px 4px 5px; }
}

/* When printing, show only the invoice sheet. */
@media print {
  .header, .sidebar, .toolbar, .no-print, .toasts, #menuRoot, #modalRoot, #searchResults { display: none !important; }
  html, body, .app, .app.show, .body, .content, .scroll-area, #mainView {
    display: block !important; height: auto !important; overflow: visible !important; background: #fff !important;
  }
  .scroll-area { padding: 0 !important; }
  .invoice-sheet { border: none !important; max-width: none !important; padding: 0 !important; border-radius: 0 !important; }
  .pill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* --------------------------- Global search dropdown --------------------- */
.search-results {
  position: fixed;
  z-index: 220;
  max-height: 64vh;
  overflow-y: auto;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: 6px;
}
.sr-group { padding: 2px 0 4px; }
.sr-group + .sr-group { border-top: 1px solid var(--border-2); margin-top: 2px; }
.sr-group-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted-2); padding: 7px 10px 3px;
}
.sr-item {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 8px 10px; border: none; background: none; border-radius: var(--radius-sm);
  cursor: pointer; color: var(--ink-2);
}
.sr-item:hover, .sr-item:focus { background: var(--surface-2); outline: none; }
.sr-ic { flex: none; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--accent-700); }
.sr-ic svg { width: 18px; height: 18px; }
.sr-tx { display: flex; flex-direction: column; min-width: 0; }
.sr-ti { font-size: 13.5px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-su { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-empty { padding: 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* --------------------------- Calendar ----------------------------------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.seg-btn { border: none; background: var(--surface); color: var(--ink-2); font-size: 13px; padding: 6px 14px; cursor: pointer; }
.seg-btn.active { background: var(--brand); color: var(--side-bg); }
.cal-grid { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); }
.cal-head > div { padding: 9px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted-2); text-align: left; }
.cal-body { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell { min-height: 104px; border-top: 1px solid var(--border-2); border-left: 1px solid var(--border-2); padding: 5px 6px 7px; cursor: pointer; overflow: hidden; }
.cal-cell:nth-child(7n+1) { border-left: none; }
.cal-cell:hover { background: var(--surface-2); }
.cal-out { background: var(--surface-2); color: var(--muted-2); }
.cal-out .cal-daynum { color: var(--muted-2); }
.cal-today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-daynum { font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 4px; }
.cal-ev { display: block; width: 100%; text-align: left; border: none; border-radius: 6px; padding: 2px 7px; margin-bottom: 3px; font-size: 11.5px; line-height: 1.45; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.cal-ev b { font-weight: 700; opacity: 0.85; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 2px; }
/* Source colours (chips + list dots) */
.src-event   { background: var(--brand); }   .cal-list-item.src-event   .cal-dot { background: var(--brand); }
.src-invoice { background: #2f7fd6; }         .cal-list-item.src-invoice .cal-dot { background: #2f7fd6; }
.src-task    { background: var(--warning); }  .cal-list-item.src-task    .cal-dot { background: var(--warning); }
.src-contract{ background: #7c5cbf; }         .cal-list-item.src-contract.cal-dot,.cal-list-item.src-contract .cal-dot { background: #7c5cbf; }
.src-dunning { background: var(--danger); }   .cal-list-item.src-dunning .cal-dot { background: var(--danger); }
/* List view */
.cal-listview { max-width: 720px; }
.cal-day-group { margin-bottom: 18px; }
.cal-day-label { font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; padding: 0 2px 8px; }
.cal-day-label.is-today { color: var(--brand-700); }
.cal-list-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 7px; cursor: pointer; color: var(--ink); }
.cal-list-item:hover { border-color: var(--brand); background: var(--surface-2); }
.cal-list-item .cal-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.cal-li-tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cal-li-ti { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-li-su { font-size: 12.5px; color: var(--muted); }
.cal-li-src { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-2); }

/* --------------------------- Custom select ------------------------------ */
.cs { position: relative; display: block; width: 100%; }
.cs-native { display: none !important; }
.cs-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-height: 40px; padding: 9px 12px;
  font-family: inherit; font-size: 14px; color: var(--ink); text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s;
}
.cs-btn:hover { border-color: var(--muted-2); }
.cs-btn:disabled { opacity: 0.55; cursor: not-allowed; background: var(--surface-2); }
.cs.open .cs-btn { border-color: var(--accent-600); box-shadow: 0 0 0 3px rgba(244, 220, 52, 0.25); }
.cs-btn::after {
  content: ''; flex: none; width: 8px; height: 8px; margin-right: 2px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translate(-1px, -2px); transition: transform 0.15s;
}
.cs.open .cs-btn::after { transform: rotate(-135deg) translate(-2px, -1px); border-color: var(--accent-700); }
.cs-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-menu {
  position: fixed; z-index: 240; max-height: 300px; overflow-y: auto;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px;
}
.cs-opt {
  display: block; width: 100%; text-align: left; padding: 8px 11px;
  font-family: inherit; font-size: 14px; color: var(--ink-2);
  background: none; border: none; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap;
}
.cs-opt:hover { background: var(--surface-2); }
.cs-opt.sel { background: rgba(244, 220, 52, 0.22); color: var(--ink); font-weight: 600; }

/* Project credentials */
.cred-row { display: flex; align-items: flex-start; gap: 8px; padding: 12px 2px; border-bottom: 1px solid var(--border-2); }
.cred-row:last-child { border-bottom: none; }
.cred-row code { color: var(--ink-2); }

/* --------------------------- Ticket tiles ------------------------------- */
.tk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.tk-card {
  display: flex; flex-direction: column; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  padding: 18px; border-radius: var(--radius);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid var(--glass-border); border-left: 4px solid var(--muted-2);
  box-shadow: var(--shadow); transition: box-shadow 0.2s, transform 0.12s;
}
.tk-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tk-card.prio-urgent { border-left-color: var(--danger); }
.tk-card.prio-high { border-left-color: var(--warning); }
.tk-card.prio-normal { border-left-color: var(--brand); }
.tk-card.prio-low { border-left-color: var(--muted-2); }
.tk-card.is-closed { opacity: 0.66; }
.tk-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tk-num { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.tk-card-title { font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.7em; }
.tk-card-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tk-tag { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font-size: 12px; color: var(--ink-2); background: var(--surface-2); padding: 3px 9px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-tag svg { width: 13px; height: 13px; flex: none; color: var(--muted); }
.tk-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--border-2); font-size: 12px; color: var(--muted); }
.tk-assignee { font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-date { flex: none; }

/* --------------------------- Project team + chat ------------------------ */
.member-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 999px; padding: 3px 8px 3px 4px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.member-chip .avatar { flex: none; cursor: default; border-width: 0; }
.member-x { display: inline-flex; align-items: center; justify-content: center; border: none; background: none; cursor: pointer; color: var(--muted); padding: 2px; border-radius: 50%; }
.member-x:hover { color: var(--danger); background: var(--danger-bg); }
.member-x svg { width: 13px; height: 13px; }

.chat { height: 360px; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, #faf9f5 0%, #f1efe8 100%); }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 82%; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg-av { cursor: default; border-width: 0; }
.msg-bubble { background: #fff; border: 1px solid var(--border-2); border-radius: 14px; padding: 8px 12px; box-shadow: var(--shadow); }
.msg.mine .msg-bubble { background: var(--accent); color: var(--side-bg); border-color: transparent; }
.msg-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.msg.mine .msg-meta { color: rgba(0, 0, 0, 0.55); }
.msg-body { font-size: 14px; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
.chat-input { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--glass-border); background: rgba(255, 255, 255, 0.5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }

/* Generated-prompt box: a dark frosted "code panel" — light monospace on smoky
   glass, a striking accent against the bright frosted modal (Crextio-style dark
   card). Selector is .input.pmpt-box so it beats the base .input styling. */
.input.pmpt-box {
  background: linear-gradient(160deg, rgba(33, 36, 47, 0.92) 0%, rgba(19, 21, 28, 0.90) 100%);
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 10px 26px rgba(10, 12, 20, 0.20);
  color: #eceae2;
  padding: 16px 18px;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.input.pmpt-box:focus { border-color: rgba(244, 220, 52, 0.45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 0 0 3px rgba(244, 220, 52, 0.16); }
.input.pmpt-box::selection { background: rgba(244, 220, 52, 0.30); }
.chat-input textarea { flex: 1; resize: none; min-height: 40px; max-height: 120px; }
.chat-join { padding: 28px; text-align: center; }

/* Project detail: main sections on the left, a free-standing sticky chat on the
   right (desktop). Collapses to a single column below 1000px. */
.pd-wrap { max-width: 1180px; }
.pd-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.pd-main { min-width: 0; }
.pd-side { min-width: 0; }
.pd-side .chat { height: 340px; }

/* Project checklist — quick check-off items */
.checklist { display: flex; flex-direction: column; }
.cl-item { display: flex; align-items: center; gap: 10px; padding: 7px 2px; }
.cl-item + .cl-item { border-top: 1px solid var(--border-2); }
.cl-check { width: 20px; height: 20px; flex: none; border: 2px solid var(--muted-2); border-radius: 6px; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--side-bg); padding: 0; transition: background .12s, border-color .12s; }
.cl-check:hover { border-color: var(--brand-700); }
.cl-item.done .cl-check { background: var(--brand); border-color: var(--brand); }
.cl-check svg { width: 13px; height: 13px; }
.cl-text { flex: 1; font-size: 14px; min-width: 0; word-break: break-word; }
.cl-item.done .cl-text { text-decoration: line-through; color: var(--muted); }
.cl-del { opacity: 0; flex: none; }
.cl-item:hover .cl-del { opacity: 1; }
.cl-add { display: flex; gap: 8px; margin-top: 12px; }
.cl-add input { flex: 1; }
/* Labelled project-data rows in the right panel. */
.pd-meta { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.pd-meta-row { display: flex; gap: 10px; font-size: 13px; line-height: 1.4; }
.pd-meta-k { flex: none; width: 82px; color: var(--muted); font-weight: 600; }
.pd-meta-v { flex: 1; min-width: 0; color: var(--ink); }
@media (max-width: 1000px) {
  .pd-grid { display: flex; flex-direction: column; }
  .pd-side { order: -1; } /* on mobile, show project data + chat above the work areas */
}

/* --------------------------- People colors (Termine & Team-Aufgaben) ----
 * Every user gets a stable color (derived from their id in app.js). Dots mark
 * events in the calendar grid; chips show names on lists and the dashboard. */
.att-dots { display: inline-flex; align-items: center; gap: 3px; vertical-align: middle; }
.att-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.cal-ev .att-dots { margin-right: 4px; }
.cal-ev .att-dot { width: 7px; height: 7px; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.75); }
.att-more { font-size: 10px; font-weight: 700; color: var(--muted); }
.cal-ev .att-more { color: rgba(255, 255, 255, 0.9); }
.att-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; color: var(--ink-2); line-height: 1.5; }
.att-chip::before { content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--att, var(--muted-2)); }
.att-chip.done { color: var(--muted); text-decoration: line-through; background: var(--surface-2); }
.cal-li-att { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }

/* Toggleable people picker (event form + team to-do widget) */
.att-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.att-opt { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: border-color .12s, background .12s, box-shadow .12s; }
.att-opt .att-dot { background: var(--att, var(--muted-2)); opacity: 0.45; transition: opacity .12s; }
.att-opt:hover { border-color: var(--brand); }
.att-opt.on { border-color: var(--att, var(--brand)); box-shadow: inset 0 0 0 1px var(--att, var(--brand)); color: var(--ink); }
.att-opt.on .att-dot { opacity: 1; }

/* --------------------------- Team to-dos (dashboard) -------------------- */
.todo-add { display: flex; gap: 8px; margin-bottom: 10px; }
.todo-add .input { flex: 1; }
.todo-pick { margin-bottom: 6px; }
.todo-pick .att-opt { padding: 3px 10px; font-size: 12px; }
.todo-list { display: flex; flex-direction: column; }
.todo-row { display: flex; align-items: flex-start; gap: 11px; padding: 11px 2px; border-bottom: 1px solid var(--border-2); }
.todo-row:last-child { border-bottom: none; }
.todo-row input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin-top: 2px; cursor: pointer; accent-color: var(--brand); }
.todo-row input[type="checkbox"]:disabled { cursor: default; opacity: 0.4; }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 14px; font-weight: 600; word-break: break-word; }
.todo-row.all-done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 5px; }
.todo-progress { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-right: 4px; }
.todo-progress.done { color: var(--up); }
.todo-row .btn-icon { opacity: 0; }
.todo-row:hover .btn-icon { opacity: 1; }

/* --------------------------- Dashboard upcoming (Termine) ---------------
 * Calendar-leaf date badge + source accent; replaces the old plain rows. */
.upc-list { display: flex; flex-direction: column; }
.u-src-event    { --srcc: var(--brand-700); }
.u-src-invoice  { --srcc: #2f7fd6; }
.u-src-task     { --srcc: var(--warning); }
.u-src-contract { --srcc: #7c5cbf; }
.u-src-dunning  { --srcc: var(--danger); }
.u-src-deadline { --srcc: var(--danger); }
.upc-item { display: flex; align-items: center; gap: 13px; width: 100%; text-align: left; background: none; border: none; border-bottom: 1px solid var(--border-2); padding: 10px 4px; cursor: pointer; border-radius: 10px; }
.upc-item:last-child { border-bottom: none; }
.upc-item:hover { background: var(--surface-2); }
.upc-date { flex: none; width: 52px; display: flex; flex-direction: column; align-items: center; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--srcc, var(--brand)); border-radius: 10px; padding: 4px 0 5px; box-shadow: var(--shadow-sm); }
.upc-dow { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--srcc, var(--muted)); }
.upc-day { font-size: 19px; font-weight: 800; line-height: 1.15; font-feature-settings: 'tnum' 1; color: var(--ink); }
.upc-mon { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.upc-date.is-today { background: var(--brand-050); border-color: var(--brand); }
.upc-item.is-overdue .upc-date { border-top-color: var(--danger); }
.upc-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.upc-name { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upc-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.upc-sub .overdue { color: var(--danger); font-weight: 700; font-style: normal; }
.upc-att { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.upc-kind { flex: none; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--muted-2); }
.upc-kind i { width: 8px; height: 8px; border-radius: 50%; background: var(--srcc, var(--muted-2)); }
@media (max-width: 640px) {
  .upc-kind { display: none; }
}

/* Sortable table headers (projects list): click to sort, arrow shows direction */
.list th.sortable { cursor: pointer; user-select: none; white-space: nowrap; transition: color .12s; }
.list th.sortable:hover { color: var(--ink); }
.list th.sortable.sorted { color: var(--brand-700); }
.list th .sort-arrow { display: inline-block; width: 12px; font-size: 8px; margin-left: 3px; vertical-align: 1px; }

/* --------------------------- Customizable dashboard grid ----------------
 * 6-column grid; each tile spans 2/3/4/6 columns (set via dt-span-*). The
 * "Anpassen" edit mode adds iOS-style wiggle, drag-reorder, resize and hide. */
.dash-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 18px; align-items: stretch; }
.dash-tile { position: relative; min-width: 0; }
.dt-span-2 { grid-column: span 2; }
.dt-span-3 { grid-column: span 3; }
.dt-span-4 { grid-column: span 4; }
.dt-span-6 { grid-column: span 6; }
.dt-content { height: 100%; min-width: 0; }
.dt-content > .panel { height: 100%; }
.dt-content > .kpi-hero-grid, .dt-content > .qstat-grid { margin-bottom: 0; height: 100%; align-content: start; }
@media (max-width: 1080px) {
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid > .dash-tile { grid-column: 1 / -1; }
}
/* Edit mode */
.dash-grid.editing .dash-tile { cursor: grab; }
.dash-tile.editing > *:not(.dt-tools) { pointer-events: none; }
@keyframes dt-wiggle { from { transform: rotate(-0.25deg); } to { transform: rotate(0.25deg); } }
.dash-grid.editing .dash-tile { animation: dt-wiggle .3s ease-in-out infinite alternate; }
.dash-tile.dragging { opacity: 0.45; }
.dash-tile.drag-over { outline: 2px dashed var(--brand-700); outline-offset: 4px; border-radius: 22px; }
.dt-tools { position: absolute; top: -9px; right: -7px; z-index: 5; display: flex; gap: 6px; }
.dt-tool { width: 27px; height: 27px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; font-size: 13px; font-weight: 700; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; padding: 0; line-height: 1; }
.dt-tool:hover { border-color: var(--brand); color: var(--ink); }
.dt-x { font-size: 16px; }
.dash-hidden { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; padding: 13px 16px; border: 1.5px dashed var(--border); border-radius: 16px; }
.dash-hidden-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px; }

/* Event location: small map pin + city (dashboard) / address (calendar list) */
.upc-loc { display: inline-flex; align-items: center; gap: 3px; }
.upc-loc svg { width: 11px; height: 11px; flex: none; color: var(--brand-700); }

/* RSVP (Zu-/Absagen) on calendar events */
.rsvp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 12px; margin-bottom: 16px; }
.rsvp-label { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-right: 2px; }
.att-chip.acc { color: var(--up); border-color: rgba(24, 153, 106, 0.45); }
.att-chip.dec { color: var(--muted); border-color: var(--border); opacity: 0.75; text-decoration: line-through; }
.att-opt.att-all { border-style: dashed; color: var(--muted); }
.att-opt.att-all:hover { color: var(--ink); }
