/* App-only additions on top of the prototype design system (css/styles.css). */

.flash {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  font-size: var(--fs-small);
  margin-bottom: var(--s-5);
  border: 1px solid var(--c-border);
}
.flash--ok { background: var(--c-status-done-bg); color: var(--c-status-done); border-color: transparent; }
.flash--info { background: var(--c-primary-soft); color: var(--c-primary); border-color: transparent; }
.flash::before { content: "✓"; font-weight: 600; }
.flash--info::before { content: "ⓘ"; }

/* unique-link box surfaced to the therapist */
.linkbox {
  display: flex; gap: var(--s-2); align-items: center;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3);
}
.linkbox code {
  flex: 1; min-width: 0;
  font-size: var(--fs-small); color: var(--c-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.copy-btn {
  border: 1px solid var(--c-border-strong); background: var(--c-surface);
  border-radius: var(--r-sm); padding: 6px var(--s-3);
  font: inherit; font-size: var(--fs-small); font-weight: 500; cursor: pointer;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--c-primary-soft); }

/* access-code row (provider view) */
.codebox {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-3); font-size: var(--fs-small); font-weight: 500; color: var(--c-text);
}
.codebox code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-h3); letter-spacing: 0.15em; font-weight: 600;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); padding: 2px var(--s-3);
}
.codebox .meta { flex-basis: 100%; font-weight: 400; }

/* client home: list of this person's tasks */
.tasklink {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-4); border: 1px solid var(--c-border); border-radius: var(--r-md);
  background: var(--c-surface); text-decoration: none; color: inherit;
  min-height: 44px;
}
.tasklink + .tasklink { margin-top: var(--s-3); }
.tasklink:hover { border-color: var(--c-primary); text-decoration: none; }
.tasklink__main { min-width: 0; }
.tasklink__title { font-weight: 500; }
.tasklink__meta { font-size: var(--fs-xs); color: var(--c-text-subtle); }

.dim { opacity: 0.6; }

/* header nav */
.app-nav { display: inline-flex; gap: var(--s-4); margin-left: var(--s-5); }
.app-nav a { font-size: var(--fs-small); font-weight: 500; color: var(--c-text-muted); }
.app-nav a:hover { color: var(--c-text); text-decoration: none; }

/* hamburger (mobile only) */
.hamburger {
  display: none; margin-left: var(--s-2);
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  cursor: pointer; align-items: center; justify-content: center;
}
.hamburger:hover { border-color: var(--c-border-strong); }
.hamburger__bars, .hamburger__bars::before, .hamburger__bars::after {
  display: block; width: 20px; height: 2px; background: var(--c-text); border-radius: 2px; position: relative;
}
.hamburger__bars::before, .hamburger__bars::after { content: ""; position: absolute; left: 0; }
.hamburger__bars::before { top: -6px; }
.hamburger__bars::after { top: 6px; }

/* drawer (mobile nav panel under the sticky header) */
.drawer {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30;
  background: var(--c-surface); border-bottom: 1px solid var(--c-border-strong);
  box-shadow: var(--shadow-lg); padding: var(--s-1) var(--s-2) var(--s-2);
  max-height: calc(100vh - 60px); overflow-y: auto;
}
.drawer[hidden] { display: none; }
.drawer .menu__item { font-size: var(--fs-body); min-height: 44px; display: flex; align-items: center; }

/* on narrow screens: show the hamburger, hide the inline bar items */
@media (max-width: 640px) {
  .app-header__inner { position: relative; }
  .app-nav,
  .app-header__inner > .btn,
  .menu { display: none; }
  .hamburger { display: inline-flex; }
}

/* small header buttons */
.btn--sm { min-height: 38px; padding: 0 var(--s-3); font-size: var(--fs-small); }

/* account dropdown menu */
.menu { position: relative; margin-left: var(--s-2); }
.menu__btn {
  border: 1px solid transparent; background: transparent; padding: 2px; border-radius: var(--r-pill);
  cursor: pointer; display: inline-flex;
}
.menu__btn:hover { border-color: var(--c-border-strong); }
.menu__list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 220px; background: var(--c-surface);
  border: 1px solid var(--c-border-strong); border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  padding: var(--s-1);
}
.menu__head { padding: var(--s-3) var(--s-3) var(--s-2); border-bottom: 1px solid var(--c-border); margin-bottom: var(--s-1); }
.menu__item {
  display: block; padding: 9px var(--s-3); border-radius: var(--r-sm);
  font-size: var(--fs-small); color: var(--c-text);
}
.menu__item:hover { background: var(--c-surface-2); text-decoration: none; }

/* searchable client combobox */
.combo { position: relative; }
.combo__list {
  list-style: none; margin: var(--s-1) 0 0; padding: var(--s-1);
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: var(--c-surface); border: 1px solid var(--c-border-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-lg);
  max-height: 280px; overflow-y: auto;
}
.combo__item {
  padding: 10px var(--s-3); border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-body);
}
.combo__item:hover { background: var(--c-primary-soft); }

/* accordion (template groups) */
.accordion {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden;
}
.accordion__summary {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5); cursor: pointer; list-style: none;
  font-weight: 600;
}
.accordion__summary::-webkit-details-marker { display: none; }
.accordion__summary:hover { background: var(--c-surface-2); }
.accordion__title { flex: 1; }
.accordion__meta { font-size: var(--fs-small); color: var(--c-text-subtle); font-weight: 400; }
.accordion__chevron { color: var(--c-text-muted); transition: transform var(--dur) var(--ease); }
.accordion[open] .accordion__chevron { transform: rotate(180deg); }
.accordion__body { padding: 0 var(--s-5) var(--s-5); }
.accordion:focus-within { border-color: var(--c-border-strong); }

/* data table (clients) */
.dtable { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.dtable th, .dtable td { text-align: left; padding: var(--s-3) var(--s-5); border-bottom: 1px solid var(--c-border); }
.dtable th {
  font-size: var(--fs-xs); font-weight: 500; color: var(--c-text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; background: var(--c-surface-2);
}
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable tbody tr:hover { background: var(--c-surface-2); }
.dtable td { font-size: var(--fs-body); vertical-align: top; }
/* give the client name room: don't let it wrap; let the Task column absorb the slack */
.dtable td:first-child, .dtable th:first-child { white-space: nowrap; min-width: 160px; }
.dtable__prompt { display: block; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c-text-muted); }
@media (max-width: 720px) { .dtable__prompt { max-width: 180px; } }

/* accumulating multi-file list */
.filelist { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.filelist__item {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-2) var(--s-2) var(--s-3);
  border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface);
}
.filelist__name { flex: 1; min-width: 0; font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filelist__rm {
  border: 1px solid var(--c-border-strong); background: var(--c-surface);
  border-radius: var(--r-sm); width: 32px; height: 32px; cursor: pointer; flex: none;
  color: var(--c-text-muted); font-size: 14px;
}
.filelist__rm:hover { background: #f7ece9; color: var(--c-danger); border-color: var(--c-danger); }

/* editable task cards (assignment page) */
.taskcard { border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface); padding: var(--s-3) var(--s-4); }
.taskcard + .taskcard { margin-top: var(--s-3); }
.taskcard__head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); }
.taskcard__title { flex: 1; font-weight: 600; font-size: var(--fs-small); }
.taskcard .textarea { min-height: 84px; }

/* modal */
.modal-overlay {
  position: fixed; inset: 0; z-index: 50; padding: var(--s-4);
  background: rgba(31, 42, 46, 0.45);
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--c-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 560px; max-height: 85vh; display: flex; flex-direction: column;
}
.modal__head { padding: var(--s-5); border-bottom: 1px solid var(--c-border); }
.modal__body { padding: var(--s-3) var(--s-5) var(--s-5); overflow-y: auto; }
.modal__body h3:first-child { margin-top: 0; }
.modal__foot { padding: var(--s-4) var(--s-5); border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: var(--s-3); }

/* file viewer modal */
.modal--viewer { max-width: 900px; width: 100%; height: 86vh; }
.modal--viewer .modal__body { flex: 1; padding: 0; background: var(--c-surface-2); overflow: auto; display: flex; }
.modal--viewer .modal__body img { margin: auto; }

/* file chips with view/download actions */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip__act {
  border: 1px solid var(--c-border-strong); background: var(--c-surface);
  border-radius: var(--r-sm); padding: 3px var(--s-2); margin-left: var(--s-1);
  font: inherit; font-size: var(--fs-xs); font-weight: 500; cursor: pointer; color: var(--c-primary);
}
.chip__act:hover { background: var(--c-primary-soft); text-decoration: none; }

/* dashboard tiles + two/three-column sections */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); margin-bottom: var(--s-5); }
.tile {
  display: flex; flex-direction: column; gap: var(--s-1);
  padding: var(--s-4) var(--s-5);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.tile:hover { border-color: var(--c-border-strong); box-shadow: var(--shadow-md); text-decoration: none; }
.tile__n { font-size: var(--fs-display); font-weight: 600; line-height: 1.1; }
.tile__label { font-size: var(--fs-small); color: var(--c-text-muted); }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
@media (max-width: 720px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .cols-2, .cols-3 { grid-template-columns: 1fr; }
}
