/* Hybrid UI: a focused SaaS workspace for the cabinet and staff console. */
:root {
    --bg: #f7f5f2;
    --card: #fff;
    --surface-2: #f6f3ef;
    --ink: #181715;
    --muted: #79746d;
    --line: #ebe7e1;
    --line-strong: #dcd6ce;
    --accent: #f18413;
    --accent-hover: #db7309;
    --accent-weak: #fff3e2;
    --shadow: 0 1px 2px rgba(31, 26, 20, .04), 0 12px 36px rgba(49, 39, 27, .05);
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    background:
        radial-gradient(circle at 78% -12%, rgba(240, 132, 19, .07), transparent 29rem),
        var(--bg);
}

.shell {
    grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
    padding: 22px 14px 16px;
    border-color: var(--line);
    box-shadow: 8px 0 30px rgba(53, 43, 31, .025);
    z-index: 3;
}

.sb-brand {
    padding: 2px 10px 27px;
    color: var(--ink);
    font-size: 1.1rem;
    letter-spacing: -.02em;
}

.sb-brand:hover { color: var(--ink); text-decoration: none; }

.sb-brand .logo {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    -webkit-mask: none;
    mask: none;
    background-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M21 11.5a8.38 8.38 0 0 1-9 8.4 8.5 8.5 0 0 1-3.9-.9L3 20l1.3-3.1A8.38 8.38 0 0 1 3.5 11 8.5 8.5 0 0 1 12 3a8.38 8.38 0 0 1 9 8.5z'/%3E%3C/svg%3E");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 19px;
    box-shadow: 0 7px 18px rgba(240, 132, 19, .25);
}

.sb-nav { gap: 5px; }

.sb-nav a {
    min-height: 44px;
    padding: 11px 13px;
    border-radius: 11px;
    color: #56514a;
    transition: color .16s ease, background-color .16s ease, transform .16s ease;
}

.sb-nav a:hover {
    background: #f7f4ef;
    transform: translateX(2px);
}

.sb-nav a.active {
    background: linear-gradient(90deg, #fff0dc, #fff7eb);
    box-shadow: inset 3px 0 0 var(--accent);
}

.sb-nav a svg { width: 20px; height: 20px; }

.sb-acct {
    margin: 12px 2px 0;
    padding: 17px 8px 5px;
}

.sb-acct .avatar,
.comment-avatar {
    background: linear-gradient(145deg, #ffe9c8, #fff7eb);
    border: 1px solid #f5d9b2;
    box-shadow: 0 2px 8px rgba(70, 52, 30, .08);
}

.sb-main { background: transparent; }

.pagehead {
    min-height: 102px;
    padding: 25px clamp(20px, 3vw, 42px) 22px;
    align-items: center;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(14px);
    border-color: var(--line);
    position: sticky;
    top: 0;
    z-index: 2;
}

.pagehead .ph-title {
    font-size: clamp(1.45rem, 2vw, 1.9rem);
    letter-spacing: -.035em;
}

.pagehead .ph-sub { margin-top: 4px; color: var(--muted); }
.pagehead .ph-actions { gap: 8px; }

.pagebody {
    max-width: 1480px;
    padding: 28px clamp(20px, 3vw, 42px) 52px;
    gap: 18px;
}

.panel,
.site,
.comment,
.tile {
    border-color: var(--line);
    box-shadow: var(--shadow);
}

.panel { padding: 24px; }
.panel:hover { border-color: #e3ddd5; }

.btn,
.act,
button.primary {
    min-height: 40px;
    justify-content: center;
    border-radius: 10px;
    transition: transform .14s ease, box-shadow .14s ease, background-color .14s ease;
}

.btn:not(.ghost),
button.primary {
    box-shadow: 0 6px 16px rgba(240, 132, 19, .2);
}

.btn:hover,
.act:hover,
button.primary:hover {
    transform: translateY(-1px);
}

.btn.ghost { background: rgba(255,255,255,.72); }

input[type=text],
input[type=email],
input[type=password],
textarea,
select {
    min-height: 44px;
    border-color: var(--line-strong);
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--accent) 32%, transparent);
    outline-offset: 2px;
}

label { color: #4c4842; }

.badge,
.st,
.bs,
.role {
    padding: 5px 11px;
    line-height: 1.2;
    border: 1px solid transparent;
}

.badge.ok,
.st-approved,
.bs-active { border-color: rgba(30, 142, 62, .1); }

.stats {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px;
}

.tile {
    position: relative;
    overflow: hidden;
    padding: 19px;
}

.tile::after {
    content: "";
    position: absolute;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    right: -18px;
    top: -20px;
    background: var(--accent-weak);
}

.tile .num { font-size: 1.8rem; letter-spacing: -.045em; }

.sites {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 16px;
}

.site {
    padding: 0;
    overflow: hidden;
    transition: transform .17s ease, box-shadow .17s ease, border-color .17s ease;
}

.site:hover {
    transform: translateY(-2px);
    border-color: #dfd8cf;
    box-shadow: 0 18px 42px rgba(54, 42, 28, .08);
}

.site-main { padding: 21px 22px 17px; }
.site h3 { font-size: 1.08rem; letter-spacing: -.015em; }
.site .domain { margin-top: 3px; }

.site-ident { display: flex; align-items: center; gap: 12px; min-width: 0; }

.site-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 12px;
    color: var(--accent);
    background: var(--accent-weak);
    font-weight: 700;
}

.site .counts {
    margin: 18px 0 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
}

.site .key {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-actions {
    padding: 13px 22px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    background: #fcfbf9;
    border-top: 1px solid var(--line);
}

.site-actions .btn { padding: 8px 12px; min-height: 36px; }

.sitetabs,
.tabs {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sitetabs::-webkit-scrollbar,
.tabs::-webkit-scrollbar { display: none; }

.sitetabs {
    gap: 28px;
    padding: 0 5px;
}

.sitetabs a {
    padding: 13px 1px;
    font-size: 15px;
    border-bottom-width: 3px;
}

.tabs {
    width: max-content;
    max-width: 100%;
    align-items: center;
    gap: 5px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-2) 72%, var(--card));
}

.tabs-label {
    padding: 0 7px 0 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.tabs .tab {
    margin: 0;
    padding: 7px 11px;
    border: 0;
    border-radius: 8px;
    font-size: 13px;
    white-space: nowrap;
}

.tabs .tab:hover {
    background: var(--card);
    color: var(--ink);
    text-decoration: none;
}

.tabs .tab.active {
    border: 0;
    background: var(--accent-weak);
    color: var(--accent);
}

.moderation-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: -4px;
}

.comment-list { display: flex; flex-direction: column; gap: 12px; }

.comment {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 0 14px;
    padding: 18px 20px;
}

.comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--accent);
    font-weight: 700;
    grid-row: 1 / span 3;
}

.comment-main { min-width: 0; }
.comment-head { min-height: 24px; }
.comment-head .author { color: var(--ink); }
.comment-body { margin: 7px 0 5px; line-height: 1.55; }
.comment-thread { color: var(--muted); }
.comment .actions { margin: 0; align-self: center; justify-content: flex-end; }
.comment .actions .act { min-height: 38px; padding: 8px 12px; }
.comment .actions .approve { background: var(--accent); color: #fff; border-color: var(--accent); }

.empty {
    padding: 46px 24px;
    background: rgba(255,255,255,.55);
    border-style: dashed;
}

.pager {
    background: rgba(255,255,255,.7);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 8px;
}

table.list th {
    background: #fcfbf9;
    letter-spacing: .06em;
}

table.list th,
table.list td { padding: 13px 14px; }

.success,
.error { border: 1px solid currentColor; border-color: color-mix(in srgb, currentColor 15%, transparent); }

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #191715;
        --card: #211e1b;
        --surface-2: #292520;
        --ink: #f0ece6;
        --muted: #a79f96;
        --line: #37312b;
        --line-strong: #494139;
        --accent: #f59632;
        --accent-hover: #f7a349;
        --accent-weak: #3b2d1c;
        --shadow: 0 1px 2px rgba(0,0,0,.28), 0 14px 38px rgba(0,0,0,.18);
    }
    body { background: radial-gradient(circle at 78% -12%, rgba(245,150,50,.08), transparent 29rem), var(--bg); }
    .sidebar,
    .pagehead,
    .panel,
    .site,
    .comment,
    .tile,
    input[type=text],
    input[type=email],
    input[type=password],
    textarea,
    select,
    .btn.ghost { background: var(--card); }
    .pagehead { background: rgba(33,30,27,.88); }
    .sb-nav a { color: #c9c1b8; }
    .sb-nav a:hover { background: #292520; }
    .sb-nav a.active { background: linear-gradient(90deg, #3b2d1c, #30271d); }
    .site-actions,
    table.list th { background: #25211d; }
    .pager,
    .empty { background: rgba(33,30,27,.66); }
    label { color: #d0c9c1; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media (max-width: 1040px) {
    .comment { grid-template-columns: 38px minmax(0, 1fr); }
    .comment-avatar { width: 38px; height: 38px; }
    .comment .actions { grid-column: 2; justify-content: flex-start; margin-top: 10px; }
}

@media (max-width: 820px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: sticky;
        top: 0;
        height: auto;
        padding: 9px 12px;
        z-index: 10;
        box-shadow: 0 6px 20px rgba(49, 39, 27, .06);
    }
    .sb-brand { padding: 0 6px 0 0; }
    .sb-brand .logo { width: 31px; height: 31px; }
    .sb-brand .tag { display: none; }
    .sb-nav a { min-height: 38px; padding: 8px 10px; }
    .sb-nav a:hover { transform: none; }
    .pagehead { position: static; min-height: auto; padding: 18px 16px; }
    .pagebody { padding: 18px 16px 36px; }
}

@media (max-width: 620px) {
    .sites { grid-template-columns: 1fr; }
    .pagehead { align-items: flex-start; }
    .pagehead .ph-actions { width: 100%; margin-left: 0; }
    .pagehead .ph-actions .btn { flex: 1; }
    .site-actions .btn { flex: 1 1 auto; }
    .comment { grid-template-columns: 34px minmax(0, 1fr); padding: 15px; gap: 0 10px; }
    .comment-avatar { width: 34px; height: 34px; }
    .comment .actions { grid-column: 1 / -1; }
    .comment .actions form { flex: 1; }
    .comment .actions .act { width: 100%; }
}
