:root {
    --bg-canvas: #f4f6f5;
    --bg-surface: #ffffff;
    --bg-soft: #f2f5f4;
    --text-primary: #0f1214;
    --text-muted: #65707a;
    --border-default: #dce2e5;
    --brand-primary: #11aa90;
    --brand-primary-hover: #0f9982;
    --cta-strong: #101214;
    --danger: #c53b3b;
    --danger-soft: #fff3f2;
    --shadow-soft: 0 16px 34px rgba(15, 18, 20, 0.08);
    --shadow-card: 0 10px 24px rgba(15, 18, 20, 0.05);
    --radius-card: 10px;
    --radius-control: 6px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    background: var(--bg-canvas);
    color: var(--text-primary);
    font-family: "Neue Haas Unica", "Helvetica Neue", "Arial Nova", Helvetica, Arial, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    text-rendering: optimizeLegibility;
}

body.portal-page {
    background:
        radial-gradient(circle at 10% -10%, rgba(17, 170, 144, 0.12) 0, rgba(17, 170, 144, 0) 38%),
        linear-gradient(180deg, #f5f7f6 0%, #ebf1ef 100%);
}

.portal-page .site-topbar {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #dce3e1;
    backdrop-filter: none;
}

.portal-page .site-topbar-inner {
    min-height: 74px;
}

.portal-page .site-logo {
    height: 38px;
}

.site-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(239, 239, 239, 0.97);
    border-bottom: 1px solid #d8dddf;
    backdrop-filter: blur(6px);
}

.site-topbar-inner {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-logo-link {
    display: inline-flex;
    align-items: center;
}

.site-logo {
    height: 34px;
    width: auto;
    display: block;
}

.site-nav {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    margin-left: auto;
}

.site-nav a {
    color: #071011;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.site-nav a:hover {
    color: var(--brand-primary);
}

.site-user-panel {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

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

button,
input {
    font: inherit;
}

.app-shell {
    min-height: 100vh;
    padding: 24px;
}

.login-shell {
    min-height: calc(100vh - 74px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 24px;
}

.portal-main {
    min-height: calc(100vh - 74px);
    padding-bottom: 0;
    background: transparent;
}

.portal-page .portal-main {
    min-height: calc(100vh - 74px);
    padding: 18px 0 20px;
    display: flex;
    align-items: flex-start;
}

.portal-container {
    width: min(1320px, calc(100% - 40px));
    margin: 0 auto;
}

.portal-page .tool-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.portal-page .tool-card {
    min-height: 188px;
    padding: 20px 20px 18px;
    border-radius: 12px;
    border: 1px solid rgba(12, 92, 79, 0.15);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 251, 250, 0.98) 100%);
    box-shadow: 0 8px 26px rgba(10, 58, 50, 0.08);
    opacity: 1;
    animation: none;
}

.portal-page .tool-card:hover {
    transform: translateY(-2px);
    border-color: rgba(12, 124, 106, 0.34);
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(10, 58, 50, 0.14);
}

.portal-page .tool-card .icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(12, 124, 106, 0.2);
    background: #e8f4f2;
}

.portal-page .tool-card h3 {
    margin: 14px 0 8px;
    font-size: clamp(2rem, 2.3vw, 2.7rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
    font-weight: 600;
}

.portal-page .tool-card p {
    margin: 0;
    font-size: 16px;
    line-height: 1.35;
    color: #2d3f45;
}

.portal-page .tool-link {
    margin-top: 14px;
    color: #0b8a76;
    font-size: 12px;
    letter-spacing: 0.13em;
}

.portal-page .portal-workspace {
    width: 100%;
}

.portal-page .portal-workspace-label {
    margin: 0 0 14px;
    color: #0c7f70;
    font-size: 48px;
    line-height: 0.95;
    letter-spacing: -0.03em;
    font-weight: 500;
}

.portal-hero {
    background: #ececec;
    border-bottom: 1px solid var(--border-default);
}

.portal-hero .portal-container {
    padding: 20px 0 24px;
}

.portal-hero h1 {
    margin: 10px 0 0;
    max-width: 640px;
    font-size: clamp(1.9rem, 3.2vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.03em;
    font-weight: 700;
}

.portal-hero .section-copy {
    margin-top: 8px;
    max-width: 680px;
    font-size: 16px;
    line-height: 1.5;
}

.portal-highlight {
    background: #ffffff;
}

.portal-highlight-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    gap: 0;
    border-bottom: 1px solid var(--border-default);
}

.portal-highlight-copy {
    padding: 56px 54px 54px 0;
}

.portal-highlight-copy h2 {
    margin: 0;
    max-width: 470px;
    color: #0da38a;
    font-size: clamp(2rem, 3.2vw, 3.35rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 600;
}

.portal-highlight-copy p {
    margin: 18px 0 0;
    max-width: 440px;
    color: #45525d;
    font-size: 16px;
    line-height: 1.65;
}

.portal-highlight-visual {
    min-height: 300px;
    background:
        linear-gradient(140deg, rgba(17, 170, 144, 0.08) 15%, rgba(17, 170, 144, 0) 60%),
        radial-gradient(circle at 18% 24%, rgba(17, 170, 144, 0.24), transparent 46%),
        linear-gradient(90deg, #dcebe8 0%, #cce4e0 50%, #b9ddd6 100%);
    border-left: 1px solid var(--border-default);
    position: relative;
    overflow: hidden;
}

.portal-highlight-visual::before,
.portal-highlight-visual::after {
    content: "";
    position: absolute;
    border-radius: 22px;
    border: 1px solid rgba(8, 84, 72, 0.15);
}

.portal-highlight-visual::before {
    inset: 34px 52px 150px 86px;
    background: rgba(255, 255, 255, 0.18);
}

.portal-highlight-visual::after {
    inset: 138px 90px 42px 32px;
    background: rgba(255, 255, 255, 0.3);
}

.portal-tools-area {
    --portal-band: clamp(170px, 23vw, 250px);
    background: linear-gradient(180deg, #ececec 0 var(--portal-band), #b8d9d4 var(--portal-band) 100%);
    min-height: calc(100vh - 90px);
    padding: clamp(30px, 5vw, 56px) 0 clamp(40px, 6vw, 72px);
    border-top: 1px solid rgba(12, 94, 81, 0.12);
    position: relative;
    overflow: hidden;
}

.portal-tools-area::before {
    content: "";
    position: absolute;
    width: 460px;
    height: 460px;
    top: calc(var(--portal-band) - 280px);
    right: -120px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 74%);
    pointer-events: none;
}

.portal-tools-area::after {
    content: "";
    position: absolute;
    left: -130px;
    bottom: -150px;
    width: 360px;
    height: 360px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(16, 131, 112, 0.16) 0%, rgba(16, 131, 112, 0) 76%);
    pointer-events: none;
}

.portal-tools-header {
    margin-bottom: clamp(20px, 3vw, 34px);
    position: relative;
    z-index: 1;
}

.portal-eyebrow {
    margin-bottom: 12px;
    color: #0d6f62;
    letter-spacing: 0.16em;
}

.portal-tools-header .portal-title {
    margin: 0;
    font-size: clamp(2.65rem, 5.8vw, 4.6rem);
    line-height: 0.95;
    letter-spacing: -0.04em;
    max-width: 760px;
}

.auth-card {
    width: min(1080px, 100%);
    overflow: hidden;
    border: 1px solid var(--border-default);
    border-radius: 14px;
    background: var(--bg-surface);
    box-shadow: 0 26px 56px rgba(15, 18, 20, 0.12);
}

.auth-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.auth-side {
    border-right: 1px solid var(--border-default);
    padding: 46px 44px;
}

.auth-main {
    padding: 36px;
}

.accent-bar {
    width: 86px;
    height: 7px;
    border-radius: 999px;
    background: var(--brand-primary);
}

.auth-logo {
    margin-top: 24px;
    width: 136px;
    height: auto;
    display: block;
}

.eyebrow {
    margin: 0;
    color: #0f6f60;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.auth-brand-eyebrow {
    margin-top: 20px;
}

.feature-eyebrow {
    color: #65707a;
}

.hero-title,
.section-title,
.page-title {
    margin: 0;
    letter-spacing: -0.02em;
}

.hero-title {
    margin-top: 18px;
    max-width: 420px;
    font-size: clamp(2.2rem, 3vw, 3rem);
    line-height: 1.06;
    font-weight: 700;
}

.hero-copy,
.section-copy,
.muted {
    color: var(--text-muted);
}

.hero-copy {
    max-width: 500px;
    margin: 18px 0 0;
    font-size: 15px;
    line-height: 1.7;
}

.feature-panel,
.surface,
.tool-card,
.placeholder-card {
    border: 1px solid var(--border-default);
    border-radius: var(--radius-card);
    background: var(--bg-surface);
    box-shadow: var(--shadow-card);
}

.feature-panel {
    margin-top: 28px;
    padding: 18px 20px;
    background: var(--bg-soft);
}

.feature-list {
    margin: 14px 0 0;
    padding-left: 18px;
    color: #34414b;
}

.feature-list li + li {
    margin-top: 10px;
}

.section-header {
    margin-bottom: 28px;
}

.section-title {
    margin-top: 10px;
    font-size: 30px;
    font-weight: 600;
}

.portal-title {
    margin-top: 10px;
    font-size: 32px;
    font-weight: 600;
}

.section-copy {
    margin-top: 10px;
    font-size: 14px;
}

.form-stack {
    display: grid;
    gap: 18px;
}

.form-shell {
    position: relative;
    padding-top: 10px;
}

.form-shell.has-message {
    padding-top: 56px;
}

.field-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #36414a;
}

.input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: #ffffff;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(17, 170, 144, 0.18);
}

.input-with-action {
    position: relative;
}

.input-with-action .input {
    padding-right: 46px;
}

.input-action {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #65707a;
    cursor: pointer;
    transform: translateY(-50%);
}

.input-action:hover {
    color: #36414a;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #36414a;
}

.checkbox-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
}

.auth-inline-note {
    padding: 14px 16px;
    border: 1px solid #cce8e1;
    border-radius: var(--radius-control);
    background: #f3fbf8;
    color: #0f6f60;
    font-size: 14px;
    line-height: 1.6;
}

.auth-inline-actions {
    display: flex;
    gap: 12px;
}

.auth-inline-actions .btn-primary {
    width: auto;
    flex: 1 1 auto;
}

.auth-inline-actions .btn-secondary {
    flex: 0 0 auto;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-control);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.btn-primary {
    width: 100%;
    background: var(--brand-primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--cta-strong);
}

.btn-secondary {
    background: #ffffff;
    color: #36414a;
    border: 1px solid var(--border-default);
}

.btn-secondary,
.btn-danger,
.btn-primary,
.input,
.admin-tab,
.list-item-card,
.status-pill {
    transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.btn-secondary:hover {
    background: var(--bg-soft);
}

.btn-danger {
    background: #ec4a4a;
    color: #ffffff;
}

.btn-danger:hover {
    background: var(--danger);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-danger:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.message {
    display: none;
    align-items: flex-start;
    gap: 10px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 0;
    font-size: 13px;
    line-height: 1.5;
}

.message.visible {
    display: flex;
}

.message-error {
    color: #a23333;
}

.message-icon {
    width: 18px;
    height: 18px;
    margin-top: 1px;
    flex: 0 0 auto;
    color: #d04d4d;
}

.message-body {
    min-width: 0;
}

.message-title {
    display: block;
    margin-bottom: 1px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b43d3d;
}

.input.has-error {
    border-color: #df9c9c;
    background: linear-gradient(0deg, rgba(255, 244, 244, 0.7), rgba(255, 244, 244, 0.7));
}

.input.has-error:focus {
    border-color: #cf6e6e;
    box-shadow: 0 0 0 3px rgba(208, 77, 77, 0.14);
}

.loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(248, 250, 249, 0.86);
    backdrop-filter: blur(4px);
    z-index: 30;
}

.confirm-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 18, 20, 0.18);
    backdrop-filter: blur(4px);
    z-index: 40;
}

.confirm-dialog {
    width: min(440px, 100%);
    padding: 24px;
}

.permission-picker-dialog {
    width: min(720px, 100%);
    padding: 24px;
}

.confirm-dialog .section-title {
    margin-top: 10px;
}

.confirm-dialog .section-copy {
    margin-bottom: 20px;
}

.loading-card {
    width: 180px;
    padding: 22px 16px;
    text-align: center;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 999px;
    animation: spin 1s linear infinite;
}

.spinner-dark {
    width: 26px;
    height: 26px;
    margin: 0 auto 12px;
    border: 3px solid rgba(17, 170, 144, 0.2);
    border-top-color: var(--brand-primary);
    border-radius: 999px;
    animation: spin 1s linear infinite;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 22px;
    margin-bottom: 24px;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-logo-wrap {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
}

.brand-logo {
    width: 126px;
    height: auto;
    display: block;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--bg-soft);
    color: var(--brand-primary);
}

.brand-copy h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.brand-copy p {
    margin: 6px 0 0;
}

.user-panel {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-meta {
    text-align: right;
}

.user-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #36414a;
}

.user-role {
    display: block;
    margin-top: 4px;
    color: #0f6f60;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.page-content {
    width: min(1120px, 100%);
    margin: 0 auto;
}

.dashboard-intro {
    padding: 28px;
    margin-bottom: 20px;
}

.dashboard-intro p {
    max-width: 640px;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
    position: relative;
    z-index: 1;
}

.tool-card {
    display: block;
    min-height: 202px;
    padding: 22px 22px 20px;
    border-radius: 14px;
    border: 1px solid rgba(7, 64, 55, 0.12);
    background: rgba(244, 247, 247, 0.96);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.58) inset, 0 14px 26px rgba(8, 84, 72, 0.08);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
    opacity: 0;
    animation: card-in 420ms ease-out forwards;
}

.tool-grid .tool-card:nth-child(2) {
    animation-delay: 60ms;
}

.tool-grid .tool-card:nth-child(3) {
    animation-delay: 120ms;
}

.tool-grid .tool-card:nth-child(4) {
    animation-delay: 180ms;
}

.tool-grid .tool-card:nth-child(5) {
    animation-delay: 240ms;
}

.tool-card:hover {
    border-color: rgba(17, 170, 144, 0.48);
    box-shadow: 0 22px 30px rgba(8, 84, 72, 0.14);
    transform: translateY(-4px);
    background: #fbfdfd;
}

.tool-card:hover .tool-link,
.tool-card:focus-visible .tool-link {
    color: #087563;
}

.tool-card .icon-wrap {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: #deece8;
    color: #0b9f85;
    border: 1px solid rgba(17, 170, 144, 0.2);
}

.tool-card h3 {
    margin: 14px 0 10px;
    font-size: clamp(1.7rem, 2.1vw, 2.25rem);
    line-height: 0.98;
    letter-spacing: -0.028em;
    font-weight: 600;
}

.tool-card p {
    margin: 0;
    max-width: 380px;
    font-size: 15px;
    line-height: 1.46;
    color: #36424a;
}

.tool-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    color: #0c8e76;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tool-link::after {
    content: ">";
    font-size: 12px;
    transform: translateY(-1px);
}

.tool-card:focus-visible {
    outline: 3px solid rgba(17, 170, 144, 0.32);
    outline-offset: 2px;
}

.portal-page .site-user-panel {
    gap: 10px;
}

.portal-page .user-meta {
    text-align: right;
}

.portal-page .user-name {
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0;
    color: #121518;
}

.portal-page .user-role {
    margin-top: 5px;
    font-size: 13px;
    letter-spacing: 0.15em;
}

.portal-page .btn-secondary,
.portal-page .btn-danger {
    min-height: 48px;
    border-radius: 8px;
    padding: 0 18px;
    font-size: 14px;
    line-height: 1;
    letter-spacing: 0;
}

.portal-page .btn-secondary {
    border-color: #cdd4d7;
    background: rgba(245, 247, 247, 0.95);
    color: #29343c;
}

.portal-page .btn-danger {
    background: #ec4a4a;
}

.portal-page .btn-danger:hover {
    background: #d84040;
}

.placeholder-shell {
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
}

.placeholder-card {
    width: min(640px, 100%);
    padding: 34px 32px;
    text-align: center;
}

.placeholder-card h2 {
    margin: 0 0 14px;
    font-size: 28px;
    font-weight: 600;
}

.placeholder-card p {
    margin: 0;
    line-height: 1.7;
}

.placeholder-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
}

.admin-page-content {
    width: min(1320px, 100%);
}

.admin-intro {
    margin-bottom: 18px;
}

.admin-notice {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #bfe2d9;
    border-radius: var(--radius-control);
    background: #f3fbf8;
    color: #0f6f60;
    font-size: 14px;
    font-weight: 600;
}

.admin-notice.error {
    border-color: #efc4c4;
    background: #fff6f6;
    color: #b43d3d;
}

.admin-tabs-shell {
    padding: 18px;
}

.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--border-default);
    padding-bottom: 14px;
}

.admin-tab {
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--border-default);
    border-radius: 999px;
    background: #ffffff;
    color: #36414a;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
}

.admin-tab:hover,
.admin-tab.active {
    border-color: #afd5ce;
    background: #eff9f6;
    color: #0f6f60;
}

.admin-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.admin-toolbar-group {
    display: flex;
    align-items: end;
    gap: 12px;
    flex: 1 1 auto;
}

.admin-search,
.admin-select {
    min-width: 220px;
}

.toolbar-label {
    display: grid;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #36414a;
}

.admin-workspace {
    display: grid;
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 18px;
}

.admin-list-panel,
.admin-detail-panel,
.audit-panel {
    padding: 18px;
}

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

.panel-heading.tight {
    margin-bottom: 12px;
}

.panel-heading h3,
.panel-heading h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.panel-subtitle {
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.panel-meta {
    color: #0f6f60;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.list-item-card {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: #ffffff;
    cursor: pointer;
    text-align: left;
}

.list-item-card:hover,
.list-item-card.active {
    border-color: #b8d8d2;
    background: #f5fbf9;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.035);
    transform: translateY(-1px);
}

.list-item-main {
    display: grid;
    gap: 4px;
}

.list-item-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--bg-soft);
    color: var(--brand-primary);
    margin-bottom: 4px;
}

.list-item-main strong {
    font-size: 15px;
    font-weight: 600;
}

.list-item-main span,
.list-item-meta small,
.readonly-label {
    color: var(--text-muted);
}

.list-item-meta {
    display: grid;
    justify-items: end;
    gap: 8px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f0f4f5;
    color: #46545d;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-pill.is-active {
    background: #eaf7f4;
    color: #0f6f60;
}

.status-pill.is-inactive {
    background: #f7eded;
    color: #b43d3d;
}

.status-pill.subtle {
    background: #f3f5f6;
    color: #6c7881;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 600;
}

.admin-form-grid {
    display: grid;
    gap: 16px;
}

.admin-form-grid label,
.admin-field-block {
    display: grid;
    gap: 8px;
}

.admin-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #36414a;
    font-size: 14px;
    font-weight: 600;
}

.admin-checkbox-label.compact {
    align-items: start;
}

.admin-checkbox-label span {
    display: grid;
    gap: 4px;
}

.admin-checkbox-label small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}

.admin-checkbox-label input {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
}

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

.readonly-card {
    padding: 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: var(--bg-soft);
}

.readonly-card strong {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
}

.admin-password-box,
.admin-access-box {
    padding: 16px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: var(--bg-soft);
}

.admin-password-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
}

.tool-access-grid {
    display: grid;
    gap: 12px;
}

.role-permissions-panel {
    padding: 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: var(--bg-soft);
}

.role-permissions-panel .panel-subtitle {
    margin-top: 0;
}

.role-permissions-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.permission-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: #ffffff;
    color: #36414a;
}

.permission-option input {
    margin: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--brand-primary);
}

.permission-option span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    word-break: break-word;
}

.permission-option.disabled {
    opacity: 0.6;
}

.permission-option-copy {
    min-width: 0;
}

.permission-option-copy strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.permission-option-copy small {
    display: block;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}

.permission-key {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    color: #0f6f60;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.tool-access-row {
    padding: 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: #ffffff;
}

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

.tool-access-fields {
    display: grid;
    grid-template-columns: 180px 1fr 1fr;
    gap: 12px;
}

.permission-trigger {
    width: 100%;
    justify-content: space-between;
}

.permission-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.permission-summary strong {
    font-size: 13px;
    font-weight: 700;
}

.permission-summary span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.permission-list-item .list-item-main small {
    color: var(--text-muted);
    font-size: 12px;
}

.admin-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-save-button {
    width: auto;
    min-width: 160px;
}

.admin-wide-field {
    grid-column: 1 / -1;
}

.admin-textarea {
    min-height: 220px;
    padding: 14px;
    resize: vertical;
}

.admin-textarea.compact {
    min-height: 120px;
}

.icon-picker {
    position: relative;
    width: fit-content;
    max-width: 100%;
}

.icon-picker-trigger {
    width: 72px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: #ffffff;
    color: #36414a;
    cursor: pointer;
    text-align: left;
}

.icon-picker-trigger:hover {
    border-color: #afd5ce;
    box-shadow: 0 0 0 3px rgba(17, 170, 144, 0.08);
}

.icon-picker-preview {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--bg-soft);
    color: var(--brand-primary);
    flex: 0 0 auto;
}

.icon-picker-caret {
    width: 8px;
    height: 8px;
    display: inline-block;
    border-right: 1.5px solid #7b878f;
    border-bottom: 1.5px solid #7b878f;
    color: #7b878f;
    transform: rotate(45deg) translateY(-1px);
    flex: 0 0 auto;
}

.icon-picker-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, 52px);
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-card);
    background: #ffffff;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.08);
}

.icon-option {
    width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border-default);
    border-radius: 10px;
    background: #ffffff;
    color: #36414a;
    cursor: pointer;
}

.icon-option:hover,
.icon-option.active {
    border-color: #afd5ce;
    background: #f4fbf8;
    color: #0f6f60;
}

.icon-option-mark {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.admin-filter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

.audit-list {
    display: grid;
    gap: 12px;
}

.audit-item {
    padding: 14px;
    border: 1px solid var(--border-default);
    border-radius: var(--radius-control);
    background: var(--bg-soft);
}

.audit-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.audit-item p {
    margin: 10px 0 0;
}

.audit-meta {
    color: var(--text-muted);
    font-size: 13px;
}

.audit-details {
    margin: 12px 0 0;
    padding: 12px;
    border-radius: var(--radius-control);
    background: #ffffff;
    color: #36414a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.empty-inline {
    padding: 18px;
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-control);
    color: var(--text-muted);
    text-align: center;
}

.hidden {
    display: none !important;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes card-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 960px) {
    .auth-grid,
    .portal-highlight-grid {
        grid-template-columns: 1fr;
    }

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

    .portal-page .tool-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-page .portal-workspace-label {
        font-size: 38px;
    }

    .site-topbar-inner,
    .portal-container {
        width: min(1320px, calc(100% - 30px));
    }

    .site-topbar-inner {
        min-height: 68px;
    }

    .portal-page .site-topbar-inner {
        min-height: 78px;
    }

    .portal-page .site-logo {
        height: 40px;
    }

    .site-nav {
        display: none;
    }

    .portal-hero .portal-container {
        padding: 20px 0 24px;
    }

    .portal-tools-header {
        margin-bottom: 14px;
    }

    .portal-tools-area {
        --portal-band: clamp(150px, 29vw, 220px);
    }

    .portal-tools-header .portal-title {
        font-size: clamp(2.5rem, 10vw, 4.25rem);
        line-height: 0.95;
    }

    .tool-card h3 {
        font-size: clamp(1.7rem, 4.6vw, 2.2rem);
    }

    .tool-card p {
        font-size: 15px;
    }

    .portal-highlight-copy {
        padding: 34px 0 28px;
    }

    .portal-highlight-visual {
        min-height: 220px;
        border-left: 0;
    }

    .admin-workspace,
    .tool-access-fields,
    .admin-filter-grid,
    .role-permissions-grid {
        grid-template-columns: 1fr;
    }

    .auth-side {
        border-right: 0;
        border-bottom: 1px solid var(--border-default);
        padding: 28px;
    }

    .auth-main,
    .dashboard-intro,
    .placeholder-card {
        padding: 24px;
    }

    .admin-tabs-shell,
    .admin-list-panel,
    .admin-detail-panel,
    .audit-panel {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .app-shell,
    .login-shell {
        padding: 16px;
    }

    .portal-main {
        padding-bottom: 0;
    }

    .site-topbar-inner,
    .portal-container {
        width: calc(100% - 24px);
    }

    .site-topbar-inner {
        min-height: 64px;
        gap: 10px;
    }

    .portal-page .site-topbar-inner {
        min-height: 72px;
    }

    .portal-page .site-logo {
        height: 36px;
    }

    .site-logo {
        height: 30px;
    }

    .site-user-panel .btn-secondary {
        display: none;
    }

    .portal-hero h1 {
        font-size: clamp(1.95rem, 10vw, 2.45rem);
    }

    .tool-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .portal-page .portal-workspace-label {
        margin-bottom: 12px;
        font-size: 22px;
    }

    .portal-page .tool-card {
        min-height: 166px;
        padding: 16px;
    }

    .portal-page .tool-card h3 {
        font-size: clamp(1.6rem, 8vw, 2.05rem);
    }

    .portal-page .tool-card p {
        font-size: 15px;
    }

    .portal-highlight-copy h2 {
        font-size: clamp(1.6rem, 9vw, 2rem);
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-panel,
    .placeholder-actions {
        width: 100%;
    }

    .user-panel {
        justify-content: space-between;
    }

    .placeholder-actions {
        flex-direction: column;
    }

    .admin-toolbar,
    .admin-toolbar-group,
    .admin-password-row,
    .admin-readonly-grid,
    .auth-inline-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-action-row {
        flex-direction: column;
    }

    .icon-picker-menu {
        grid-template-columns: repeat(4, 52px);
    }
}
