:root {
  --ink: #18212a;
  --muted: #667380;
  --line: #d8e0e5;
  --surface: #ffffff;
  --canvas: #f3f6f7;
  --accent: #176b5b;
  --accent-dark: #0f5145;
  --accent-soft: #e0f0eb;
  --warning: #805e0d;
  --warning-soft: #fff4cf;
  --danger: #ad3d36;
  --radius: 6px;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--canvas); font: 14px/1.5 Inter, "Microsoft YaHei", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner, .page-shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; }
.header-inner { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius); color: #fff; background: var(--accent); font-weight: 700; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { color: var(--muted); font-size: 12px; }
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav form { margin: 0; }
.top-nav form input { display: none; }
.top-nav a, .top-nav .logout { min-height: 32px; padding: 6px 10px; border: 0; border-radius: 4px; color: var(--muted); background: transparent; font: inherit; cursor: pointer; }
.top-nav a:hover, .top-nav a.active { color: var(--accent-dark); background: var(--accent-soft); }
.top-nav .logout { color: var(--danger); }
.page-shell { padding: 28px 0 50px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.eyebrow { margin: 0 0 4px; color: var(--accent-dark); font-size: 12px; font-weight: 700; letter-spacing: 0; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 27px; line-height: 1.2; }
h2 { margin-bottom: 0; font-size: 16px; line-height: 1.25; }
.environment-state { display: grid; grid-template-columns: auto auto; gap: 3px 14px; padding: 8px 12px; border-left: 3px solid var(--warning); background: var(--warning-soft); color: var(--warning); font-size: 12px; }
.environment-state.live { border-left-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.environment-state strong { text-align: right; font-size: 12px; }
.notice { margin-bottom: 16px; padding: 10px 12px; border: 1px solid #b7d9cf; border-left: 3px solid var(--accent); border-radius: var(--radius); color: #174a3d; background: var(--accent-soft); }
.notice.warning { border-color: #e5ca72; border-left-color: var(--warning); color: #654d13; background: var(--warning-soft); }
.notice.error, .form-error { border-color: #e5b7b2; border-left-color: var(--danger); color: #7e2c27; background: #fff0ee; }
.form-error { padding: 8px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.metric, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.metric { min-height: 96px; padding: 17px; }
.metric span { display: block; margin-bottom: 8px; color: var(--muted); }
.metric strong { font-size: 25px; line-height: 1; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; margin-bottom: 16px; }
.panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 15px 17px; border-bottom: 1px solid var(--line); }
.inline-form, .catalog-form { display: grid; gap: 9px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.customer-create { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.catalog-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.catalog-form button { grid-column: span 2; }
label { display: grid; gap: 4px; color: var(--muted); font-size: 12px; }
input { width: 100%; min-height: 34px; padding: 7px 9px; border: 1px solid #bdc8d0; border-radius: 4px; color: var(--ink); background: #fff; font: inherit; }
input:focus { outline: 2px solid #9bc9bb; outline-offset: 1px; border-color: var(--accent); }
button { min-height: 34px; padding: 7px 12px; border: 1px solid var(--accent); border-radius: 4px; color: #fff; background: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
button:hover { background: var(--accent-dark); }
.button-quiet { min-height: 28px; padding: 4px 7px; border-color: #bdc8d0; color: var(--ink); background: #fff; font-size: 12px; font-weight: 500; }
.button-quiet:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid #e8edf0; text-align: left; vertical-align: middle; white-space: nowrap; }
th { color: var(--muted); background: #f8fafb; font-size: 12px; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.empty-state { padding: 24px; color: var(--muted); text-align: center; }
.row-actions, .row-actions form { display: flex; align-items: center; gap: 5px; }
.row-actions input { width: 76px; min-height: 28px; padding: 4px 6px; font-size: 12px; }
code { padding: 1px 4px; border-radius: 3px; color: #354756; background: #edf1f4; font-family: Consolas, monospace; font-size: .91em; }
.status { display: inline-block; padding: 2px 7px; border-radius: 999px; color: #52606b; background: #e8ecef; font-size: 12px; }
.status-waiting_sms, .status-sms_received { color: #0d5a48; background: #dcefe8; }
.status-completed { color: #10523f; background: #cae8db; }
.status-cancel_requested, .status-manual_review, .status-failed { color: #85421b; background: #fff0d2; }
.status-cancelled { color: #5e6670; background: #e8ecef; }
.text-link { color: var(--accent-dark); font-weight: 600; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(310px, .8fr); align-items: center; gap: 46px; min-height: calc(100vh - 180px); max-width: 920px; margin: 0 auto; }
.login-intro h1 { font-size: 34px; }
.login-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 26px 0 0; }
.login-points div { padding: 10px; border-top: 2px solid var(--accent); background: #ecf4f1; }
.login-points dt { font-weight: 700; }
.login-points dd { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.login-form { padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 10px 24px rgba(28, 45, 56, .08); }
.login-form h2 { margin-bottom: 18px; font-size: 20px; }
.login-form label { margin-bottom: 7px; }
.login-form button { width: 100%; margin-top: 16px; }
.docs-layout { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.doc-panel { padding: 17px; }
.doc-panel p { margin: 8px 0 0; color: var(--muted); }
pre { overflow-x: auto; margin: 12px 0 0; padding: 12px; border: 1px solid #dbe2e5; border-radius: 4px; background: #f7f9fa; line-height: 1.45; }
pre code { padding: 0; background: transparent; white-space: pre; }
@media (max-width: 880px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } .two-column, .docs-layout, .login-layout { grid-template-columns: 1fr; } .login-layout { padding-top: 26px; } }
@media (max-width: 600px) { .header-inner, .page-shell { width: min(100% - 26px, 1220px); } .metrics, .login-points { grid-template-columns: 1fr; } .page-heading { display: block; } .environment-state { display: inline-grid; margin-top: 14px; } .customer-create { grid-template-columns: 1fr; } .brand small { display: none; } }
