/* Admin & User Panel Styles */

/* Welcome card (user dashboard) */
.welcome {
  background: linear-gradient(135deg, #ECFDF5 0%, #FFFFFF 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
[data-theme="dark"] .welcome {
  background: linear-gradient(135deg, rgba(16,185,129,.08) 0%, var(--surface) 60%);
}
.welcome::after {
  content: 'ক';
  position: absolute;
  right: 24px; bottom: -28px;
  font-family: 'Noto Sans Bengali', sans-serif;
  font-size: 160px;
  color: var(--accent);
  opacity: .07;
  line-height: 1;
  font-weight: 600;
}
.welcome h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.welcome p {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}
.welcome .actions {
  display: flex; gap: 8px;
  margin-top: 16px;
}

/* Quick action card */
.qa {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all .15s ease;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.qa:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}
.qa .icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--accent-bg);
  color: var(--accent-text);
  display: grid; place-items: center;
}
.qa .icon svg { width: 20px; height: 20px; }
.qa h4 { margin: 0; font-size: 15px; font-weight: 600; }
.qa p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.55; }

/* Mini examples */
.examples {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ex {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border-radius: 7px;
  font-size: 13.5px;
}
.ex .lat { font-family: 'JetBrains Mono', monospace; color: var(--text-2); min-width: 56px; }
.ex .arrow { color: var(--text-3); }
.ex .bn { font-family: 'Noto Sans Bengali', sans-serif; font-size: 16px; }

/* Top queries */
.tq-row {
  display: grid;
  grid-template-columns: 80px 1fr 56px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
.tq-row:last-child { border-bottom: none; }
.tq-q { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--text); }
.tq-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}
.tq-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-500), var(--emerald-600));
  border-radius: 99px;
}
.tq-c { text-align: right; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; font-weight: 500; }

/* Token cell */
.token-cell {
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text-2);
}
.token-cell .copy-btn {
  color: var(--text-3);
  cursor: pointer;
  background: transparent;
  border: none;
  padding: 2px;
}
.token-cell .copy-btn:hover { color: var(--accent); }
.token-cell .copy-btn svg { width: 14px; height: 14px; }

/* API doc card */
.api-doc {
  background: var(--slate-900);
  color: #E2E8F0;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 18px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  line-height: 1.7;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--slate-700);
}
.api-doc .lbl {
  color: #94A3B8;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 12px;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.1em;
}
.api-doc .lbl:first-child { margin-top: 0; }
.api-doc .method { color: #34D399; font-weight: 700; }
.api-doc .url { color: #FCD34D; }
.api-doc .str { color: #BEF264; }
.api-doc .key { color: #93C5FD; }
.api-doc .com { color: #64748B; }
.api-doc-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 4px;
}
.api-doc-head h3 {
  margin: 0; font-family: 'Inter', sans-serif; font-size: 13px;
  font-weight: 600; color: #F8FAFC;
  text-transform: uppercase; letter-spacing: 0.06em;
  display: flex; align-items: center; gap: 8px;
}
.api-doc-head h3 svg { width: 14px; height: 14px; color: var(--emerald-500); }
.api-doc-head .copy-btn {
  color: #94A3B8;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  padding: 4px 10px;
  border-radius: 6px;
  font-family: 'Inter', sans-serif;
  font-size: 11.5px;
  cursor: pointer;
  display: flex; align-items: center; gap: 5px;
}
.api-doc-head .copy-btn:hover { color: white; background: rgba(255,255,255,.1); }
.api-doc-head .copy-btn svg { width: 12px; height: 12px; }

/* Profile page */
.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  align-items: start;
}
.profile-pic-card {
  text-align: center;
  padding: 24px 20px;
}
.pp-avatar {
  width: 96px; height: 96px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, #818CF8, #6366F1);
  color: white;
  font-weight: 600;
  font-size: 36px;
  display: grid; place-items: center;
}
.danger-zone {
  border: 1px solid var(--red-500);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  background: var(--red-50);
}
[data-theme="dark"] .danger-zone { background: rgba(239,68,68,.08); }
.danger-zone h3 {
  margin: 0 0 4px; color: #B91C1C; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
[data-theme="dark"] .danger-zone h3 { color: #FCA5A5; }
.danger-zone p { margin: 0 0 12px; font-size: 12.5px; color: var(--text-2); }

/* Row layouts */
.row-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

@media (max-width: 900px) {
  .row-2 { grid-template-columns: 1fr; }
  .profile-grid { grid-template-columns: 1fr; }
}

/* Admin Panel Styles */

/* Admin banner badge */
.admin-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(245, 158, 11, .12);
  color: var(--amber-500);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(245, 158, 11, .3);
}

/* Grid layouts */
.row-2-13 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.row-2-eq {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* Bar chart */
.chart-wrap {
  padding: 18px 20px 8px;
}

.bar-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 14px;
  height: 200px;
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border);
}

.bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: end;
  position: relative;
}

.bar {
  width: 100%;
  max-width: 38px;
  background: linear-gradient(180deg, var(--emerald-500), var(--emerald-700));
  border-radius: 6px 6px 0 0;
}

.bar .val {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.day-labels {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 14px;
  padding: 10px 0 4px;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}

/* Top words list */
.tw-row {
  display: grid;
  grid-template-columns: 24px 1fr 60px 80px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.tw-row:last-child {
  border-bottom: none;
}

.tw-rank {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.tw-row:nth-child(-n+3) .tw-rank {
  background: var(--accent-bg);
  color: var(--accent-text);
}

.tw-bn {
  font-family: 'Noto Sans Bengali', sans-serif;
  font-size: 17px;
}

.tw-lat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-3);
  margin-left: 8px;
}

.tw-c {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 500;
}

.tw-bar {
  height: 5px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
}

.tw-bar > div {
  height: 100%;
  background: var(--accent);
}

/* Quick actions grid */
.qa-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
}

.qa-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
}

.qa-tile:hover {
  border-color: var(--accent);
}

.qa-tile .icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent-bg);
  color: var(--accent-text);
  display: grid;
  place-items: center;
}

.qa-tile .icon svg {
  width: 16px;
  height: 16px;
}

/* System info grid */
.sys-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.sys-cell {
  padding: 14px 18px;
  border-right: 1px solid var(--border);
}

.sys-cell:last-child {
  border-right: none;
}

.sys-cell .l {
  font-size: 10.5px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}

.sys-cell .v {
  font-size: 17px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.sys-cell .v.green {
  color: var(--accent-text);
}

/* Progress bar */
.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0 6px;
}

.progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--emerald-500), var(--emerald-600));
  border-radius: 99px;
  transition: width .3s ease;
}

/* Action buttons for tables */
.icon-action {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  display: inline-grid;
  place-items: center;
  color: var(--text-3);
  background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  margin-right: 4px;
}

.icon-action:hover {
  color: var(--text);
  background: var(--surface-2);
}

.icon-action.danger:hover {
  color: var(--red-500);
  border-color: var(--red-500);
}

.icon-action svg {
  width: 12px;
  height: 12px;
}

/* Sidebar footer logout button */
.sb-logout {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-3);
  cursor: pointer;
  margin-left: auto;
}

.sb-logout:hover {
  color: var(--red-400);
  border-color: var(--red-500);
  background: rgba(239, 68, 68, 0.1);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .sys-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .sys-cell:nth-child(2) {
    border-right: none;
  }
}

@media (max-width: 768px) {
  .row-2-13,
  .row-2-eq,
  .row-3 {
    grid-template-columns: 1fr;
  }
  .sys-grid {
    grid-template-columns: 1fr;
  }
  .sys-cell {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sys-cell:last-child {
    border-bottom: none;
  }
}
