/* ================================================================
   Web Order Ltd — Catalogue demo kit (dashboard template look)
   All classes are prefixed wd- so demos embed inline without clashes.
   ================================================================ */

.wd-frame {
  --wd-bg: #1a1d21;
  --wd-surface: #2c3034;
  --wd-surface-2: #23272b;
  --wd-border: #373b3e;
  --wd-text: #e9ecef;
  --wd-muted: #8f979e;
  --wd-primary: #0d6efd;
  --wd-success: #198754;
  --wd-warning: #ffc107;
  --wd-danger: #dc3545;
  --wd-info: #0dcaf0;
  --wd-radius: 10px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #2a2e33;
  box-shadow: 0 30px 80px rgba(10, 10, 15, 0.25);
  background: var(--wd-bg);
  color: var(--wd-text);
  font-family: var(--font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
}

.wd-frame *,
.wd-frame *::before,
.wd-frame *::after {
  box-sizing: border-box;
}

.wd-frame [hidden] {
  display: none !important;
}

.wd-frame ul,
.wd-frame ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wd-frame ul li,
.wd-frame ol li {
  padding-left: 0;
  margin-bottom: 0;
  line-height: 1.5;
}

.wd-frame ul li::before,
.wd-frame ol li::before {
  content: none;
  background-image: none;
  position: static;
}

/* --- Shell --- */
.wd-app {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  min-height: 480px;
}

.wd-side {
  background: var(--wd-surface);
  border-right: 1px solid var(--wd-border);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wd-logo {
  display: block;
  width: 120px;
  margin: 2px 6px 14px;
}

.wd-dash {
  display: block;
  width: 100%;
  height: 110px;
  margin: -6px 0 6px;
  cursor: pointer;
}

.wd-side-rule {
  border: 0;
  border-top: 1px solid var(--wd-border);
  margin: 8px 0;
}

.wd-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.8);
  font: inherit;
  text-align: left;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.wd-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.wd-nav-item.is-active {
  background: var(--wd-primary);
  color: #fff;
}

.wd-nav-item svg {
  flex: none;
}

.wd-side-foot {
  margin-top: auto;
  font-size: 11px;
  color: #6c757d;
  padding: 8px 6px 0;
  border-top: 1px solid var(--wd-border);
}

.wd-main {
  padding: 18px 22px 22px;
  min-width: 0;
}

.wd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--wd-border);
}

.wd-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.wd-title svg {
  color: var(--wd-primary);
}

.wd-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.wd-panel {
  display: none;
}

.wd-panel.is-active {
  display: block;
  animation: wd-fade 0.3s ease;
}

/* --- Layout helpers --- */
.wd-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 14px;
}

.wd-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wd-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wd-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.wd-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.wd-stack {
  display: grid;
  gap: 10px;
}

.wd-muted { color: var(--wd-muted); }
.wd-mono { font-family: var(--font-mono, 'JetBrains Mono', monospace); font-size: 12px; }
.wd-small { font-size: 12px; }
.wd-right { margin-left: auto; }
.wd-text-success { color: #4ade80; }
.wd-text-warning { color: var(--wd-warning); }
.wd-text-danger { color: #ff6b7a; }
.wd-text-info { color: var(--wd-info); }

/* --- Cards and stats --- */
.wd-card {
  background: var(--wd-surface);
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius);
  overflow: hidden;
  margin-bottom: 14px;
}

.wd-grid > .wd-card {
  margin-bottom: 0;
}

.wd-card-header {
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid var(--wd-border);
  padding: 9px 14px;
  font-weight: 600;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wd-card-body {
  padding: 14px;
}

.wd-stat {
  padding: 14px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.wd-stat:hover {
  transform: translateY(-3px);
  filter: brightness(1.12);
}

.wd-stat-label {
  font-size: 12px;
  color: var(--wd-muted);
  margin-bottom: 4px;
}

.wd-stat-value {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.wd-stat-delta {
  font-size: 12px;
  margin-top: 2px;
}

.wd-glow-primary { box-shadow: 0 0 18px 2px hsla(212, 100%, 52%, 0.45); }
.wd-glow-success { box-shadow: 0 0 18px 2px hsla(134, 61%, 41%, 0.45); }
.wd-glow-warning { box-shadow: 0 0 18px 2px hsla(45, 100%, 51%, 0.4); }
.wd-glow-danger  { box-shadow: 0 0 18px 2px hsla(354, 70%, 54%, 0.45); }
.wd-glow-info    { box-shadow: 0 0 18px 2px hsla(188, 78%, 41%, 0.45); }

/* --- Forms and buttons --- */
.wd-field {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
}

.wd-label {
  font-size: 12px;
  color: var(--wd-muted);
}

.wd-input,
.wd-select,
.wd-textarea {
  width: 100%;
  background: var(--wd-surface-2);
  border: 1px solid var(--wd-border);
  border-radius: 6px;
  color: var(--wd-text);
  font: inherit;
  padding: 7px 10px;
  outline: none;
}

.wd-textarea {
  min-height: 90px;
  resize: vertical;
}

.wd-input:focus,
.wd-select:focus,
.wd-textarea:focus {
  border-color: var(--wd-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25);
}

.wd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 7px 14px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  background: var(--wd-surface-2);
  color: var(--wd-text);
  transition: filter 0.2s, background 0.2s;
}

.wd-btn:hover { filter: brightness(1.15); }
.wd-btn:disabled { opacity: 0.55; cursor: progress; }
.wd-btn-primary { background: var(--wd-primary); color: #fff; }
.wd-btn-success { background: var(--wd-success); color: #fff; }
.wd-btn-danger { background: var(--wd-danger); color: #fff; }
.wd-btn-outline { background: transparent; border-color: var(--wd-primary); color: #6ea8fe; }
.wd-btn-sm { padding: 4px 10px; font-size: 12px; }

.wd-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

/* --- Badges --- */
.wd-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: var(--wd-text);
}

.wd-badge-success { background: rgba(25, 135, 84, 0.25); color: #4ade80; }
.wd-badge-warning { background: rgba(255, 193, 7, 0.2); color: #ffd666; }
.wd-badge-danger  { background: rgba(220, 53, 69, 0.25); color: #ff8592; }
.wd-badge-info    { background: rgba(13, 202, 240, 0.2); color: #6edff6; }
.wd-badge-primary { background: rgba(13, 110, 253, 0.25); color: #8bb9fe; }

/* --- Tables --- */
.wd-table-wrap {
  overflow-x: auto;
}

.wd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.wd-table th,
.wd-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--wd-border);
  text-align: left;
  white-space: nowrap;
}

.wd-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wd-muted);
  font-weight: 600;
}

.wd-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.wd-num { text-align: right !important; font-variant-numeric: tabular-nums; }

/* --- Progress, log and results --- */
.wd-progress {
  height: 8px;
  border-radius: 999px;
  background: var(--wd-surface-2);
  overflow: hidden;
}

.wd-progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--wd-primary), var(--wd-info));
  transition: width 0.25s linear;
}

.wd-progress-label {
  font-size: 12px;
  color: var(--wd-muted);
  margin-top: 6px;
  min-height: 18px;
}

.wd-log {
  background: #111316;
  border: 1px solid var(--wd-border);
  border-radius: 6px;
  padding: 10px 12px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 12px;
  color: #a3e4b5;
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
}

.wd-log:empty::before {
  content: 'Waiting\2026';
  color: var(--wd-muted);
}

.wd-result {
  animation: wd-fade 0.4s ease;
}

.wd-dropzone {
  border: 1.5px dashed var(--wd-border);
  border-radius: var(--wd-radius);
  padding: 22px;
  text-align: center;
  color: var(--wd-muted);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.wd-dropzone:hover,
.wd-dropzone.is-loaded {
  border-color: var(--wd-primary);
  background: rgba(13, 110, 253, 0.06);
  color: var(--wd-text);
}

/* --- Media --- */
.wd-media {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--wd-border);
  background: #111316;
}

.wd-media img,
.wd-media video {
  display: block;
  width: 100%;
  height: auto;
}

.wd-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.wd-placeholder {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(13, 110, 253, 0.25), rgba(13, 202, 240, 0.12)),
    var(--wd-surface-2);
  color: var(--wd-muted);
  font-size: 12px;
}

/* --- Charts --- */
.wd-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding-top: 8px;
}

.wd-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
  min-width: 0;
}

.wd-bar-fill {
  width: 100%;
  height: 0;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--wd-info), var(--wd-primary));
  transition: height 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.wd-bar-label {
  font-size: 10px;
  color: var(--wd-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* --- Chat --- */
.wd-chat-log {
  display: grid;
  gap: 10px;
  max-height: 300px;
  overflow-y: auto;
  padding: 4px 2px 12px;
}

.wd-msg {
  max-width: 82%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  white-space: pre-wrap;
}

.wd-msg-user {
  justify-self: end;
  background: var(--wd-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.wd-msg-bot {
  justify-self: start;
  background: var(--wd-surface-2);
  border: 1px solid var(--wd-border);
  border-bottom-left-radius: 4px;
}

.wd-chat-form {
  display: flex;
  gap: 8px;
}

/* --- Kanban --- */
.wd-kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 1fr);
  gap: 12px;
  overflow-x: auto;
}

.wd-kanban-col {
  background: var(--wd-surface-2);
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius);
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.wd-kanban-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--wd-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wd-kanban-card {
  background: var(--wd-surface);
  border: 1px solid var(--wd-border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

/* --- Steps / timeline --- */
.wd-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.wd-steps li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--wd-muted);
}

.wd-frame .wd-steps li::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--wd-border);
  flex: none;
}

.wd-steps li.is-done {
  color: var(--wd-text);
}

.wd-frame .wd-steps li.is-done::before {
  background: var(--wd-success);
  border-color: var(--wd-success);
}

.wd-frame .wd-steps li.is-current::before {
  border-color: var(--wd-primary);
  box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.3);
}

@keyframes wd-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 760px) {
  .wd-app {
    grid-template-columns: 1fr;
  }

  .wd-side {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: 0;
    border-bottom: 1px solid var(--wd-border);
  }

  .wd-logo,
  .wd-dash,
  .wd-side-rule,
  .wd-side-foot {
    display: none;
  }

  .wd-nav-item {
    width: auto;
  }

  .wd-grid-2,
  .wd-grid-3,
  .wd-grid-4 {
    grid-template-columns: 1fr;
  }
}
