/* ===========================================================================
   PelycanDesk — design system
   Brand: Pelycan teal (#00a6a6). Clean, minimal, corporate.
   =========================================================================== */

:root {
  --brand: #00a6a6;
  --brand-600: #009393;
  --brand-700: #007d7d;
  --brand-050: #e8f7f7;
  --brand-100: #d3efef;

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

  --bg: #eef3f3;
  --surface: #ffffff;
  --surface-2: #f3f7f7;
  --border: #c3d2d1;
  --border-2: #d6e0df;

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

  --shadow-sm: 0 1px 2px rgba(16, 40, 39, 0.06);
  --shadow: 0 4px 16px rgba(16, 40, 39, 0.08);
  --shadow-lg: 0 18px 48px rgba(16, 40, 39, 0.18);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", sans-serif;

  --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(--bg);
  -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); }

.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; }

.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-600); }
.btn-primary:focus-visible { outline: 3px solid var(--brand-100); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: #aabdbc;
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-050); }

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

.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(--brand-050); color: var(--brand-700); }

/* ----------------------------- 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; }

/* ----------------------------- Auth screen ------------------------------- */
.auth {
  min-height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-aside {
  background: linear-gradient(150deg, var(--brand-700), var(--brand) 70%, var(--brand-600));
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-aside::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.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%; flex-direction: column; }
.app.show { display: flex; }

.header {
  height: var(--header-h);
  flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  z-index: 30;
}
.header .brand-mark { height: 30px; }
.header .search {
  flex: 1;
  max-width: 460px;
  position: relative;
}
.header .search input {
  width: 100%;
  padding: 9px 12px 9px 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  font-size: 14px;
}
.header .search input:focus { outline: none; border-color: var(--brand); background: #fff; }
.header .search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  color: var(--muted-2);
}
.header .spacer { flex: 1; }

.user-menu { position: relative; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 2px solid transparent;
}
.avatar:hover { border-color: var(--brand-100); }

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

/* Sidebar */
.sidebar {
  width: var(--sidebar-w);
  flex: none;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  width: 100%;
}
.nav-item svg { width: 19px; height: 19px; color: var(--muted); }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--brand-050); color: var(--brand-700); }
.nav-item.active svg { color: var(--brand); }
.nav-sep { height: 1px; background: var(--border-2); margin: 12px 8px; }
.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  font-weight: 700;
  padding: 6px 12px;
}

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

/* Main content */
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.toolbar {
  flex: none;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  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; }

.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(--brand-050); color: var(--brand-700); }
.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);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.card:hover { border-color: var(--brand-100); box-shadow: var(--shadow); }
.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; }
.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 */
.list { width: 100%; border-collapse: collapse; }
.list th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.list td { padding: 11px 12px; border-bottom: 1px solid var(--border-2); font-size: 14px; vertical-align: middle; }
.list tr { cursor: pointer; }
.list tbody tr:hover { background: var(--surface-2); }
.list .cell-name { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.list .cell-name .ic { width: 34px; height: 34px; border-radius: 8px; 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: #e7f5f5; color: var(--brand-700); }
.t-default { background: #eef2f2; color: var(--muted); }

/* ----------------------------- Dropdown menu ----------------------------- */
.menu {
  position: fixed;
  z-index: 200;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  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(16, 32, 31, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.14s ease-out;
}
.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 var(--border-2);
  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 var(--border-2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: var(--surface-2);
}

/* 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); }
.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) invert(1); }
.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; }

/* ----------------------------- Business suite ---------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow-sm);
}
.kpi-ic { width: 46px; height: 46px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex: none; }
.kpi-ic svg { width: 22px; height: 22px; }
.kpi-val { font-size: 22px; font-weight: 800; line-height: 1.1; }
.kpi-label { font-size: 13px; color: var(--muted); margin-top: 3px; }

.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; }

@media (max-width: 720px) {
  .sidebar { display: none; }
  .toolbar { padding: 14px 16px; }
  .scroll-area { padding: 16px; }
  .header .search { display: none; }
}

/* When printing, show only the invoice sheet. */
@media print {
  .header, .sidebar, .toolbar, .no-print, .toasts, #menuRoot, #modalRoot { 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; }
}
