/* ==========================================================================
   رمزدان — زبان بصری: One UI روشن
   خاکستری روشن، سطح‌های سفیدِ خیلی گرد، سایهٔ نرم به‌جای خط، دکمه‌های قرصی،
   تینت پاستلی برای هر نوع مورد. امضا: کارت بانکی به شکل کارت واقعی با رنگ بانک،
   و رمزهای رنگی (رقم آبی، نماد نارنجی).
   ========================================================================== */

@font-face { font-family: Vazirmatn; font-weight: 400; font-display: swap; src: url("../fonts/Vazirmatn-Regular.woff2") format("woff2"); }
@font-face { font-family: Vazirmatn; font-weight: 500 600; font-display: swap; src: url("../fonts/Vazirmatn-Medium.woff2") format("woff2"); }
@font-face { font-family: Vazirmatn; font-weight: 700 900; font-display: swap; src: url("../fonts/Vazirmatn-Bold.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg: #f1f3f7;
  --surface: #ffffff;
  --surface-2: #f5f6fa;
  --surface-3: #e9ecf3;
  --ink: #161a28;
  --ink-2: #5a6174;
  --ink-3: #9299aa;
  --line: #e8ebf1;

  --brand: #0e7c66;
  --brand-600: #0a6552;
  --brand-tint: #d9f2ea;
  --on-brand: #ffffff;

  --blue: #2b6fff;   --blue-t: #dfe9ff;
  --amber: #e07800;  --amber-t: #ffedd4;
  --yellow: #b58900; --yellow-t: #fff3c4;
  --red: #e5484d;    --red-t: #ffe4e3;
  --violet: #7c4ddf; --violet-t: #ece4ff;
  --green: #0f9a68;  --green-t: #d6f4e7;
  --pink: #d9467d;   --pink-t: #ffe1ec;
  --cyan: #0891b2;   --cyan-t: #d5f2f8;

  --ch-digit: #2b6fff;
  --ch-sym: #ee7a12;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --sh-1: 0 1px 2px rgba(22, 28, 45, .04), 0 8px 24px rgba(22, 28, 45, .06);
  --sh-2: 0 4px 12px rgba(22, 28, 45, .08), 0 22px 48px rgba(22, 28, 45, .16);
  --mono: ui-monospace, "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1216; --surface: #1a1e25; --surface-2: #222731; --surface-3: #2c323d;
    --ink: #eef1f6; --ink-2: #aeb5c3; --ink-3: #737c8c; --line: #2a303a;
    --brand: #34c29f; --brand-600: #5fd6b8; --brand-tint: #173a33; --on-brand: #04231b;
    --blue: #7aa7ff; --blue-t: #1c2a45; --amber: #ffab4d; --amber-t: #3a2912; --yellow: #f0c94a; --yellow-t: #3a3113;
    --red: #ff7a7e; --red-t: #3d1c1e; --violet: #b199ff; --violet-t: #2b2346; --green: #4fd39d; --green-t: #173a2c;
    --pink: #ff8fb6; --pink-t: #3d1c29; --cyan: #5ed1ea; --cyan-t: #133540;
    --ch-digit: #7fb0ff; --ch-sym: #ffa04d;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --sh-2: 0 4px 12px rgba(0, 0, 0, .4), 0 22px 48px rgba(0, 0, 0, .5);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1216; --surface: #1a1e25; --surface-2: #222731; --surface-3: #2c323d;
  --ink: #eef1f6; --ink-2: #aeb5c3; --ink-3: #737c8c; --line: #2a303a;
  --brand: #34c29f; --brand-600: #5fd6b8; --brand-tint: #173a33; --on-brand: #04231b;
  --blue: #7aa7ff; --blue-t: #1c2a45; --amber: #ffab4d; --amber-t: #3a2912; --yellow: #f0c94a; --yellow-t: #3a3113;
  --red: #ff7a7e; --red-t: #3d1c1e; --violet: #b199ff; --violet-t: #2b2346; --green: #4fd39d; --green-t: #173a2c;
  --pink: #ff8fb6; --pink-t: #3d1c29; --cyan: #5ed1ea; --cyan-t: #133540;
  --ch-digit: #7fb0ff; --ch-sym: #ffa04d;
  --sh-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  --sh-2: 0 4px 12px rgba(0, 0, 0, .4), 0 22px 48px rgba(0, 0, 0, .5);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.65 Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.35; }
::selection { background: var(--brand-tint); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 20px; border: 3px solid transparent; background-clip: content-box; }

.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 16px; height: 16px; }
.ic.star-on { width: 15px; height: 15px; fill: var(--amber); stroke: var(--amber); }
.muted { color: var(--ink-2); }
.mono { font-family: var(--mono); letter-spacing: .02em; }

/* ── دکمه‌ها ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  height: 44px; padding: 0 20px; border: 0; border-radius: 999px;
  font-weight: 600; font-size: 14.5px; white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 28%, transparent); }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); }
.btn-ghost { background: var(--surface-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-soft { background: var(--red-t); color: var(--red); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; }
.btn-block { width: 100%; height: 50px; font-size: 15.5px; }

.icon-btn {
  display: inline-grid; place-items: center; flex: none;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn.sm { width: 32px; height: 32px; }
.icon-btn.sm .ic { width: 17px; height: 17px; }
.icon-btn.star-active { color: var(--amber); }
.icon-btn.star-active .ic { fill: var(--amber); }

.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 2px;
  border: 0; background: none; color: var(--brand); font-weight: 600; font-size: 14px;
}
.link-btn:hover { text-decoration: underline; }

/* ── فرم ─────────────────────────────────────────────────── */
.stack { display: grid; gap: 16px; }
.field-label { display: grid; gap: 6px; min-width: 0; }
.field-label > span:first-child { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.input {
  width: 100%; height: 48px; padding: 0 16px;
  border: 1.5px solid transparent; border-radius: 14px;
  background: var(--surface-2); outline: none; transition: border-color .15s, background .15s;
}
.input:focus { border-color: var(--brand); background: var(--surface); }
.input::placeholder { color: var(--ink-3); }
.textarea { height: auto; padding: 12px 16px; resize: vertical; line-height: 1.8; }
select.input { appearance: none; padding-inline-start: 16px; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%); background-position: 18px 21px, 23px 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.panel .input { background: var(--surface); }
.panel .input:focus { background: var(--surface); }

.secret-field { position: relative; }
.input-secret { font-family: var(--mono); letter-spacing: .04em; padding-left: 92px; }
.secret-tools { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); display: flex; gap: 2px; }
.secret-tools .icon-btn { width: 36px; height: 36px; }

.meter { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 6px; align-items: center; margin-top: 8px; }
.meter i { height: 5px; border-radius: 9px; background: var(--surface-3); transition: background .2s; }
.meter-label { font-size: 12px; color: var(--ink-2); min-width: 64px; text-align: left; }
.meter[data-score="0"] i:nth-child(-n+1) { background: var(--red); }
.meter[data-score="1"] i:nth-child(-n+2) { background: var(--amber); }
.meter[data-score="2"] i:nth-child(-n+3) { background: var(--yellow); }
.meter[data-score="3"] i:nth-child(-n+4) { background: var(--green); }
.meter[data-score="4"] i { background: var(--brand); }

.form-error { background: var(--red-t); color: var(--red); border-radius: 14px; padding: 10px 14px; font-size: 14px; }
.tip { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-t); color: var(--ink); border-radius: 16px; padding: 12px 14px; font-size: 13.5px; }
.tip .ic { color: var(--amber); margin-top: 3px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.hint, .bank-badge { font-size: 12.5px; color: var(--green); min-height: 1em; }
.hint.warn, .bank-badge.warn { color: var(--red); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 14.5px; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-ui { position: relative; width: 46px; height: 28px; border-radius: 99px; background: var(--surface-3); flex: none; transition: background .2s; }
.switch-ui::after { content: ""; position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--brand); }
.switch input:checked + .switch-ui::after { transform: translateX(-18px); }
.switch input:focus-visible + .switch-ui { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch.inline { height: 48px; }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 2px; }
.seg-btn { height: 36px; padding: 0 16px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 13.5px; }
.seg-btn.on { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ── صفحه‌های ورود ───────────────────────────────────────── */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px 16px; }
.auth-card { width: min(440px, 100%); background: var(--surface); border-radius: 32px; padding: 34px 30px 28px; box-shadow: var(--sh-1); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; font-weight: 800; font-size: 20px; margin-bottom: 18px; }
.auth-title { font-size: 26px; font-weight: 800; margin: 0 0 6px; text-align: center; }
.auth-sub { color: var(--ink-2); margin: 0 0 22px; text-align: center; font-size: 14.5px; }
.auth-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.auth-note { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-3); margin: 0; }
.loading-card { display: grid; justify-items: center; gap: 14px; }
.pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; transform: scale(.94); } }

.brand-mark { width: 44px; height: 44px; border-radius: 14px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; flex: none; }
.brand-mark .ic { width: 24px; height: 24px; stroke-width: 2.1; }
.brand-mark.lg { width: 56px; height: 56px; border-radius: 18px; }
.brand-mark.lg .ic { width: 30px; height: 30px; }

.who { display: flex; align-items: center; gap: 12px; background: var(--surface-2); border-radius: 20px; padding: 12px 14px; }
.who b { display: block; }
.who .muted { font-size: 13px; }

/* ── آواتار ──────────────────────────────────────────────── */
.av { width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-weight: 800; font-size: 19px; flex: none; }
.av-c0 { background: var(--blue-t); color: var(--blue); }
.av-c1 { background: var(--green-t); color: var(--green); }
.av-c2 { background: var(--violet-t); color: var(--violet); }
.av-c3 { background: var(--pink-t); color: var(--pink); }
.av-c4 { background: var(--cyan-t); color: var(--cyan); }
.av-c5 { background: var(--amber-t); color: var(--amber); }
.av-c6 { background: var(--red-t); color: var(--red); }
.av-c7 { background: var(--yellow-t); color: var(--yellow); }
.av-note { background: var(--yellow-t); color: var(--yellow); }
.av-card { width: 58px; background: none; }

/* ── کارت بانکی واقعی ────────────────────────────────────── */
.cardface {
  position: relative; overflow: hidden; isolation: isolate;
  aspect-ratio: 1.586; width: 100%;
  display: flex; flex-direction: column;
  padding: 22px 24px 20px; border-radius: 22px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c2));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--c1) 38%, transparent);
}
.cardface::before, .cardface::after { content: ""; position: absolute; border-radius: 50%; z-index: -1; }
.cardface::before { width: 75%; aspect-ratio: 1; left: -22%; bottom: -55%; background: rgba(255, 255, 255, .10); }
.cardface::after { width: 55%; aspect-ratio: 1; right: -12%; top: -38%; background: rgba(255, 255, 255, .08); }
.cf-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cf-bank { font-weight: 800; font-size: 17px; color: var(--acc); }
.cf-shetab { font-size: 11px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 99px; padding: 1px 10px; opacity: .9; }
.cf-chip { width: 46px; height: 34px; border-radius: 8px; margin-top: 16px; background: linear-gradient(135deg, #f6dc8e, #c79c3f); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.cf-num { margin-top: auto; font: 600 clamp(15px, 4.4vw, 22px)/1.3 var(--mono); letter-spacing: .08em; text-align: left; white-space: nowrap; }
.cf-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 13px; opacity: .95; gap: 10px; }
.cf-holder { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-exp { font-family: var(--mono); }
.cardface.cf-sm { width: 58px; height: 38px; aspect-ratio: auto; padding: 5px 6px 4px; border-radius: 9px; box-shadow: 0 3px 8px color-mix(in srgb, var(--c1) 35%, transparent); }
.cf-sm .cf-bank { font-size: 7.5px; white-space: nowrap; overflow: hidden; }
.cf-sm .cf-num { font-size: 6.5px; letter-spacing: 0; }
.face-holder { max-width: 420px; margin: 0 auto 22px; cursor: pointer; }
.face-holder.editing { cursor: default; max-width: 360px; margin-bottom: 8px; }

/* ── پوسته ───────────────────────────────────────────────── */
.shell {
  display: grid; grid-template-columns: 272px minmax(320px, 400px) minmax(0, 1fr);
  gap: 16px; padding: 16px; height: 100dvh;
}
.side { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-1); display: flex; flex-direction: column; padding: 16px 12px; overflow: auto; min-height: 0; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.brand b { display: block; font-size: 18px; font-weight: 800; line-height: 1.2; }
.brand small { color: var(--ink-3); font-size: 12.5px; }
.side-nav { display: grid; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 14px;
  border: 0; border-radius: 14px; background: transparent; color: var(--ink-2); font-weight: 500; text-align: right;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--brand-tint); color: var(--brand-600); font-weight: 700; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count { font-size: 12px; min-width: 24px; height: 22px; padding: 0 7px; display: grid; place-items: center; border-radius: 99px; background: var(--surface-2); color: var(--ink-3); }
.nav-item.active .nav-count { background: var(--surface); color: var(--brand-600); }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 14px 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.side-empty { font-size: 12.5px; color: var(--ink-3); padding: 2px 14px; margin: 0; }
/* بالا و پایین نوار ثابت‌اند؛ فقط فهرست پوشه‌ها کوچک می‌شود و اسکرول خودش را دارد.
   اگر صفحه خیلی کوتاه باشد، کل نوار اسکرول می‌خورد (overflow: auto روی .side). */
.side > * { flex: none; }
.side > .side-folders { flex: 1 1 auto; min-height: 176px; display: flex; flex-direction: column; }
.side-head-count { margin-inline-start: 6px; font-weight: 600; color: var(--ink-3); opacity: .8; }
.folder-scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start;
  overscroll-behavior: contain; scrollbar-width: thin; padding-bottom: 6px;
}
.nav-label.two { display: grid; line-height: 1.3; }
.nav-label.two > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-label.two small { font-size: 11px; color: var(--ink-3); font-weight: 500; }
.side-foot { padding-top: 10px; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.side-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 6px; }
.side-tool {
  display: grid; justify-items: center; gap: 4px; min-width: 0; padding: 9px 4px 8px;
  border: 0; border-radius: 16px; background: var(--surface-2); color: var(--ink-2);
  font-size: 11.5px; font-weight: 600;
}
.side-tool span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-tool:hover { background: var(--brand-tint); color: var(--brand-600); }
.side-tool:disabled { opacity: .55; }
/* صفحه‌های کوتاه (لپ‌تاپ کوچک): ردیف‌ها فشرده‌تر تا پوشه‌ها جای بیشتری داشته باشند. */
@media (max-height: 780px) {
  .side { padding-block: 12px 8px; }
  .side .brand { padding-bottom: 10px; }
  .side .coll-switch { height: 42px; margin-bottom: 6px; }
  .side .nav-item { height: 38px; }
  .side-head { padding-top: 10px; }
  .side > .side-folders { min-height: 150px; }
  .side-tool { padding-block: 6px 5px; }
  .side .sig { margin-top: 8px; }
}
.scrim { display: none; }

.list-pane { display: flex; flex-direction: column; min-height: 0; position: relative; }
.list-head { padding: 6px 4px 12px; }
.list-title { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.list-title h1 { font-size: 30px; font-weight: 800; margin: 0; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-count { color: var(--ink-3); font-size: 13px; white-space: nowrap; margin-top: 8px; }
.list-tools { margin-inline-start: auto; display: flex; gap: 4px; }
.search { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px; background: var(--surface); border-radius: 999px; box-shadow: var(--sh-1); color: var(--ink-3); }
.search:focus-within { box-shadow: 0 0 0 2px var(--brand), var(--sh-1); }
.search-input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; height: 100%; }
.search-input::-webkit-search-cancel-button { filter: grayscale(1); }
.search kbd { font: 12px var(--mono); color: var(--ink-3); background: var(--surface-2); border-radius: 7px; padding: 1px 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin-top: 12px; padding-bottom: 2px; scrollbar-width: none; }
.chip { height: 36px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: 13.5px; white-space: nowrap; box-shadow: var(--sh-1); }
.chip.on { background: var(--ink); color: var(--bg); }

.list { flex: 1; min-height: 0; overflow: auto; padding: 4px 4px 100px; display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; flex: none;
  background: var(--surface); border-radius: 20px; cursor: pointer; outline: none;
  transition: box-shadow .15s, transform .12s, background .15s;
}
.row:hover { box-shadow: var(--sh-1); }
.row:focus-visible { box-shadow: 0 0 0 2px var(--brand); }
.row.selected { background: var(--brand-tint); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.row-title > span, .row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--ink-3); font-size: 13px; }

.fab-wrap { position: absolute; bottom: 18px; left: 18px; z-index: 5; }
.fab { display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 24px 0 22px; border: 0; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-weight: 700; font-size: 15px; box-shadow: var(--sh-2); }
.fab .ic { width: 22px; height: 22px; stroke-width: 2.2; }
.fab-menu { position: absolute; bottom: 66px; left: 0; min-width: 230px; background: var(--surface); border-radius: 22px; padding: 8px; box-shadow: var(--sh-2); display: grid; gap: 2px; animation: pop .16s ease-out; }
.fab-opt { display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 12px; border: 0; border-radius: 15px; background: transparent; font-weight: 600; text-align: right; }
.fab-opt:hover { background: var(--surface-2); }
.fab-opt-ic { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }

.t-login { background: var(--blue-t); color: var(--blue); }
.t-card { background: var(--amber-t); color: var(--amber); }
.t-note { background: var(--yellow-t); color: var(--yellow); }
.t-folder { background: var(--violet-t); color: var(--violet); }

.empty { text-align: center; padding: 56px 20px; display: grid; justify-items: center; gap: 8px; }
.empty-ic { width: 76px; height: 76px; border-radius: 26px; background: var(--surface); color: var(--brand); display: grid; place-items: center; box-shadow: var(--sh-1); margin-bottom: 6px; }
.empty-ic .ic { width: 34px; height: 34px; }
.empty b { font-size: 17px; }
.empty p { color: var(--ink-3); margin: 0 0 10px; max-width: 300px; font-size: 14px; }

/* ── جزئیات ──────────────────────────────────────────────── */
.detail-pane { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-1); overflow: auto; min-height: 0; }
.detail { padding: 28px 32px 40px; max-width: 780px; margin: 0 auto; }
.detail-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.detail-head .av { width: 56px; height: 56px; border-radius: 18px; font-size: 23px; }
.detail-titles { flex: 1; min-width: 0; }
.detail-titles h2 { font-size: 24px; font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.detail-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.type-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; font-weight: 600; }
.type-pill .ic { width: 15px; height: 15px; }
.detail-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.panel { background: var(--surface-2); border-radius: var(--r-lg); padding: 6px 18px; margin-bottom: 14px; }
.editor .panel { padding: 16px 18px; display: grid; gap: 14px; }
.panel-title { font-size: 13px; font-weight: 700; color: var(--ink-3); padding: 12px 0 2px; }
.editor .panel-title { padding: 0; }
.fv { padding: 12px 0; border-bottom: 1px solid var(--line); }
.fv:last-child { border-bottom: 0; }
.fv-label { font-size: 12.5px; color: var(--ink-3); }
.fv-row { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.fv-value { flex: 1; min-width: 0; font-size: 16px; overflow-wrap: anywhere; display: flex; align-items: center; gap: 12px; }
.fv-value.mono { font-family: var(--mono); }
.fv-act { display: flex; gap: 2px; opacity: .75; transition: opacity .15s; }
.fv:hover .fv-act { opacity: 1; }
.secret { font-family: var(--mono); letter-spacing: .03em; unicode-bidi: isolate; }
.ch-d { color: var(--ch-digit); }
.ch-y { color: var(--ch-sym); }
.ch-s { background: var(--surface-3); border-radius: 3px; }
.dots { color: var(--ink-3); letter-spacing: .18em; }
.notes { white-space: pre-wrap; padding: 10px 0 14px; overflow-wrap: anywhere; }
.notice { display: flex; align-items: center; gap: 8px; background: var(--amber-t); color: var(--amber); border-radius: 16px; padding: 10px 14px; margin-bottom: 16px; font-weight: 600; font-size: 14px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 12.5px; color: var(--ink-3); margin-top: 18px; padding: 0 6px; }
.detail-empty { height: 100%; min-height: 360px; display: grid; place-content: center; justify-items: center; text-align: center; gap: 8px; padding: 32px; }
.detail-empty b { font-size: 18px; }
.detail-empty p { color: var(--ink-3); max-width: 320px; margin: 0; font-size: 14px; }
.vault-emblem { width: 104px; height: 104px; border-radius: 36px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; margin-bottom: 10px; }
.vault-emblem .ic { width: 46px; height: 46px; stroke-width: 1.6; }

.totp-code { font: 700 22px var(--mono); letter-spacing: .12em; color: var(--brand); }
.totp-ring { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--brand-tint); display: grid; place-items: center; font-size: 11.5px; color: var(--ink-2); }
.totp-ring.low { border-color: var(--red-t); color: var(--red); }

.history { display: grid; padding-bottom: 8px; }
.hist-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.hist-meta { display: grid; font-size: 12px; color: var(--ink-3); min-width: 130px; }
.hist-meta b { color: var(--ink-2); font-size: 13px; }
.hist-val { flex: 1; min-width: 0; overflow-wrap: anywhere; direction: ltr; text-align: left; }

.custom-list { display: grid; gap: 8px; }
.custom-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto auto; gap: 8px; align-items: center; }
.mini-check { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.mini-check input { accent-color: var(--brand); }

/* ── تنظیمات ─────────────────────────────────────────────── */
.page-pane { display: none; min-height: 0; overflow: auto; padding: 0 4px 40px; }
.shell.show-page { grid-template-columns: 272px minmax(0, 1fr); }
.shell.show-page .list-pane, .shell.show-page .detail-pane { display: none; }
.shell.show-page .page-pane { display: block; }
.page-head { display: flex; align-items: center; gap: 10px; padding: 6px 0 16px; }
.page-head h1 { font-size: 28px; font-weight: 800; margin: 0; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr)); gap: 16px; align-items: start; }
.set-card { background: var(--surface); border-radius: 26px; padding: 20px 22px; box-shadow: var(--sh-1); display: grid; gap: 12px; }
.set-card h3 { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 800; margin: 0; }
.set-card p { margin: 0; font-size: 14px; }
.set-ic { width: 38px; height: 38px; border-radius: 13px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; }
.account { display: flex; align-items: center; gap: 12px; }
.account b { display: block; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.facts { margin: 0; padding-inline-start: 18px; color: var(--ink-2); font-size: 14px; }
.facts li { margin: 4px 0; }
.partial { min-height: 40px; }
.skeleton { height: 60px; border-radius: 16px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.sess-list, .act-list { list-style: none; margin: 0; padding: 0; }
.sess { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.sess:last-child, .act:last-child { border-bottom: 0; }
.sess-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.sess-main { flex: 1; min-width: 0; }
.sess-main b { font-size: 14.5px; }
.sess-main small, .act small { display: block; color: var(--ink-3); font-size: 12.5px; }
.badge-now { display: inline-block; font-size: 11px; font-weight: 700; background: var(--green-t); color: var(--green); border-radius: 99px; padding: 0 8px; margin-inline-start: 6px; }
.act { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.act b { font-size: 14px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 8px; flex: none; }
.dot-ok { background: var(--green); } .dot-warn { background: var(--amber); } .dot-bad { background: var(--red); } .dot-muted { background: var(--ink-3); }

.recovery { display: grid; gap: 10px; }
.recovery-key { font: 700 19px/1.9 var(--mono); letter-spacing: .06em; text-align: center; background: var(--surface-2); border: 2px dashed var(--brand); border-radius: 20px; padding: 18px 14px; user-select: all; overflow-wrap: anywhere; }
.recovery-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }

/* ── مودال، سازندهٔ رمز، اعلان ───────────────────────────── */
.modal { border: 0; padding: 0; background: transparent; max-width: none; max-height: none; }
.modal::backdrop { background: rgba(10, 14, 22, .38); backdrop-filter: blur(3px); }
.modal-card { width: min(480px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; background: var(--surface); border-radius: 28px; padding: 20px 22px 18px; box-shadow: var(--sh-2); animation: pop .18s ease-out; }
.modal-wide .modal-card { width: min(620px, calc(100vw - 24px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.modal-head h3 { font-size: 19px; font-weight: 800; margin: 0; }
.modal-body { margin: 12px 0 18px; display: grid; gap: 14px; }
.modal-body p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

.gen { display: grid; gap: 16px; }
.gen-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border-radius: 20px; padding: 16px 16px 16px 10px; min-height: 84px; }
.gen-out { flex: 1; min-width: 0; font: 600 19px/1.6 var(--mono); overflow-wrap: anywhere; direction: ltr; text-align: left; }
.gen-box-tools { display: flex; flex-direction: column; }
.gen-meter { font-size: 13px; font-weight: 700; margin-top: -8px; }
.gen-meter[data-score="0"], .gen-meter[data-score="1"] { color: var(--red); }
.gen-meter[data-score="2"] { color: var(--amber); }
.gen-meter[data-score="3"], .gen-meter[data-score="4"] { color: var(--green); }
.range { width: 100%; accent-color: var(--brand); }
.toggles { display: grid; gap: 12px; }

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; box-shadow: var(--sh-2); font-size: 14px; font-weight: 500; animation: pop .2s ease-out; transition: opacity .3s, transform .3s; }
.toast-error { background: var(--red); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

.only-mobile { display: none !important; }

/* ── تبلت ────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 236px minmax(300px, 350px) minmax(0, 1fr); gap: 12px; padding: 12px; }
  .shell.show-page { grid-template-columns: 236px minmax(0, 1fr); }
  .detail { padding: 22px 22px 32px; }
}

/* ── موبایل ──────────────────────────────────────────────── */
@media (max-width: 860px) {
  .only-mobile { display: inline-flex !important; }
  .only-desktop { display: none !important; }
  .chips.only-mobile { display: flex !important; }
  .shell, .shell.show-page { display: block; height: auto; min-height: 100dvh; padding: 12px 12px 0; }
  .side {
    position: fixed; top: 0; bottom: 0; right: 0; width: min(300px, 84vw); z-index: 60;
    border-radius: 28px 0 0 28px; transform: translateX(105%); transition: transform .25s ease;
  }
  .shell.drawer-open .side { transform: none; }
  .shell.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 22, .35); }
  .list-head { padding-top: 4px; }
  .list-title { gap: 6px; margin-bottom: 12px; }
  .list-title h1 { font-size: 26px; }
  .list { overflow: visible; padding-bottom: 110px; }
  .fab-wrap { position: fixed; bottom: 20px; left: 16px; }
  .detail-pane, .page-pane { display: none; }
  .shell.show-detail .list-pane { display: none; }
  .shell.show-detail .detail-pane { display: block; min-height: calc(100dvh - 24px); border-radius: 24px; margin-bottom: 12px; }
  .shell.show-page .page-pane { display: block; padding: 0 0 32px; }
  .detail { padding: 14px 14px 28px; }
  .detail-head { flex-wrap: wrap; gap: 10px; }
  .detail-head .detail-actions { width: 100%; justify-content: flex-end; }
  .editor .detail-head .detail-actions { justify-content: stretch; }
  .editor .detail-head .detail-actions .btn { flex: 1; }
  .panel { padding: 4px 14px; }
  .editor .panel { padding: 14px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .custom-row { grid-template-columns: 1fr 1fr; }
  .auth-card { padding: 28px 20px 22px; border-radius: 28px; }
  .hist-meta { min-width: 96px; }
}

@media print {
  body * { visibility: hidden !important; }
  .recovery, .recovery * { visibility: visible !important; }
  .recovery { position: absolute; top: 40px; left: 0; right: 0; }
  .recovery-tools { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.sess-all { margin-top: 12px; }
.sess .btn-sm { flex: none; }

.recovery-send { display: grid; gap: 8px; background: var(--surface-2); border-radius: 18px; padding: 12px 14px; }
.recovery-send b { font-size: 14px; }
.recovery-send small { font-size: 12.5px; line-height: 1.7; }
.recovery-send-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.recovery-send-row .input { flex: 1 1 160px; height: 40px; background: var(--surface); }
@media print { .recovery-send { display: none !important; } }

/* ── مجموعه‌ها (لایهٔ اول: شرکت/مجموعه) ──────────────────── */
.coll-switch {
  display: flex; align-items: center; gap: 8px; width: 100%;
  height: 46px; padding: 0 12px; margin: 0 0 10px; border: 0;
  border-radius: 16px; background: var(--surface-2); color: var(--ink);
  font-weight: 700; font-size: 14.5px; text-align: right;
}
.coll-switch:hover { background: var(--surface-3); }
.coll-switch .coll-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-switch > .ic:first-child { color: var(--brand); }
.coll-bar { display: none; align-items: center; gap: 8px; margin-bottom: 8px; }
.coll-bar .coll-switch { margin: 0; background: var(--surface); box-shadow: var(--sh-1); height: 44px; }

.coll-list { display: grid; gap: 4px; max-height: min(60dvh, 420px); overflow: auto; }
.coll-row { display: flex; align-items: center; gap: 4px; border-radius: 16px; }
.coll-row.on { background: var(--brand-tint); }
.coll-pick {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 0; background: none; border-radius: 16px; text-align: right;
}
.coll-row:not(.on) .coll-pick:hover { background: var(--surface-2); }
.coll-ic { width: 38px; height: 38px; flex: none; border-radius: 13px; display: grid; place-items: center; background: var(--surface-2); color: var(--brand); }
.coll-row.on .coll-ic { background: var(--surface); }
.coll-text { flex: 1; min-width: 0; display: grid; }
.coll-text b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-text small { color: var(--ink-3); font-size: 12.5px; }
.coll-check { color: var(--brand-600); }
.coll-tools { display: flex; gap: 2px; padding-inline-end: 6px; }

@media (max-width: 860px) {
  .coll-bar { display: flex; }
}

/* ── امضای سازنده ────────────────────────────────────────── */
.sig {
  position: fixed; bottom: 10px; left: 16px; z-index: 900;
  direction: ltr; display: flex; align-items: center; gap: 6px;
  font: 500 11px/1 var(--mono); letter-spacing: .18em;
  color: var(--ink-3); opacity: .7; user-select: none; pointer-events: none;
}
.sig::before { content: ""; width: 14px; height: 1px; background: currentColor; opacity: .6; }
.sig b { color: var(--brand); font-weight: 700; }
.side .sig { position: static; margin: 14px 14px 4px; opacity: .6; }
@media (max-width: 860px) {
  body.has-fab .sig:not(.sig-static) { display: none; }
}

.fixed-coll {
  display: flex; align-items: center; gap: 6px; align-self: end;
  height: 48px; padding: 0 14px; border-radius: 14px;
  background: var(--brand-tint); color: var(--brand-600); font-size: 13.5px;
}
.fixed-coll b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── جستجو در مجموعه‌ها/پوشه‌ها و مسیر نتیجه ───────────────── */
.coll-search, .folder-filter { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.folder-filter { margin: 4px 8px 6px; }
.coll-search .input, .folder-filter .input { height: 40px; background: var(--surface-2); }
.row-path { display: flex; align-items: center; gap: 5px; margin-top: 3px; font-size: 12px; color: var(--brand-600); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-path .ic { color: var(--brand); }
.search-wider {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex: none;
  margin-top: 6px; padding: 14px; border: 0; border-radius: 20px;
  background: var(--surface-2); color: var(--brand-600); font-weight: 600; font-size: 13.5px;
}
.search-wider:hover { background: var(--brand-tint); }

/* ── ارسال / اشتراک‌گذاری یک مورد ─────────────────────────── */
.share-hint { margin: 0; font-size: 13.5px; }
.share-list { display: grid; gap: 6px; max-height: min(38dvh, 320px); overflow: auto; }
.share-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.share-opt input { width: 18px; height: 18px; flex: none; accent-color: var(--brand); }
.share-opt-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.share-opt-text b { font-size: 14px; font-weight: 600; }
.share-opt-text small { color: var(--ink-3); font-size: 12.5px; line-height: 1.5; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-tag { flex: none; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--amber-t); color: var(--amber); }
.share-preview {
  margin: 0; padding: 12px 14px; max-height: 170px; overflow: auto;
  border-radius: 14px; border: 1px dashed var(--line); background: var(--surface-2); color: var(--ink-2);
  font: inherit; font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere;
}
.share-warn { margin: 0; align-items: flex-start; font-weight: 500; font-size: 13px; }
.share-warn[hidden] { display: none; }
.btn-whatsapp { background: #25d366; color: #fff; }
.btn-whatsapp:hover:not(:disabled) { background: #1ebe5a; }
