.btn:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--danger); }
.btn-success { background: var(--success); }

/* Meeting tools */
.toolbar { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); flex-wrap: wrap; }
.toolbar > * { min-width: 0; max-width: 100%; }

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
table.data th, table.data td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow: hidden;
  text-overflow: ellipsis;
}
table.data th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
}
table.data tr:hover td { background: var(--bg); }

/* Activity log: ~12 rows visible; scroll for the rest */
.log-table-scroll {
  max-height: calc(12 * 2.75em + 2.5em);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius, 6px);
}
.log-table-scroll table.data { margin: 0; }
.log-table-scroll table.data thead th {
  position: sticky; top: 0;
  background: var(--surface, var(--bg-elevated, var(--bg)));
  z-index: 1;
  box-shadow: 0 1px 0 var(--border);
}
.work-item:has(> .work-action) {
  flex-direction: row; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: 8px 12px;
}
.work-item:has(> .work-action) > div:first-child { min-width: 0; flex: 1 1 12rem; }
.work-action { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0; flex: 0 0 auto; }
.work-item-overdue { border-left: 3px solid var(--danger, #c0392b); padding-left: 8px; }
.work-overdue { color: var(--danger, #c0392b); font-weight: 600; }


/* Organization Directory — aligned columns */
table.data-dir col.c-name { width: 16.85%; }
table.data-dir col.c-pos  { width: 16.09%; }
table.data-dir col.c-email { width: 28.21%; }
table.data-dir col.c-phone { width: 22%; min-width: 9.5em; }
table.data-dir th:nth-child(4),
table.data-dir td:nth-child(4) {
  min-width: 9.5em;
  width: 9.5em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  vertical-align: middle;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: var(--font-size-xs);
  font-weight: 500;
  line-height: 18px;
}
.badge-draft { background: #e0e0e0; color: #333; }
[data-theme="dark"] .badge-draft { background: #555; color: #ddd; }
.badge-published { background: #cce5ff; color: #004085; }
[data-theme="dark"] .badge-published { background: #1a3a5c; color: #8ec8ff; }
.badge-completed { background: #d4edda; color: #155724; }
[data-theme="dark"] .badge-completed { background: #1e3a24; color: #8fd99f; }
.badge-closed { background: #c8e6c9; color: #1b5e20; border: 1px solid #1b5e20; }
[data-theme="dark"] .badge-closed { background: #1b3d24; color: #81c784; border-color: #81c784; }
.badge-pending { background: #fff3cd; color: #856404; }
[data-theme="dark"] .badge-pending { background: #3d3200; color: #ffd666; }
.badge-passed { background: #d4edda; color: #155724; }
.badge-failed { background: #f8d7da; color: #721c24; }

.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 4px; }
.form-row input, .form-row textarea, .form-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.form-row textarea { min-height: 80px; resize: vertical; }
.form-row textarea.mins-area { min-height: 160px; }

.list-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  line-height: var(--line-height);
}
.list-item:last-child { border-bottom: none; }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--surface);
  border-radius: 8px;
  padding: 24px;
  width: 420px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.modal h2 { font-size: 16px; margin-bottom: 16px; }
.modal-close { float: right; border: 0; background: transparent; color: var(--text-muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px; }
.modal-close:hover { color: var(--text); }

.modal-actions { display: flex; gap: var(--space-2); justify-content: flex-end; margin-top: 16px; }

.hidden { display: none !important; }

/* Demo mode indicator */
.demo-badge {
  background: #c00;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

/* --- Expanders / accordion (v0.21.0) --- */
.expander.hidden { display: none; }
.expander.hidden.open { display: block; }
.expander {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 16px;
  overflow: hidden;
}
.expander-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  text-align: left;
}
.expander-header:hover {
  background: var(--bg);
}
.expander-header h3 {
  margin: 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
}
.head-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  margin-right: 4px;
  flex-shrink: 0;
  font-weight: 400;
}
.head-when {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.expander-header .badge {
  text-transform: none;
  font-weight: 500;
}
.expander-header h3 {
  flex: 1;
  color: var(--accent);
  min-width: 0;
}
.expander-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  color: var(--text-muted);
  font-size: 12px;
}
.expander.open > .expander-header .expander-chevron {
  transform: rotate(180deg);
}
.expander > .expander-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}
.expander.open > .expander-body {
  display: block;
}
/* The notification panel's "Recently dismissed" is a native <details> wearing
   the .expander class, so its body is revealed by the open ATTRIBUTE and never
   by an .open class -- nothing adds one to it. Without this rule the disclosure
   triangle turned and nothing appeared. */
details.expander[open] > .expander-body {
  display: block;
}
/* Nested ticket/meeting expanders inside an open parent */
.expander .expander {
  margin-bottom: 10px;
}
.expander.open > .expander-body .expander > .expander-body {
  display: none;
}
.expander.open > .expander-body .expander.open > .expander-body {
  display: block;
}
.expander-body .toolbar {
  margin-top: 12px;
}


/* My Work spacing */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.work-stats {
  /* One row, sized to the item count: staff/management render 5 stats, the
     platform roles render 4. A fixed repeat() had to be wrong for one of them --
     4 columns orphaned "Minutes pending", 5 would leave the platform grid a gap. */
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  margin-bottom: 12px;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.stat strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}
.stat span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

/* Diagnostic dashboard states: positive green, warning yellow, negative red. */
.stat-success strong { color: var(--success); }
.stat-warning strong { color: var(--warning); }
.stat-error strong { color: var(--danger); }
.stat-success { border-color: color-mix(in srgb, var(--success) 35%, var(--border)); }
.stat-warning { border-color: color-mix(in srgb, var(--warning) 35%, var(--border)); }
.stat-error { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.it-diagnostics-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .it-diagnostics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.work-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 14px 14px;
  background: var(--surface);
}
.work-section .section-title {
  margin-top: 0;
  margin-bottom: 8px;
}
.work-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.work-meta {
  display: block;
  line-height: 1.4;
}
.work-action {
  display: block;
  margin-top: 4px;
}
.work-empty {
  margin: 0;
  line-height: 1.5;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--bg);
}
.work-empty-positive {
  color: var(--success);
}
.work-upcoming {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
}
.org-tickets {
  margin: 12px 0 0;
}
.org-tickets .expander-header {
  padding: 12px 16px;
}
.org-tickets .expander-header .section-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  color: var(--accent);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.org-tickets > .expander-body {
  padding: 0 0 4px;
}

.org-tickets .expander-header {
  box-sizing: border-box;
  min-width: 0;
}
.org-tickets > .expander-body {
  min-width: 0;
  overflow-x: auto;
}
.org-tickets #my-tickets {
  min-width: 0;
}
@media (max-width: 700px) {
  .stats-grid:not(.work-stats), .work-grid {
    grid-template-columns: 1fr;
  }
  .work-stats {
    /* Narrow viewports: let the stat cards wrap onto extra rows instead of
       squeezing five columns into a phone width. auto-fit keeps the row
       filled while there is room, then wraps. */
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: unset;
  }
  .network-detail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Meeting workflow checklist */
.workflow-steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.workflow-steps li {
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.workflow-steps li.done {
  color: var(--success);
  font-weight: 600;
}
[data-theme="dark"] .workflow-steps li.done {
  color: var(--success);
}
/* Meeting completed step — green when status is completed */
.workflow-steps li.workflow-complete-done {
  color: var(--success);
  font-weight: 700;
}
.workflow-steps li:last-child { border-bottom: none; }
.badge-scheduled { background: #fff3cd; color: #856404; }
[data-theme="dark"] .badge-scheduled { background: #3d3200; color: #ffd666; }



.toast-main { display: flex; align-items: flex-start; gap: 8px; }
.toast-icon { font-weight: 800; min-width: 18px; }
.toast-message { font-weight: 700; }
.toast-detail { margin-top: 5px; color: var(--text-muted); line-height: 1.4; }
.toast-actions { margin-top: 8px; }
.toast-link { font-weight: 700; text-decoration: underline; color: var(--accent); }
.toast-close { position: absolute; top: 6px; right: 7px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 5px; }
.toast-close:hover { color: var(--text); }
.toast-item { position: relative; }
/* Two classes deep on purpose. `.toast-item { border: ... }` is declared further
   down this file at the same specificity, and its shorthand was resetting
   border-left -- so every toast rendered with the same grey edge and the severity
   colour never appeared at all. */
.toast-item.toast-success { border-left: 4px solid var(--success); }
.toast-item.toast-warning { border-left: 4px solid var(--warning, #b7791f); }
.toast-item.toast-error { border-left: 4px solid var(--danger); }
.toast-item.toast-info { border-left: 4px solid var(--accent); }
.btn-feedback-success { border-color: var(--success) !important; }
.btn-feedback-error { border-color: var(--danger) !important; }

/* Change notices */
.toast-box {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 360px;
}
.toast-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  /* Right padding reserves room beside the absolutely-positioned close button
     so the × never overlaps the message text. */
  padding: 10px 42px 10px 14px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}


/* Windows-style role menu */
.role-menu {
  position: relative;
  display: inline-block;
}
.role-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.role-btn:hover, .role-menu.open .role-btn {
  background: var(--bg);
}
.role-btn .role-caret {
  font-size: 10px;
  opacity: 0.7;
}
.role-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 2px;
  min-width: 160px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  z-index: 1000;
  padding: 4px 0;
}
.role-menu.open .role-panel { display: block; }
.role-panel a {
  display: block;
  padding: 8px 14px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}
.role-panel a:hover,
.role-panel a:focus-visible {
  background: var(--menu-hover);
  color: var(--text);
}
.account-menu-wrap .role-panel { left: auto; right: 0; }
.account-menu-end { border-top: 1px solid var(--border); margin-top: 4px; }
.account-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.account-menu-item:hover,
.account-menu-item:focus-visible {
  background: var(--menu-hover);
  color: var(--text);
}
.role-panel a.active {
  background: var(--accent);
  color: #fff;
}
.file-row {
  margin-top: 8px;
  font-size: 13px;
}
.file-row label {
  display: block;
  margin-bottom: 6px;
}
input[type=file] {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 100%;
}
/* Style the browser "Choose file" control like .btn / .btn-sm */
input[type=file]::file-selector-button,
input[type=file]::-webkit-file-upload-button {
  display: inline-block;
  padding: 4px 10px;
  margin-right: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
input[type=file]::file-selector-button:hover,
input[type=file]::-webkit-file-upload-button:hover {
  background: var(--accent-hover);
}


/* In-page file viewer */
.file-view {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.file-view.hidden { display: none; }
.file-view-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: min(960px, 100%);
  height: min(90vh, 800px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.file-view-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.file-view-bar strong { flex: 1; font-size: 14px; }
.file-view-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #111;
}


/* Login introductory copy */
.login-intro { color: #555; }
.login-intro strong { color: #555; }

.home-actions { display:flex; justify-content:center; align-items:center; gap:12px; flex-wrap:wrap; }
.diagnostics-time { margin-top: 8px; }

.file-view-bar .btn { flex: 0 0 auto; }

/* An action that cannot run yet. Deliberately NOT the `disabled` attribute: a
   disabled control is inert, unfocusable and silent, so the user learns nothing
   from it. This mutes the control and sets aria-disabled while leaving the click
   live, so the handler still explains why. */
.is-unavailable {
  opacity: 0.5;
  cursor: not-allowed;
}
.is-unavailable:hover { border-color: var(--border); transform: none; }
@media (max-width: 700px) { .file-view { padding: 8px; } .file-view-box { height: 94vh; } .file-view-bar { flex-wrap: wrap; } .file-view-bar strong { flex: 1 1 100%; } }

/* work-grid 2-col force */
.work-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--content-gap, 12px);
}
@media (max-width: 700px) {
  .work-grid {
    grid-template-columns: 1fr !important;
  }
}


/* Diagnostics expander header status counts (green / yellow / red) */
.diag-status-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  flex-shrink: 0;
}
.diag-status-badges .badge {
  min-width: 1.4em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.4;
  padding: 1px 6px;
}
.diag-badge-ok {
  background: color-mix(in srgb, var(--success) 22%, var(--surface));
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 45%, var(--border));
}
.diag-badge-warn {
  background: color-mix(in srgb, var(--warning) 22%, var(--surface));
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 45%, var(--border));
}
.diag-badge-fail {
  background: color-mix(in srgb, var(--danger) 22%, var(--surface));
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--border));
}

/* Agenda items: completed = green + check */
.agenda-item-done {
  color: var(--success);
  font-weight: 600;
}
.agenda-item-done .agenda-check {
  color: var(--success);
  font-weight: 700;
  margin-right: 0.35em;
}
.list-item.agenda-item-done {
  border-left: 3px solid var(--success);
  padding-left: 10px;
}
.list-item.agenda-item-done strong {
  color: var(--success);
}
.list-item.agenda-item-done .muted {
  color: color-mix(in srgb, var(--success) 70%, var(--text-muted));
}


/* My Work flat body (no nested expander) */
.my-work-root { margin-bottom: var(--space-4, 16px); }
.my-work-body { margin-top: 8px; }
.my-work-body .work-upcoming { margin-top: 12px; }

/* Meeting list filter chips */
/* Support ticket surfaces: unread replies, what a Waiting ticket is blocked on,
   and what the requester already tried before filing. */
.ticket-unread { margin-right: 6px; }
.ticket-waiting-on {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-left: 3px solid var(--accent, #2563eb);
  background: var(--surface-alt, rgba(127, 127, 127, .08));
  border-radius: var(--radius-sm);
}
.ticket-tried { margin: 0 0 10px; }
.ticket-priority { margin: 8px 0; align-items: center; gap: 8px; }

.meet-filters { margin-bottom: 10px; gap: 6px; }
.meet-filters .meet-filter.active {
  background: var(--accent, #2563eb);
  color: #fff;
  border-color: var(--accent, #2563eb);
}
.meet-filters .meet-filter { min-width: auto; }
/* Sits in the filter toolbar and is ANDed with the status buttons, so it is sized
   to read as one more filter rather than a separate search page. */
.meet-search {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 280px;
  padding: 5px 9px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.meet-search:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 1px; }


/* In-site confirm / prompt */
.modal-confirm-body { margin: 0 0 12px; line-height: 1.45; }
#app-prompt-input { width: 100%; min-height: 72px; resize: vertical; }
#modal-confirm.btn-danger { background: var(--danger, #dc2626); border-color: var(--danger, #dc2626); color: #fff; }
