:root {
  --ink: #111827;
  --ink-soft: #475569;
  --paper: #f7f8fa;
  --panel: rgba(255, 255, 255, .92);
  --line: rgba(148, 163, 184, .25);
  --accent: #c39b55;
  --accent-deep: #92703a;
  --success: #158467;
  --warning: #b7791f;
  --danger: #b84949;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(15, 23, 42, .18);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: #202328; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Manrope, Arial, sans-serif;
  background: linear-gradient(rgba(12, 15, 20, .66), rgba(12, 15, 20, .76)), url('/assets/jurify-background.webp') center / cover fixed;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.eyebrow { margin: 0 0 10px; color: var(--accent-deep); font-size: 12px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.ambient { position: fixed; z-index: -1; border-radius: 999px; filter: blur(80px); opacity: .15; pointer-events: none; }
.ambient-one { width: 420px; height: 420px; top: -180px; right: 8%; background: #d8bc84; }
.ambient-two { width: 330px; height: 330px; bottom: -160px; left: 7%; background: #dbe7ef; }

.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; letter-spacing: -.04em; }
.brand-mark { position: relative; width: 38px; height: 42px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #d2b16d, #8f6b32); clip-path: polygon(50% 0, 92% 18%, 85% 74%, 50% 100%, 15% 74%, 8% 18%); box-shadow: 0 8px 18px rgba(195, 155, 85, .32); }
.brand-mark::after { content: 'J'; font-family: Georgia, serif; font-size: 22px; font-weight: 700; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(300px, 1fr) minmax(420px, 580px); padding: 30px; }
.auth-story { display: flex; flex-direction: column; justify-content: space-between; padding: 34px 5vw 34px 3vw; color: #fff; }
.auth-copy { max-width: 660px; margin: auto 0; }
.auth-copy h1 { max-width: 640px; margin: 0; font-family: Georgia, serif; font-size: clamp(42px, 5vw, 76px); line-height: .98; letter-spacing: -.04em; }
.auth-copy p { max-width: 560px; margin: 28px 0; color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.7; }
.trust-row { display: flex; flex-wrap: wrap; gap: 10px; }
.trust-pill { padding: 9px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.8); background: rgba(255,255,255,.06); font-size: 12px; font-weight: 700; backdrop-filter: blur(12px); }
.auth-card { align-self: center; width: 100%; padding: clamp(30px, 5vw, 58px); border: 1px solid rgba(255,255,255,.35); border-radius: 30px; background: rgba(250, 251, 252, .95); box-shadow: var(--shadow); backdrop-filter: blur(24px); }
.auth-card h2 { margin: 12px 0 8px; font-family: Georgia, serif; font-size: 38px; letter-spacing: -.03em; }
.auth-card > p { margin: 0 0 30px; color: var(--ink-soft); line-height: 1.6; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label, .field-label { color: #334155; font-size: 13px; font-weight: 800; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 50px; padding: 13px 15px; border: 1px solid #d9dee7; border-radius: 13px; outline: 0; color: var(--ink); background: #fff; transition: .2s;
}
.field textarea { min-height: 112px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(195,155,85,.12); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 18px; border: 0; border-radius: 12px; font-weight: 800; transition: transform .18s, box-shadow .18s, opacity .18s; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: not-allowed; opacity: .52; transform: none; }
.btn-primary { color: #fff; background: linear-gradient(135deg, #1b2432, #0e1420); box-shadow: 0 10px 24px rgba(15,23,42,.18); }
.btn-gold { color: #19140b; background: linear-gradient(135deg, #d8ba7d, #b38a48); box-shadow: 0 10px 24px rgba(195,155,85,.2); }
.btn-ghost { color: #334155; border: 1px solid #d9dee7; background: #fff; }
.btn-danger { color: #fff; background: var(--danger); }
.btn-block { width: 100%; }
.auth-foot { margin-top: 22px; text-align: center; color: #64748b; font-size: 12px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 268px minmax(0, 1fr); padding: 18px; gap: 18px; }
.sidebar { position: sticky; top: 18px; height: calc(100vh - 36px); display: flex; flex-direction: column; padding: 25px 18px; border: 1px solid rgba(255,255,255,.1); border-radius: 24px; color: #fff; background: rgba(17, 24, 39, .86); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.sidebar .brand { padding: 0 8px 24px; }
.nav { display: grid; gap: 7px; margin-top: 18px; }
.nav button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; border: 0; border-radius: 12px; color: rgba(255,255,255,.64); background: transparent; text-align: left; font-weight: 700; }
.nav button.active, .nav button:hover { color: #fff; background: rgba(255,255,255,.09); }
.nav-icon { width: 21px; text-align: center; color: #dabd83; }
.sidebar-bottom { margin-top: auto; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); }
.user-mini { display: flex; align-items: center; gap: 11px; padding: 7px; }
.avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 12px; color: #19140b; background: #d6b778; font-weight: 800; }
.user-mini strong, .user-mini small { display: block; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-mini small { color: rgba(255,255,255,.55); font-size: 10px; }
.logout { width: 100%; margin-top: 10px; color: rgba(255,255,255,.72); border-color: rgba(255,255,255,.12); background: rgba(255,255,255,.04); }

.main { min-width: 0; padding: 16px 2vw 40px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 64px; margin-bottom: 24px; color: #fff; }
.topbar h1 { margin: 0; font-family: Georgia, serif; font-size: clamp(28px, 3vw, 42px); font-weight: 500; }
.topbar p { margin: 5px 0 0; color: rgba(255,255,255,.62); }
.secure-badge { display: flex; align-items: center; gap: 8px; padding: 10px 13px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; color: rgba(255,255,255,.8); background: rgba(15,23,42,.3); font-size: 11px; font-weight: 800; backdrop-filter: blur(12px); }

.content { display: grid; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.card { min-width: 0; padding: 24px; border: 1px solid rgba(255,255,255,.65); border-radius: var(--radius); background: var(--panel); box-shadow: 0 16px 42px rgba(15,23,42,.13); backdrop-filter: blur(20px); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.card h2, .card h3 { margin: 0; }
.card h2 { font-family: Georgia, serif; font-size: 28px; font-weight: 500; }
.card h3 { font-size: 16px; }
.metric-label { color: #64748b; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.metric { margin: 15px 0 8px; font-family: Georgia, serif; font-size: clamp(28px, 3vw, 44px); letter-spacing: -.03em; }
.metric-note { color: #64748b; font-size: 12px; }
.icon-box { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; color: var(--accent-deep); background: #f2e8d5; font-weight: 900; }
.status { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-verified { color: #0f785c; background: #dff5ec; }
.status-pending, .status-clarification { color: #9b6615; background: #fff0cf; }
.status-restricted, .status-blocked { color: #a73e3e; background: #fae2e2; }
.progress { height: 8px; margin: 18px 0 10px; overflow: hidden; border-radius: 99px; background: #e8ebf0; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b58a48, #d8be87); }
.quick-list, .transaction-list { display: grid; gap: 11px; }
.quick-item, .transaction { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid #e8ebef; border-radius: 14px; background: rgba(255,255,255,.72); }
.quick-item strong, .quick-item small, .transaction strong, .transaction small { display: block; }
.quick-item small, .transaction small { margin-top: 4px; color: #64748b; }
.amount { white-space: nowrap; font-weight: 800; }

.compliance-banner { display: grid; grid-template-columns: auto 1fr; gap: 18px; padding: 22px; border: 1px solid #eadfc9; border-radius: 18px; background: linear-gradient(135deg, #fffaf0, #f9f3e7); }
.compliance-banner .seal { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; color: #fff; background: #b28a4a; font-size: 22px; }
.compliance-copy { color: #c43131; font-weight: 700; line-height: 1.65; }
.rich-content p:first-child { margin-top: 0; }
.rich-content p:last-child { margin-bottom: 0; }
.dd-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.dd-item { min-height: 130px; padding: 18px; border: 1px solid #e4e8ee; border-radius: 15px; background: #fff; }
.dd-item span { display: block; margin-bottom: 10px; color: #8a6a36; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dd-item p { margin: 0; color: #475569; white-space: pre-line; line-height: 1.6; }
.notice { padding: 13px 15px; border-radius: 12px; color: #8d5c14; background: #fff3d9; font-size: 13px; line-height: 1.55; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 5px 0 20px; color: #475569; font-size: 13px; line-height: 1.5; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: #a98243; }

.admin-layout { display: grid; grid-template-columns: minmax(280px, .78fr) minmax(520px, 1.6fr); gap: 18px; align-items: start; }
.admin-list { max-height: calc(100vh - 170px); overflow: auto; padding: 10px; }
.user-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 13px; border: 0; border-radius: 14px; background: transparent; text-align: left; }
.user-row:hover, .user-row.active { background: #f0ece4; }
.user-row .avatar { width: 38px; height: 38px; border-radius: 11px; }
.user-row strong, .user-row small { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row small { margin-top: 3px; color: #64748b; font-size: 11px; }
.editor { min-height: 130px; padding: 14px; border: 1px solid #d9dee7; border-radius: 0 0 13px 13px; outline: 0; background: #fff; line-height: 1.6; }
.editor:focus { border-color: var(--accent); }
.editor-toolbar { display: flex; gap: 5px; padding: 7px; border: 1px solid #d9dee7; border-bottom: 0; border-radius: 13px 13px 0 0; background: #f7f8fa; }
.editor-toolbar button { width: 34px; height: 31px; border: 0; border-radius: 7px; color: #475569; background: transparent; font-weight: 800; }
.editor-toolbar button:hover { background: #e9edf2; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 12px 14px; border: 1px solid #e4e8ee; border-radius: 13px; background: #fff; }
.switch { width: 44px; height: 25px; position: relative; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #cbd5e1; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 19px; height: 19px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 7px rgba(0,0,0,.18); transition: .2s; }
.switch input:checked + span { background: #ad8747; }
.switch input:checked + span::before { transform: translateX(19px); }
.section-divider { height: 1px; margin: 24px 0; background: #e4e8ee; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(6,10,16,.7); backdrop-filter: blur(9px); }
.modal { width: min(460px,100%); padding: 36px; border: 1px solid rgba(255,255,255,.4); border-radius: 25px; background: #fff; box-shadow: var(--shadow); text-align: center; }
.loader { width: 52px; height: 52px; margin: 0 auto 22px; border: 4px solid #eee5d6; border-top-color: #ae8440; border-radius: 50%; animation: spin .8s linear infinite; }
.modal h3 { margin: 0 0 10px; font-family: Georgia, serif; font-size: 26px; }
.modal p { margin: 0; color: #64748b; line-height: 1.6; }
.toast { position: fixed; z-index: 200; right: 22px; bottom: 22px; max-width: 370px; padding: 14px 18px; border-radius: 13px; color: #fff; background: #111827; box-shadow: var(--shadow); opacity: 0; transform: translateY(15px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #9f3f3f; }
.empty { padding: 30px; color: #64748b; text-align: center; }
.support-card { min-height: 620px; display: flex; flex-direction: column; }
.support-online { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border-radius: 999px; color: #087354; background: #ddf6ec; font-size: 11px; font-weight: 800; }
.support-online i { width: 8px; height: 8px; border-radius: 50%; background: #16a678; box-shadow: 0 0 0 4px rgba(22,166,120,.12); }
.chat-messages { flex: 1; min-height: 360px; max-height: 520px; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 18px; border: 1px solid #e2e7ed; border-radius: 16px; background: #f5f7f9; }
.chat-message { width: fit-content; max-width: min(76%, 650px); padding: 12px 14px 9px; border-radius: 16px 16px 16px 4px; color: #334155; background: #fff; box-shadow: 0 5px 16px rgba(15,23,42,.06); line-height: 1.55; }
.chat-message.from-user { align-self: flex-end; border-radius: 16px 16px 4px 16px; color: #fff; background: #172130; }
.chat-message small { display: block; margin-top: 6px; color: #94a3b8; font-size: 9px; }
.chat-message.from-user small { color: rgba(255,255,255,.55); }
.chat-compose { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; margin-top: 14px; }
.chat-compose textarea { min-height: 58px; max-height: 140px; padding: 14px; resize: vertical; border: 1px solid #d9dee7; border-radius: 13px; outline: 0; }
.chat-compose textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(195,155,85,.12); }
.support-admin-layout { display: grid; grid-template-columns: minmax(280px,.72fr) minmax(500px,1.6fr); gap: 18px; align-items: stretch; }
.support-dialogs { max-height: 700px; overflow-y: auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1020px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-story { min-height: 42vh; padding: 24px; }
  .auth-copy { margin: 60px 0 30px; }
  .auth-card { max-width: 620px; margin: -10px auto 30px; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .support-admin-layout { grid-template-columns: 1fr; }
  .admin-list { max-height: 360px; }
}
@media (max-width: 760px) {
  .auth-shell { padding: 14px; }
  .auth-story { min-height: 36vh; }
  .auth-copy h1 { font-size: 42px; }
  .app-shell { display: block; padding: 10px; }
  .sidebar { position: static; height: auto; display: block; margin-bottom: 12px; padding: 14px; }
  .sidebar .brand { padding: 0 4px 12px; }
  .nav { display: flex; overflow-x: auto; margin: 0; }
  .nav button { width: auto; min-width: max-content; }
  .sidebar-bottom { display: none; }
  .main { padding: 10px 4px 30px; }
  .topbar { padding: 4px 8px; }
  .secure-badge { display: none; }
  .grid-3, .grid-2, .dd-grid, .field-row { grid-template-columns: 1fr; }
  .card { padding: 19px; border-radius: 18px; }
  .compliance-banner { grid-template-columns: 1fr; }
  .chat-compose { grid-template-columns: 1fr; }
  .chat-message { max-width: 90%; }
}
