/* Admin — today feature styles (loaded after admin.css; use its tokens)
 *
 * Everything here is scoped to #panel-today or a .today-/.walkin- prefix.
 * admin.css owns the shared shell; this file must never need to touch it.
 */

#panel-today { position: relative; }

#today-body {
  display: grid;
  gap: 28px;
  max-width: 1180px;
}

/* ---------- Sections ---------- */

.today-section { display: grid; gap: 12px; }

.today-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.today-section-title {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.today-count {
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
}

.today-seeall {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.today-seeall:hover { text-decoration: underline; }

.today-whoami {
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 600;
}

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

.today-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 26px 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}
.today-empty-title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
}
.today-empty .btn-small { text-decoration: none; display: inline-block; }

/* ---------- In the showroom now ---------- */

.today-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(288px, 1fr));
  gap: 14px;
}

.today-card {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.today-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.today-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-deep);
  font-size: 0.76rem;
  font-weight: 700;
}

.today-card-id { min-width: 0; }
.today-card-name {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.today-card-contact {
  margin: 3px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.today-card-contact a { color: inherit; text-decoration: none; }
.today-card-contact a:hover { color: var(--accent); text-decoration: underline; }

.today-device {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 600;
}

.today-card-time {
  color: var(--ink-faint);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.today-card-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}
.today-unassigned { color: var(--amber); font-weight: 600; }

.today-card-quoted {
  margin: 0;
  color: var(--accent-deep);
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  justify-self: start;
}

.today-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}
.today-card-actions .today-action { text-decoration: none; }
.today-card-actions .today-end { border: 1px solid var(--line); }

/* ---------- Follow-ups ---------- */

.today-rows {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}

.today-row {
  display: grid;
  grid-template-columns: 148px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr) 16px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  text-decoration: none;
}
.today-row:last-child { border-bottom: none; }
.today-row:hover { background: var(--surface-soft); }

.today-due {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.today-due-over { background: var(--amber-soft); color: var(--amber); }
.today-due-date { margin-left: 6px; color: var(--ink-faint); font-size: 0.74rem; }

.today-row-name { font-weight: 600; overflow-wrap: anywhere; }
.today-row-type,
.today-row-who { color: var(--ink-soft); font-size: 0.85rem; }
.today-row-go { color: var(--ink-faint); text-align: right; }

/* ---------- Assigned to you + This week ---------- */

.today-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.today-minis {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.today-mini {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line-soft);
  color: inherit;
  text-decoration: none;
}
.today-mini:last-child { border-bottom: none; }
.today-mini:hover { background: var(--surface-soft); }
.today-mini-name { font-weight: 600; overflow-wrap: anywhere; }
.today-mini-type { color: var(--ink-soft); font-size: 0.82rem; }

.today-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.today-stat {
  display: grid;
  gap: 2px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}
.today-stat-n {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.today-stat-l {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ---------- Skeletons ---------- */

.today-loading { display: grid; gap: 28px; }
.today-skel {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--surface-soft), var(--line-soft), var(--surface-soft));
  background-size: 240% 100%;
  animation: today-shimmer 1.2s linear infinite;
}
.today-skel-card { height: 148px; }
.today-skel-row { height: 46px; margin-bottom: 8px; }
@keyframes today-shimmer {
  to { background-position: -240% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .today-skel { animation: none; }
}

/* ---------- "New walk-in" dialog ---------- */

.walkin-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(28, 36, 32, 0.38);
  overflow-y: auto;
}

.walkin-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  padding: 20px 22px 22px;
}

.walkin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.walkin-head h2 { margin: 0; font-size: 1.15rem; font-weight: 700; }

#walkin-form { display: grid; gap: 0; }

.walkin-label {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
}
.walkin-req { color: var(--danger); }
.walkin-optional {
  color: var(--ink-faint);
  font-weight: 500;
  font-size: 0.78rem;
}

.walkin-input,
#walkin-form .select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px 12px;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}
.walkin-input:focus,
#walkin-form .select:focus {
  outline: none;
  border-color: var(--accent-mid);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.walkin-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.walkin-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 14px;
  font: 500 0.82rem Inter, sans-serif;
  cursor: pointer;
  user-select: none;
}
.walkin-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.walkin-chip:hover { background: var(--surface-soft); color: var(--ink); }
.walkin-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 650;
}
.walkin-chip input:focus-visible + span {
  outline: 2px solid var(--accent-deep);
  outline-offset: 4px;
  border-radius: 4px;
}

.walkin-hint { margin: 8px 0 0; }
.walkin-error { margin: 12px 0 0; font-size: 0.86rem; }

.walkin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.walkin-actions .btn-ghost { border: 1px solid var(--line); }

/* ---------- iPad portrait + phones ---------- */

@media (max-width: 1024px) {
  .today-split { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .today-cards { grid-template-columns: minmax(0, 1fr); }
  .today-row {
    grid-template-columns: minmax(0, 1fr) 16px;
    grid-template-areas:
      "due    go"
      "name   go"
      "meta   go";
    row-gap: 4px;
  }
  .today-row-due { grid-area: due; }
  .today-row-name { grid-area: name; }
  .today-row-type { grid-area: meta; }
  .today-row-who { grid-area: meta; justify-self: end; }
  .today-row-go { grid-area: go; align-self: center; }
}

@media (max-width: 560px) {
  #today-body { gap: 24px; }
  .today-stats { grid-template-columns: minmax(0, 1fr); }
  .today-stat {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    text-align: left;
  }
  .today-card-actions .today-action { flex: 1 1 auto; text-align: center; }
  .walkin-actions .btn-ghost,
  .walkin-actions .btn-primary { flex: 1 1 auto; text-align: center; }
}

/* ---------- Touch: every tap target ≥44px ---------- */

@media (pointer: coarse) {
  .today-card-actions .today-action,
  .today-empty .btn-small,
  .today-seeall {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .today-row { min-height: 60px; }
  .today-mini { min-height: 48px; }
  .walkin-chip { min-height: 44px; }
  .walkin-input,
  #walkin-form .select { min-height: 44px; }
  .walkin-actions .btn-ghost,
  .walkin-actions .btn-primary { min-height: 44px; }
  #walkin-close { width: 44px; height: 44px; }
}
