:root {
    --bg: #f6f7f9;
    --panel: #ffffff;
    --text: #1f2933;
    --muted: #687382;
    --line: #d9dee5;
    --accent: #0f766e;
    --accent-dark: #0b5f59;
    --danger: #b42318;
    --warn: #a15c07;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px/1.45 Arial, Helvetica, sans-serif;
}
a { color: var(--accent-dark); text-decoration: none; }
.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px 36px; }
.topbar {
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    margin-bottom: 24px;
}
.brand { font-weight: 700; color: var(--text); }
.topnav { display: flex; gap: 18px; }
.page-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
    margin-bottom: 18px;
}
h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 17px; }
p { margin: 8px 0 0; }
.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 18px;
    margin-bottom: 16px;
}
.panel.narrow { max-width: 680px; margin: 40px auto; }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    font: inherit;
}
.btn.primary {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}
.btn.small { min-height: 28px; padding: 5px 9px; font-size: 12px; }
.btn:hover { border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-dark); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
    padding: 10px 8px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}
.table th { color: var(--muted); font-size: 12px; font-weight: 600; }
.right { text-align: right !important; }
.muted { color: var(--muted); font-size: 12px; }
.strong { font-weight: 700; }
.status {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 4px;
    background: #e8f5f3;
    color: var(--accent-dark);
    font-size: 12px;
}
.warn { color: var(--warn); }
.notice {
    padding: 10px 12px;
    border-radius: 5px;
    background: #eef7f6;
    border: 1px solid #c8e3df;
    margin-bottom: 16px;
}
.notice.danger {
    background: #fff1f0;
    border-color: #f3b7b2;
    color: var(--danger);
}
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.form { display: grid; gap: 14px; max-width: 760px; }
.form label { display: grid; gap: 6px; }
.form label span { color: var(--muted); font-size: 12px; }
input, select, textarea {
    width: 100%;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: var(--text);
    font: inherit;
}
textarea { resize: vertical; min-height: 120px; }
.inline-form { display: flex; gap: 10px; flex-wrap: wrap; }
.lifecycle-actions { margin-top: 14px; }
.lifecycle-actions form { margin: 0; }
.hint { color: var(--muted); font-size: 12px; }
code {
    display: inline-block;
    background: #eef1f4;
    border-radius: 4px;
    padding: 2px 5px;
    margin: 2px;
}
.json-box, .error-box {
    overflow: auto;
    max-height: 460px;
    background: #111827;
    color: #e5e7eb;
    border-radius: 5px;
    padding: 14px;
    font-size: 12px;
}
body.embed {
    background: #fff;
    padding: 14px;
}
.popup h1 { font-size: 20px; margin-bottom: 12px; }
.widget {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

@media (max-width: 760px) {
    .shell { padding: 0 14px 28px; }
    .page-head, .topbar { align-items: flex-start; flex-direction: column; height: auto; padding: 14px 0; }
    .grid.two { grid-template-columns: 1fr; }
    .table { font-size: 12px; }
    .kv { grid-template-columns: 1fr; }
}
