/* Dizayn tokenlari, asosiy elementlar va qayta ishlatiladigan komponentlar. */
:root {
  color-scheme: light;
  --bg: #f4f3ee;
  --surface: #ffffff;
  --surface-2: #f8f7f3;
  --line: #e6e3da;
  --line-strong: #d3cfc3;
  --text: #17181a;
  --muted: #65676c;
  --faint: #9a9ca1;
  --accent: #0b7a5c;
  --accent-hover: #096649;
  --accent-soft: #e1f2eb;
  --on-accent: #ffffff;
  --blue: #2457d6;
  --blue-soft: #e6edfc;
  --amber: #9a5a05;
  --amber-soft: #fcefd3;
  --red: #b3261e;
  --red-soft: #fbe8e6;
  --shadow-sm: 0 1px 2px rgba(24, 24, 16, 0.05);
  --shadow-md: 0 10px 30px rgba(24, 24, 16, 0.08);
  --shadow-lg: 0 28px 70px rgba(24, 24, 16, 0.22);
  --radius: 16px;
  --radius-sm: 10px;
  --avatar-l: 90%;
  --avatar-text-l: 28%;
  --font: 'Onest', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d100f;
  --surface: #151917;
  --surface-2: #1a1f1d;
  --line: #252b28;
  --line-strong: #353d39;
  --text: #eceeed;
  --muted: #9ba29e;
  --faint: #6b726e;
  --accent: #34d399;
  --accent-hover: #5fe0b0;
  --accent-soft: #11332a;
  --on-accent: #05251a;
  --blue: #8fb0ff;
  --blue-soft: #18233f;
  --amber: #f2bd62;
  --amber-soft: #382a10;
  --red: #ff8f86;
  --red-soft: #3b1a17;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.6);
  --avatar-l: 24%;
  --avatar-text-l: 82%;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 30px);
  font-weight: 650;
  letter-spacing: -0.025em;
  line-height: 1.15;
}

h2 {
  font-size: 17px;
  font-weight: 620;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 15px;
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

svg {
  flex: none;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.num {
  font-variant-numeric: tabular-nums;
}

.pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- Tugmalar ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 550;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:hover {
  background: var(--surface-2);
  border-color: var(--faint);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 8px 18px -10px color-mix(in srgb, var(--accent) 85%, transparent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-danger {
  color: var(--red);
  border-color: color-mix(in srgb, var(--red) 35%, var(--line));
}

.btn-danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
}

.btn-sm {
  height: 32px;
  padding: 0 11px;
  font-size: 13px;
  border-radius: 8px;
}

.btn-lg {
  height: 48px;
  padding: 0 22px;
  font-size: 15px;
  border-radius: 12px;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

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

/* ---- Kartalar va ro'yxatlar ---- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 0;
}

.card-body {
  padding: 20px;
}

.list {
  padding: 8px;
}

.row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}

a.row,
button.row {
  cursor: pointer;
}

a.row:hover,
button.row:hover {
  background: var(--surface-2);
}

.row-main {
  flex: 1;
  min-width: 0;
}

.row-title {
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-side {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.row-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--muted);
}

.row-icon.tone-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.row-icon.tone-blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.row-icon.tone-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 50%;
  background: hsl(var(--hue) 55% var(--avatar-l));
  color: hsl(var(--hue) 55% var(--avatar-text-l));
  font-weight: 650;
  font-size: 14px;
  letter-spacing: 0.02em;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 22px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.badge.tone-accent {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.badge.tone-blue {
  background: var(--blue-soft);
  border-color: transparent;
  color: var(--blue);
}

.badge.tone-amber {
  background: var(--amber-soft);
  border-color: transparent;
  color: var(--amber);
}

.badge.tone-red {
  background: var(--red-soft);
  border-color: transparent;
  color: var(--red);
}

.empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--faint);
}

.empty strong {
  color: var(--text);
  font-weight: 600;
}

.spinner {
  width: 26px;
  height: 26px;
  margin: 64px auto;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Telefonda bo'sh holat bloklari ekranni ortiqcha egallamasin. */
@media (max-width: 860px) {
  .empty {
    padding: 22px 16px;
  }

  .empty-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }
}
