Law/app/web/admin.html
2026-02-22 10:57:49 +03:00

675 lines
15 KiB
HTML

<!doctype html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Административная панель • Правовой трекер</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Prata&display=swap" rel="stylesheet">
<style>
:root {
--bg: #0b1015;
--bg-soft: #111922;
--surface: #15202b;
--surface-2: #1d2a37;
--line: rgba(196, 210, 228, 0.2);
--text: #f3f7fc;
--muted: #9db0c5;
--brand: #d4a86a;
--brand-soft: rgba(212, 168, 106, 0.14);
--ok: #4dbe93;
--danger: #ff7f7f;
--radius: 16px;
--shadow: 0 24px 58px rgba(0, 0, 0, 0.34);
}
* { box-sizing: border-box; }
html, body {
margin: 0;
padding: 0;
background: radial-gradient(circle at 12% 2%, #1a2532, var(--bg) 50%), var(--bg);
color: var(--text);
font-family: "Manrope", sans-serif;
}
body.modal-open { overflow: hidden; }
.layout {
display: grid;
grid-template-columns: 272px 1fr;
min-height: 100vh;
}
.sidebar {
border-right: 1px solid var(--line);
background: linear-gradient(180deg, rgba(19, 29, 39, 0.94), rgba(13, 20, 27, 0.94));
padding: 1rem;
position: sticky;
top: 0;
height: 100vh;
}
.logo {
font-weight: 800;
font-size: 0.82rem;
text-transform: uppercase;
letter-spacing: 0.12em;
color: #ebf2fb;
margin-bottom: 1.2rem;
}
.logo a {
color: inherit;
text-decoration: none;
}
.menu {
display: flex;
flex-direction: column;
gap: 0.45rem;
}
.menu button {
width: 100%;
text-align: left;
border: 1px solid transparent;
background: transparent;
color: #d4deec;
padding: 0.72rem 0.78rem;
border-radius: 10px;
cursor: pointer;
font-weight: 600;
font-size: 0.92rem;
}
.menu button:hover {
border-color: var(--line);
background: rgba(255, 255, 255, 0.03);
}
.menu button.active {
border-color: rgba(212, 168, 106, 0.45);
background: var(--brand-soft);
color: #fde5c2;
}
.auth-box {
margin-top: 1.2rem;
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(255, 255, 255, 0.02);
padding: 0.75rem;
font-size: 0.86rem;
color: var(--muted);
line-height: 1.45;
}
.auth-box b {
color: #f4f7fc;
font-weight: 700;
}
.main {
padding: 1.2rem;
}
.topbar {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
margin-bottom: 1rem;
border: 1px solid var(--line);
border-radius: var(--radius);
background: linear-gradient(130deg, rgba(22, 33, 45, 0.94), rgba(15, 23, 31, 0.97));
padding: 0.85rem 1rem;
box-shadow: var(--shadow);
}
.topbar h1 {
margin: 0;
font-family: "Prata", serif;
font-size: 1.5rem;
letter-spacing: 0.01em;
}
.badge {
border: 1px solid rgba(212, 168, 106, 0.35);
border-radius: 999px;
background: var(--brand-soft);
color: #fedfb1;
font-size: 0.76rem;
font-weight: 700;
padding: 0.32rem 0.55rem;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.btn {
border: 1px solid transparent;
border-radius: 999px;
background: linear-gradient(120deg, #d9b57f, #c59048);
color: #1b2430;
padding: 0.64rem 1rem;
font-weight: 700;
font-size: 0.88rem;
cursor: pointer;
}
.btn:hover { filter: brightness(1.05); }
.btn.secondary {
border-color: var(--line);
background: rgba(255, 255, 255, 0.04);
color: #dbe6f5;
}
.btn.danger {
border-color: rgba(255, 127, 127, 0.3);
background: rgba(255, 127, 127, 0.13);
color: #ffd3d3;
}
.section {
display: none;
border: 1px solid var(--line);
border-radius: var(--radius);
background: linear-gradient(160deg, rgba(20, 30, 40, 0.93), rgba(14, 22, 30, 0.96));
box-shadow: var(--shadow);
padding: 1rem;
}
.section.active { display: block; }
.section h2 {
margin: 0;
font-family: "Prata", serif;
font-size: 1.35rem;
}
.section-head {
display: flex;
justify-content: space-between;
align-items: center;
gap: 1rem;
margin-bottom: 0.9rem;
flex-wrap: wrap;
}
.muted {
color: var(--muted);
margin: 0.45rem 0 0;
line-height: 1.55;
font-size: 0.94rem;
}
.cards {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 0.75rem;
}
.card {
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(255, 255, 255, 0.025);
padding: 0.8rem;
}
.card p {
margin: 0;
color: var(--muted);
font-size: 0.83rem;
}
.card b {
display: block;
margin-top: 0.3rem;
font-size: 1.2rem;
color: #f6dab0;
}
.filters {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 0.65rem;
margin-bottom: 0.75rem;
}
.filter-toolbar {
display: flex;
align-items: center;
gap: 0.55rem;
margin-bottom: 0.75rem;
padding: 0.5rem;
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(255, 255, 255, 0.02);
}
.filter-chips {
display: flex;
align-items: center;
gap: 0.45rem;
flex-wrap: wrap;
flex: 1 1 auto;
min-height: 34px;
}
.filter-chip {
display: inline-flex;
align-items: center;
gap: 0.35rem;
padding: 0.25rem 0.5rem;
border: 1px solid rgba(212, 168, 106, 0.3);
border-radius: 999px;
background: var(--brand-soft);
color: #f9dfb5;
font-size: 0.76rem;
line-height: 1.2;
cursor: pointer;
}
.filter-chip button {
border: none;
width: 18px;
height: 18px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.1);
color: #fce3bd;
cursor: pointer;
font-size: 0.82rem;
line-height: 1;
padding: 0;
}
.chip-placeholder {
color: var(--muted);
font-size: 0.84rem;
}
.filter-action {
margin-left: auto;
flex-shrink: 0;
}
.field {
display: flex;
flex-direction: column;
gap: 0.3rem;
}
.field label {
text-transform: uppercase;
letter-spacing: 0.06em;
color: #9fb3c8;
font-size: 0.73rem;
font-weight: 700;
}
input, textarea, select {
width: 100%;
border: 1px solid #3c4d62;
border-radius: 10px;
background: rgba(255, 255, 255, 0.03);
color: var(--text);
font: inherit;
padding: 0.58rem 0.68rem;
min-height: 38px;
}
textarea {
min-height: 108px;
resize: vertical;
}
.table-wrap {
border: 1px solid var(--line);
border-radius: 12px;
overflow: auto;
background: rgba(255, 255, 255, 0.015);
}
table {
width: 100%;
border-collapse: collapse;
min-width: 840px;
}
th, td {
padding: 0.63rem 0.65rem;
border-bottom: 1px solid var(--line);
vertical-align: top;
font-size: 0.89rem;
}
th {
text-align: left;
color: #9fb3c8;
font-size: 0.77rem;
text-transform: uppercase;
letter-spacing: 0.06em;
}
.sortable-th {
cursor: pointer;
user-select: none;
}
.sortable-head {
display: inline-flex;
align-items: center;
gap: 0.35rem;
}
.sort-indicator {
color: #6d7f96;
font-weight: 700;
font-size: 0.8rem;
line-height: 1;
}
.sort-indicator.active {
color: #f1d3a3;
}
td code {
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
color: #f7dfb8;
}
.table-actions {
display: flex;
gap: 0.4rem;
flex-wrap: wrap;
}
.icon-btn {
border: 1px solid var(--line);
border-radius: 9px;
background: rgba(255, 255, 255, 0.03);
color: #d8e4f4;
cursor: pointer;
width: 30px;
height: 30px;
display: inline-grid;
place-items: center;
font-size: 0.95rem;
line-height: 1;
position: relative;
}
.icon-btn:hover {
border-color: rgba(212, 168, 106, 0.42);
background: rgba(212, 168, 106, 0.16);
color: #fce0b6;
}
.icon-btn.danger:hover {
border-color: rgba(255, 127, 127, 0.45);
background: rgba(255, 127, 127, 0.16);
color: #ffd9d9;
}
.icon-btn::after {
content: attr(data-tooltip);
position: absolute;
left: 50%;
bottom: calc(100% + 7px);
transform: translate(-50%, 2px);
background: #081018;
border: 1px solid var(--line);
color: #dce6f5;
font-size: 0.72rem;
white-space: nowrap;
border-radius: 7px;
padding: 0.24rem 0.4rem;
opacity: 0;
pointer-events: none;
transition: opacity 0.16s ease, transform 0.16s ease;
z-index: 3;
}
.icon-btn:hover::after,
.icon-btn:focus-visible::after {
opacity: 1;
transform: translate(-50%, 0);
}
.pager {
display: flex;
justify-content: space-between;
align-items: center;
gap: 0.8rem;
margin-top: 0.72rem;
color: var(--muted);
font-size: 0.86rem;
flex-wrap: wrap;
}
.status {
margin: 0.6rem 0 0;
min-height: 1.1rem;
color: var(--muted);
font-size: 0.87rem;
}
.status.ok { color: var(--ok); }
.status.error { color: var(--danger); }
.stack {
display: grid;
gap: 0.9rem;
}
.triple {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 0.8rem;
}
.config-layout {
display: grid;
grid-template-columns: 260px 1fr;
gap: 0.85rem;
}
.config-tree {
border: 1px solid var(--line);
border-radius: 12px;
background: rgba(255, 255, 255, 0.02);
padding: 0.75rem;
display: flex;
flex-direction: column;
gap: 0.45rem;
align-self: start;
position: sticky;
top: 1rem;
}
.tree-title {
margin: 0 0 0.2rem;
font-size: 0.72rem;
text-transform: uppercase;
letter-spacing: 0.06em;
color: #8da2bc;
font-weight: 700;
}
.tree-node {
border: 1px solid transparent;
border-radius: 10px;
background: rgba(255, 255, 255, 0.02);
color: #d7e4f5;
cursor: pointer;
text-align: left;
padding: 0.52rem 0.6rem;
font-weight: 600;
}
.tree-node:hover {
border-color: var(--line);
background: rgba(255, 255, 255, 0.04);
}
.tree-node.active {
border-color: rgba(212, 168, 106, 0.5);
background: var(--brand-soft);
color: #f7dfb8;
}
.config-panel {
min-width: 0;
}
.block {
border: 1px solid var(--line);
border-radius: 12px;
padding: 0.75rem;
background: rgba(255, 255, 255, 0.02);
}
.block h3 {
margin: 0 0 0.5rem;
font-size: 1rem;
}
.block .table-wrap table {
min-width: 640px;
}
.json {
border: 1px solid var(--line);
border-radius: 12px;
padding: 0.7rem;
background: #0e151d;
color: #ccdef4;
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 0.83rem;
overflow: auto;
max-height: 380px;
white-space: pre-wrap;
word-break: break-word;
}
.overlay {
position: fixed;
inset: 0;
display: none;
align-items: center;
justify-content: center;
padding: 1rem;
z-index: 40;
background: rgba(6, 10, 14, 0.78);
backdrop-filter: blur(4px);
}
.overlay.open { display: flex; }
.modal {
width: min(680px, 100%);
max-height: 90vh;
overflow: auto;
border: 1px solid var(--line);
border-radius: 16px;
background: linear-gradient(160deg, rgba(21, 31, 42, 0.95), rgba(14, 21, 28, 0.98));
padding: 0.9rem;
box-shadow: var(--shadow);
}
.modal-head {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 0.8rem;
margin-bottom: 0.65rem;
}
.modal-head h3 {
margin: 0;
font-family: "Prata", serif;
font-size: 1.2rem;
}
.close {
border: 1px solid var(--line);
width: 34px;
height: 34px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.04);
color: #d7e4f5;
cursor: pointer;
font-size: 1.05rem;
}
.login-screen {
position: fixed;
inset: 0;
z-index: 60;
background: rgba(7, 11, 15, 0.86);
backdrop-filter: blur(5px);
display: grid;
place-items: center;
padding: 1rem;
}
.login-card {
width: min(420px, 100%);
border: 1px solid var(--line);
border-radius: 16px;
background: linear-gradient(160deg, rgba(24, 36, 48, 0.95), rgba(15, 24, 32, 0.98));
box-shadow: var(--shadow);
padding: 1rem;
}
.login-card h2 {
margin: 0;
font-family: "Prata", serif;
font-size: 1.4rem;
}
@media (max-width: 1160px) {
.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.triple { grid-template-columns: 1fr; }
.config-layout { grid-template-columns: 1fr; }
.config-tree { position: static; }
}
@media (max-width: 920px) {
.layout { grid-template-columns: 1fr; }
.sidebar {
position: static;
height: auto;
}
}
@media (max-width: 620px) {
.cards,
.filters {
grid-template-columns: 1fr;
}
.filter-toolbar {
flex-direction: column;
align-items: stretch;
}
.filter-action {
margin-left: 0;
}
.topbar {
flex-direction: column;
align-items: flex-start;
}
}
</style>
</head>
<body>
<div id="admin-root"></div>
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
<script type="text/babel" data-presets="env,react" src="/admin.jsx"></script>
</body>
</html>