:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f7f4f8;
    color: #2b2430;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: linear-gradient(135deg, #fbf8fb 0%, #f2edf5 100%); }
a { color: #713474; }
.app-shell { display: grid; grid-template-columns: 270px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #2e1833; color: #fff; padding: 26px 20px; }
.brand { display: block; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.15rem; margin-bottom: 28px; }
.tree { display: grid; gap: 8px; }
.tree a, .tree summary, .link-button { color: #f7edf8; text-decoration: none; display: block; padding: 10px 12px; border-radius: 9px; cursor: pointer; }
.tree a:hover, .tree summary:hover, .link-button:hover { background: #ffffff18; }
.tree details a { margin-left: 17px; color: #dbcbdc; }
.tree summary { font-weight: 750; }
.link-button { width: 100%; border: 0; background: transparent; font: inherit; text-align: left; }
.content { width: min(1100px, 100%); padding: 34px; }
.auth-content { width: min(680px, calc(100% - 32px)); margin: 42px auto; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.page-header h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.1rem); }
.page-header span { color: #6b606e; }
.card { background: #fff; border: 1px solid #e9e0ea; border-radius: 17px; padding: 24px; box-shadow: 0 8px 28px #3e1c4610; margin-bottom: 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.stat { background: #f8f3f9; padding: 18px; border-radius: 13px; }
.stat strong { display: block; font-size: 1.2rem; margin-top: 5px; }
.usage-bar { height: 14px; overflow: hidden; border-radius: 999px; background: #eee2ef; margin: 18px 0 10px; }
.usage-bar span { display: block; height: 100%; border-radius: inherit; background: #7b397d; transition: width .2s ease; }
.plan-pro { border-color: #d8badb; background: linear-gradient(135deg, #fff 0%, #f8eef9 100%); }
.plan-price strong { font-size: 2rem; color: #713474; }
label { display: block; font-weight: 700; margin: 17px 0 7px; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=url], select, textarea {
    width: 100%; border: 1px solid #cfc4d1; border-radius: 9px; padding: 12px; font: inherit; background: #fff;
}
textarea { min-height: 130px; resize: vertical; }
small, .muted { color: #716975; }
.checkbox { display: flex; align-items: center; gap: 9px; }
.checkbox input { width: 18px; height: 18px; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.actions.compact { margin-top: 0; gap: 8px; }
.button, button.button {
    display: inline-block; border: 0; border-radius: 9px; padding: 11px 17px; font: inherit; font-weight: 750;
    text-decoration: none; cursor: pointer; color: #fff; background: #7b397d;
}
.button.secondary { color: #542959; background: #eee2ef; }
.button.danger { background: #a62f3e; }
.button:disabled { cursor: not-allowed; opacity: .48; }
.flash { padding: 13px 15px; border-radius: 10px; margin: 0 0 18px; }
.flash.success { background: #e2f5e7; color: #215c30; }
.flash.error { background: #ffe5e7; color: #891c2b; }
.flash.notice { background: #eee8f2; }
.status-active { color: #197238; font-weight: 750; }
.status-inactive { color: #a02435; font-weight: 750; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; border-bottom: 1px solid #e7dfe8; padding: 12px 9px; vertical-align: top; }
th { color: #665b69; font-size: .9rem; }
.table-wrap { overflow-x: auto; }
.status { display: inline-block; border-radius: 999px; padding: 4px 9px; font-size: .85rem; font-weight: 750; }
.status.ok { background: #e2f5e7; color: #215c30; }
.status.off { background: #ffe5e7; color: #891c2b; }
.inline-form { display: inline; }
.auth-links { margin-top: 18px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
code { overflow-wrap: anywhere; }
@media (max-width: 800px) {
    .app-shell { display: block; }
    .sidebar { position: static; }
    .content { padding: 22px 16px; }
    .split { grid-template-columns: 1fr; }
    table { display: block; overflow-x: auto; }
}
