:root {
	--bg: #0f1115;
	--surface: #181b22;
	--surface-2: #1f232c;
	--border: #2a2f3a;
	--text: #e6e9ef;
	--muted: #8b93a3;
	--primary: #4f8cff;
	--primary-hover: #3d7bef;
	--danger: #ef4d4d;
	--ok: #2fbf71;
	--radius: 10px;
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--bg);
	color: var(--text);
	font-size: 15px;
	line-height: 1.5;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }

/* ---- Topbar ---- */
.topbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 20px;
	background: var(--surface);
	border-bottom: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 10;
}
.brand { font-weight: 700; font-size: 17px; color: var(--text); }
a.brand:hover { text-decoration: none; color: var(--primary); }

.container { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.container.narrow { max-width: 760px; }
h1 { font-size: 24px; margin: 0 0 20px; }
h2 { font-size: 18px; margin: 0 0 14px; }

/* ---- Buttons ---- */
.btn, button {
	font: inherit;
	cursor: pointer;
	border: 1px solid var(--border);
	background: var(--surface-2);
	color: var(--text);
	padding: 8px 14px;
	border-radius: var(--radius);
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: background .15s, border-color .15s;
}
.btn:hover, button:hover { text-decoration: none; background: #262b35; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: rgba(239,77,77,.12); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.inline { display: inline; margin: 0; }

/* ---- Login ---- */
.login-body { display: flex; min-height: 100vh; align-items: center; justify-content: center; }
.login-card {
	background: var(--surface);
	border: 1px solid var(--border);
	padding: 32px;
	border-radius: 14px;
	width: 340px;
	display: flex;
	flex-direction: column;
	gap: 14px;
	text-align: center;
}
.login-card h1 { margin: 0; font-size: 22px; }
.login-card p { margin: 0 0 8px; }
.login-card input, .login-card button { width: 100%; padding: 11px 14px; }
.login-card button { justify-content: center; background: var(--primary); border-color: var(--primary); color: #fff; }

input, textarea {
	background: var(--surface-2);
	border: 1px solid var(--border);
	color: var(--text);
	padding: 9px 12px;
	border-radius: 8px;
	width: 100%;
	font: inherit;
}
input:focus { outline: none; border-color: var(--primary); }

/* ---- Alerts ---- */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; }
.alert.error { background: rgba(239,77,77,.14); color: #ff9d9d; }
.alert.ok { background: rgba(47,191,113,.14); color: #79e0a8; }

/* ---- Table ---- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.accounts { width: 100%; border-collapse: collapse; }
table.accounts th, table.accounts td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.accounts th { background: var(--surface); font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
table.accounts tbody tr:last-child td { border-bottom: none; }
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--surface-2); }
.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { background: var(--primary); color: #fff; border-radius: 20px; padding: 1px 9px; font-size: 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }

/* ---- Cards / forms ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form-grid label input { color: var(--text); font-size: 15px; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 10px; margin-top: 4px; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

.form-grid label.full { grid-column: 1 / -1; }
.form-grid label textarea { color: var(--text); font-size: 14px; resize: vertical; }
textarea.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
select { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); padding: 9px 12px; border-radius: 8px; font: inherit; }
select option { background: #1f232c; color: var(--text); }

/* ---- Статусы и световые индикаторы ---- */
.status-nokyc { --c: #8b93a3; }
.status-kyc   { --c: #2fbf71; }
.status-rc    { --c: #f5a623; }
.status-close { --c: #ef4d4d; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c, #8b93a3); box-shadow: 0 0 7px var(--c, #8b93a3); flex: none; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; }
.status-select { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding-left: 12px; }
.status-select select { border: none; background: transparent; flex: 1; color: var(--text); padding: 9px 12px 9px 4px; }
.status-select select:focus { outline: none; }

.reveal { position: relative; display: flex; }
.reveal input { padding-right: 40px; }
.reveal-btn { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); background: transparent; border: none; padding: 4px 8px; opacity: .6; }
.reveal-btn:hover { opacity: 1; background: transparent; }

/* ---- TOTP ---- */
.totp-card { text-align: center; }
.totp-label { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .05em; }
.totp-code { font-size: 44px; font-weight: 700; letter-spacing: 8px; font-variant-numeric: tabular-nums; margin: 8px 0; cursor: pointer; }
.totp-code.err { font-size: 18px; letter-spacing: 0; color: var(--danger); font-weight: 500; }
.totp-bar { height: 5px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.totp-bar-fill { height: 100%; background: var(--primary); width: 100%; transition: width 1s linear; }
.totp-hint { font-size: 12px; color: var(--muted); margin-top: 6px; height: 16px; }

/* ---- Screenshots ---- */
.paste-zone {
	border: 2px dashed var(--border);
	border-radius: 12px;
	padding: 30px;
	text-align: center;
	color: var(--muted);
	cursor: pointer;
	transition: border-color .15s, background .15s;
	outline: none;
}
.paste-zone:focus, .paste-zone.hot { border-color: var(--primary); background: rgba(79,140,255,.06); color: var(--text); }
.paste-zone.busy { opacity: .6; pointer-events: none; }
kbd { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 12px; }

/* ---- Modal ---- */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 100; align-items: flex-start; justify-content: center; padding: 60px 20px; overflow-y: auto; }
.modal.open { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 24px; width: 100%; max-width: 640px; }
.modal-box h2 { margin: 0 0 8px; }
.modal-box textarea { width: 100%; margin-top: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; resize: vertical; }
.modal-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ---- Share ---- */
.share-row { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.share-row input { flex: 1; min-width: 200px; }
.center { text-align: center; }
.small { font-size: 12px; }

/* ---- Публичная карточка ---- */
.share-view { padding-top: 40px; }
.share-title { font-size: 22px; margin: 0 0 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-title .status { font-size: 15px; }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sec-head h2 { margin: 0; }
.field { padding: 12px 0; border-bottom: 1px solid var(--border); }
.field:last-child { border-bottom: none; }
.field-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.field-value { font-size: 18px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; cursor: pointer; }
.field-value.copyable:hover { color: var(--primary); }
.field-value.copied { color: var(--ok); }

.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.shot { position: relative; margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.shot img { width: 100%; height: 130px; object-fit: cover; display: block; }
.shot form { position: absolute; top: 6px; right: 6px; margin: 0; }
.shot-del { background: rgba(0,0,0,.6); border: none; color: #fff; width: 26px; height: 26px; border-radius: 50%; padding: 0; justify-content: center; font-size: 18px; line-height: 1; }
.shot-del:hover { background: var(--danger); }
