/* Panel page-specific styles — shell in panel-shell.css, primitives in /shared/ */

/* Dashboard */
.stat-grid + .stat-grid { margin-top: 0.75rem; }
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}
.quick-action-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
  text-decoration: none;
  color: var(--text);
  transition: border-color var(--transition), background var(--transition), transform var(--transition), box-shadow var(--transition);
}
.quick-action-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 6%, var(--card));
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.quick-action-card .qa-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: var(--accent-glow);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  color: var(--accent);
  flex-shrink: 0;
}
.quick-action-card > div { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.quick-action-card strong { font-size: 0.95rem; }
.quick-action-card span { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }

.api-key-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.75rem 0;
}
.api-key-display {
  flex: 1;
  min-width: 200px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.api-key-full {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  word-break: break-all;
  padding: 0.85rem;
  background: var(--bg);
  border: 1px dashed var(--ok);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

/* New order — two column */
.new-order-layout {
  display: grid;
  grid-template-columns: 1fr min(320px, 36%);
  gap: 1.25rem;
  align-items: start;
}
.order-summary-card {
  position: sticky;
  top: 1rem;
}
.order-summary-card dl {
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.order-summary-card dt {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.order-summary-card dd {
  margin: 0.15rem 0 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.order-summary-card .summary-total {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 1.25rem;
  color: var(--accent);
}
.order-summary-card .summary-total.insufficient { color: var(--err); }

.order-form-panel label { font-weight: 500; color: var(--text); }
.price-estimate {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0.5rem 0 0.25rem;
}
.price-estimate strong { font-size: 1.15rem; color: var(--accent); }
.price-estimate.insufficient strong { color: var(--err); }

/* Order history */
.order-history-page .page-head { margin-bottom: 0.75rem; }
.order-history-filters {
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--card);
}
.order-history-filters .order-status-tabs {
  margin-bottom: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}
.order-history-filters .order-search-wrap {
  border: none;
  border-bottom: 1px solid var(--border);
}
.order-history-filters .orders-toolbar {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
}
.order-status-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.65rem;
  margin-bottom: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.order-tab {
  flex: 0 1 auto;
  min-width: auto;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.order-tab:last-child { border-right: 1px solid var(--border); }
.order-tab:hover {
  color: var(--text);
  background: var(--card);
  border-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}
.order-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 8px var(--accent-glow);
}
[data-theme="light"] .order-tab.active { color: #fff; }
.order-tab[aria-selected="true"] { outline: none; }

.order-search-wrap {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-top: none;
  background: var(--card);
}
.order-search {
  flex: 1;
  border: none;
  padding: 0.75rem 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: transparent;
  color: var(--text);
}
.order-search:focus { outline: none; box-shadow: inset 0 0 0 2px var(--accent-glow); }
.order-search-btn {
  width: 3rem;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}
.order-search-btn:hover { color: var(--text); }

.order-history-table-wrap {
  margin-top: 0;
}
.order-history-table-wrap:not(.table-wrap) {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--card);
}
.order-history-table-wrap.table-wrap {
  max-height: min(70vh, 720px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.panel-app main.order-history-page {
  max-width: 1280px;
}
.order-history-table {
  width: 100%;
  min-width: 820px;
  table-layout: auto;
  font-size: 0.84rem;
}
.order-history-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}
.order-history-table th,
.order-history-table td {
  display: table-cell;
  vertical-align: middle;
}
.order-history-table .check-col {
  width: 2.5rem;
  min-width: 2.5rem;
  max-width: 2.5rem;
  text-align: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}
.order-history-table .check-col input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  cursor: pointer;
  vertical-align: middle;
}
.order-history-table .order-col {
  width: 8.5rem;
  white-space: nowrap;
}
.order-history-table .target-col {
  width: 28%;
  min-width: 10rem;
  max-width: 18rem;
}
.order-history-table .progress-col {
  width: 10.5rem;
  min-width: 9rem;
}
.order-history-table .status-col {
  width: 6.5rem;
  white-space: nowrap;
}
.order-history-table .charge-col {
  width: 5rem;
  min-width: 4.5rem;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.order-history-table .actions-col,
.order-history-table .actions-cell {
  width: 6.5rem;
  min-width: 6rem;
  white-space: nowrap;
}
.order-cell { display: grid; gap: 0.15rem; }
.order-id-num { font-family: var(--font-mono); font-size: 0.82rem; }
.order-date-sub { font-size: 0.72rem; }
.order-progress-cell { display: grid; gap: 0.25rem; min-width: 0; }
.order-progress-cell.is-done .order-progress-text { color: var(--ok); font-weight: 600; }
.order-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.order-progress-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--info));
  transition: width 0.25s ease;
}
.order-progress-text {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.order-history-table td.link-cell {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.order-actions-compact { flex-wrap: nowrap; }
.order-actions-compact .btn-view-sm,
.order-actions-compact .btn-order-action {
  padding: 0.25rem 0.4rem;
  font-size: 0.68rem;
}
.order-history-table .status-text { font-weight: 500; }
.order-history-table .empty-filter {
  text-align: center;
  color: var(--muted);
  padding: 2rem !important;
}
.orders-table td.link-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
.orders-table a.link-url { color: var(--info); text-decoration: none; }
.orders-table a.link-url:hover { text-decoration: underline; }

.order-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.actions-cell { min-width: 6rem; }
.btn-order-action {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 0.28rem 0.45rem;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  font-weight: 600;
}
.btn-cancel-sm { color: var(--err); border-color: rgba(255, 138, 138, 0.35); }

.orders-last-updated {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  text-align: right;
}

/* Mobile order cards */
.order-cards { display: none; }
@media (max-width: 768px) {
  .order-history-table-wrap { display: none; }
  .order-cards { display: grid; gap: 0.75rem; }
  .order-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    transition: border-color var(--transition), box-shadow var(--transition);
  }
  .order-card:hover {
    border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
    box-shadow: var(--shadow-sm);
  }
  .order-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.65rem;
  }
  .order-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 0.75rem;
    font-size: 0.82rem;
  }
  .order-card-meta dt { color: var(--muted); font-size: 0.72rem; }
  .order-card-meta dd { margin: 0; font-weight: 500; }
  .order-card-actions { margin-top: 0.75rem; }
}

/* Auth */
.auth-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
}
.auth-brand {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--card)), var(--card));
  border-right: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.auth-brand::before {
  content: '';
  position: absolute;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: var(--accent-glow);
  filter: blur(60px);
  top: -80px;
  right: -80px;
  pointer-events: none;
}
.auth-brand-inner { position: relative; max-width: 400px; }
.auth-brand h1 {
  margin: 0 0 0.75rem;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.auth-brand p { margin: 0; color: var(--muted); line-height: 1.55; }
.auth-features {
  margin-top: 2rem;
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
.auth-features li {
  font-size: 0.9rem;
  padding-left: 1.5rem;
  position: relative;
}
.auth-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--ok);
  font-weight: 700;
}
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  position: relative;
}
.auth-top { position: absolute; top: 1rem; right: 1rem; }
.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-sm);
}
.auth-card h2 { margin: 0 0 0.35rem; font-size: 1.35rem; }
.auth-card .auth-sub { margin: 0 0 1.25rem; color: var(--muted); font-size: 0.9rem; }
.auth-card form { max-width: none; gap: 1rem; display: grid; }
.auth-card label { color: var(--text); font-weight: 500; }
.auth-footer {
  margin-top: 1.25rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}
.auth-footer a { color: var(--accent); font-weight: 600; text-decoration: none; }
.key-reveal {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ok);
  background: color-mix(in srgb, var(--ok) 8%, var(--bg));
}
.docs-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* API docs */
.api-docs-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.docs-toc {
  position: sticky;
  top: 1rem;
  padding: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
}
.docs-toc h2 {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.docs-toc ul { list-style: none; margin: 0; padding: 0; }
.docs-toc a {
  display: block;
  padding: 0.35rem 0;
  color: var(--muted);
  text-decoration: none;
}
.docs-toc a:hover, .docs-toc a.active { color: var(--accent); }
.docs-content { min-width: 0; }

.docs-block {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.docs-block.is-collapsed .docs-block-body { display: none; }
.docs-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}
.docs-block-head h2 { margin: 0; font-size: 1.05rem; border: none; padding: 0; }
.docs-toggle {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
}
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.docs-table th, .docs-table td {
  text-align: left;
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.docs-table th { color: var(--muted); font-weight: 600; width: 28%; }
.docs-json {
  margin: 0.5rem 0 0;
  padding: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-x: auto;
  white-space: pre;
}
.docs-callout {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  font-size: 0.85rem;
}
.docs-method {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  vertical-align: middle;
  font-family: var(--font-mono);
}
.docs-method.get { background: color-mix(in srgb, var(--ok) 20%, transparent); color: var(--ok); }
.docs-method.post { background: color-mix(in srgb, var(--info) 20%, transparent); color: var(--info); }
.api-docs-page .api-key-hint { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }
.api-docs-page .docs-note { margin: 0.5rem 0 0; font-size: 0.82rem; color: var(--muted); }

/* Transactions */
.transactions-page { max-width: 1200px; }
.tx-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--card)), var(--card));
  color: var(--text);
}
.tx-breadcrumb { margin: 0 0 0.35rem; font-size: 0.8rem; color: var(--muted); }
.tx-hero h1 {
  margin: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tx-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--accent-glow);
  color: var(--accent);
  font-weight: 700;
}
.tx-hero-sub { margin: 0.35rem 0 0.75rem; font-size: 0.9rem; color: var(--muted); }
.tx-hero-stats { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tx-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
}
.tx-stat-pill strong { color: var(--text); }
.tx-funds-note {
  flex-shrink: 0;
  align-self: center;
  max-width: 220px;
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--info-muted);
  border: 1px solid color-mix(in srgb, var(--info) 25%, var(--border));
  color: var(--text);
}
.tx-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.tx-search-wrap { display: flex; flex: 1; min-width: 200px; }
.tx-search {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  border: 1px solid var(--border);
  border-right: none;
  background: var(--input-bg);
  color: var(--text);
}
.tx-type-filter {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}
.tx-amt-pos { color: var(--info); font-weight: 600; }
.tx-amt-neg { color: var(--err); font-weight: 600; }
.tx-status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ok);
  text-transform: uppercase;
}
.tx-desc { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.tx-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.tx-page-size select {
  margin-left: 0.35rem;
  padding: 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
}
.tx-pager { display: flex; gap: 0.35rem; margin-left: auto; }

@media (max-width: 900px) {
  .new-order-layout { grid-template-columns: 1fr; }
  .order-summary-card { position: static; }
  .api-docs-layout { grid-template-columns: 1fr; }
  .docs-toc { position: static; }
}
@media (max-width: 768px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-panel::before {
    content: 'Tiknis.com';
    display: block;
    width: 100%;
    max-width: 400px;
    margin-bottom: 1rem;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
  }
  .auth-panel::before { color: var(--text); }
  .auth-panel::after {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--accent), #6366f1);
    margin: -0.75rem 0 0.5rem;
    max-width: 400px;
  }
  .tx-hero { flex-direction: column; }
}

.account-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.35rem;
  max-width: 560px;
  margin-bottom: 1rem;
}
.account-card + .account-card { margin-top: 0; }
.account-card h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.account-card p { margin: 0 0 1rem; color: var(--muted); font-size: 0.88rem; }
.account-form label {
  display: block;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.account-form input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}
.funds-hero {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  max-width: 560px;
}
.funds-hero-balance { font-size: 2rem; font-weight: 700; color: var(--accent); }
.funds-steps { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--muted); }
.funds-steps li { margin-bottom: 0.35rem; }
.funds-contact-block {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.funds-contact-block p { margin: 0 0 0.5rem; color: var(--text); }
.funds-contact-block p:last-child { margin-bottom: 0; }
.funds-contact-block a { color: var(--info); font-weight: 600; text-decoration: none; }
.funds-contact-block a:hover { text-decoration: underline; }
.funds-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tx-funds-note a { color: var(--accent); font-weight: 600; }
