:root {
  color-scheme: light;
  --bg: #eef7f4;
  --bg-2: #f8fafc;
  --card: rgba(255, 255, 255, 0.94);
  --text: #10201e;
  --muted: #64748b;
  --line: #dbe7e4;
  --primary: #0f766e;
  --primary-2: #14b8a6;
  --primary-hover: #115e59;
  --danger: #dc2626;
  --success: #15803d;
  --soft: #f1f8f6;
  --shadow: 0 24px 60px rgba(15, 118, 110, 0.14);
  --radius-xl: 28px;
  --radius: 18px;
  --focus: 0 0 0 4px rgba(20, 184, 166, 0.16);
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg), var(--bg-2));
  color: var(--text);
  min-height: 100vh;
}
button, input, textarea, select { font: inherit; }
button, a.ghost { border: 0; cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .72; }
.page-bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.page-bg::before, .page-bg::after { content: ""; position: absolute; border-radius: 999px; filter: blur(4px); opacity: .75; }
.page-bg::before { width: 360px; height: 360px; background: #bdf6ec; top: -100px; right: -110px; }
.page-bg::after { width: 420px; height: 420px; background: #dbeafe; bottom: -180px; left: -110px; }
.glass-card { background: var(--card); border: 1px solid rgba(255,255,255,.72); box-shadow: var(--shadow); backdrop-filter: blur(16px); border-radius: var(--radius-xl); }
.login-shell { width: min(1120px, calc(100% - 32px)); min-height: 100vh; margin: auto; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 28px; padding: 34px 0; }
.hero-card { padding: 28px; }
.brand-badge, .avatar { width: 58px; height: 58px; border-radius: 20px; display: inline-grid; place-items: center; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; font-size: 25px; font-weight: 800; box-shadow: 0 16px 30px rgba(15,118,110,.24); }
h1, h2, h3, p { margin-top: 0; }
.hero-card h1 { font-size: clamp(30px, 5vw, 54px); margin: 10px 0 14px; letter-spacing: -1.2px; }
.hero-card p { color: var(--muted); font-size: 17px; line-height: 2; max-width: 620px; }
.eyebrow { color: var(--primary); font-weight: 800; font-size: 13px; margin-bottom: 6px; }
.feature-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.feature-list span, .members span, .count-badge { background: #ecfbf8; color: var(--primary); border: 1px solid #caeee8; border-radius: 999px; padding: 8px 12px; font-size: 13px; font-weight: 800; }
.login-card { padding: 24px; }
.quick-users { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.quick-users button { color: var(--primary); background: #ecfbf8; border: 1px solid #caeee8; border-radius: 15px; padding: 11px 8px; font-weight: 800; }
.quick-users button:hover, .quick-users button:focus-visible { background: #dff8f3; outline: none; box-shadow: var(--focus); }
.form-grid, .form-card { display: grid; gap: 14px; }
label { display: grid; gap: 8px; color: #334155; font-size: 14px; }
label > span { font-weight: 800; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: rgba(255,255,255,.96); border-radius: 16px; padding: 13px 14px; outline: none; color: var(--text); transition: border-color .18s ease, box-shadow .18s ease, background .18s ease; }
textarea { resize: vertical; min-height: 92px; }
.date-input { direction: ltr; text-align: center; letter-spacing: 1px; }
input:focus, textarea:focus, select:focus { border-color: var(--primary-2); box-shadow: var(--focus); }
button.primary, button.secondary, a.ghost, button.ghost { border-radius: 16px; padding: 12px 18px; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: white; box-shadow: 0 14px 28px rgba(15,118,110,.20); }
button.primary:hover { background: var(--primary-hover); }
button.secondary { background: #ecfbf8; color: var(--primary); border: 1px solid #caeee8; }
a.ghost, button.ghost { background: white; color: var(--primary); border: 1px solid var(--line); }
button.danger { color: white; background: var(--danger); border-radius: 14px; padding: 9px 12px; font-weight: 900; }
button.small { font-size: 13px; }
button.xsmall { font-size: 11px; padding: 6px 8px; border-radius: 999px; }
.hint { color: var(--muted); text-align: center; }
.alert { padding: 13px 16px; border-radius: 16px; margin: 14px 0; font-weight: 800; }
.alert.error { color: #991b1b; background: #fee2e2; border: 1px solid #fecaca; }
.alert.success { color: #166534; background: #dcfce7; border: 1px solid #bbf7d0; }
.app-shell { width: min(1240px, calc(100% - 28px)); margin: 0 auto; padding: 22px 0 36px; display: grid; gap: 18px; }
.topbar { padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.identity { display: flex; gap: 14px; align-items: center; }
.identity p { color: var(--muted); margin-bottom: 4px; }
.identity h1 { font-size: clamp(22px, 3vw, 34px); margin-bottom: 8px; }
.members { display: flex; gap: 8px; flex-wrap: wrap; }
.top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.summary-card, .form-card, .table-card, .mail-card, .backup-card { padding: 22px; }
.summary-card { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: stretch; }
.summary-total { border-radius: 24px; padding: 22px; background: linear-gradient(135deg, #0f766e, #14b8a6); color: white; display: grid; align-content: center; gap: 10px; min-height: 160px; }
.summary-total span { opacity: .86; }
.summary-total strong { font-size: 28px; }
.member-summaries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.member-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 18px; }
.member-card h3 { display: flex; align-items: center; justify-content: space-between; }
.member-card h3 span { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; background: #ecfbf8; color: var(--primary); }
.stat { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px dashed var(--line); padding: 13px 0; color: var(--muted); }
.stat strong { color: var(--text); white-space: nowrap; }
.stat.negative strong { color: #b45309; }
.stat.positive strong { color: var(--success); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-head h2 { margin-bottom: 0; }
.expense-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: start; }
.wide, .share-box, .percent-box, .receipt-preview, .receipts-preview, .form-actions { grid-column: 1 / -1; }
.share-box, .percent-box { background: var(--soft); border: 1px dashed #b9e9e2; border-radius: 20px; padding: 16px; }
.share-box p, .percent-box p { color: var(--muted); margin-bottom: 12px; }
.payment-box-head { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 12px; }
.payment-box-head p { margin: 0; line-height: 1.9; }
.mode-select { min-width: 190px; }
.payment-panel.is-hidden { display: none; }
.mini-hint { font-size: 13px; margin-top: 0; }
.percent-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.file-input small { color: var(--muted); }
.receipt-preview, .receipts-preview { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 10px; color: var(--muted); }
.receipt-preview { display: flex; align-items: center; gap: 12px; }
.receipt-preview img { width: 76px; height: 76px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.receipt-preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px; }
.receipt-thumb { display: grid; gap: 7px; align-items: start; min-width: 0; }
.receipt-thumb img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: #f8fafc; }
.receipt-thumb span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; direction: ltr; text-align: left; }
.form-actions { display: flex; justify-content: flex-start; }
.table-head { align-items: end; }
.table-tools { display: flex; gap: 10px; align-items: center; min-width: min(100%, 420px); }
.table-wrap { overflow-x: auto; border-radius: 20px; border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; min-width: 1180px; }
th, td { text-align: right; padding: 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: #f8fafc; color: #475569; font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.amount-cell { font-weight: 900; white-space: nowrap; }
.pay-chip { display: inline-flex; background: #eef2ff; color: #4338ca; padding: 7px 10px; border-radius: 999px; font-weight: 900; font-size: 12px; }
.percent-text { color: var(--muted); min-width: 150px; }
.receipt-links { display: flex; flex-wrap: wrap; gap: 8px; }
.receipt-item { display: inline-flex; align-items: center; gap: 5px; background: #f8fafc; border: 1px solid var(--line); border-radius: 999px; padding: 4px; }
.receipt-link { color: var(--primary); font-weight: 900; background: #ecfbf8; border: 1px solid #caeee8; border-radius: 999px; padding: 6px 10px; display: inline-flex; }
.receipt-delete-form { display: inline-flex; margin: 0; }
.empty-state { display: grid; place-items: center; gap: 7px; padding: 38px; color: var(--muted); text-align: center; }
.empty-state span { font-size: 34px; }
.empty-state strong { color: var(--text); }
.mail-card { display: flex; justify-content: space-between; gap: 16px; align-items: center; }
.mail-card p, .backup-card p { color: var(--muted); line-height: 1.8; margin: 0; }
.backup-head { margin-bottom: 10px; }
.backup-form { display: grid; grid-template-columns: 240px 1fr auto; gap: 12px; align-items: end; }
.backup-custom { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

code { direction: ltr; display: inline-block; background: #f1f5f9; border: 1px solid var(--line); border-radius: 8px; padding: 2px 6px; }
@media (max-width: 900px) {
  .login-shell { grid-template-columns: 1fr; align-content: center; }
  .summary-card { grid-template-columns: 1fr; }
  .expense-form { grid-template-columns: repeat(2, 1fr); }
  .topbar, .mail-card { align-items: stretch; flex-direction: column; }
  .backup-form { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .login-shell, .app-shell { width: min(100% - 18px, 100%); }
  .hero-card, .login-card, .summary-card, .form-card, .table-card, .mail-card, .backup-card, .topbar { border-radius: 22px; padding: 16px; }
  .quick-users { grid-template-columns: repeat(2, 1fr); }
  .expense-form, .member-summaries, .percent-grid, .backup-custom { grid-template-columns: 1fr; }
  .section-head, .table-tools, .payment-box-head { flex-direction: column; align-items: stretch; }
  .identity { align-items: flex-start; }
  table, thead, tbody, th, td, tr { display: block; min-width: 0; }
  thead { display: none; }
  .table-wrap { border: 0; background: transparent; overflow: visible; }
  tbody { display: grid; gap: 12px; }
  tr { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 10px; }
  td { border: 0; padding: 9px 6px; display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
  td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 900; }
  .empty-row td { display: block; }
  .empty-row td::before { content: none; }
}

.shop-assets-card { padding: 22px; }
.shop-assets-card p { color: var(--muted); line-height: 1.8; margin: 0; }
.shop-summary-card .summary-total small { opacity: .85; line-height: 1.8; }
.asset-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.asset-tags span { background: #f8fafc; border: 1px solid var(--line); color: #475569; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 800; }
.asset-tags small { color: var(--muted); }
.profit-badge { border-radius: 999px; padding: 10px 14px; font-weight: 900; white-space: nowrap; }
.profit-badge.profit { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.profit-badge.loss { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.profit-text { color: var(--success); font-weight: 900; white-space: nowrap; }
.loss-text { color: var(--danger); font-weight: 900; white-space: nowrap; }
.pay-chip.usage-chip { background: #fff7ed; color: #c2410c; }
.compact-wrap table { min-width: 760px; }
.shop-form { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .shop-form { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .shop-form { grid-template-columns: 1fr; }
  .profit-badge { white-space: normal; text-align: center; }
}

.people-card { padding: 22px; }
.people-card p { color: var(--muted); line-height: 1.8; margin: 0; }
.people-forms { display: grid; gap: 14px; margin-bottom: 18px; }
.mini-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; background: var(--soft); border: 1px dashed #b9e9e2; border-radius: 20px; padding: 16px; }
.person-ledger-form { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 16px; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.person-account-card { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 18px; display: grid; gap: 12px; }
.person-account-card header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.person-account-card header p { font-size: 12px; color: var(--primary); font-weight: 900; margin-bottom: 3px; }
.person-account-card h3 { margin-bottom: 2px; font-size: 24px; }
.person-account-card small, .person-note { color: var(--muted); }
.tx-badge { background: #f1f5f9; border: 1px solid var(--line); color: #475569; border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 900; white-space: nowrap; }
.balance-list { display: flex; flex-wrap: wrap; gap: 8px; }
.balance-pill { border-radius: 999px; padding: 8px 11px; font-size: 12px; font-weight: 900; border: 1px solid var(--line); background: #f8fafc; color: #475569; }
.balance-pill b { margin-left: 5px; }
.balance-pill.positive { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.balance-pill.negative { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.balance-pill.neutral { background: #f8fafc; color: #64748b; }
.person-meter { height: 9px; border-radius: 999px; background: #fee2e2; overflow: hidden; }
.person-meter span { display: block; width: var(--w, 18%); height: 100%; background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-radius: inherit; }
.person-details { border-top: 1px dashed var(--line); padding-top: 10px; }
.person-details summary { cursor: pointer; color: var(--primary); font-weight: 900; margin-bottom: 10px; }
.empty-person { grid-column: 1 / -1; background: #fff; border: 1px dashed var(--line); border-radius: 22px; }
.person-custom-asset { align-self: end; }
@media (max-width: 900px) {
  .people-grid { grid-template-columns: 1fr; }
  .mini-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .people-card { border-radius: 22px; padding: 16px; }
  .mini-form, .person-ledger-form { grid-template-columns: 1fr; }
  .person-account-card header { flex-direction: column; }
}

.person-conversion-form {
  background: linear-gradient(135deg, #fff, #f8fffd);
  border-color: #99f6e4;
}
.conversion-help {
  display: grid;
  gap: 6px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 18px;
  padding: 13px 15px;
  color: #065f46;
}
.conversion-help strong { font-size: 15px; }
.conversion-help span { color: #475569; line-height: 1.8; font-size: 13px; }
.pay-chip.conversion-chip { background: #ecfeff; color: #0e7490; border: 1px solid #a5f3fc; }
.tx-detail { display: grid; gap: 5px; min-width: 240px; }
.tx-detail span { display: block; color: #475569; font-size: 12px; line-height: 1.7; }
.tx-detail span:first-child { color: #0f766e; font-weight: 900; }


/* UI cleanup for person accounts */
.people-grid {
  grid-template-columns: 1fr;
  align-items: start;
}
.person-account-card {
  overflow: hidden;
  gap: 14px;
}
.person-account-card header {
  align-items: center;
}
.person-account-card h3 {
  font-size: 28px;
  line-height: 1.3;
}
.person-account-card small, .person-note {
  line-height: 1.8;
}
.balance-list {
  gap: 10px;
}
.balance-pill {
  font-size: 13px;
  padding: 9px 12px;
}
.person-meter {
  margin-top: 4px;
}
.person-details {
  margin-top: 2px;
  padding-top: 14px;
}
.person-details summary {
  padding: 4px 0 8px;
}
.table-wrap.compact-wrap {
  overflow-x: auto;
  overflow-y: hidden;
}
.compact-wrap table {
  min-width: 980px;
  table-layout: fixed;
}
.compact-table th,
.compact-table td {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.compact-table th:nth-child(1),
.compact-table td:nth-child(1) { width: 110px; }
.compact-table th:nth-child(2),
.compact-table td:nth-child(2) { width: 120px; }
.compact-table th:nth-child(3),
.compact-table td:nth-child(3) { width: 100px; }
.compact-table th:nth-child(4),
.compact-table td:nth-child(4) { width: 100px; }
.compact-table th:nth-child(5),
.compact-table td:nth-child(5) { width: 130px; }
.compact-table th:nth-child(6),
.compact-table td:nth-child(6) { width: 340px; }
.compact-table th:nth-child(7),
.compact-table td:nth-child(7) { width: 180px; }
.compact-table th:nth-child(8),
.compact-table td:nth-child(8) { width: 90px; }
.tx-detail {
  min-width: 0;
  max-width: none;
}
.tx-detail span {
  overflow-wrap: anywhere;
}
.receipt-links {
  align-items: flex-start;
}
@media (min-width: 1200px) {
  .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .person-account-card.person-expanded {
    grid-column: 1 / -1;
  }
}
@media (max-width: 1199px) {
  .people-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= Hesab Admin Professional UI ================= */
.hesab-body {
  background: #0f172a;
  color: #0f172a;
}
.hesab-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 15% 20%, rgba(20,184,166,.28), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(59,130,246,.22), transparent 28%),
    linear-gradient(135deg, #0f172a, #111827 55%, #0b1220);
}
.hesab-shell {
  width: min(1440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 38px;
  display: grid;
  gap: 18px;
}
.hesab-topbar,
.hesab-card,
.hesab-kpi {
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 30px 90px rgba(2,6,23,.24);
  background: rgba(255,255,255,.96);
  border-radius: 28px;
}
.hesab-topbar {
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 10px;
  z-index: 20;
  backdrop-filter: blur(18px);
}
.hesab-brand { display: flex; align-items: center; gap: 14px; }
.hesab-logo {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: white;
  font-size: 28px;
  font-weight: 1000;
  background: linear-gradient(135deg, #0f766e, #2563eb);
  box-shadow: 0 18px 35px rgba(37,99,235,.22);
}
.hesab-brand p { margin: 0 0 4px; color: #64748b; font-weight: 800; }
.hesab-brand h1 { margin: 0; font-size: clamp(24px, 3vw, 36px); }
.hesab-top-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.hesab-btn {
  border: 0;
  text-decoration: none;
  border-radius: 16px;
  padding: 12px 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 950;
  cursor: pointer;
  white-space: nowrap;
}
.hesab-btn.primary { background: linear-gradient(135deg, #0f766e, #2563eb); color: white; box-shadow: 0 16px 30px rgba(37,99,235,.20); }
.hesab-btn.secondary { background: #ecfdf5; color: #0f766e; border: 1px solid #99f6e4; }
.hesab-btn.ghost { background: #fff; color: #0f766e; border: 1px solid #dbe7e4; }
.hesab-card { padding: 20px; }
.hesab-alert { padding: 13px 16px; border-radius: 18px; font-weight: 900; }
.hesab-alert.error { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.hesab-alert.success { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.setup-card p { color: #475569; line-height: 2; }
.setup-card pre { overflow-x: auto; background: #0f172a; color: #e2e8f0; padding: 18px; border-radius: 18px; direction: ltr; }
.hesab-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.hesab-kpi { padding: 18px; display: grid; gap: 8px; min-height: 132px; align-content: center; }
.hesab-kpi.primary { background: linear-gradient(135deg, #0f766e, #2563eb); color: white; }
.hesab-kpi span, .hesab-kpi small { color: inherit; opacity: .78; font-weight: 850; }
.hesab-kpi strong { font-size: clamp(24px, 3vw, 34px); letter-spacing: -.5px; }
.ok { color: #15803d !important; }
.bad { color: #dc2626 !important; }
.hesab-section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.hesab-section-head h2 { margin: 0; }
.hesab-filter-grid,
.create-person-form,
.hesab-form {
  display: grid;
  gap: 13px;
}
.hesab-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: end; }
.create-person-form { grid-template-columns: 1fr 1fr 2fr auto; align-items: end; background: #f8fafc; border: 1px dashed #cbd5e1; padding: 14px; border-radius: 22px; margin-bottom: 16px; }
.hesab-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hesab-form .full { grid-column: 1 / -1; }
.filter-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.asset-summary-strip { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 9px; }
.asset-chip, .balance-mini, .op-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
}
.asset-chip.positive, .balance-mini.positive { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.asset-chip.negative, .balance-mini.negative { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.asset-chip.neutral, .balance-mini.neutral { background: #f8fafc; color: #64748b; }
.counterparty-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 13px; }
.counterparty-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #ffffff, #f8fafc);
  border-radius: 24px;
  padding: 15px;
  display: grid;
  gap: 12px;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.counterparty-card:hover, .counterparty-card.selected { transform: translateY(-2px); border-color: #14b8a6; box-shadow: 0 22px 45px rgba(20,184,166,.14); }
.person-title { display: flex; align-items: center; gap: 12px; }
.person-title > span { width: 46px; height: 46px; border-radius: 17px; display: grid; place-items: center; background: #ecfeff; color: #0e7490; font-size: 22px; font-weight: 1000; }
.person-title h3 { margin: 0 0 2px; font-size: 22px; }
.person-title small, .counterparty-card small { color: #64748b; }
.person-profit { font-weight: 950; }
.person-balances { display: flex; gap: 7px; flex-wrap: wrap; min-height: 36px; }
.hesab-forms-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.accent-card { background: linear-gradient(135deg, rgba(255,255,255,.98), #f0fdfa); }
.accent-card.soft-blue { background: linear-gradient(135deg, rgba(255,255,255,.98), #eff6ff); }
.admin-table-wrap { overflow-x: auto; border: 1px solid #e2e8f0; border-radius: 22px; background: #fff; }
.admin-table { min-width: 1240px; width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 13px; border-bottom: 1px solid #e2e8f0; text-align: right; vertical-align: top; }
.admin-table th { background: #f8fafc; color: #475569; font-size: 13px; }
.admin-table tr:last-child td { border-bottom: 0; }
.op-pill.in { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.op-pill.out { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.tx-note { display: grid; gap: 5px; max-width: 330px; overflow-wrap: anywhere; color: #334155; line-height: 1.8; }
.tx-note small { color: #64748b; direction: ltr; text-align: right; }
.file-links { display: flex; flex-wrap: wrap; gap: 6px; }
.file-links a { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; padding: 6px 9px; border-radius: 999px; text-decoration: none; font-size: 12px; font-weight: 900; }
.empty-admin-state { padding: 28px; text-align: center; color: #64748b; }
.hesab-custom-asset[hidden] { display: none !important; }
@media (max-width: 1180px) {
  .hesab-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hesab-forms-grid { grid-template-columns: 1fr; }
  .counterparty-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .hesab-shell { width: min(100% - 18px, 100%); }
  .hesab-topbar, .hesab-section-head { flex-direction: column; align-items: stretch; }
  .hesab-kpis, .hesab-filter-grid, .create-person-form, .counterparty-grid, .hesab-form { grid-template-columns: 1fr; }
  .hesab-card, .hesab-topbar, .hesab-kpi { border-radius: 22px; padding: 16px; }
  .admin-table, .admin-table thead, .admin-table tbody, .admin-table th, .admin-table td, .admin-table tr { display: block; min-width: 0; }
  .admin-table thead { display: none; }
  .admin-table-wrap { border: 0; background: transparent; overflow: visible; }
  .admin-table tbody { display: grid; gap: 12px; }
  .admin-table tr { background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 10px; }
  .admin-table td { border: 0; display: grid; grid-template-columns: 118px 1fr; gap: 10px; padding: 9px 6px; }
  .admin-table td::before { content: attr(data-label); color: #64748b; font-size: 12px; font-weight: 950; }
}
.op-pill.neutral { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.field-help { color: #64748b; font-size: 11px; line-height: 1.7; font-weight: 600; }
