/* Accountchi Dashboard — modern user panel (theme-token aware, RTL) */
.akch-dash {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
  max-width: 1240px;
  margin-inline: auto;
  padding: clamp(20px, 3vw, 36px) clamp(12px, 3vw, 32px);
  color: var(--text, #1a1035);
  align-items: start;
}

/* ── Sidebar ── */
.akch-dash-side {
  position: sticky;
  top: 84px;
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e0f5);
  border-radius: 20px;
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.akch-dash-user { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; border-bottom: 1px solid var(--border, #e5e0f5); }
.akch-dash-avatar img { border-radius: 12px; display: block; }
.akch-dash-user-meta { min-width: 0; display: flex; flex-direction: column; }
.akch-dash-user-meta strong { font-size: 13.5px; font-weight: 800; }
.akch-dash-user-meta span { font-size: 11px; color: var(--muted2, #8f80b0); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.akch-dash-nav { display: flex; flex-direction: column; gap: 3px; }
.akch-dash-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: none; border: none; cursor: pointer;
  font: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--muted, #6b5f8a); text-align: right; text-decoration: none;
  transition: background 0.2s, color 0.2s;
  width: 100%;
}
.akch-dash-nav-item:hover { background: var(--surface, rgba(124, 58, 237, 0.05)); color: var(--text, #1a1035); }
.akch-dash-nav-item.active {
  background: linear-gradient(135deg, var(--accent, #7c3aed), var(--accent2, #c026d3));
  color: #fff;
  box-shadow: 0 8px 20px -8px var(--glow, rgba(124, 58, 237, 0.4));
}
.akch-nav-icon { display: grid; place-items: center; flex-shrink: 0; }
.akch-logout { color: #ef4444 !important; margin-top: 8px; border-top: 1px solid var(--border, #e5e0f5); border-radius: 0 0 12px 12px; padding-top: 14px !important; }
.akch-logout:hover { background: rgba(239, 68, 68, 0.08) !important; }

/* ── Main panels ── */
.akch-dash-main { min-width: 0; }
.akch-dash-panel { display: none; animation: akchFade 0.3s ease; }
.akch-dash-panel.active { display: block; }
@keyframes akchFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.akch-panel-head { margin-bottom: 20px; }
.akch-panel-head h2 { font-size: clamp(18px, 2.2vw, 24px); font-weight: 900; margin: 0 0 6px; }
.akch-panel-head p { font-size: 13px; color: var(--muted, #6b5f8a); margin: 0; }

.akch-sec-title { font-size: 15px; font-weight: 800; margin: 26px 0 12px; }
.akch-muted { color: var(--muted, #6b5f8a); font-size: 13px; }

/* Stats */
.akch-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.akch-stat {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e0f5);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}
.akch-stat-num { display: block; font-size: 22px; font-weight: 900; color: var(--accent-text, #6d28d9); }
.akch-stat-label { display: block; margin-top: 5px; font-size: 12px; color: var(--muted, #6b5f8a); }

/* CTA card */
.akch-cta-card {
  background: var(--surface, rgba(124, 58, 237, 0.05));
  border: 1px dashed var(--border2, #cbc3ea);
  border-radius: 18px;
  padding: 26px;
  text-align: center;
  margin: 18px 0;
}
.akch-cta-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 800; }
.akch-cta-card p { margin: 0 0 16px; font-size: 13px; color: var(--muted, #6b5f8a); }
.akch-cta-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Buttons */
.akch-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: linear-gradient(135deg, var(--accent, #7c3aed), var(--accent2, #c026d3));
  color: #fff !important;
  font-size: 13px; font-weight: 800;
  padding: 10px 24px; border-radius: 12px;
  border: none; cursor: pointer; font-family: inherit;
  text-decoration: none !important;
  transition: filter 0.2s, transform 0.2s;
}
.akch-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.akch-btn-ghost { background: var(--card, #fff); color: var(--text, #1a1035) !important; border: 1px solid var(--border, #e5e0f5); }
.akch-btn-sm { padding: 6px 16px; font-size: 12px; }
.akch-link-btn {
  background: none; border: none; cursor: pointer; font: inherit;
  color: var(--accent-text, #6d28d9); font-size: 13px; font-weight: 700; padding: 8px 0;
}

/* Tables */
.akch-table-wrap { overflow-x: auto; border: 1px solid var(--border, #e5e0f5); border-radius: 14px; }
.akch-table { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--card, #fff); }
.akch-table th {
  text-align: right; padding: 12px 14px;
  background: var(--surface, rgba(124, 58, 237, 0.05));
  font-weight: 800; font-size: 12px;
  border-bottom: 1px solid var(--border, #e5e0f5);
}
.akch-table td { padding: 11px 14px; border-bottom: 1px solid var(--border, #e5e0f5); }
.akch-table tr:last-child td { border-bottom: none; }

/* Badges */
.akch-badge { display: inline-block; padding: 3px 11px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.akch-badge-ok { background: rgba(52, 211, 153, 0.14); color: #059669; }
.akch-badge-info { background: rgba(59, 130, 246, 0.13); color: #2563eb; }
.akch-badge-warn { background: rgba(245, 158, 11, 0.14); color: #d97706; }
.akch-badge-bad { background: rgba(239, 68, 68, 0.13); color: #dc2626; }

/* Overview mini subscriptions */
.akch-mini-subs { display: flex; flex-direction: column; gap: 10px; }
.akch-mini-sub {
  background: var(--card, #fff); border: 1px solid var(--border, #e5e0f5);
  border-radius: 14px; padding: 14px 16px;
}
.akch-mini-sub-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; }
.akch-mini-sub-top span { color: var(--muted, #6b5f8a); font-size: 12px; }
.akch-meter { height: 6px; border-radius: 99px; background: var(--chip, rgba(124, 58, 237, 0.1)); overflow: hidden; }
.akch-meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent, #7c3aed), var(--accent2, #c026d3)); }

/* Orders accordion */
.akch-orders { display: flex; flex-direction: column; gap: 10px; }
.akch-order { background: var(--card, #fff); border: 1px solid var(--border, #e5e0f5); border-radius: 14px; overflow: hidden; }
.akch-order summary {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 18px; cursor: pointer; list-style: none; font-size: 13px;
}
.akch-order summary::-webkit-details-marker { display: none; }
.akch-order-id { font-weight: 800; }
.akch-order-date { color: var(--muted, #6b5f8a); font-size: 12px; }
.akch-order-total { font-weight: 700; margin-inline-start: auto; }
.akch-order-chev { color: var(--muted2, #8f80b0); transition: transform 0.25s; }
.akch-order[open] .akch-order-chev { transform: rotate(180deg); }
.akch-order-body { padding: 0 18px 16px; display: flex; flex-direction: column; gap: 12px; }

/* Forms */
.akch-form-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.akch-form-card { background: var(--card, #fff); border: 1px solid var(--border, #e5e0f5); border-radius: 18px; padding: 22px; }
.akch-form-card h3 { margin: 0 0 16px; font-size: 15px; font-weight: 800; }
.akch-form-card form { display: flex; flex-direction: column; gap: 14px; }
.akch-form-card label { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; font-weight: 700; }
.akch-form-card input {
  background: var(--bg2, #f4f1fc); border: 1px solid var(--border, #e5e0f5);
  border-radius: 11px; color: var(--text, #1a1035);
  padding: 10px 14px; font: inherit; font-size: 13.5px;
}
.akch-form-card input:focus { outline: none; border-color: var(--border2, #cbc3ea); }
.akch-form-card input:disabled { opacity: 0.6; }
.akch-form-card small { font-weight: 400; color: var(--muted2, #8f80b0); }
.akch-form-msg { font-size: 12.5px; font-weight: 700; padding: 10px 14px; border-radius: 10px; }
.akch-form-msg.ok { background: rgba(52, 211, 153, 0.12); color: #059669; }
.akch-form-msg.err { background: rgba(239, 68, 68, 0.12); color: #dc2626; }

/* Guide */
.akch-guide-steps { display: flex; flex-direction: column; gap: 12px; }
.akch-guide-step {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card, #fff); border: 1px solid var(--border, #e5e0f5);
  border-radius: 16px; padding: 18px;
}
.akch-guide-num {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center;
  border-radius: 11px; font-weight: 900;
  background: var(--accent-soft, rgba(124, 58, 237, 0.12));
  color: var(--accent-text, #6d28d9);
}
.akch-guide-step h3 { margin: 2px 0 6px; font-size: 14.5px; font-weight: 800; }
.akch-guide-step p { margin: 0; font-size: 12.5px; color: var(--muted, #6b5f8a); line-height: 1.9; }

/* Login prompt */
.akch-dash-login {
  max-width: 420px; margin: 60px auto; text-align: center;
  background: var(--card, #fff); border: 1px solid var(--border, #e5e0f5);
  border-radius: 22px; padding: 40px 30px;
}
.akch-dash-login-icon { font-size: 40px; margin-bottom: 10px; }
.akch-dash-login h2 { font-weight: 900; margin: 0 0 8px; }
.akch-dash-login p { color: var(--muted, #6b5f8a); font-size: 13.5px; margin: 0 0 20px; }

/* ── Responsive ── */
@media (max-width: 880px) {
  .akch-dash { grid-template-columns: 1fr; }
  .akch-dash-side { position: static; }
  .akch-dash-nav { flex-direction: row; flex-wrap: wrap; }
  .akch-dash-nav-item { width: auto; flex: 1 1 auto; justify-content: center; padding: 9px 12px; font-size: 12.5px; }
  .akch-logout { margin-top: 0; border-top: none; padding-top: 9px !important; }
  .akch-dash-user { border-bottom: none; padding-bottom: 4px; }
}

/* ══════════════════════════════════════════════════════════════════
   Full-screen shell
   Applied only when the page uses the full-screen template, so the
   shortcode keeps working inside a normal content column elsewhere.
   ══════════════════════════════════════════════════════════════════ */
.akch-dash-shell {
  display: block;
  width: 100%;
  min-height: 70vh;
  /* No background of its own: --surface2 is undefined in dark mode, so a
     light fallback painted a white band behind the dark cards. Let the theme
     body show through and the shell is correct in both themes. */
  background: transparent;
  padding-block: clamp(16px, 2.5vw, 32px);
}
.akch-dash-shell .akch-dash {
  max-width: 1560px;
  grid-template-columns: 272px 1fr;
  gap: 24px;
  padding-inline: clamp(14px, 2.5vw, 40px);
}
.akch-dash-shell .akch-dash-side {
  top: 24px;
  padding: 20px 16px;
  border-radius: 22px;
}
.akch-dash-shell .akch-dash-main {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e0f5);
  border-radius: 22px;
  padding: clamp(18px, 2.2vw, 30px);
  min-height: 60vh;
}

/* WooCommerce endpoint views borrow the same card so /panel/orders,
   /panel/edit-account etc. do not look like a different site. */
.akch-dash-wc {
  max-width: 1100px;
  margin-inline: auto;
  padding-inline: clamp(14px, 2.5vw, 40px);
}
.akch-dash-wc .woocommerce {
  background: var(--card, #fff);
  border: 1px solid var(--border, #e5e0f5);
  border-radius: 22px;
  padding: clamp(18px, 2.2vw, 30px);
}

/* Copy-to-clipboard credential chip (deliveries tab) */
.akch-copy {
  display: inline-block;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  direction: ltr;
  unicode-bidi: embed;
  background: var(--surface, rgba(124, 58, 237, 0.06));
  border: 1px solid var(--border, #e5e0f5);
  border-radius: 8px;
  padding: 3px 9px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.akch-copy:hover { border-color: var(--accent, #7c3aed); }
.akch-copy.copied {
  background: rgba(16, 185, 129, 0.12);
  border-color: #10b981;
}

@media (max-width: 900px) {
  .akch-dash-shell .akch-dash { grid-template-columns: 1fr; gap: 14px; }
  .akch-dash-shell .akch-dash-side { position: static; padding: 14px; border-radius: 16px; }
  .akch-dash-shell .akch-dash-main { padding: 16px; border-radius: 16px; min-height: 0; }
  /* Tabs become a horizontal rail so they do not eat a whole screen. */
  .akch-dash-shell .akch-dash-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .akch-dash-shell .akch-dash-nav::-webkit-scrollbar { display: none; }
  .akch-dash-shell .akch-dash-nav-item { flex: 0 0 auto; white-space: nowrap; }
  .akch-dash-shell .akch-table-wrap { overflow-x: auto; }
  .akch-dash-shell .akch-table { min-width: 520px; }
}

@media (max-width: 480px) {
  .akch-dash-shell { padding-block: 10px; }
  .akch-dash-shell .akch-dash { padding-inline: 10px; }
  .akch-dash-shell .akch-dash-nav-item span:not(.akch-nav-icon) { font-size: 12.5px; }
}
