/*!
 * dtfzone-app-supplement.css
 * ---------------------------------------------------------------------------
 * Rules for the six classes the DTF Zone templates reference but the theme
 * never styled. Unlike dtfzone-app.css -- which is a verbatim extract -- this
 * file is hand-written, and is the only place in the bridge where new design
 * decisions were made.
 *
 * Every rule is built from the theme's own variables and mirrors an existing
 * component, so nothing here introduces a new visual language:
 *
 *   .dtf-tabs / .dtf-tab       follows .dashboard-nav-item (pill, 6px radius,
 *                              accent-light-green + brand-green when current)
 *   .dtf-stat-grid             follows .dtf-stats-row (auto-fit minmax grid)
 *   .dashboard-nav-section-label   follows .dtf-stat-label (uppercase, muted)
 *   .plugin-download-page      follows .dashboard-page (min-height only)
 *   .dtf-text-error / -success reuses the exact colours of the existing
 *                              .dtf-amount-negative / -positive pair
 *
 * Load AFTER dtfzone-app.css. Depends on the :root block that file provides.
 * Restyle freely -- nothing in the templates or the JS reads these rules.
 *
 * Install: wp-content/mu-plugins/dtfzone-bridge/dtfzone-app-supplement.css
 */

/* ===========================================
   Admin tab bar
   Markup: <nav class="dtf-tabs"> of <a class="dtf-tab">, with
   .dtf-tab-active on the current page. Sits in the right-hand slot of
   .dtf-card-header-row, so it must survive that row's flex-wrap.
   =========================================== */
.dtf-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--color-bg);
  border-radius: 8px;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dtf-tab {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 6px;
  color: var(--color-text-light);
  text-decoration: none;
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s;
}

.dtf-tab:hover {
  background: var(--color-accent-light-green);
  color: var(--color-brand-green);
}

.dtf-tab:focus-visible {
  outline: 2px solid var(--color-brand-green);
  outline-offset: 2px;
}

.dtf-tab-active,
.dtf-tab-active:hover {
  background: var(--color-white);
  color: var(--color-brand-green);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* ===========================================
   Admin dashboard tile grid
   Markup: <div class="dtf-stat-grid"> of .dtf-stat-card.
   Ten tiles on /admin-dashboard/, four on the finances view -- auto-fit lets
   the same rule serve both without a fixed column count.
   =========================================== */
.dtf-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

/* ===========================================
   Sidebar section heading
   Markup: <div class="dashboard-nav-section-label">Admin</div>, revealed
   inside #adminNavSection when /auth/me returns role === 'admin'.
   Horizontal padding matches .dashboard-nav-item so the label's text aligns
   with the nav labels beneath it.
   =========================================== */
.dashboard-nav-section-label {
  padding: var(--spacing-xs) 16px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
}

/* ===========================================
   Plugin download page wrapper
   Markup: <main class="plugin-download-page">. The page's inner components
   (.plugin-dl-*) are already styled in dtfzone-app.css; this only keeps a
   short page from collapsing above the footer.
   =========================================== */
.plugin-download-page {
  min-height: calc(100vh - 200px);
}

/* ===========================================
   Finances amount column
   Markup: template-admin-finances.php builds
   <td class="dtf-text-error|dtf-text-success"> from the sign of t.amount.
   The customer-side credit history solves the same problem with
   .dtf-amount-negative / .dtf-amount-positive, which the theme does style --
   these reuse those exact values so a debit reads identically on both pages.
   =========================================== */
.dtf-text-error {
  color: #b91c1c;
  font-weight: 600;
}

.dtf-text-success {
  color: #166534;
  font-weight: 600;
}

/* ===========================================
   Narrow screens
   The tab bar scrolls rather than wrapping, so the four admin views stay
   reachable on mobile without stacking into the stat grid below.
   =========================================== */
@media (max-width: 768px) {
  .dtf-tabs {
    width: 100%;
    justify-content: flex-start;
  }

  .dtf-stat-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--spacing-sm);
  }
}

/* ── Team & permissions (team.html) ─────────────────────────────────────── */
.dtf-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.dtf-form-row .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  flex: 1 1 220px;
}

.dtf-form-row .dtf-input,
.dtf-form-row .dtf-select {
  width: 100%;
  box-sizing: border-box;
}

.dtf-form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}

.dtf-role-help {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--color-text-light);
  font-size: 13px;
  line-height: 1.6;
}

.dtf-badge-role {
  background: var(--color-accent-light-green);
  color: var(--color-brand-green);
}

.dtf-badge-invited {
  background: #fef3c7;
  color: #92400e;
}

.dtf-perm-table td.dtf-perm-check,
.dtf-perm-table th.dtf-perm-check {
  text-align: center;
  width: 120px;
}

.dtf-perm-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent-green);
  cursor: pointer;
}

.dtf-perm-table .dtf-perm-desc {
  display: block;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dtf-link-danger {
  background: none;
  border: 0;
  padding: 0;
  color: #b91c1c;
  font-weight: 600;
  cursor: pointer;
}

.dtf-link-danger:hover { text-decoration: underline; }

.dtf-actions-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.dtf-profile-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 24px;
  margin: 0;
}

.dtf-profile-list dt {
  font-weight: 600;
  color: var(--color-text-muted);
}

.dtf-profile-list dd { margin: 0; }

/* ── Order artwork, downloads and timeline (order-detail.html) ──────────── */
.dtf-artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.dtf-artwork-card {
  background: var(--color-surface, #f7f8f7);
  border: 1px solid var(--color-border-light, #e5e7eb);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dtf-artwork-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid var(--color-border-light, #e5e7eb);
  border-radius: 6px;
  cursor: zoom-in;
  overflow: hidden;
  /* checkerboard shows transparency in the artwork */
  background: #fff repeating-conic-gradient(#eceeec 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}

.dtf-artwork-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.dtf-artwork-thumb:focus-visible {
  outline: 3px solid var(--color-accent-green);
  outline-offset: 2px;
}

.dtf-artwork-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  color: var(--color-text-muted);
  font-size: 13px;
}

.dtf-artwork-meta {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted);
}

.dtf-artwork-note {
  margin: 0;
  font-size: 12px;
}

.dtf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15, 23, 20, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.dtf-lightbox[hidden] { display: none; }

.dtf-lightbox figure {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.dtf-lightbox img {
  max-width: min(1200px, 100%);
  max-height: calc(100vh - 110px);
  object-fit: contain;
  background: #fff repeating-conic-gradient(#eceeec 0% 25%, #fff 0% 50%) 50% / 20px 20px;
  border-radius: 6px;
}

.dtf-lightbox figcaption {
  color: #fff;
  font-size: 14px;
}

.dtf-lightbox-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.dtf-timeline {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.dtf-timeline-step {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--color-text-muted);
}

.dtf-timeline-step strong {
  display: block;
  color: var(--color-text);
}

.dtf-timeline-desc {
  display: block;
  font-size: 12px;
}

.dtf-timeline-dot {
  flex: 0 0 14px;
  height: 14px;
  margin-top: 3px;
  border-radius: 50%;
  border: 2px solid #c7ccc8;
  background: #fff;
}

.dtf-timeline-step.is-done .dtf-timeline-dot {
  border-color: var(--color-accent-green);
  background: var(--color-accent-green);
}

.dtf-timeline-log-wrap {
  margin-top: 16px;
  font-size: 13px;
}

.dtf-timeline-log-wrap summary {
  cursor: pointer;
  color: var(--color-accent-green);
  font-weight: 600;
}

.dtf-timeline-log {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--color-text-light);
  line-height: 1.8;
}

.dtf-timeline-log span {
  color: var(--color-text-muted);
}

/* ── Dashboard analytics (dashboard.html, customers.html) ──────────────── */
.dtf-dash-header { align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.dtf-dash-range { margin: 4px 0 0; }
.dtf-dash-filters { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

.dtf-segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--color-white);
  border: 1px solid var(--color-border-light, #e5e7eb);
  border-radius: 8px;
  flex-wrap: wrap;
}

.dtf-segmented button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  color: var(--color-text-light);
  cursor: pointer;
}

.dtf-segmented button:hover { background: var(--color-accent-light-green); color: var(--color-brand-green); }
.dtf-segmented button[aria-pressed="true"] { background: var(--color-brand-green); color: #fff; font-weight: 600; }
.dtf-segmented button:focus-visible { outline: 2px solid var(--color-brand-green); outline-offset: 2px; }
.dtf-segmented-sm button { padding: 5px 10px; font-size: 12px; }

.dtf-custom-range { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.dtf-custom-range[hidden] { display: none; }
.dtf-custom-range label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--color-text-muted); }

.dtf-dash-cards .dtf-stat-sub a { color: var(--color-accent-green); }
#dashboardContent { transition: opacity 0.15s; }
#dashboardContent.dtf-is-loading .dtf-stat-grid,
#dashboardContent.dtf-is-loading .dtf-chart { opacity: 0.55; }

.dtf-chart svg { width: 100%; height: 220px; display: block; }
.dtf-chart-bar { fill: var(--color-accent-green); }
.dtf-chart-bar:hover { fill: var(--color-brand-green); }
.dtf-chart-grid { stroke: #e5e7eb; stroke-width: 1; }
.dtf-chart-axis { fill: var(--color-text-muted); font-size: 11px; }
.dtf-chart-caption { margin: 6px 0 0; font-size: 12px; color: var(--color-text-muted); }

.dtf-dash-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--spacing-lg, 24px); }
.dtf-dash-split > .dtf-card { margin-bottom: var(--spacing-lg, 24px); }
.dtf-dash-pair { display: flex; gap: 32px; }

.dtf-size-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; }
.dtf-size-list li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid #eef0ee; }
.dtf-size-list span { color: var(--color-text-muted); }

.dtf-activity { list-style: none; margin: 0; padding: 0; }
.dtf-activity li { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid #eef0ee; font-size: 13px; }
.dtf-activity li:first-child { border-top: 0; }
.dtf-activity li > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dtf-activity a { color: var(--color-text); font-weight: 600; text-decoration: none; }
.dtf-activity a:hover { color: var(--color-brand-green); text-decoration: underline; }
.dtf-activity-dot { flex: 0 0 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: #c7ccc8; }
.dtf-activity-created .dtf-activity-dot { background: #3b82f6; }
.dtf-activity-exported .dtf-activity-dot { background: var(--color-accent-green); }
.dtf-activity-downloaded .dtf-activity-dot { background: var(--color-brand-gold, #d4a020); }
.dtf-activity-completed .dtf-activity-dot { background: var(--color-brand-green); }

@media (max-width: 768px) {
  .dtf-dash-filters { align-items: stretch; width: 100%; }
  .dtf-chart svg { height: 180px; }
}

/* ── Support Center (support*.html) ────────────────────────────────────── */
button.dtf-tab {
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.dtf-support-tabs { margin-bottom: var(--spacing-lg, 24px); }
.dtf-sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dtf-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 4px; }

.dtf-doc-search { max-width: 280px; }
.dtf-docs { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin-top: 12px; }
.dtf-docs-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 16px; align-self: start; }
.dtf-docs-nav a { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 6px; color: var(--color-text); text-decoration: none; font-size: 14px; }
.dtf-docs-nav a:hover { background: var(--color-accent-light-green); color: var(--color-brand-green); }
.dtf-docs-nav span { color: var(--color-text-muted); font-size: 12px; }
.dtf-doc-section { margin-bottom: 24px; scroll-margin-top: 16px; }
.dtf-doc-section h3 { margin: 0 0 8px; font-size: 16px; }
.dtf-doc { border: 1px solid #e5e7eb; border-radius: 8px; margin-bottom: 8px; background: #fff; }
.dtf-doc summary { padding: 12px 14px; cursor: pointer; font-weight: 600; list-style-position: inside; }
.dtf-doc[open] summary { border-bottom: 1px solid #eef0ee; }
.dtf-doc-body { padding: 4px 16px 12px; line-height: 1.65; color: var(--color-text-light); }
.dtf-doc-body img, .dtf-doc-body iframe { max-width: 100%; }
.dtf-doc-body code { background: #f3f4f3; padding: 1px 5px; border-radius: 4px; }

.dtf-video-cat { margin-bottom: 24px; }
.dtf-video-cat h3 { margin: 0 0 12px; font-size: 16px; }
.dtf-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.dtf-video { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.dtf-video-thumb, .dtf-video-frame { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 8px; overflow: hidden; padding: 0; background: #000; }
.dtf-video-thumb { cursor: pointer; }
.dtf-video-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.dtf-video-thumb:hover img { opacity: 1; }
.dtf-video-thumb:focus-visible { outline: 3px solid var(--color-accent-green); outline-offset: 2px; }
.dtf-video-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 44px; margin: -22px 0 0 -32px; border-radius: 12px; background: rgba(220, 0, 0, 0.9); }
.dtf-video-play::after { content: ""; position: absolute; left: 26px; top: 13px; border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; }
.dtf-video figcaption { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.dtf-video figcaption span { color: var(--color-text-muted); font-size: 13px; }

.dtf-support-form { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.dtf-support-form .form-group { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.dtf-support-form label { font-weight: 600; font-size: 14px; }
.dtf-support-form .dtf-input, .dtf-support-form .dtf-textarea { width: 100%; box-sizing: border-box; }

.dtf-badge-ticket-open { background: #fef3c7; color: #92400e; }
.dtf-badge-ticket-answered { background: #dcfce7; color: #166534; }
.dtf-badge-ticket-closed { background: #eceeec; color: #555; }
.dtf-ticket-waiting td:first-child { box-shadow: inset 3px 0 0 #d97706; }

.dtf-ticket-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.dtf-ticket-head-actions { display: flex; align-items: center; gap: 10px; }
.dtf-ticket-thread { display: flex; flex-direction: column; gap: 12px; }
.dtf-ticket-msg { border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px 14px; background: #fff; max-width: 85%; }
.dtf-ticket-msg-agent { background: var(--color-accent-light-green); border-color: #cfe3d4; }
.dtf-ticket-msg.is-mine { align-self: flex-end; }
.dtf-ticket-msg-head { display: flex; justify-content: space-between; gap: 16px; font-size: 13px; margin-bottom: 6px; }
.dtf-ticket-msg-head span { color: var(--color-text-muted); }
.dtf-ticket-msg-body { white-space: pre-wrap; line-height: 1.6; word-break: break-word; }
.dtf-ticket-shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.dtf-ticket-shot { display: block; width: 96px; height: 72px; border-radius: 6px; overflow: hidden; border: 1px solid #e5e7eb; background: #f7f8f7; }
.dtf-ticket-shot img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 768px) {
  .dtf-docs { grid-template-columns: 1fr; }
  .dtf-docs-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .dtf-ticket-msg { max-width: 100%; }
}
