:root {
    --app-bg: #e9eaec;
    --surface: #f5f6f7;
    --panel: rgba(255, 255, 255, .78);
    --panel-solid: #ffffff;
    --line: rgba(31, 36, 44, .08);
    --line-strong: rgba(31, 36, 44, .14);
    --text: #151b23;
    --muted: #69717d;
    --faint: #9aa2ad;
    --primary: #0f8b78;
    --primary-soft: #e6f7f3;
    --ink: #10161d;
    --danger: #b64250;
    --warning: #a66d0a;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 18px 44px rgba(21, 27, 35, .08);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    color: var(--text);
    background: var(--app-bg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    letter-spacing: 0;
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: currentColor;
}

.shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    background: var(--surface);
    transition: grid-template-columns .2s ease;
}

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

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 14px;
    border-right: 1px solid var(--line);
    background: rgba(239, 240, 242, .96);
}

.brand {
    min-height: 50px;
    display: grid;
    align-items: center;
}

.traffic {
    display: none;
}

.brand-lockup {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 10px 22px rgba(15, 35, 42, .12);
}

.brand-name {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-size: 17px;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand-subtitle {
    margin-top: 2px;
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-toggle,
.nav-link {
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: #59616c;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.sidebar-toggle {
    width: 100%;
    border-color: var(--line);
    background: rgba(255, 255, 255, .54);
    font-weight: 700;
}

.sidebar-toggle:hover,
.nav-link:hover,
.nav-link.active {
    color: var(--text);
    background: rgba(255, 255, 255, .86);
}

.nav {
    display: grid;
    gap: 14px;
}

.nav-section {
    display: grid;
    gap: 6px;
}

.nav-title {
    padding: 0 12px 4px;
    color: var(--faint);
    font-size: 11px;
    font-weight: 760;
}

.nav-link {
    width: 100%;
    font-weight: 720;
}

.nav-link span,
.sidebar-toggle span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-footer {
    margin-top: auto;
    display: grid;
    gap: 10px;
}

.user-chip {
    min-width: 0;
    min-height: 50px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .55);
}

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: #fff;
    background: linear-gradient(145deg, #111820, #108a77);
    font-weight: 800;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 13px;
}

.user-meta {
    min-width: 0;
    display: grid;
}

.user-meta strong,
.user-meta span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta span {
    color: var(--muted);
    font-size: 12px;
}

.logout {
    width: 100%;
    color: #7c4650;
}

.sidebar-collapsed .sidebar {
    align-items: center;
    padding: 18px 10px;
}

.sidebar-collapsed .brand,
.sidebar-collapsed .nav,
.sidebar-collapsed .nav-section,
.sidebar-collapsed .sidebar-footer {
    width: 100%;
}

.sidebar-collapsed .brand-lockup {
    grid-template-columns: 1fr;
    justify-items: center;
}

.sidebar-collapsed .brand-lockup > div,
.sidebar-collapsed .sidebar-toggle span,
.sidebar-collapsed .nav-title,
.sidebar-collapsed .nav-link span,
.sidebar-collapsed .user-meta {
    display: none;
}

.sidebar-collapsed .sidebar-toggle,
.sidebar-collapsed .nav-link,
.sidebar-collapsed .logout {
    width: 44px;
    justify-content: center;
    padding: 0;
}

.sidebar-collapsed .user-chip {
    width: 44px;
    grid-template-columns: 1fr;
    justify-items: center;
    padding: 0;
    border-color: transparent;
    background: transparent;
}

.main {
    min-width: 0;
    overflow: hidden auto;
    background: #eff0f2;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    min-height: 72px;
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 14px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(239, 240, 242, .9);
    backdrop-filter: blur(18px);
}

.topbar-tabs,
.topbar-tools,
.topbar-date {
    min-width: 0;
    display: flex;
    align-items: center;
}

.topbar-tab {
    max-width: 220px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .76);
    font-weight: 760;
}

.topbar-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-tools {
    justify-content: flex-end;
    gap: 10px;
}

.topbar-date {
    height: 40px;
    gap: 8px;
    padding: 0 12px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .7);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.page-head,
.stats-grid,
.mini-stats,
.filter-bar,
.result-toolbar,
.project-grid,
.dashboard-workspace,
.split-grid,
.panel,
.project-detail-layout,
.detail-hero,
.flash {
    margin-left: 28px;
    margin-right: 28px;
}

.page-head {
    min-height: auto;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin-top: 26px;
    margin-bottom: 18px;
    padding: 0;
}

.page-head h1 {
    margin: 0;
    color: var(--text);
    font-size: 34px;
    line-height: 1.12;
    font-weight: 820;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 820;
}

.lead {
    max-width: 720px;
    margin: 8px 0 0;
    color: var(--muted);
}

.actions,
.form-actions,
.card-actions,
.row-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.card-actions {
    grid-area: actions;
    align-self: end;
}

.btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-weight: 760;
    cursor: pointer;
}

.btn.primary {
    color: #fff;
    background: var(--ink);
}

.btn.secondary {
    color: #075f51;
    border-color: rgba(15, 139, 120, .18);
    background: var(--primary-soft);
}

.btn.ghost {
    color: #48515c;
    border-color: var(--line);
    background: rgba(255, 255, 255, .72);
}

.btn.danger,
.btn.ghost.danger {
    color: var(--danger);
}

.btn.full {
    width: 100%;
}

.panel,
.stat-card,
.mini-stats article,
.project-card,
.filter-bar,
.result-toolbar {
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
}

.panel {
    padding: 18px;
    margin-bottom: 18px;
}

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

.stat-card,
.mini-stats article {
    min-height: 118px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    align-content: start;
    padding: 18px;
}

.stat-card span,
.stat-card small,
.mini-stats span,
.mini-stats small,
dt {
    color: var(--muted);
}

.stat-card strong,
.mini-stats strong {
    display: block;
    margin: 8px 0 2px;
    color: var(--text);
    font-size: 32px;
    line-height: 1;
}

.dashboard-workspace {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
    margin-bottom: 18px;
}

.dashboard-workspace.single {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.panel-head h2,
.content-panel h2 {
    margin: 0;
    color: var(--text);
    font-size: 18px;
}

.panel-head a {
    color: var(--primary);
    font-weight: 760;
}

.card-list,
.supplier-list,
.dictionary-list,
.summary-stack,
.detail-list,
.package-cards,
.package-list {
    display: grid;
    gap: 10px;
}

.settings-grid {
    grid-template-columns: 1fr;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-bottom: 14px;
}

.inline-form .btn {
    min-width: 92px;
}

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

.dashboard-workspace .panel {
    min-height: 386px;
    margin-left: 0;
    margin-right: 0;
}

.dashboard-workspace .card-list,
.dashboard-workspace .supplier-list {
    align-content: start;
}

.dashboard-recent {
    margin-bottom: 0;
}

.project-row,
.supplier-mini,
.dictionary-row,
.summary-stack div,
.detail-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(72px, auto);
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .62);
}

.dictionary-row {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 48px;
}

.dictionary-row > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-row strong,
.supplier-mini strong,
.entity-title,
.identity-cell strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-row span,
.supplier-mini small,
.entity-subtitle,
.identity-cell span {
    color: var(--muted);
    font-size: 13px;
}

.project-row em,
.supplier-mini em {
    color: var(--primary);
    font-style: normal;
    font-weight: 820;
    text-align: right;
    white-space: nowrap;
}

.filter-bar {
    display: grid;
    grid-template-columns: minmax(260px, 1.6fr) repeat(auto-fit, minmax(128px, 1fr));
    gap: 10px;
    padding: 10px;
    margin-bottom: 16px;
}

.supplier-filter {
    grid-template-columns: minmax(300px, 1fr) minmax(132px, 180px) auto;
}

.search-box {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .84);
}

.filter-bar > select,
.filter-bar > input,
.filter-bar > .btn,
.filter-bar > .search-box {
    width: 100%;
    height: 42px;
}

input,
select,
textarea {
    width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--text);
    background: rgba(255, 255, 255, .88);
    outline: none;
}

.search-box input {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(15, 139, 120, .44);
    box-shadow: 0 0 0 4px rgba(15, 139, 120, .1);
}

textarea {
    resize: vertical;
}

.result-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 16px;
}

.result-toolbar strong,
.result-toolbar span {
    display: block;
}

.result-toolbar strong {
    font-size: 18px;
}

.result-toolbar span {
    color: var(--muted);
    font-size: 13px;
}

.project-catalog {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.project-catalog-card {
    position: relative;
    min-height: 0;
    display: grid;
    grid-template-columns: clamp(250px, 17vw, 320px) minmax(0, 1fr);
    grid-template-rows: minmax(132px, 1fr) auto;
    grid-template-areas:
        "image body"
        "image meta";
    align-items: stretch;
    gap: 12px 16px;
    padding: 14px;
    overflow: hidden;
}

.project-catalog-card.no-image {
    grid-template-columns: 1fr;
    grid-template-areas:
        "body"
        "meta";
}

.project-catalog-card.no-image .project-card-main {
    padding-top: 24px;
}

.project-card-image {
    grid-area: image;
    width: calc(100% + 14px);
    height: calc(100% + 28px);
    min-height: 198px;
    align-self: stretch;
    margin: -14px 0 -14px -14px;
    overflow: hidden;
    border-radius: var(--radius) 0 0 var(--radius);
    background: #e7e9eb;
}

.project-card-image img,
.project-gallery-cover {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.project-card-body {
    grid-area: body;
    min-width: 0;
    min-height: 0;
    display: block;
}

.project-card-main {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "title"
        "desc";
    align-items: start;
    gap: 8px;
    padding: 6px 62px 0 0;
}

.project-card-main h2 {
    grid-area: title;
    min-height: 0;
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.28;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.project-card-main p {
    grid-area: desc;
    min-height: 0;
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.tag-line {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.project-card-main > .tag-line {
    grid-area: tags;
    min-width: 0;
    display: contents;
}

.project-card-main > .tag-line .tag {
    min-height: 21px;
    padding: 2px 7px;
    font-size: 11.5px;
    line-height: 1;
}

.project-badge-featured,
.project-badge-status {
    position: absolute;
    z-index: 5;
    pointer-events: none;
}

.project-badge-featured {
    top: 0;
    left: 0;
    width: 42px;
    height: 42px;
    min-height: 0 !important;
    padding: 0 !important;
    border-radius: var(--radius) 0 0 0 !important;
    color: #fff !important;
    background: linear-gradient(135deg, var(--primary) 0 49%, transparent 50%) !important;
    box-shadow: none !important;
    font-size: 0 !important;
    font-weight: 820;
    line-height: 1;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    transform: none;
}

.project-badge-featured > span {
    position: absolute;
    top: 7px;
    left: -4px;
    width: 35px;
    color: #fff;
    font-size: 9.5px;
    font-weight: 820;
    text-align: center;
    transform: rotate(-45deg);
    transform-origin: center;
}

.project-badge-status {
    top: 12px;
    right: 12px;
    min-height: 22px !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .88) !important;
    box-shadow: 0 8px 18px rgba(21, 27, 35, .08);
    font-size: 11.5px !important;
    backdrop-filter: blur(8px);
}

.tag,
.level,
.metric-pill,
.role-pill,
.access-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    color: #46515c;
    background: rgba(235, 238, 240, .9);
    font-size: 11px;
    font-weight: 760;
}

.tag.accent,
.status-active,
.role-admin,
.state-active {
    color: #075f51;
    background: rgba(15, 139, 120, .14);
}

.status-paused,
.role-sales {
    color: var(--warning);
    background: rgba(245, 181, 71, .18);
}

.status-draft,
.status-inactive,
.state-inactive {
    color: var(--danger);
    background: rgba(182, 66, 80, .12);
}

.status-tag {
    gap: 6px;
}

.status-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.meta-grid,
.project-meta-strip {
    grid-area: meta;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    align-self: end;
}

.project-meta-admin {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.meta-grid div {
    min-height: 38px;
    display: grid;
    align-content: center;
    padding: 5px 7px;
    border-radius: var(--radius);
    background: rgba(247, 248, 249, .86);
}

.project-meta-strip div {
    min-height: 52px;
    display: grid;
    align-content: center;
    justify-items: start;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(247, 248, 249, .86);
}

dd {
    margin: 0;
    font-weight: 760;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
}

dt {
    margin-bottom: 1px;
    font-size: 11px;
}

.project-meta-strip dd {
    overflow: hidden;
    font-size: 15px;
    font-weight: 820;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-meta-strip dt {
    margin-bottom: 2px;
    font-size: 12px;
    font-weight: 760;
}

.project-meta-strip div:first-child dd {
    color: var(--primary);
}

.project-catalog .empty {
    grid-column: 1 / -1;
}

.project-detail-shell {
    display: grid;
    gap: 14px;
    margin: 0 28px 28px;
}

.project-overview {
    display: grid;
    grid-template-columns: minmax(380px, .94fr) minmax(0, 1.06fr);
    align-items: stretch;
    gap: 14px;
    padding: 10px;
    margin: 0;
}

.project-overview .project-gallery {
    min-height: 0;
    padding: 0;
}

.project-gallery-cover {
    width: 100%;
    height: clamp(420px, 42vw, 560px);
    border-radius: var(--radius);
    object-fit: cover;
    cursor: zoom-in;
}

.project-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 6px;
    max-height: 154px;
    overflow-y: auto;
    padding-right: 2px;
    scrollbar-width: thin;
}

.project-gallery-grid img {
    width: 100%;
    height: 68px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    cursor: zoom-in;
}

.project-overview-main {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 9px;
    padding: 6px 4px 4px 2px;
}

.project-gallery-strip {
    display: grid;
    gap: 7px;
    padding: 9px;
    border-radius: var(--radius);
    background: rgba(247, 248, 249, .72);
}

.strip-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.strip-head strong {
    font-size: 13px;
}

.strip-head span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.project-overview-main h2 {
    margin: 0;
    overflow: hidden;
    font-size: 24px;
    line-height: 1.22;
}

.project-overview-copy,
.project-overview-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.project-detail-metrics,
.project-contact-inline {
    display: grid;
    gap: 6px;
    margin: 0;
}

.project-detail-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.project-contact-inline {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding-top: 2px;
}

.project-detail-metrics div,
.project-contact-inline div {
    min-width: 0;
    min-height: 46px;
    display: grid;
    align-content: center;
    padding: 7px 8px;
    border-radius: var(--radius);
    background: rgba(247, 248, 249, .86);
}

.project-contact-inline div {
    min-height: 42px;
}

.project-detail-metrics dt,
.project-contact-inline dt {
    margin: 0 0 2px;
    font-size: 10.5px;
}

.project-detail-metrics dd,
.project-contact-inline dd {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-detail-metrics .detail-price dd {
    color: var(--primary);
    font-size: 18px;
    font-weight: 860;
}

.project-detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    align-items: start;
}

.project-detail-content > .panel {
    margin: 0;
}

.project-rich-panel {
    padding: 22px;
}

.project-rich-panel .rich-content {
    max-width: 980px;
}

.project-rich-panel .rich-content img {
    display: block;
    margin: 14px 0;
}

.project-summary-card h2 {
    margin: 12px 0 14px;
    font-size: 24px;
    line-height: 1.24;
}

.summary-price dd {
    color: var(--primary);
    font-size: 30px;
}

.summary-stack div,
.detail-list div {
    min-height: 58px;
}

.summary-stack dd,
.detail-list dd {
    text-align: right;
}

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

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0 8px;
}

th,
td {
    padding: 12px 10px;
    text-align: left;
    vertical-align: middle;
}

th:nth-last-child(-n+3),
td:nth-last-child(-n+3) {
    text-align: right;
}

th:last-child,
td:last-child {
    text-align: right;
}

th {
    color: var(--muted);
    font-size: 12px;
}

td {
    background: rgba(255, 255, 255, .58);
}

td:first-child {
    border-radius: var(--radius) 0 0 var(--radius);
}

td:last-child {
    border-radius: 0 var(--radius) var(--radius) 0;
}

td a {
    color: var(--text);
    font-weight: 760;
}

.entity-link,
.identity-cell,
.contact-stack {
    min-width: 0;
    display: grid;
}

.identity-cell {
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.contact-stack span {
    color: var(--muted);
    font-size: 12px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: #535c67;
    background: rgba(255, 255, 255, .72);
    cursor: pointer;
}

.icon-btn.danger {
    color: var(--danger);
}

.row-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

td.row-actions {
    display: flex;
    align-items: center;
}

.row-actions form {
    margin: 0;
}

.table-empty,
.empty-inline,
.dictionary-empty {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.form,
.project-form,
.storage-form {
    max-width: none;
}

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

.project-primary-grid,
.package-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 7px;
    color: #34404c;
    font-weight: 700;
}

label span {
    font-size: 13px;
}

label em {
    color: var(--danger);
    font-style: normal;
}

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

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

.form-intro,
.package-editor,
.package-item,
.rich-editor,
.upload-zone,
.image-preview,
.existing-image-item,
.dictionary-row,
.package-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .62);
}

.form-intro,
.package-editor,
.package-item,
.package-card {
    padding: 14px;
}

.form-intro {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.form-intro span,
.form-intro small {
    color: var(--muted);
    font-size: 12px;
}

.form-intro strong {
    display: block;
    font-size: 18px;
}

.editor-block,
.upload-block,
.package-editor {
    margin-top: 20px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    border-bottom: 1px solid var(--line);
}

.editor-toolbar button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
}

.editor-toolbar button:hover {
    background: rgba(15, 139, 120, .1);
}

.editor-canvas {
    min-height: 260px;
    padding: 16px;
    outline: none;
    background: rgba(255, 255, 255, .78);
}

.editor-canvas:empty::before {
    content: attr(data-placeholder);
    color: var(--faint);
}

.editor-canvas img,
.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
}

.editor-status {
    padding: 7px 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.upload-zone {
    min-height: 150px;
    place-items: center;
    padding: 20px;
    border-style: dashed;
    cursor: pointer;
    text-align: center;
}

.upload-zone input {
    display: none;
}

.upload-zone.dragging {
    border-color: rgba(15, 139, 120, .4);
    background: var(--primary-soft);
}

.upload-icon {
    font-size: 26px;
}

.existing-image-grid,
.image-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.existing-image-item,
.image-preview figure {
    position: relative;
    margin: 0;
    overflow: hidden;
}

.existing-image-item img,
.image-preview img {
    width: 100%;
    height: 120px;
    display: block;
    object-fit: cover;
}

.existing-image-item span,
.image-preview figcaption {
    display: block;
    padding: 8px;
    color: var(--muted);
    font-size: 12px;
}

.image-preview button {
    position: absolute;
    top: 6px;
    right: 6px;
}

.hidden {
    display: none !important;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.check-row input {
    width: auto;
    min-height: 0;
}

.sticky-actions {
    position: sticky;
    bottom: 0;
    z-index: 12;
    margin: 18px -18px -18px;
    padding: 12px 18px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .9);
}

.package-card {
    display: grid;
    grid-template-columns: minmax(180px, .8fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.project-package-panel .package-cards {
    grid-template-columns: repeat(auto-fit, minmax(460px, 1fr));
}

.package-card > div:first-child {
    min-width: 0;
}

.package-card > div:first-child strong,
.package-card > div:first-child span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.package-card > div:first-child strong {
    white-space: nowrap;
}

.package-card > div:first-child span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.package-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.package-card dl div {
    min-height: 44px;
    display: grid;
    align-content: center;
    padding: 6px 7px;
    border-radius: var(--radius);
    background: rgba(247, 248, 249, .86);
}

.rich-content {
    color: #313b47;
    line-height: 1.68;
}

.rich-content p:first-child {
    margin-top: 0;
}

.rich-content p:last-child {
    margin-bottom: 0;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    place-items: center;
    padding: 28px;
    background: rgba(12, 18, 24, .84);
}

.image-lightbox.active {
    display: grid;
}

.image-lightbox figure {
    max-width: min(1120px, 96vw);
    max-height: 92vh;
    margin: 0;
}

.image-lightbox img {
    max-width: 100%;
    max-height: 84vh;
}

.image-lightbox figcaption {
    color: rgba(255, 255, 255, .76);
    text-align: center;
}

.image-lightbox-close,
.image-lightbox-nav {
    position: fixed;
    z-index: 3;
    border: 1px solid rgba(255, 255, 255, .22);
    color: #fff;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
}

.image-lightbox-close {
    top: 20px;
    right: 22px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 28px;
}

.image-lightbox-nav {
    top: 50%;
    width: 52px;
    height: 68px;
    border-radius: var(--radius);
    font-size: 46px;
    transform: translateY(-50%);
}

.image-lightbox-nav.prev {
    left: 24px;
}

.image-lightbox-nav.next {
    right: 24px;
}

.image-lightbox-nav[hidden] {
    display: none;
}

.project-submit-progress {
    position: fixed;
    inset: 0;
    z-index: 190;
    display: none;
    place-items: center;
    background: rgba(240, 242, 244, .76);
}

.project-submit-progress.active {
    display: grid;
}

.project-submit-progress-panel {
    width: min(420px, 92vw);
    padding: 20px;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.project-submit-progress-head {
    display: flex;
    justify-content: space-between;
}

.project-submit-progress-track {
    height: 8px;
    margin: 14px 0;
    overflow: hidden;
    border-radius: 999px;
    background: #e7eaed;
}

.project-submit-progress-track span {
    height: 100%;
    display: block;
    border-radius: inherit;
    background: var(--primary);
}

.access-badge {
    gap: 8px;
    justify-content: flex-start;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
    background: #dfe3e7;
}

.login-screen {
    width: min(460px, 100%);
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}

.login-panel {
    display: grid;
    place-items: center;
    padding: 36px;
}

.login-card {
    width: 100%;
    max-width: 380px;
}

.login-title {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.app-mark {
    width: 46px;
    height: 46px;
    border-radius: var(--radius);
}

.login-title h1 {
    margin: 0;
    font-size: 24px;
}

.login-title p {
    margin: 4px 0 0;
    color: var(--muted);
}

.form.stacked {
    display: grid;
    gap: 14px;
}

.flash {
    padding: 12px 14px;
    border-radius: var(--radius);
    background: rgba(15, 139, 120, .12);
    color: #075f51;
}

.flash.danger {
    background: rgba(182, 66, 80, .12);
    color: var(--danger);
}

@media (max-width: 1280px) {
    .project-catalog {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-workspace,
    .project-detail-layout,
    .project-overview,
    .project-detail-content {
        grid-template-columns: 1fr;
    }

    .project-detail-aside {
        position: static;
    }

    .project-gallery-cover {
        height: 460px;
    }
}

@media (max-width: 1180px) {
    .project-catalog-card {
        grid-template-columns: 196px minmax(0, 1fr);
        grid-template-rows: minmax(104px, 1fr) auto;
        gap: 10px 13px;
        padding: 12px;
    }

    .project-card-image {
        width: calc(100% + 12px);
        height: calc(100% + 24px);
        min-height: 172px;
        margin: -12px 0 -12px -12px;
    }

    .project-card-main {
        gap: 6px;
        padding: 4px 54px 0 0;
    }

    .project-card-main h2 {
        font-size: 16.5px;
    }

    .project-card-main p {
        font-size: 12.5px;
        line-height: 1.46;
    }

    .project-meta-strip div {
        min-height: 44px;
        padding: 7px 8px;
    }

    .project-meta-strip dd {
        font-size: 13.5px;
    }

    .project-meta-strip dt {
        font-size: 10.5px;
    }
}

@media (max-width: 920px) {
    .shell {
        display: flex;
        flex-direction: column;
    }

    .sidebar {
        position: sticky;
        z-index: 40;
        width: 100%;
        height: auto;
        min-height: 0;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-template-areas: "brand nav footer";
        align-items: center;
        padding: 10px 12px;
    }

    .brand {
        grid-area: brand;
    }

    .brand-lockup {
        grid-template-columns: 38px;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
    }

    .brand-lockup > div,
    .sidebar-toggle,
    .nav-title,
    .nav-link span,
    .user-chip {
        display: none;
    }

    .nav {
        grid-area: nav;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .nav::-webkit-scrollbar {
        display: none;
    }

    .nav-section {
        display: flex;
        gap: 8px;
    }

    .nav-link {
        width: 42px;
        min-height: 42px;
        justify-content: center;
        padding: 0;
    }

    .sidebar-footer {
        grid-area: footer;
        margin: 0;
    }

    .logout {
        width: 42px;
        justify-content: center;
        padding: 0;
    }

    .app-topbar {
        position: static;
        grid-template-columns: 1fr;
        gap: 10px;
        min-height: auto;
        padding: 12px;
    }

    .app-topbar,
    .topbar-tabs,
    .topbar-tools {
        display: none;
    }

    .page-head,
    .stats-grid,
    .mini-stats,
    .filter-bar,
    .result-toolbar,
    .project-grid,
    .project-detail-shell,
    .dashboard-workspace,
    .split-grid,
    .panel,
    .project-detail-layout,
    .detail-hero,
    .flash {
        margin-left: 12px;
        margin-right: 12px;
    }

    .page-head {
        display: grid;
        align-items: start;
        margin-top: 18px;
    }

    .page-head h1 {
        font-size: 28px;
    }

    .stats-grid,
    .mini-stats,
    .project-catalog,
    .split-grid,
    .form-grid,
    .project-primary-grid,
    .package-grid,
    .filter-bar,
    .supplier-filter,
    .project-filter {
        grid-template-columns: 1fr;
    }

    .project-meta-admin,
    .project-meta-sales,
    .project-meta-strip,
    .project-detail-metrics,
    .project-contact-inline {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .project-detail-shell {
        margin-top: 0;
        margin-bottom: 18px;
    }

    .project-overview {
        padding: 10px;
    }

    .project-gallery-cover {
        height: 300px;
    }

    .project-gallery-grid img {
        width: 74px;
        height: 56px;
    }

    .project-package-panel .package-cards {
        grid-template-columns: 1fr;
    }

    .project-rich-panel {
        padding: 18px;
    }

    .project-catalog-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
            "body"
            "meta";
        gap: 10px;
    }

    .project-card-image {
        display: none;
    }

    .project-card-body {
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .project-card-main {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "desc";
        padding-right: 0;
    }

    .project-card-main h2,
    .project-card-main p {
        min-height: 0;
    }

    .dictionary-list {
        grid-template-columns: 1fr;
    }

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

    .package-card dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card-actions,
    .form-actions,
    .actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .login-body {
        padding: 0;
    }

    .login-screen {
        min-height: 100vh;
        grid-template-columns: 1fr;
        border-radius: 0;
    }

}

@media (max-width: 420px) {
    .project-meta-admin,
    .project-meta-sales,
    .project-meta-strip,
    .package-card dl,
    .stats-grid,
    .mini-stats {
        grid-template-columns: 1fr;
    }
}
