:root {
    --body-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --heading-font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --base-font-size: 16px;
    --hero-font-size: 1.8rem;
    --card-title-size: 1.1rem;
    --sidebar-font-size: 0.92rem;
    --app-bg: #eef1f6;
    --app-ink: #1f2937;
    --app-muted: #6b7280;
    --app-soft: #f7f8fb;
    --app-surface: #ffffff;
    --app-line: #dfe4ec;
    --app-sidebar: #141b2d;
    --app-sidebar-2: #1c2540;
    --app-sidebar-muted: #97a3ba;
    --app-primary: #6259ca;
    --app-primary-2: #4f8df7;
    --app-green: #23b58a;
    --app-orange: #f59f30;
    --app-red: #e54864;
    --app-cyan: #17a6b8;
    --app-shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
    --app-radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--app-ink);
    background:
        linear-gradient(90deg, rgba(98, 89, 202, 0.06) 1px, transparent 1px),
        linear-gradient(180deg, #f6f7fb 0%, var(--app-bg) 100%);
    background-size: 28px 28px, auto;
    font-family: var(--body-font);
    font-size: var(--base-font-size);
}

h1,
h2,
h3,
h4,
h5,
h6,
.brand-title,
.section-head h2,
.section-head h3 {
    font-family: var(--heading-font);
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92em;
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 18px 14px;
    color: #fff;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)),
        var(--app-sidebar);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    display: grid;
    align-content: start;
    gap: 18px;
}

.brand {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 58px;
    padding: 8px 8px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--app-radius);
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-2));
    color: #fff;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(98, 89, 202, 0.28);
}

.brand-title {
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.brand-subtitle {
    margin-top: 2px;
    color: var(--app-sidebar-muted);
    font-size: 0.78rem;
}

.sidebar-section {
    display: grid;
    gap: 4px;
}

.sidebar-label {
    padding: 0 10px 6px;
    color: var(--app-sidebar-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-link {
    min-height: 42px;
    padding: 10px 10px;
    border-radius: var(--app-radius);
    color: #e7ecf8;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: var(--sidebar-font-size);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.side-link:hover,
.side-link.active {
    background: var(--app-sidebar-2);
    color: #fff;
}

.side-link.active {
    box-shadow: inset 3px 0 0 var(--app-primary-2);
}

.side-link:hover {
    transform: translateX(2px);
}

.side-link-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.side-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
}

.side-link.active .side-dot {
    background: var(--app-primary-2);
    border-color: var(--app-primary-2);
}

.side-link small {
    color: var(--app-sidebar-muted);
    font-size: 0.72rem;
}

.sidebar-status {
    margin-top: 6px;
    padding: 12px;
    border-radius: var(--app-radius);
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.sidebar-status strong,
.sidebar-status small {
    display: block;
}

.sidebar-status strong {
    font-size: 0.82rem;
}

.sidebar-status small {
    margin-top: 2px;
    color: var(--app-sidebar-muted);
    font-size: 0.72rem;
}

.status-light {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--app-green);
    box-shadow: 0 0 0 4px rgba(35, 181, 138, 0.16);
}

.content {
    min-width: 0;
    padding: 18px 22px 28px;
    display: grid;
    align-content: start;
    gap: 18px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: minmax(190px, 250px) minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 0 6px;
    background: linear-gradient(180deg, rgba(238, 241, 246, 0.96), rgba(238, 241, 246, 0.8));
    backdrop-filter: blur(12px);
}

.topbar-heading {
    min-width: 0;
}

.topbar-heading h1 {
    margin: 2px 0 0;
    font-size: 1.28rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-kicker {
    color: var(--app-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-card,
.top-resources,
.top-actions,
.topbar-toolbar,
.panel,
.card,
.stat-card,
.feature-card,
.table-card,
.feed-card,
.hero-card,
.notice-card {
    background: var(--app-surface);
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    box-shadow: var(--app-shadow);
}

.topbar-toolbar {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 5px;
    display: grid;
    grid-template-columns: minmax(430px, 1fr) 48px minmax(104px, 132px) max-content;
    align-items: center;
    gap: 8px;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

.search-card {
    width: 48px;
    min-height: 46px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    box-shadow: none;
}

.search-trigger {
    width: 48px;
    justify-content: center;
    cursor: pointer;
}

.search-trigger:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.search-icon {
    width: 14px;
    height: 14px;
    border: 2px solid var(--app-muted);
    border-radius: 50%;
    position: relative;
    opacity: 0.8;
}

.search-icon::after {
    content: "";
    width: 6px;
    height: 2px;
    position: absolute;
    right: -5px;
    bottom: -3px;
    background: var(--app-muted);
    transform: rotate(45deg);
}

.search-card input {
    appearance: none;
    min-width: 0;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--app-muted);
    font: inherit;
}

.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: start center;
    padding: 12vh 18px 18px;
    background: rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(10px);
}

.search-modal {
    width: min(760px, 100%);
}

.search-modal-box {
    min-height: 64px;
    padding: 8px 8px 8px 18px;
    border: 1px solid #cfd8e6;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.search-modal-box input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #0f172a;
    font: inherit;
    font-size: 1.06rem;
}

.search-modal-close {
    min-height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: var(--app-radius);
    background: var(--app-soft);
    color: var(--app-muted);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    padding: 0 14px;
}

.search-modal-close:hover {
    color: #0f172a;
    background: #fff;
}

body.search-is-open {
    overflow: hidden;
}

[data-search-overlay][hidden] {
    display: none !important;
}

.search-card input::-webkit-search-decoration,
.search-card input::-webkit-search-cancel-button {
    appearance: none;
}

[hidden] {
    display: none !important;
}

.top-resources {
    min-width: 0;
    min-height: 46px;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(4, minmax(82px, 1fr));
    align-items: center;
    gap: 6px;
    box-shadow: none;
}

.top-resources span {
    min-width: 0;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid #e8ebf1;
    border-radius: var(--app-radius);
    background: var(--app-soft);
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}

.top-resources small {
    color: var(--app-muted);
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

.top-resources strong {
    color: #0f172a;
    font-size: 0.78rem;
    line-height: 1.15;
    white-space: nowrap;
}

.top-actions {
    justify-self: end;
    min-width: 0;
    min-height: 46px;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-end;
    box-shadow: none;
    white-space: nowrap;
}

.top-actions form {
    flex: 0 0 auto;
}

.button.danger {
    border-color: #fecaca;
    background: #fee2e2;
    color: #991b1b;
}

.button.danger:hover {
    border-color: #fca5a5;
    background: #fecaca;
    color: #7f1d1d;
}

.pill {
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid #e8ebf1;
    border-radius: var(--app-radius);
    background: var(--app-soft);
    color: var(--app-muted);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    white-space: nowrap;
}

.pill.success {
    border-color: #bbf7d0;
    background: #ecfdf5;
    color: #047857;
    font-weight: 900;
}

.profile-pill {
    color: var(--app-muted);
}

.team-online-pill {
    justify-content: center;
    gap: 6px;
    min-width: 104px;
    max-width: 132px;
    overflow: hidden;
}

.team-online-pill small {
    color: var(--app-muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.team-online-pill strong {
    color: #047857;
    font-size: 0.78rem;
    white-space: nowrap;
}

.time-pill {
    gap: 10px;
}

.time-pill strong {
    color: #0f172a;
    font-size: 0.78rem;
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-pill:hover {
    color: #0f172a;
    border-color: #cbd5e1;
    background: #fff;
}

.hero-card {
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
    gap: 16px;
    overflow: hidden;
}

.hero-card h1 {
    margin: 10px 0 8px;
    max-width: 980px;
    font-size: clamp(1.35rem, var(--hero-font-size), 2rem);
    line-height: 1.12;
}

.hero-card p,
.muted {
    color: var(--app-muted);
}

.hero-card p {
    max-width: 780px;
    margin: 0;
    line-height: 1.55;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: var(--app-radius);
    background: rgba(98, 89, 202, 0.1);
    color: var(--app-primary);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero-meta,
.grid-two,
.grid-three,
.grid-four,
.meta-grid,
.metric-grid {
    display: grid;
    gap: 10px;
}

.hero-meta {
    margin-top: 16px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-two,
.meta-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-four,
.metric-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hero-metric,
.metric-box,
.callout,
.meta,
.metric,
.feed-item {
    padding: 12px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-soft);
    overflow-wrap: anywhere;
}

.hero-metric strong,
.metric-box strong,
.metric strong,
.mini-stat strong {
    display: block;
    margin-top: 6px;
    color: var(--app-ink);
    font-size: 1.28rem;
    line-height: 1.15;
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.stat-card {
    min-height: 116px;
    padding: 16px;
    position: relative;
    overflow: hidden;
    color: #fff;
}

.stat-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 54%);
    pointer-events: none;
}

.stat-card span,
.stat-card strong,
.stat-card div {
    position: relative;
    z-index: 1;
}

.stat-card span {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    opacity: 0.9;
}

.stat-card strong {
    display: block;
    margin-top: 14px;
    font-size: 1.8rem;
    line-height: 1.1;
}

.stat-card div {
    margin-top: 8px;
    font-size: 0.84rem;
    opacity: 0.86;
}

.stat-card.blue {
    background: linear-gradient(135deg, var(--app-primary), var(--app-primary-2));
}

.stat-card.pink {
    background: linear-gradient(135deg, var(--app-red), #f0788f);
}

.stat-card.green {
    background: linear-gradient(135deg, #159a75, var(--app-green));
}

.stat-card.orange {
    background: linear-gradient(135deg, #e37d22, var(--app-orange));
}

.main-grid,
.grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
}

.grid {
    grid-column: span 12;
}

.span-12 {
    grid-column: span 12;
}

.span-8 {
    grid-column: span 8;
}

.span-6 {
    grid-column: span 6;
}

.span-4 {
    grid-column: span 4;
}

.span-3 {
    grid-column: span 3;
}

.span-2 {
    grid-column: span 2;
}

.panel,
.feature-card,
.table-card,
.feed-card,
.notice-card,
.card {
    padding: 16px;
}

.section-head {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.section-head h2,
.section-head h3 {
    margin: 0 0 4px;
    font-size: clamp(1rem, var(--card-title-size), 1.2rem);
    line-height: 1.2;
}

.action-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.button,
button.button {
    min-height: 36px;
    appearance: none;
    border: 1px solid transparent;
    border-radius: var(--app-radius);
    padding: 8px 12px;
    background: var(--app-primary);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.2;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.button:hover,
button.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(98, 89, 202, 0.18);
}

.button.secondary,
button.button.secondary {
    border-color: var(--app-line);
    background: #fff;
    color: var(--app-ink);
}

.button.green,
button.button.green {
    background: var(--app-green);
}

.icon-button {
    width: 38px;
    height: 38px;
    min-height: 38px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: #fff;
    color: var(--app-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.icon-button:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 8px 18px rgba(98, 89, 202, 0.18);
}

.icon-button .refresh-glyph {
    width: 16px;
    height: 16px;
    border: 2px solid currentColor;
    border-left-color: transparent;
    border-radius: 50%;
    display: block;
    position: relative;
}

.icon-button .refresh-glyph::after {
    content: "";
    position: absolute;
    right: -3px;
    top: 0;
    width: 0;
    height: 0;
    border-left: 5px solid currentColor;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transform: rotate(38deg);
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    background: #fff;
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid #edf0f5;
    text-align: left;
    vertical-align: top;
}

tr:last-child td {
    border-bottom: 0;
}

th {
    background: #fafbfe;
    color: var(--app-muted);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
    background: #eef1f6;
    color: var(--app-ink);
}

.badge.pro,
.badge.info,
.badge.registered,
.badge.pending {
    background: rgba(98, 89, 202, 0.12);
    color: #5149a8;
}

.badge.lite,
.badge.active,
.badge.ok,
.badge.applied {
    background: rgba(35, 181, 138, 0.13);
    color: #147d62;
}

.badge.stale,
.badge.sent,
.badge.trialing {
    background: rgba(245, 159, 48, 0.15);
    color: #9a6117;
}

.badge.cancelled,
.badge.past_due,
.badge.failed,
.badge.warning {
    background: rgba(229, 72, 100, 0.12);
    color: #ae3149;
}

.feed-list {
    display: grid;
    gap: 10px;
}

.feed-item {
    background: #fff;
}

.feed-item.compact {
    padding: 10px 12px;
    border-radius: 12px;
}

.feed-item.compact .muted {
    font-size: 0.9rem;
}

.feed-meta {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.notice-card {
    padding: 14px 16px;
    border-left: 4px solid var(--app-primary);
}

.admin-update-progress {
    margin-top: 16px;
    padding: 14px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: #fafbfe;
}

.admin-update-head {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.admin-update-head strong {
    font-size: 0.95rem;
}

.admin-update-head span {
    color: var(--app-primary);
    font-size: 0.86rem;
    font-weight: 800;
}

.admin-update-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e7ebf3;
    overflow: hidden;
}

.admin-update-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--app-primary), var(--app-primary-2));
    transition: width 0.25s ease;
}

.admin-update-bar.failed {
    background: linear-gradient(90deg, var(--app-red), #ff8a8a);
}

.admin-update-status {
    margin-top: 10px;
    color: var(--app-muted);
    font-size: 0.88rem;
}

.admin-update-log {
    margin-top: 12px;
    max-height: 220px;
    overflow: auto;
    padding: 12px;
    border-radius: var(--app-radius);
    background: #141b2d;
    color: #d7e0f5;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
}

.admin-update-log-line {
    margin-bottom: 5px;
    overflow-wrap: anywhere;
}

.admin-update-log-line.ok {
    color: #88e8bf;
}

.admin-update-log-line.warn {
    color: #ffd38d;
}

.admin-update-log-line.error {
    color: #ff9f9f;
}

.admin-update-log-line.info {
    color: #a9c5ff;
}

input[type="file"],
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    padding: 10px 12px;
    background: #fff;
    color: var(--app-ink);
    font: inherit;
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(98, 89, 202, 0.65);
    box-shadow: 0 0 0 3px rgba(98, 89, 202, 0.12);
}

textarea {
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    color: var(--app-muted);
    font-size: 0.82rem;
    font-weight: 800;
}

.checkbox {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--app-muted);
    font-weight: 700;
}

.checkbox input {
    width: auto;
}

.check-row {
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #d8e0ec;
    border-radius: var(--app-radius);
    background: #fff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0f172a;
    font-weight: 800;
}

.check-row input {
    width: auto;
}

.plan-editor {
    display: block;
}

details.feed-item {
    background: #fff;
}

details summary {
    outline: none;
}

details summary::-webkit-details-marker {
    display: none;
}

.installation-card {
    padding: 0;
    overflow: hidden;
}

.installation-summary {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    user-select: none;
}

.installation-summary:hover {
    background: #fafbfe;
}

.installation-card > .grid {
    padding: 0 16px 16px;
}

.installation-toggle {
    width: 30px;
    height: 30px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: var(--app-soft);
    position: relative;
    display: inline-grid;
    place-items: center;
}

.installation-toggle::before,
.installation-toggle::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: var(--app-primary);
    transition: transform 0.16s ease, opacity 0.16s ease;
}

.installation-toggle::after {
    transform: rotate(90deg);
}

.installation-card[open] .installation-toggle {
    background: rgba(98, 89, 202, 0.1);
    border-color: rgba(98, 89, 202, 0.22);
}

.installation-card[open] .installation-toggle::after {
    opacity: 0;
    transform: rotate(90deg) scaleX(0);
}

.auth-page {
    min-height: 100vh;
    color: var(--app-ink);
    background:
        linear-gradient(90deg, rgba(98, 89, 202, 0.07) 1px, transparent 1px),
        linear-gradient(180deg, #f8f9fd 0%, #e9edf5 100%);
    background-size: 30px 30px, auto;
}

.auth-shell {
    min-height: 100vh;
    padding: 24px;
    display: grid;
    place-items: center;
}

.auth-panel {
    width: min(470px, 100%);
    padding: 22px;
    border: 1px solid var(--app-line);
    border-radius: var(--app-radius);
    background: #fff;
    box-shadow: var(--app-shadow);
}

.auth-brand {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--app-line);
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.auth-brand .brand-subtitle {
    color: var(--app-muted);
}

.auth-heading {
    margin-bottom: 18px;
}

.auth-heading h1 {
    margin: 10px 0 8px;
    font-size: 1.7rem;
    line-height: 1.16;
}

.auth-heading p {
    margin: 0;
    color: var(--app-muted);
    line-height: 1.55;
}

.auth-form {
    display: grid;
    gap: 14px;
}

.auth-remember {
    margin: 2px 0;
}

.auth-submit {
    width: 100%;
}

.auth-error {
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid rgba(229, 72, 100, 0.24);
    border-radius: var(--app-radius);
    background: rgba(229, 72, 100, 0.08);
    color: #ae3149;
    font-weight: 700;
}

@media (max-width: 1250px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .brand,
    .sidebar-status {
        grid-column: 1 / -1;
    }

    .hero-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .content {
        padding: 14px;
    }

    .topbar {
        position: static;
        grid-template-columns: 1fr;
    }

    .topbar-toolbar {
        grid-template-columns: minmax(430px, 1fr) 48px minmax(104px, 132px) max-content;
        overflow-x: auto;
    }

    .top-actions {
        grid-column: auto;
        justify-content: flex-end;
        flex-wrap: nowrap;
    }

    .team-online-pill {
        grid-column: auto;
        justify-content: center;
    }

    .top-resources {
        grid-template-columns: repeat(4, minmax(82px, 1fr));
    }

    .mini-stats,
    .grid-four,
    .grid-three,
    .grid-two,
    .hero-meta,
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .span-8,
    .span-6,
    .span-4,
    .span-3 {
        grid-column: span 12;
    }
}

@media (max-width: 640px) {
    .sidebar {
        grid-template-columns: 1fr;
    }

    .mini-stats,
    .grid-four,
    .grid-three,
    .grid-two,
    .hero-meta,
    .meta-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .form-grid,
    .form-grid.compact {
        grid-template-columns: 1fr;
    }

    .top-resources {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .span-2 {
        grid-column: span 1;
    }

    .hero-card,
    .panel,
    .feature-card,
    .table-card,
    .feed-card,
    .notice-card,
    .card {
        padding: 14px;
    }
}
