/* ICU Partner-Portal — Brand CSS (ICU CI-Standard)
   Shared by the public storefront pages, the fullscreen kiosk portal and the
   embedded portal inside the host backend.
   Colors: ICU Orange #D47F2F, ICU Grün #0D5233, ICU Schwarz #131111,
   ICU Blau #309AC2, neutral #F5F5F5, greys #575756/#5A5A5A. */

@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/barlow-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/barlow-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/barlow-700.woff2') format('woff2');
}

:root {
  --icu-orange: #D47F2F;
  --icu-orange-dark: #b96a20;
  --icu-green: #0D5233;
  --icu-black: #131111;
  --icu-blue: #309AC2;
  --icu-blue-dark: #1d6e8e;
  --icu-grey: #575756;
  --icu-grey-light: #5A5A5A;
  --icu-surface: #F5F5F5;
  --icu-white: #FFFFFF;
  --icu-danger: #A5231F;
  --icu-border: #e4e2e0;
  --icu-shadow: 0 1px 3px rgba(19, 17, 17, 0.10);
  --icu-radius: 10px;
  --icu-font: 'Barlow', 'Inter', 'Source Sans Pro', Arial, sans-serif;
}

/* Deliberately minimal: this stylesheet is also loaded inside the host
   backend, so it must not restyle the host chrome. Fonts/colors live on the
   component roots (.icu-portal / .icu-page). */
body { margin: 0; }

/* ---------- Portal shell (kiosk fullscreen + host embedded) ---------- */

.icu-portal {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--icu-surface);
  color: var(--icu-black);
  font-family: var(--icu-font);
  font-size: 16px;
  line-height: 1.5;
}

/* Embedded inside the host backend: behaves like a normal page card instead
   of claiming the whole viewport, and hides no host chrome. */
.icu-portal-embedded {
  min-height: 0;
  /* Never shrink inside a fixed-height host column and never clip: a clipped,
     shrinking box cut tall pages (admin dashboard) off at the bottom and would
     also clip the option list of the searchable selects. */
  flex: 0 0 auto;
  border: 1px solid var(--icu-border);
  border-radius: var(--icu-radius);
  box-shadow: var(--icu-shadow);
}
/* Rounded top corners without clipping: the first bar follows the radius. */
.icu-portal-embedded > :first-child { border-radius: var(--icu-radius) var(--icu-radius) 0 0; }
.icu-portal-embedded .icu-header { padding: 0.6rem 1.25rem; }
.icu-portal-embedded .icu-header-logo { height: 36px; }
.icu-portal-embedded .icu-main { padding: 1rem 1.25rem 1.5rem 1.25rem; }

.icu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--icu-white);
  border-bottom: 4px solid var(--icu-orange);
}

.icu-header-brand { display: flex; align-items: center; gap: 0.85rem; min-width: 0; }
.icu-header-logo { height: 44px; width: auto; flex: 0 0 auto; }
.icu-header-title { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.01em; }
.icu-header-sub {
  font-size: 0.9rem;
  color: var(--icu-grey-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Several header actions (e.g. "Change password" + "Sign out") side by side. */
.icu-header-actions { display: flex; align-items: center; gap: 0.25rem; flex-wrap: wrap; justify-content: flex-end; }

.icu-logout {
  color: var(--icu-blue-dark);
  text-decoration: none;
  font-weight: 600;
  font-family: var(--icu-font);
  font-size: 1rem;
  padding: 0.6rem 0.9rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.icu-logout:hover, .icu-logout:focus { background-color: var(--icu-surface); text-decoration: underline; }

/* ---------- Navigation ---------- */

.icu-nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.25rem;
  padding: 0.4rem 1rem;
  background-color: var(--icu-white);
  border-bottom: 1px solid var(--icu-border);
  -webkit-overflow-scrolling: touch;
}

.icu-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1rem;
  border-radius: 8px 8px 0 0;
  color: var(--icu-grey);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
  flex: 0 0 auto;
}
.icu-nav-link:hover, .icu-nav-link:focus { background-color: var(--icu-surface); color: var(--icu-black); }
.icu-nav-link.active {
  border-bottom-color: var(--icu-orange);
  color: var(--icu-black);
  background-color: var(--icu-surface);
}
.icu-nav-external { color: var(--icu-blue-dark); }
.icu-nav-external::after { content: " ↗"; font-size: 0.85em; }

/* ---------- Main content ---------- */

.icu-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 2.5rem 1.5rem;
  box-sizing: border-box;
}
/* Pages with wide tables (many columns). */
.icu-main-wide { max-width: 1400px; }

.icu-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--icu-border);
}
.icu-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--icu-grey);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 1.5rem 0 0.6rem 0;
}

/* ---------- Cards (dashboard) ---------- */

.icu-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.icu-card {
  background-color: var(--icu-white);
  border: 1px solid var(--icu-border);
  border-radius: var(--icu-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--icu-shadow);
  transition: box-shadow 0.15s ease;
}
.icu-card:hover { box-shadow: 0 4px 12px rgba(19, 17, 17, 0.14); }
.icu-card-disabled { opacity: 0.9; }
.icu-card-disabled:hover { box-shadow: var(--icu-shadow); }
.icu-card-disabled .icu-card-image { filter: grayscale(60%); }

.icu-card-image {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background-color: var(--icu-white);
  border-bottom: 1px solid var(--icu-border);
}
.icu-card-image-placeholder {
  background: linear-gradient(135deg, var(--icu-surface) 0%, #e8e8e8 100%);
  border-bottom: 1px solid var(--icu-border);
}

.icu-card-body {
  padding: 1rem 1.1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex: 1 1 auto;
}
.icu-card-title { font-size: 1.1rem; font-weight: 700; margin: 0; }
.icu-card-text { margin: 0; color: var(--icu-grey); font-size: 0.95rem; }
.icu-card-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.icu-card-body .icu-btn { margin-top: auto; align-self: stretch; }

/* ---------- Badges (status) ---------- */

.icu-badge {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.icu-badge-success { background-color: var(--icu-green); color: var(--icu-white); }
.icu-badge-info { background-color: #d3ecf5; color: var(--icu-black); border: 1px solid var(--icu-blue); }
.icu-badge-muted { background-color: #e5e5e5; color: var(--icu-grey); }
.icu-badge-danger { background-color: var(--icu-danger); color: var(--icu-white); }

/* ---------- Buttons ---------- */

.icu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 1.4rem;
  border: none;
  border-radius: 8px;
  background-color: var(--icu-orange);
  color: var(--icu-black);
  font-family: var(--icu-font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.12s ease;
}
.icu-btn:hover, .icu-btn:focus { background-color: var(--icu-orange-dark); color: var(--icu-white); }
.icu-btn:disabled { background-color: #e5e5e5; color: var(--icu-grey-light); cursor: not-allowed; }

.icu-btn-secondary {
  background-color: var(--icu-white);
  color: var(--icu-black);
  border: 2px solid #c9c7c5;
}
.icu-btn-secondary:hover, .icu-btn-secondary:focus { background-color: var(--icu-surface); color: var(--icu-black); border-color: var(--icu-grey-light); }

.icu-btn-small { min-height: 38px; padding: 0.35rem 0.85rem; font-size: 0.9rem; }

/* Unobtrusive grey action (e.g. "Clear filters"). */
.icu-btn-muted { background-color: #e9e7e5; color: var(--icu-grey); font-weight: 600; }
.icu-btn-muted:hover, .icu-btn-muted:focus { background-color: #d9d6d3; color: var(--icu-black); }
/* Pushes a button to the right end of a flex row (.icu-form-actions). */
.icu-btn-end { margin-left: auto; align-self: center; }
/* A form that follows an action row keeps a small distance. */
.icu-form-actions + .icu-form { margin-top: 0.75rem; }

/* Destructive action (e.g. delete in a table row). */
.icu-btn-danger { background-color: var(--icu-danger); color: var(--icu-white); }
.icu-btn-danger:hover, .icu-btn-danger:focus { background-color: #831a17; color: var(--icu-white); }

/* Icon-only button: square, touch friendly, inline SVG in the text color. */
.icu-btn-icon { width: 44px; min-height: 44px; padding: 0; }
.icu-btn-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Forms ---------- */

.icu-form {
  background-color: var(--icu-white);
  border: 1px solid var(--icu-border);
  border-radius: var(--icu-radius);
  box-shadow: var(--icu-shadow);
  padding: 1.5rem;
  max-width: 820px;
}
.icu-form .icu-section-title:first-child { margin-top: 0; }
/* Form embedded in a storefront panel: the panel already provides the surface. */
.icu-form-plain { border: none; box-shadow: none; padding: 0; max-width: none; background: transparent; }
.icu-form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.5rem 1rem; }
.icu-form-group { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.85rem; }
.icu-label { font-weight: 600; font-size: 0.95rem; }

.icu-input {
  font-family: var(--icu-font);
  font-size: 1rem;
  color: var(--icu-black);
  background-color: var(--icu-white);
  border: 1px solid #b5b3b1;
  border-radius: 6px;
  padding: 0.6rem 0.75rem;
  min-height: 44px;
  box-sizing: border-box;
  width: 100%;
}
textarea.icu-input { min-height: auto; resize: vertical; }
.icu-input:focus { outline: 3px solid var(--icu-blue); outline-offset: 1px; border-color: var(--icu-blue); }

.icu-radio-group { border: 1px solid var(--icu-border); border-radius: 8px; padding: 0.75rem 1rem; margin: 0 0 0.85rem 0; background-color: var(--icu-surface); }
.icu-radio-group legend { padding: 0 0.35rem; }
/* Also used for checkbox lists (multi-select of packages). */
.icu-radio { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; cursor: pointer; }
.icu-list-plain { margin: 0.5rem 0 0 0; padding-left: 1.2rem; }
.icu-radio input { width: 20px; height: 20px; accent-color: var(--icu-orange); flex: 0 0 auto; }

.icu-form-actions { display: flex; gap: 0.75rem; margin-top: 1.1rem; flex-wrap: wrap; }

.icu-readonly-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--icu-surface);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
}
.icu-readonly-label { font-weight: 600; color: var(--icu-grey); }

/* ---------- Alerts (icon-free but never color-only: bold lead text) ---------- */

.icu-alert { border-radius: 8px; padding: 0.9rem 1.1rem; margin: 0.85rem 0; }
.icu-alert p { margin: 0.3rem 0 0 0; }
.icu-alert-success { background-color: #e3efe8; border-left: 6px solid var(--icu-green); color: var(--icu-black); }
.icu-alert-error { background-color: #f9e5e4; border-left: 6px solid var(--icu-danger); color: var(--icu-black); }
.icu-alert-info { background-color: #e2f1f7; border-left: 6px solid var(--icu-blue); color: var(--icu-black); }

/* ---------- Tables ---------- */

.icu-table-wrap {
  overflow-x: auto;
  background-color: var(--icu-white);
  border: 1px solid var(--icu-border);
  border-radius: var(--icu-radius);
  box-shadow: var(--icu-shadow);
}
.icu-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.icu-table th {
  text-align: left;
  padding: 0.8rem 1rem;
  border-bottom: 2px solid var(--icu-orange);
  font-weight: 700;
  color: var(--icu-grey);
  white-space: nowrap;
  background-color: var(--icu-white);
}
.icu-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #efedec; vertical-align: middle; }
.icu-table tbody tr:last-child td { border-bottom: none; }
.icu-table tbody tr:hover { background-color: var(--icu-surface); }
.icu-table td .icu-btn + .icu-btn { margin-left: 0.4rem; }
/* Action cell: buttons stay side by side, the column takes only the space it needs. */
.icu-table td.icu-table-actions { white-space: nowrap; width: 1%; text-align: right; }
/* Rows with a varying number of buttons: left-aligned keeps the first button in place. */
.icu-table td.icu-table-actions-start { text-align: left; }
/* Tables with many columns: tighter cells so the action column stays visible
   (desktop only — below 761px the rows are stacked as cards). */
@media (min-width: 761px) {
  .icu-table-compact th, .icu-table-compact td { padding-left: 0.6rem; padding-right: 0.6rem; }
  .icu-table-compact th:first-child, .icu-table-compact td:first-child { padding-left: 1rem; }
  .icu-table-compact th:last-child, .icu-table-compact td:last-child { padding-right: 1rem; }
}

/* Mobile: stack each row as a labeled card (uses the data-label attributes). */
@media (max-width: 760px) {
  .icu-table thead { display: none; }
  .icu-table, .icu-table tbody { display: block; width: 100%; }
  .icu-table tr { display: block; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--icu-border); }
  .icu-table tbody tr:last-child { border-bottom: none; }
  .icu-table td {
    display: flex;
    gap: 0.6rem;
    padding: 0.2rem 0;
    border: none;
    align-items: baseline;
  }
  .icu-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--icu-grey);
    flex: 0 0 110px;
  }
  .icu-table td .icu-btn { margin-top: 0.35rem; }
  .icu-table td.icu-table-actions { width: auto; }
}

/* ---------- Empty states ---------- */

.icu-empty {
  background-color: var(--icu-white);
  border: 1px dashed #cfcdcb;
  border-radius: var(--icu-radius);
  padding: 2.25rem 1.5rem;
  text-align: center;
  color: var(--icu-grey);
}
.icu-empty strong { color: var(--icu-black); font-size: 1.1rem; display: block; margin-bottom: 0.35rem; }
.icu-empty p { margin: 0; }

/* ---------- Guide (role-based step-by-step walkthrough) ---------- */

.icu-guide-intro { color: var(--icu-grey); max-width: 640px; margin: 0 0 1.25rem 0; }

.icu-guide-role-card {
  text-align: left;
  font-family: var(--icu-font);
  font-size: 1rem;
  cursor: pointer;
  padding: 1.25rem 0 0 0;
  align-items: center;
}
.icu-guide-role-card:hover { border-color: var(--icu-orange); }
.icu-guide-role-card:focus { outline: 3px solid var(--icu-blue); outline-offset: 2px; }

.icu-guide-emoji { font-size: 2.5rem; line-height: 1; text-align: center; }
.icu-guide-emoji-big { font-size: 4rem; line-height: 1; }

.icu-guide-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.icu-guide-progress-label { font-weight: 600; color: var(--icu-grey); }

.icu-guide-progress {
  height: 10px;
  border-radius: 999px;
  background-color: #e5e3e1;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.icu-guide-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--icu-orange) 0%, var(--icu-orange-dark) 100%);
  transition: width 0.25s ease;
}

.icu-guide-step-card {
  background-color: var(--icu-white);
  border: 1px solid var(--icu-border);
  border-radius: var(--icu-radius);
  box-shadow: var(--icu-shadow);
  padding: 1.75rem 1.75rem 1.5rem 1.75rem;
  max-width: 760px;
  margin: 0 auto 1.25rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  align-items: flex-start;
}
.icu-guide-step-title { font-size: 1.35rem; font-weight: 700; margin: 0; }
.icu-guide-step-text { margin: 0; font-size: 1.05rem; line-height: 1.6; }

.icu-guide-tip {
  background-color: #e2f1f7;
  border-left: 6px solid var(--icu-blue);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--icu-black);
}

.icu-guide-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  max-width: 760px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.icu-guide-dots { display: flex; gap: 0.45rem; align-items: center; }
.icu-guide-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--icu-grey-light);
  background-color: var(--icu-white);
  cursor: pointer;
  padding: 0;
}
.icu-guide-dot.done { background-color: var(--icu-green); border-color: var(--icu-green); }
.icu-guide-dot.active { background-color: var(--icu-orange); border-color: var(--icu-orange); transform: scale(1.25); }

.icu-guide-celebrate {
  background-color: var(--icu-white);
  border: 1px solid var(--icu-border);
  border-radius: var(--icu-radius);
  box-shadow: var(--icu-shadow);
  padding: 2.5rem 1.5rem;
  max-width: 640px;
  margin: 1.5rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  align-items: center;
}

@media (max-width: 640px) {
  .icu-guide-nav { justify-content: center; }
  .icu-guide-nav .icu-btn { flex: 1 1 40%; }
  .icu-guide-dots { order: -1; width: 100%; justify-content: center; }
}

/* ---------- Storefront pages (font/colors scoped here, not on body) ---------- */

.icu-page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1rem;
  box-sizing: border-box;
  background-color: var(--icu-surface);
  color: var(--icu-black);
  font-family: var(--icu-font);
  font-size: 16px;
  line-height: 1.5;
}

.icu-panel {
  background-color: var(--icu-white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(19, 17, 17, 0.10);
  padding: 2rem;
  width: 100%;
  max-width: 560px;
  box-sizing: border-box;
}

.icu-panel-wide { max-width: 760px; }

.icu-storefront-logo { display: block; margin: 0 auto 1.5rem auto; max-width: 240px; height: auto; }

.icu-panel h1 { font-size: 1.4rem; font-weight: 700; margin: 0 0 1rem 0; }
.icu-panel p { color: var(--icu-grey); }

.icu-footer-note { margin-top: 1.5rem; font-size: 0.85rem; color: var(--icu-grey-light); text-align: center; }
.icu-footer-note a { color: var(--icu-blue-dark); }

/* ---------- Small screens ---------- */

@media (max-width: 640px) {
  .icu-header { padding: 0.6rem 0.9rem; }
  .icu-header-logo { height: 36px; }
  .icu-main { padding: 1rem 0.9rem 2rem 0.9rem; }
  .icu-form { padding: 1.1rem; }
  .icu-form-grid { grid-template-columns: 1fr; }
  .icu-cards { grid-template-columns: 1fr; }
  .icu-form-actions .icu-btn { flex: 1 1 auto; }
}

/* ---------- Admin environment & backend view bar ---------- */

.icu-viewbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background-color: var(--icu-surface);
  border-bottom: 1px solid var(--icu-border);
}
.icu-viewbar-label { font-weight: 600; color: var(--icu-grey); }
.icu-viewbar .icu-nav-link { border-radius: 8px; border-bottom-width: 3px; }
.icu-viewbar .icu-combo { flex: 1 1 240px; max-width: 380px; }
.icu-viewbar .icu-input { margin: 0; }

.icu-tile { text-decoration: none; color: var(--icu-black); }
.icu-tile-number { font-size: 2.4rem; font-weight: 700; color: var(--icu-orange); line-height: 1.1; }

.icu-filterbar { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; align-items: flex-end; }
.icu-filterbar .icu-form-group { flex: 1 1 200px; margin: 0; }
/* Many filters: narrower fields so they share one row on wide screens. */
.icu-filterbar-dense .icu-form-group { flex-basis: 150px; }

/* Searchable select (PortalSearchSelect): text field with a filtered option list. */
.icu-combo { position: relative; }
.icu-combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background-color: var(--icu-white);
  border: 1px solid #b5b3b1;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(19, 17, 17, 0.18);
}
.icu-combo-option {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  box-sizing: border-box;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.icu-combo-option:hover, .icu-combo-option-active { background-color: var(--icu-surface); }
.icu-combo-option-active { box-shadow: inset 4px 0 0 var(--icu-orange); }
.icu-combo-option-selected { font-weight: 700; }
.icu-combo-empty { padding: 0.6rem 0.75rem; color: var(--icu-grey); font-size: 0.9rem; }

.icu-text-danger { color: var(--icu-danger); font-weight: 700; }
.icu-input-small { max-width: 110px; }
.icu-linkbox { word-break: break-all; font-size: 0.9rem; }

/* ---------- Kiosk dialogs (PortalConfirmDialog) ---------- */

/* Background must not scroll while a dialog is open. */
html.icu-dialog-open, html.icu-dialog-open body { overflow: hidden; }

.icu-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  box-sizing: border-box;
  background-color: rgba(19, 17, 17, 0.6);
  font-family: var(--icu-font);
  overscroll-behavior: contain;
  animation: icu-dialog-fade-in 0.16s ease-out;
}

.icu-dialog-card {
  width: 100%;
  max-width: 480px;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 1.5rem;
  background-color: var(--icu-white);
  color: var(--icu-black);
  border-top: 4px solid var(--icu-orange);
  border-radius: var(--icu-radius);
  box-shadow: 0 12px 40px rgba(19, 17, 17, 0.35);
  animation: icu-dialog-pop-in 0.16s ease-out;
}

.icu-dialog-title { margin: 0 0 0.6rem 0; font-size: 1.25rem; font-weight: 700; line-height: 1.3; }
.icu-dialog-message { margin: 0; color: var(--icu-grey); font-size: 1rem; line-height: 1.5; overflow-wrap: anywhere; }

/* Number dialog: the single input below the message. */
.icu-dialog-field { display: flex; flex-direction: column; gap: 0.3rem; margin: 1.1rem 0 0 0; }
.icu-dialog-field .icu-input { min-height: 48px; font-size: 1.15rem; }
.icu-dialog-error { color: var(--icu-danger); font-size: 0.9rem; font-weight: 600; }

.icu-dialog-actions { display: flex; justify-content: flex-end; gap: 0.75rem; margin-top: 1.5rem; }

.icu-dialog-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.6rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 8px;
  font-family: var(--icu-font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}
.icu-dialog-btn:focus-visible { outline: 3px solid var(--icu-blue); outline-offset: 2px; }

.icu-dialog-btn-primary { background-color: var(--icu-orange); color: var(--icu-black); }
.icu-dialog-btn-primary:hover, .icu-dialog-btn-primary:focus { background-color: var(--icu-orange-dark); color: var(--icu-white); }

.icu-dialog-btn-danger { background-color: var(--icu-danger); color: var(--icu-white); }
.icu-dialog-btn-danger:hover, .icu-dialog-btn-danger:focus { background-color: #831a17; }

.icu-dialog-btn-cancel { background-color: var(--icu-white); color: var(--icu-black); border-color: #c9c7c5; }
.icu-dialog-btn-cancel:hover, .icu-dialog-btn-cancel:focus { background-color: var(--icu-surface); border-color: var(--icu-grey-light); }

.icu-dialog-closing { animation: icu-dialog-fade-out 0.14s ease-in forwards; }

@keyframes icu-dialog-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes icu-dialog-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes icu-dialog-pop-in { from { transform: translateY(8px) scale(0.98); } to { transform: none; } }

@media (max-width: 640px) {
  .icu-dialog-actions { flex-direction: column-reverse; }
  .icu-dialog-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .icu-dialog-overlay, .icu-dialog-card, .icu-dialog-closing { animation: none; }
  .icu-dialog-btn { transition: none; }
}

/* ---------- Kiosk admin dashboard (icu-dash-*) ---------- */

/* Visually hidden, still read by screen readers (chart data table). */
.icu-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icu-dash-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 1.25rem; border-bottom: 2px solid var(--icu-border); }
.icu-dash-head .icu-page-title { flex: 1 1 auto; margin: 0; border-bottom: none; }
.icu-dash-head-actions { display: flex; align-items: center; gap: 0.75rem; padding-bottom: 0.5rem; }
.icu-dash-asof { color: var(--icu-grey); font-size: 0.9rem; }

/* Zone A: tiles. Neutral at 0, orange accent when there is work, red when overdue. */
.icu-dash-tiles { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.icu-dash-tile { border-left: 6px solid var(--icu-border); min-width: 0; }
.icu-dash-tile .icu-card-body { gap: 0.4rem; }
.icu-dash-tile .icu-card-title { font-size: 1rem; overflow-wrap: break-word; hyphens: auto; }
.icu-dash-tile .icu-badge { align-self: flex-start; white-space: normal; }
.icu-dash-tile-ok .icu-tile-number { color: var(--icu-grey); }
.icu-dash-tile-hot { border-left-color: var(--icu-orange); }
.icu-dash-tile-danger { border-left-color: var(--icu-danger); }
.icu-dash-tile-danger .icu-tile-number { color: var(--icu-danger); }
.icu-dash-tile:focus-visible { outline: 3px solid var(--icu-blue-dark); outline-offset: 2px; }

/* Zone B: key figures */
.icu-dash-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.icu-dash-kpi {
  background-color: var(--icu-white);
  border: 1px solid var(--icu-border);
  border-radius: var(--icu-radius);
  box-shadow: var(--icu-shadow);
  padding: 0.8rem 1rem;
  min-width: 0;
}
.icu-dash-kpi-label { color: var(--icu-grey); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; }
.icu-dash-kpi-value { font-size: 1.7rem; font-weight: 700; line-height: 1.2; color: var(--icu-black); }
.icu-dash-kpi-sub { color: var(--icu-grey); font-size: 0.85rem; }

/* Panels, two-column layout (one column on tablet/phone) */
.icu-dash-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.25rem; }
.icu-dash-panel {
  background-color: var(--icu-white);
  border: 1px solid var(--icu-border);
  border-radius: var(--icu-radius);
  box-shadow: var(--icu-shadow);
  padding: 1rem 1.1rem;
  margin: 0 0 1.5rem 0;
  min-width: 0;
}
.icu-dash-panel .icu-card-title { margin-bottom: 0.4rem; }

/* Progress bars (utilization) */
.icu-dash-bar { height: 12px; border-radius: 999px; background-color: #e5e5e5; overflow: hidden; margin: 0.35rem 0; }
.icu-dash-bar-fill { height: 100%; border-radius: 999px; background-color: var(--icu-green); }
.icu-dash-bar-warn { background-color: var(--icu-orange); }
.icu-dash-bar-danger { background-color: var(--icu-danger); }
.icu-dash-quota { display: block; text-decoration: none; color: var(--icu-black); padding: 0.45rem 0; border-bottom: 1px solid #efedec; }
.icu-dash-quota:last-child { border-bottom: none; }
.icu-dash-quota:hover .icu-dash-quota-name, .icu-dash-quota:focus .icu-dash-quota-name { text-decoration: underline; }
.icu-dash-quota-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.2rem 0.75rem; }
.icu-dash-quota-name { font-weight: 600; }
.icu-dash-quota-figures { color: var(--icu-grey); font-size: 0.9rem; }

/* Zone C: inline SVG chart */
.icu-dash-chart { width: 100%; height: auto; display: block; }
.icu-dash-chart-axis { stroke: var(--icu-border); stroke-width: 1; }
.icu-dash-chart-bar { fill: var(--icu-orange); }
.icu-dash-chart-bar-cancelled { fill: #ecc9a6; stroke: var(--icu-orange); stroke-width: 0.5; }
.icu-dash-chart-value { fill: var(--icu-black); font-size: 11px; font-weight: 600; font-family: var(--icu-font); }
.icu-dash-chart-label { fill: var(--icu-grey); font-size: 10px; font-family: var(--icu-font); }
.icu-dash-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.25rem; color: var(--icu-grey); font-size: 0.85rem; margin-top: 0.4rem; }
.icu-dash-legend-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 0.4rem; vertical-align: -1px; }
.icu-dash-legend-submitted { background-color: var(--icu-orange); }
.icu-dash-legend-cancelled { background-color: #ecc9a6; border: 1px solid var(--icu-orange); box-sizing: border-box; }

/* Zones E + F: lists */
.icu-dash-list, .icu-dash-feed { list-style: none; padding-left: 0; }
.icu-dash-list { margin: 0.4rem 0 0 0; }
.icu-dash-feed { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.icu-dash-list li, .icu-dash-feed li { border-bottom: 1px solid #efedec; }
.icu-dash-list li:last-child, .icu-dash-feed li:last-child { border-bottom: none; }
.icu-dash-list a { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.1rem 0.75rem; padding: 0.6rem 0; min-height: 44px; align-items: center; text-decoration: none; color: var(--icu-black); box-sizing: border-box; }
.icu-dash-list a:hover .icu-dash-list-main, .icu-dash-list a:focus .icu-dash-list-main,
a.icu-dash-feed-row:hover .icu-dash-list-main, a.icu-dash-feed-row:focus .icu-dash-list-main { text-decoration: underline; }
.icu-dash-list-main { font-weight: 600; overflow-wrap: anywhere; }
.icu-dash-list-meta { color: var(--icu-grey); font-size: 0.9rem; overflow-wrap: anywhere; }
.icu-dash-feed-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; min-height: 44px; text-decoration: none; color: var(--icu-black); box-sizing: border-box; }
.icu-dash-feed-icon { flex: 0 0 auto; font-size: 1.25rem; width: 1.8rem; text-align: center; }
.icu-dash-feed-text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.icu-dash-feed-time { flex: 0 0 auto; color: var(--icu-grey); font-size: 0.85rem; white-space: nowrap; }

/* Full message of a support request */
.icu-dash-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 0.5rem 0; }

@media (max-width: 900px) {
  .icu-dash-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .icu-dash-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem; }
  .icu-dash-tile .icu-tile-number { font-size: 1.9rem; }
  .icu-dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .icu-dash-feed-row { flex-wrap: wrap; }
  .icu-dash-feed-time { flex-basis: 100%; padding-left: 2.55rem; }
}
