:root {
    --gc-primary: #287d71;
    --gc-primary-dark: #155d55;
    --gc-primary-soft: #dff0ea;
    --gc-ink: #173330;
    --gc-muted: #687d78;
    --gc-line: #dce8e4;
    --gc-card: rgba(255, 255, 255, .88);
    --gc-bg: #eff7f3;
    --gc-shell-gap: 6px;
}

* {
    box-sizing: border-box;
}

body {
    /* min-height: 100vh; */
    margin: 0;
    color: var(--gc-ink);
    font-size: var(--gc-font-size, 13px);
    background:
        radial-gradient(circle at 8% 8%, rgba(40, 125, 113, .20), transparent 26rem),
        radial-gradient(circle at 92% 4%, rgba(239, 172, 92, .23), transparent 22rem),
        linear-gradient(135deg, #f8fbf9, var(--gc-bg));
}

.mb-16 {
    margin-bottom: 16px;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 26px;
}

.login-card {
    width: min(460px, 100%);
    padding: 34px;
    border: 1px solid var(--gc-line);
    border-radius: 28px;
    background: var(--gc-card);
    box-shadow: 0 28px 90px rgba(22, 49, 47, .14);
    backdrop-filter: blur(18px);
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--gc-primary-dark);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
}

.login-card h1 {
    margin: 0;
    font-size: clamp(34px, 7vw, 54px);
    line-height: .95;
    letter-spacing: -.055em;
}

.summary {
    margin: 16px 0 26px;
    color: var(--gc-muted);
    line-height: 1.75;
}

.admin-shell {
    min-height: 100vh;
    padding: 0;
}

.admin-auth-guard {
    position: fixed;
    z-index: 20000;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 8% 8%, rgba(40, 125, 113, .20), transparent 26rem),
        linear-gradient(135deg, #f8fbf9, var(--gc-bg));
}

.shell-layout {
    min-height: 100vh;
    background: transparent;
}

.ant-layout-header.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 46px !important;
    min-height: 46px;
    line-height: normal !important;
    padding: 0 10px;
    border: 1px solid var(--gc-line);
    border-radius: 0;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 10px 32px rgba(22, 49, 47, .08);
    backdrop-filter: blur(16px);
    overflow: hidden;
}

.topbar,
.topbar * {
    line-height: normal;
}

.module-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-height: 44px;
    height: 44px;
    margin: 0 auto 0 16px;
    overflow: hidden;
}

.pinned-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    max-height: 44px;
    height: 44px;
    margin-left: 12px;
    overflow-x: auto;
}

.pinned-switcher button {
    flex: 0 0 auto;
    max-height: 32px;
    height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--gc-line);
    border-radius: 999px;
    color: var(--gc-primary-dark);
    font-size: 12px;
    font-weight: 850;
    background: rgba(255, 255, 255, .72);
    cursor: pointer;
}

.pinned-switcher button:hover,
.pinned-switcher button.active {
    border-color: var(--gc-primary);
    background: var(--gc-primary-soft);
}

.module-switcher__label {
    display: inline-flex;
    align-items: center;
    height: 30px;
    color: var(--gc-muted);
    font-size: 12px;
    font-weight: 800;
}

.module-switcher__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-height: 32px;
    height: 30px;
    padding: 5px 10px;
    border: 1px solid var(--gc-line);
    border-radius: 8px;
    color: var(--gc-primary-dark);
    font-weight: 850;
    text-decoration: none;
    background: rgba(255, 255, 255, .72);
}

.module-switcher__link:hover {
    border-color: var(--gc-primary);
    background: var(--gc-primary-soft);
}

.module-switcher__link small {
    display: grid;
    min-width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: var(--gc-primary);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    min-width: 0;
    font-weight: 950;
    letter-spacing: -.03em;
}

.brand-mark {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--gc-primary), var(--gc-primary-dark));
    box-shadow: 0 12px 30px rgba(21, 93, 85, .22);
}

.userbar {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 44px;
    flex: 0 0 auto;
    color: var(--gc-muted);
    font-size: 13px;
    font-weight: 800;
}

.topbar .gc-popup-main-menu,
.topbar .gc-theme-trigger,
.topbar .ant-btn {
    line-height: 1;
}

.topbar .ant-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 900px) {
    .module-switcher__label,
    .module-switcher__link small {
        display: none;
    }

    .module-switcher {
        margin-left: 12px;
    }

    .pinned-switcher {
        display: none;
    }
}

.content {
    min-width: 0;
    margin-top: 4px;
    padding: 0 var(--gc-shell-gap) var(--gc-shell-gap);
}

.workspace-tabs {
    height: 32px;
    margin: 4px var(--gc-shell-gap) 0;
    overflow: hidden;
}

.workspace-tabs__list {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 32px;
    min-width: 0;
    border-bottom: 1px solid var(--gc-line);
    overflow-x: auto;
    overflow-y: hidden;
}

.workspace-tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-width: 96px;
    max-width: 184px;
    height: 28px;
    margin: 0;
    border: 1px solid var(--gc-line);
    border-radius: 7px 7px 0 0;
    background: rgba(255, 255, 255, .48);
    transition: background .16s ease, border-color .16s ease;
}

.workspace-tab:hover {
    border-color: var(--gc-primary);
    background: rgba(255, 255, 255, .72);
}

.workspace-tab.active {
    border-color: var(--gc-line);
    border-bottom-color: var(--gc-card);
    background: var(--gc-card);
    box-shadow: 0 8px 20px rgba(22, 49, 47, .07);
}

.workspace-tab__label,
.workspace-tab__close {
    height: 26px;
    border: 0;
    color: var(--gc-muted);
    background: transparent;
    cursor: pointer;
}

.workspace-tab__label {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 8px 0 10px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 800;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-tab__close {
    flex: 0 0 24px;
    width: 16px;
    padding: 0 6px 0 0;
    color: var(--gc-muted);
}

.workspace-tab__close svg {
    width: 11px;
    height: 11px;
}

.workspace-tab.active .workspace-tab__label {
    color: var(--gc-primary-dark);
}

.resource-card {
    min-height: calc(100vh - 46px - 32px - (var(--gc-shell-gap) * 2) - 4px);
    border-radius: 8px;
    background: var(--gc-card);
    box-shadow: 0 18px 58px rgba(22, 49, 47, .09);
}

.resource-card > .ant-card-body {
    padding: var(--gc-density-space, 12px);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-search {
    margin-bottom: var(--gc-density-space, 12px);
    padding: var(--gc-density-space, 12px);
    border: 1px solid var(--gc-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, .56);
}

.gc-theme-trigger {
    max-height: 30px;
}

.gc-theme-section + .gc-theme-section {
    margin-top: 24px;
}

.gc-theme-section h3 {
    margin: 0 0 12px;
    color: var(--gc-ink);
    font-size: 14px;
}

.gc-theme-colors {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gc-theme-colors button,
.gc-theme-colors input {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid var(--gc-line);
    border-radius: 8px;
    cursor: pointer;
}

.gc-theme-colors button.active {
    outline: 2px solid var(--gc-primary);
    outline-offset: 2px;
}

.resource-search .ant-form-item {
    margin-bottom: 8px;
}

.ant-menu {
    background: transparent;
    border-inline-end: 0 !important;
    padding: 8px;
}

.ant-menu-item {
    border-radius: 13px;
}

.ant-menu-item-selected {
    color: var(--gc-primary-dark) !important;
    background: var(--gc-primary-soft) !important;
}

.table-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.table-actions a {
    color: var(--gc-primary-dark);
    font-weight: 700;
}

.table-actions a.danger {
    color: #b94a48;
}

.table-engine {
    display: grid;
    gap: 8px;
}

.table-engine-toolbar {
    display: flex;
    justify-content: flex-end;
}

.table-engine-pager {
    display: flex;
    justify-content: flex-end;
    padding-top: 10px;
}

.drawer-actions {
    display: flex;
    justify-content: flex-end;
    width: 100%;
    margin-top: 8px;
}

.action-json {
    max-height: calc(100vh - 180px);
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--gc-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    white-space: pre-wrap;
}

.action-result-section + .action-result-section {
    margin-top: 18px;
}

.action-result-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.admin-home {
    display: grid;
    gap: 14px;
}

.home-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 24px;
    border: 1px solid var(--gc-line);
    border-radius: 22px;
    background:
        radial-gradient(circle at 92% 12%, rgba(40, 125, 113, .16), transparent 18rem),
        rgba(255, 255, 255, .64);
}

.home-hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(28px, 5vw, 46px);
    line-height: 1.05;
    letter-spacing: -.055em;
}

.metric-card {
    min-height: 128px;
    border: 1px solid var(--gc-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .70);
}

.metric-card strong {
    display: block;
    margin: 6px 0;
    color: var(--gc-primary-dark);
    font-size: 34px;
    line-height: 1;
}

.metric-card p {
    margin: 0;
    color: var(--gc-muted);
}

.metric-label {
    color: var(--gc-muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.home-section {
    align-items: stretch;
}

.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.quick-grid button {
    display: grid;
    gap: 5px;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--gc-line);
    border-radius: 16px;
    color: var(--gc-ink);
    text-align: left;
    background: rgba(255, 255, 255, .72);
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.quick-grid button:hover {
    border-color: var(--gc-primary);
    box-shadow: 0 14px 36px rgba(21, 93, 85, .12);
    transform: translateY(-1px);
}

.quick-grid span {
    font-weight: 900;
}

.quick-grid small {
    color: var(--gc-muted);
}

@media (max-width: 820px) {
    .admin-shell {
        padding: 0;
    }

    .topbar {
        border-radius: 0;
    }

    .shell-layout > .ant-layout {
        display: block;
    }

    .sider {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .content {
        padding-right: var(--gc-shell-gap);
        padding-left: var(--gc-shell-gap);
    }
}
