/* ==========================================================================
   Modern Customer Account Panel, Auth & Ticketing UI (Adaptive to All Themes)
   ========================================================================== */
:root {
  --acc-primary: var(--ch-primary, var(--prk-primary, var(--primary, #0ea5a4)));
  --acc-primary-dark: #0f766e;
  --acc-bg: #f8fafc;
  --acc-card: #ffffff;
  --acc-border: #e2e8f0;
  --acc-text: #0f172a;
  --acc-muted: #64748b;
  --acc-radius: 16px;
}

.acc-wrap {
  max-width: 1260px;
  margin: 26px auto 48px;
  padding: 0 16px;
  direction: rtl;
  font-family: inherit;
  color: var(--acc-text);
}

/* --- Auth Pages (Login / Register / OTP) --- */
.acc-auth-shell {
  max-width: 480px;
  margin: 34px auto 56px;
  background: var(--acc-card);
  border: 1px solid var(--acc-border);
  border-radius: 20px;
  padding: 28px 26px;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}
.acc-auth-head {
  text-align: center;
  margin-bottom: 20px;
}
.acc-auth-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--acc-primary), #1e293b);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}
.acc-auth-head h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 800;
}
.acc-auth-head p {
  margin: 0;
  font-size: 13px;
  color: var(--acc-muted);
}
.acc-auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: #f1f5f9;
  padding: 5px;
  border-radius: 12px;
  margin-bottom: 18px;
}
.acc-auth-tab {
  border: none;
  background: transparent;
  padding: 9px 10px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  color: var(--acc-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.acc-auth-tab.is-active {
  background: #fff;
  color: var(--acc-text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* --- Account 2-Column Layout --- */
.acc-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.acc-sidebar {
  background: var(--acc-card);
  border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius);
  overflow: hidden;
  position: sticky;
  top: 20px;
  box-shadow: 0 6px 22px rgba(15, 23, 42, 0.04);
}
.acc-user-box {
  padding: 20px 18px;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
}
.acc-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--acc-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
}
.acc-user-meta strong {
  display: block;
  font-size: 15px;
  margin-bottom: 3px;
}
.acc-user-meta span {
  font-size: 12px;
  color: #cbd5e1;
  display: block;
}
.acc-nav {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.acc-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-radius: 11px;
  color: #334155;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  transition: all 0.18s;
}
.acc-nav a .acc-nav-l {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.acc-nav a i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  color: #64748b;
}
.acc-nav a:hover {
  background: #f1f5f9;
  color: #0f172a;
}
.acc-nav a.is-active {
  background: var(--acc-primary);
  color: #fff !important;
}
.acc-nav a.is-active i {
  color: #fff;
}
.acc-nav a.is-logout {
  color: #dc2626;
  margin-top: 6px;
  border-top: 1px solid #f1f5f9;
  padding-top: 13px;
}
.acc-nav a.is-logout i { color: #dc2626; }
.acc-badge-cnt {
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}
.acc-nav a.is-active .acc-badge-cnt {
  background: rgba(255, 255, 255, 0.25);
}

/* --- Main Content Cards --- */
.acc-main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
}
.acc-card {
  background: var(--acc-card);
  border: 1px solid var(--acc-border);
  border-radius: var(--acc-radius);
  padding: 20px 22px;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.03);
}
.acc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f1f5f9;
}
.acc-card-head h1, .acc-card-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* --- KPI Grid --- */
.acc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.acc-kpi {
  background: var(--acc-card);
  border: 1px solid var(--acc-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 13px;
}
.acc-kpi-ico {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.acc-kpi-val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}
.acc-kpi-lbl {
  font-size: 12px;
  color: var(--acc-muted);
  margin-top: 3px;
}

/* --- Tables & Pills --- */
.acc-table-wrap {
  width: 100%;
  overflow-x: auto;
}
.acc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.acc-table th {
  text-align: right;
  padding: 11px 10px;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  border-bottom: 1px solid var(--acc-border);
  white-space: nowrap;
}
.acc-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.acc-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}
.acc-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.acc-filter-btn {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--acc-border);
  background: #fff;
  color: #475569;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
}
.acc-filter-btn.is-active {
  background: var(--acc-primary);
  border-color: var(--acc-primary);
  color: #fff;
}

/* --- Forms & Buttons --- */
.acc-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.acc-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}
.acc-field label {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
}
.acc-field input, .acc-field select, .acc-field textarea {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  color: #0f172a;
  box-sizing: border-box;
}
.acc-field input:focus, .acc-field select:focus, .acc-field textarea:focus {
  outline: none;
  border-color: var(--acc-primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 164, 0.14);
}
.acc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all 0.18s;
}
.acc-btn-primary {
  background: var(--acc-primary);
  color: #fff !important;
}
.acc-btn-primary:hover { filter: brightness(0.93); }
.acc-btn-outline {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155 !important;
}
.acc-btn-outline:hover { background: #f8fafc; }
.acc-btn-danger {
  background: #fee2e2;
  color: #b91c1c !important;
}
.acc-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.acc-btn-block { width: 100%; }

.acc-alert {
  padding: 12px 15px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 16px;
}
.acc-alert-ok { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.acc-alert-err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.acc-alert-info { background: #e0f2fe; color: #075985; border: 1px solid #7dd3fc; }

/* --- Order Timeline --- */
.acc-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 22px;
}
.acc-step {
  text-align: center;
  padding: 12px 8px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 12px;
  color: #64748b;
  font-weight: 700;
}
.acc-step i { display: block; font-size: 18px; margin-bottom: 6px; }
.acc-step.is-done {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #047857;
}

/* --- Ticket Chat Messages --- */
.acc-chat-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 16px 0 22px;
}
.acc-msg {
  max-width: 86%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  line-height: 1.75;
  font-size: 13.5px;
}
.acc-msg-customer {
  align-self: flex-start;
  background: #f8fafc;
  border-color: #cbd5e1;
}
.acc-msg-admin {
  align-self: flex-end;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.acc-msg-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 7px;
  font-weight: 700;
}

/* --- Address & Wishlist Cards --- */
.acc-addr-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.acc-addr-card {
  border: 1px solid var(--acc-border);
  border-radius: 14px;
  padding: 15px;
  background: #fff;
  position: relative;
}
.acc-addr-card.is-default {
  border-color: var(--acc-primary);
  background: #f0fdfa;
}
.acc-wish-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.acc-wish-card {
  border: 1px solid var(--acc-border);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.acc-wish-card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 10px;
  background: #f8fafc;
}

.acc-empty {
  text-align: center;
  padding: 36px 16px;
  color: var(--acc-muted);
}
.acc-empty i { font-size: 36px; opacity: 0.35; margin-bottom: 10px; display: block; }

/* --- Responsive --- */
@media (max-width: 960px) {
  .acc-layout { grid-template-columns: 1fr; }
  .acc-sidebar { position: static; }
  .acc-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .acc-wish-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .acc-form-grid, .acc-addr-grid, .acc-timeline { grid-template-columns: 1fr; }
  .acc-wish-grid { grid-template-columns: 1fr; }
  .acc-msg { max-width: 100%; }
}
@media print {
  header, footer, nav, .acc-sidebar, .no-print { display: none !important; }
  .acc-layout { display: block !important; }
  .acc-card { border: none !important; box-shadow: none !important; padding: 0 !important; }
}
