:root {
  color-scheme: light; --ink: #211c20; --muted: #665d62; --border: #e9e2e5;
  --bg: #f7f4f5; --red: #9e1530; --red-dark: #761025; --soft: #fff0f3;
  font-family: "Segoe UI", system-ui, sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.48; }
a { color: var(--red-dark); text-decoration-thickness: .08em; text-underline-offset: .2em; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 3px solid #ba2e4e; outline-offset: 3px; }
.app { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.app main { min-width: 0; width: 100%; max-width: 1480px; margin: 0 auto; padding: 38px clamp(20px, 4vw, 62px); }
.sidebar { min-width: 0; display: flex; flex-direction: column; gap: 28px; padding: 28px 18px; background: #fff; border-right: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; font-weight: 850; letter-spacing: .08em; width: fit-content; }
.brand small { display: block; font-size: .63rem; letter-spacing: .055em; color: var(--muted); }
.brand-mark { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 11px; background: var(--red); color: #fff; font-size: 1.3rem; }
nav { display: grid; gap: 4px; }
nav a { display: block; border-radius: 9px; padding: 10px 11px; color: #453a41; text-decoration: none; font-weight: 680; font-size: .91rem; }
nav a:hover, nav a[aria-current] { background: var(--soft); color: var(--red-dark); }
.nav-label { color: var(--muted); font-size: .75rem; font-weight: 700; margin: 16px 11px 0; }
.account { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 10px; align-items: center; overflow-wrap: anywhere; }
.account small, .list-row small { display: block; color: var(--muted); font-size: .82rem; }
h1, h2, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); letter-spacing: -.045em; margin-bottom: 5px; line-height: 1.13; overflow-wrap: anywhere; }
h2 { font-size: 1.13rem; letter-spacing: -.015em; margin-bottom: 14px; }
.head { display: flex; justify-content: space-between; gap: 16px; align-items: end; margin-bottom: 23px; }
.head p, .muted { color: var(--muted); }
.head p { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric, .panel { min-width: 0; padding: clamp(15px, 2.7vw, 24px); border: 1px solid var(--border); border-radius: 15px; background: #fff; box-shadow: 0 4px 16px #38232a08; }
.metric { border-top: 3px solid #c54f67; }
.metric span { color: var(--muted); font-weight: 650; }
.metric strong { display: block; font-size: 2rem; line-height: 1.2; margin-top: 7px; }
.panel-head, .list-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.panel-head { margin-bottom: 14px; } .panel-head h2 { margin: 0; }
.list-row { padding: 11px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.list-row a { font-weight: 650; }
.stack { display: flex; flex-direction: column; align-items: stretch; gap: 14px; }
.stack > button { align-self: start; }
label { display: grid; gap: 5px; min-width: 0; font-size: .92rem; font-weight: 640; }
input:not([type=checkbox]), select, textarea { display: block; min-width: 0; width: 100%; padding: 9px 10px; border: 1px solid #d9cdd2; border-radius: 8px; background: white; color: var(--ink); font: inherit; font-weight: 400; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid #c34863; outline-offset: 1px; }
input[type=checkbox] { accent-color: var(--red); margin: 0; }
button, .button { display: inline-flex; justify-content: center; align-items: center; min-height: 38px; width: fit-content; border: 1px solid #d8cbd0; padding: 8px 13px; border-radius: 8px; background: #fff; color: var(--ink); text-decoration: none; font: inherit; font-size: .89rem; font-weight: 720; text-align: center; cursor: pointer; }
button:hover, .button:hover { background: #fbf4f6; }
.primary { color: #fff; background: var(--red); border-color: var(--red); }
.primary:hover { color: #fff; background: var(--red-dark); border-color: var(--red-dark); }
.quiet { color: var(--red-dark); border-color: transparent; }
.danger { border-color: #e5b8c1; color: var(--red-dark); }
.filters, .actions { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.filters { margin-bottom: 15px; }
.filters label:first-of-type { flex: 2 1 195px; } .filters label { flex: 1 1 120px; }
.actions:not(:empty) { margin-top: 12px; }
.detail-grid, .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.form-grid { gap: 12px; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
th { color: #5e5159; background: #faf7f8; font-size: .82rem; }
td { font-size: .93rem; } td a { font-weight: 680; }
.checks { display: flex; gap: 10px 18px; flex-wrap: wrap; }
.checks label, label.check { display: flex; align-items: center; gap: 6px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px 12px; margin: 0; }
legend { font-size: .91rem; font-weight: 700; padding: 0 5px; }
.profile { display: grid; grid-template-columns: minmax(78px, .75fr) minmax(0, 1.75fr); gap: 8px 10px; }
.profile dt { font-weight: 680; } .profile dd { margin: 0; overflow-wrap: anywhere; }
.preserve { white-space: pre-wrap; overflow-wrap: anywhere; }
.private, .notice { padding: 12px 14px; border-radius: 8px; background: var(--soft); color: var(--red-dark); }
.private p { margin: 5px 0 0; }
.notice.ok { color: #23593c; background: #edf9ef; }
.timeline article { border-top: 1px solid var(--border); padding-top: 10px; }
.timeline small { color: var(--muted); }
details { border-top: 1px solid var(--border); padding: 9px 0; }
summary { cursor: pointer; overflow-wrap: anywhere; font-weight: 670; } details form { margin-top: 12px; }
.catalog-new summary { color: var(--red-dark); }
.problem { max-width: 650px; margin: 30px auto; }
.portal main { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; padding: 22px; }
.login-wrap { display: grid; grid-template-columns: 1.03fr 1fr; max-width: 850px; width: min(100vw - 44px, 850px); overflow: hidden; border-radius: 20px; background: white; box-shadow: 0 22px 70px #5b213f21; }
.login-banner { min-height: 390px; padding: clamp(23px, 5vw, 48px); display: flex; flex-direction: column; justify-content: space-between; gap: 28px; color: white; background: linear-gradient(145deg, #651022, #a81536 64%, #b62344); }
.login-banner .brand small, .login-banner p { color: #ffe0e8; }
.login-banner .brand-mark { background: #fff; color: var(--red-dark); }
.login-banner p { max-width: 30ch; margin: 13px 0 0; }
.login-form { align-self: center; padding: clamp(23px, 5vw, 50px); }
.login-form h2 { margin-bottom: 20px; }
.login-form .primary { width: 100%; }
@media (max-width: 900px) {
  .app { display: block; }
  .sidebar { gap: 14px; padding: 15px 20px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar nav { display: flex; flex-wrap: wrap; }
  .nav-label { display: none; }
  .account { margin-top: 0; }
  .app main { padding-top: 22px; }
}
@media (max-width: 600px) {
  .detail-grid, .form-grid, .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .head { align-items: start; flex-direction: column; }
  .stats { gap: 6px; }
  .metric { padding: 10px 7px; font-size: .82rem; }
  .metric strong { font-size: 1.45rem; }
  .login-banner { min-height: 0; }
  input:not([type=checkbox]), select, textarea { font-size: 1rem; }
}

