/* Heddy CRM · Dashboard surfaces, shared by Browser, PWA and Agenten frame.
 * Presentation only. No selectors change permissions, layout tracks or media.
 * Depth values come from the approved dashboardDepth / containerDepth styles.
 */
:root {
  --heddy-surface: #fff;
  --heddy-surface-inset: #f7f8f9;
  --heddy-surface-hover: #f1f3f5;
  --heddy-surface-card-hover: #fff;
  --heddy-surface-hover-line: #17191c;
  --heddy-surface-line: #d5d9de;
  --heddy-surface-depth: inset 0 1px 0 #fff, inset 1px 0 0 rgba(255,255,255,.5), inset 0 -1px 0 rgba(23,25,28,.035), 0 4px 12px rgba(23,25,28,.045);
}
html.dark {
  --heddy-surface: #18181a;
  --heddy-surface-inset: #202022;
  --heddy-surface-hover: #222225;
  --heddy-surface-card-hover: #222225;
  --heddy-surface-hover-line: rgba(255,255,255,.075);
  --heddy-surface-line: rgba(255,255,255,.10);
  --heddy-surface-depth: inset 0 1px 0 rgba(255,255,255,.13), inset 1px 0 0 rgba(255,255,255,.035), inset 0 -1px 0 rgba(0,0,0,.25), 0 5px 18px rgba(0,0,0,.17);
}

/* The same material for primary panels, without another overlay over controls. */
.np-app :is(.nest-identity,.panel,.stat-card,.resource-card,.member-table-wrap,.calendar,.members-list,.np-messages,.nm-card,.nm-editor,.push-banner,.np-resource-controls),
.np-app .admin-stats > button,
.n2-workspace :is(.n2-panel,.n2-stat),
.heddy-agenten-shell :is([data-slot="card"],.heddy-channel-grid article[data-channel],[aria-label="Live-Inbox"]),
.heddy-agenten-shell :is(section,details)[class~="border"][class*="rounded-"]:not([role="alert"]):not([class*="border-red-"]):not([class*="border-blue-"]):not([class*="border-amber-"]),
.heddy-agenten-shell > [data-slot="tabs"] > [data-slot="tabs-list"] {
  background: var(--heddy-surface) !important;
  border-color: var(--heddy-surface-line);
  /* Existing day-mode adapters are loaded by route chunks. Material must stay
   * identical regardless of their load order; layout and state rules still win. */
  box-shadow: var(--heddy-surface-depth) !important;
}

/* The identity keeps the cover's existing clipping and rounded outer frame. */
.np-app :is(.panel,.stat-card,.resource-card,.member-table-wrap,.members-list,.np-messages),
.np-app .admin-stats > button,
.heddy-agenten-shell :is([data-slot="card"],.heddy-channel-grid article[data-channel]) {
  border-radius: 16px;
}
.np-app .admin-stats > button { border-color:var(--heddy-surface-line); }
.np-app :is(.resource-card,.panel,.stat-card),
.heddy-agenten-shell :is([data-slot="card"],.heddy-channel-grid article[data-channel]) {
  transform: none;
  transition: background-color 170ms ease, border-color 170ms ease;
}
/* Use the actual Dashboard interaction curve for Nest cards and quick actions.
 * Buttons retain the shell's matching 160 ms transition; no card lift is added. */
.np-app :is(.panel,.stat-card,.resource-card,.collection-card,.collection-button,.collection-tile,.folder-card,.n2-resource-row,.member-row),
.np-app .admin-stats > button,
.n2-workspace :is(.n2-panel,.n2-stat) {
  transition: background-color 160ms cubic-bezier(.23,1,.32,1), border-color 160ms cubic-bezier(.23,1,.32,1), color 160ms cubic-bezier(.23,1,.32,1), opacity 160ms cubic-bezier(.23,1,.32,1), transform 160ms cubic-bezier(.23,1,.32,1) !important;
}

/* Nest subpanels: quiet grouping, matching Dashboard quick actions. */
.np-app :is(.collection-card,.collection-button,.folder-card,.n2-resource-row,.n2-agenda-row),
.np-app :is(.collection-tile,.mini-month,.np-activity-numbers > div),
.np-dialog-root :is(.highlight-slot,.n2-option,.n2-resource-row,.n2-agenda-row,.n2-confirm),
.heddy-agenten-shell .heddy-channel-grid article[data-channel] > .heddy-channel-action {
  background-color: var(--heddy-surface-inset);
  border-color: var(--heddy-surface-line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.065);
}

/* Channel cards used to carry a separate gradient. Use the Dashboard material
 * here too, without touching connection and activity status colors. */
html .heddy-agenten-shell .heddy-channel-grid article[data-channel] {
  background: var(--heddy-surface);
  border-color: var(--heddy-surface-line);
  box-shadow: var(--heddy-surface-depth);
}
.heddy-agenten-shell :is(section,details)[class~="border"][class*="rounded-"]:not([role="alert"]):not([class*="border-red-"]):not([class*="border-blue-"]):not([class*="border-amber-"]) {
  border-color: var(--heddy-surface-line);
}
.np-app .members-list { overflow: hidden; }
.np-app .member-row { background-color: transparent; }
@media (hover:hover) {
  .np-app button.member-row:hover { background-color:var(--heddy-surface-hover) !important; }
}

/* Dialogs use the same surface. Their height/scroll/focus rules remain intact. */
.np-dialog-root .n2-modal,
body[data-heddy-customer-agenten] :is([data-slot="dialog-content"],[data-slot="sheet-content"],[data-slot="alert-dialog-content"]) {
  background-color: var(--heddy-surface) !important;
  border-color: var(--heddy-surface-line);
  box-shadow: var(--heddy-surface-depth), 0 20px 65px rgba(0,0,0,.24) !important;
}
.np-dialog-root .n2-modal > :is(header,footer) {
  background-color: var(--heddy-surface);
}
.np-dialog-root :is(.np-collection-list > div,.np-order-list > li,.np-nest-list > button,.n2-stats > div) {
  background-color: var(--heddy-surface-inset);
  border-color: var(--heddy-surface-line);
}

/* The channel-branded test chat must be legible in the shared day mode too. */
html:not(.dark) .heddy-agenten-shell [aria-label="Echter Agententest"] > :is(header,form) {
  background: var(--heddy-surface-inset);
  color: #25252a;
  border-color: var(--heddy-surface-line);
}
html:not(.dark) .heddy-agenten-shell [aria-label="Echter Agententest"] > header p {
  color: #65656e;
}
html:not(.dark) .heddy-agenten-shell [aria-label="Echter Agententest"] textarea {
  background: var(--heddy-surface);
  color: #25252a;
  border-color: var(--heddy-surface-line);
}
html:not(.dark) .heddy-agenten-shell [aria-label="Echter Agententest"] textarea::placeholder { color:#65656e; }

/* No lift and no decorative glow. Preserve the existing resource white outline,
 * calendar red selection/hover and blue/green/orange/red state indicators. */
@media (hover:hover) {
  /* The base material uses !important for route-load stability. The matching
   * hover must override it too, otherwise Nest resource surfaces stay frozen.
   * Light Dashboard cards stay white; their quick actions use the pale hover. */
  .np-app :is(.panel,.stat-card,.resource-card):hover,
  .np-app .admin-stats > button:hover,
  .n2-workspace :is(.n2-panel,.n2-stat):hover {
    background: var(--heddy-surface-card-hover) !important;
  }
  .np-app .resource-card:hover { transform:none; }
  .np-app .admin-stats > button:hover { border-color:var(--heddy-surface-hover-line) !important; }
  .np-app :is(.collection-card,.collection-button,.collection-tile,.folder-card,.n2-resource-row):hover {
    background: var(--heddy-surface-hover) !important;
  }
  .heddy-agenten-shell .heddy-channel-grid article[data-channel] > .heddy-channel-action:hover {
    background-color: var(--heddy-surface-hover);
  }
}
@media (prefers-reduced-motion:reduce) {
  .np-app :is(.panel,.stat-card,.resource-card,.collection-card,.collection-button,.collection-tile,.folder-card,.n2-resource-row,.member-row),
  .np-app .admin-stats > button,
  .n2-workspace :is(.n2-panel,.n2-stat),
  .heddy-agenten-shell :is([data-slot="card"],.heddy-channel-grid article[data-channel]) { transition:none !important; }
}

/* The complete browser-installed PWA uses this same material. Scope deliberately
 * excludes native Android / Apple apps. Paint only: no sizing, grid, overflow,
 * position or typography changes. Tailwind's rings remain in the shadow stack.
 * Premium gold, blue activity and user-defined content colors stay untouched.
 * Broadcast .hbc-* panels own their verified rim; never give them a second one.
 */
html[data-heddy-web-app] :is(
  .glass,.glass-strong,[data-slot="card"],.pricing-card,
  .native-quick,.native-functions > button,.native-appearance > button,
  .native-create-choices > button,.web-install,.pwa-nest-row,
  [data-heddy-module="integrations"] article,
  [data-calendar-day-agenda],
  .heddy-quiet-contact-controls
):not(:where(
  [class*="owl-border"],[class*="heddy-focus"],[class*="heddy-profile"],
  [data-native-color-status],[class*="border-sky-"],[class*="border-blue-"],
  [role="alert"]
)) {
  box-shadow: var(--tw-inset-shadow,0 0 #0000),
    var(--tw-inset-ring-shadow,0 0 #0000),
    var(--tw-ring-offset-shadow,0 0 #0000),
    var(--tw-ring-shadow,0 0 #0000),var(--heddy-surface-depth) !important;
}
html[data-heddy-web-app] :is(
  [data-slot="dialog-content"],[data-slot="alert-dialog-content"],
  [data-slot="sheet-content"],[data-dayplan-surface]
) {
  box-shadow: var(--tw-inset-shadow,0 0 #0000),
    var(--tw-inset-ring-shadow,0 0 #0000),
    var(--tw-ring-offset-shadow,0 0 #0000),
    var(--tw-ring-shadow,0 0 #0000),var(--heddy-surface-depth),
    0 20px 65px rgba(0,0,0,.24) !important;
}
