:root {
    --podio-950: #062f32;
    --podio-900: #073f43;
    --podio-800: #09585b;
    --podio-700: #0f7779;
    --podio-600: #168c89;
    --podio-500: #25a59d;
    --podio-300: #70d5bd;
    --podio-200: #a6efc1;
    --ink-950: #132425;
    --ink-700: #41595a;
    --ink-500: #718687;
    --surface: #f3f7f6;
    --line: #dbe7e4;
    --white: #fff;
    --danger: #c43f4c;
    --warning: #a4660a;
    --success: #13765c;
    --shadow: 0 14px 40px rgba(12, 70, 70, .10);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--surface);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink-950);
    background: var(--surface);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
.button {
    cursor: pointer;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .72rem 1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 750;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    color: var(--white);
    background: linear-gradient(135deg, var(--podio-700), var(--podio-500));
    box-shadow: 0 8px 22px rgba(15, 119, 121, .23);
}

.button-secondary {
    color: var(--podio-800);
    background: #e9f6f2;
    border-color: #cce8df;
}

.button-ghost {
    color: var(--ink-700);
    background: var(--white);
    border-color: var(--line);
}

.button-danger {
    color: var(--white);
    background: var(--danger);
}

.button-small {
    min-height: 36px;
    padding: .48rem .75rem;
    font-size: .86rem;
}

.auth-shell {
    position: relative;
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, .86fr) minmax(520px, 1.14fr);
    overflow: hidden;
}

.auth-brand {
    position: relative;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(2rem, 5vw, 5rem);
    color: var(--white);
    background: linear-gradient(150deg, var(--podio-950), var(--podio-700) 62%, var(--podio-500));
    isolation: isolate;
}

.auth-brand::before,
.auth-brand::after,
.step-motif::before,
.step-motif::after {
    position: absolute;
    z-index: -1;
    display: block;
    content: "";
    background: rgba(255, 255, 255, .08);
    transform: skewY(-8deg);
}

.auth-brand::before {
    right: -5%;
    bottom: 16%;
    width: 56%;
    height: 54px;
    box-shadow:
        -54px -70px 0 rgba(255, 255, 255, .07),
        -108px -140px 0 rgba(255, 255, 255, .06),
        -162px -210px 0 rgba(255, 255, 255, .05);
}

.auth-brand::after {
    right: 12%;
    bottom: 10%;
    width: 3px;
    height: 260px;
    background: rgba(166, 239, 193, .7);
    transform: none;
}

.brand-wordmark {
    width: min(320px, 80%);
    padding: 1rem 1.2rem;
    border-radius: 16px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.auth-brand h1 {
    max-width: 700px;
    margin: 2rem 0 1rem;
    font-size: clamp(2.4rem, 5vw, 4.8rem);
    line-height: .98;
    letter-spacing: -.055em;
}

.auth-brand p {
    max-width: 600px;
    color: rgba(255, 255, 255, .8);
    font-size: 1.08rem;
    line-height: 1.75;
}

.auth-proof {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
}

.auth-proof span {
    padding: .58rem .76rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 9px;
    color: rgba(255, 255, 255, .86);
    background: rgba(2, 39, 42, .26);
    font-size: .82rem;
    font-weight: 700;
}

.auth-main {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: clamp(1.5rem, 5vw, 5rem);
    background:
        linear-gradient(145deg, rgba(166, 239, 193, .15), transparent 35%),
        var(--white);
}

.auth-card {
    width: min(620px, 100%);
}

.auth-card-wide {
    width: min(760px, 100%);
}

.eyebrow {
    margin: 0 0 .55rem;
    color: var(--podio-700);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.auth-card h2,
.page-heading h1 {
    margin: 0;
    letter-spacing: -.035em;
}

.auth-card h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.muted {
    color: var(--ink-500);
}

.form-stack {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

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

.field {
    display: grid;
    gap: .43rem;
}

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

.field label,
.label {
    color: var(--ink-700);
    font-size: .85rem;
    font-weight: 750;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 48px;
    padding: .72rem .84rem;
    color: var(--ink-950);
    border: 1px solid #ccdad7;
    border-radius: 12px;
    outline: 0;
    background: var(--white);
    transition: border .15s ease, box-shadow .15s ease;
}

.field textarea {
    min-height: 120px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--podio-500);
    box-shadow: 0 0 0 4px rgba(37, 165, 157, .13);
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    color: var(--ink-700);
    font-size: .9rem;
    line-height: 1.5;
}

.check-row input {
    width: 18px;
    height: 18px;
    margin-top: .12rem;
    accent-color: var(--podio-700);
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.form-actions .button {
    min-width: 150px;
}

.text-link {
    color: var(--podio-700);
    font-weight: 750;
}

.text-link:hover {
    text-decoration: underline;
}

.field-error,
.error-list {
    color: var(--danger);
    font-size: .82rem;
}

.error-list {
    padding: .85rem 1rem .85rem 2rem;
    border: 1px solid #f2c7cc;
    border-radius: 12px;
    background: #fff4f5;
}

.notice {
    padding: .88rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink-700);
    background: var(--white);
}

.notice-success {
    border-color: #a8deca;
    color: #0d5e48;
    background: #edfbf5;
}

.notice-warning {
    border-color: #ecd7ae;
    color: #7d520e;
    background: #fff9ec;
}

.terms-box {
    max-height: 180px;
    overflow: auto;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink-700);
    background: #f8fbfa;
    font-size: .86rem;
    line-height: 1.65;
    white-space: pre-line;
}

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

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 1rem;
    color: var(--white);
    background: linear-gradient(170deg, var(--podio-950), var(--podio-800));
    overflow-y: auto;
}

.sidebar-brand {
    display: block;
    margin-bottom: 1.4rem;
    padding: .7rem;
    border-radius: 14px;
    background: var(--white);
}

.sidebar-brand img {
    display: block;
    width: 100%;
}

.sidebar-context {
    margin-bottom: 1rem;
    padding: .75rem;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 12px;
    background: rgba(255, 255, 255, .06);
}

.sidebar-context small {
    display: block;
    margin-bottom: .24rem;
    color: rgba(255, 255, 255, .57);
}

.sidebar-context strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-section {
    margin: 1rem .65rem .45rem;
    color: rgba(255, 255, 255, .45);
    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.nav-list {
    display: grid;
    gap: .28rem;
}

.nav-link {
    display: flex;
    min-height: 42px;
    align-items: center;
    gap: .7rem;
    padding: .65rem .75rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, .72);
    font-size: .9rem;
    font-weight: 680;
}

.nav-link:hover,
.nav-link.active {
    color: var(--white);
    background: rgba(255, 255, 255, .11);
}

.nav-icon {
    display: grid;
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    place-items: center;
    border-radius: 7px;
    color: var(--podio-200);
    background: rgba(166, 239, 193, .10);
    font-size: .72rem;
    font-weight: 900;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .65rem;
}

.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    place-items: center;
    border-radius: 10px;
    color: var(--podio-950);
    background: var(--podio-200);
    font-weight: 900;
}

.sidebar-user span {
    display: block;
    overflow: hidden;
    color: rgba(255, 255, 255, .6);
    font-size: .73rem;
    text-overflow: ellipsis;
}

.app-main {
    min-width: 0;
}

.topbar {
    position: sticky;
    z-index: 20;
    top: 0;
    display: flex;
    min-height: 74px;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem clamp(1rem, 3vw, 2.5rem);
    border-bottom: 1px solid rgba(215, 228, 225, .8);
    background: rgba(243, 247, 246, .92);
    backdrop-filter: blur(14px);
}

.topbar-title {
    display: flex;
    align-items: center;
    gap: .8rem;
}

.topbar-title strong {
    display: block;
}

.topbar-title span {
    color: var(--ink-500);
    font-size: .78rem;
}

.mobile-menu {
    display: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.content {
    width: min(1600px, 100%);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem);
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.6rem;
}

.page-heading p {
    max-width: 760px;
    margin: .45rem 0 0;
    color: var(--ink-500);
}

.page-heading h1 {
    font-size: clamp(1.8rem, 3vw, 2.8rem);
}

.metric-grid,
.product-grid {
    display: grid;
    gap: 1rem;
}

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

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

.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: 0 8px 24px rgba(12, 70, 70, .045);
}

.card-pad {
    padding: 1.15rem;
}

.metric-card {
    position: relative;
    min-height: 138px;
    overflow: hidden;
    padding: 1.1rem;
}

.metric-card::after {
    position: absolute;
    right: -14px;
    bottom: 18px;
    width: 90px;
    height: 18px;
    content: "";
    background: rgba(37, 165, 157, .09);
    box-shadow:
        -18px -24px 0 rgba(37, 165, 157, .075),
        -36px -48px 0 rgba(37, 165, 157, .06);
    transform: skewY(-8deg);
}

.metric-label {
    color: var(--ink-500);
    font-size: .78rem;
    font-weight: 750;
}

.metric-value {
    display: block;
    margin-top: .45rem;
    font-size: 2rem;
    letter-spacing: -.04em;
}

.metric-note {
    margin-top: .28rem;
    color: var(--success);
    font-size: .76rem;
}

.section-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr);
    gap: 1rem;
    margin-top: 1rem;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.15rem;
    border-bottom: 1px solid var(--line);
}

.section-title h2 {
    margin: 0;
    font-size: 1.03rem;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: .82rem 1rem;
    border-bottom: 1px solid #edf2f0;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--ink-500);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.data-table td {
    color: var(--ink-700);
    font-size: .86rem;
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.empty-state {
    padding: 2rem;
    color: var(--ink-500);
    text-align: center;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .32rem .55rem;
    border-radius: 999px;
    color: var(--ink-700);
    background: #edf3f2;
    font-size: .7rem;
    font-weight: 820;
}

.badge-success {
    color: #0c684e;
    background: #dff7ed;
}

.badge-warning {
    color: #8b590c;
    background: #fff1d4;
}

.badge-danger {
    color: #a52f3b;
    background: #fde4e7;
}

.product-card {
    position: relative;
    display: flex;
    min-height: 245px;
    flex-direction: column;
    overflow: hidden;
    padding: 1.2rem;
}

.product-card::after {
    position: absolute;
    right: -22px;
    bottom: -5px;
    width: 130px;
    height: 24px;
    content: "";
    background: rgba(15, 119, 121, .06);
    box-shadow:
        -28px -34px 0 rgba(15, 119, 121, .055),
        -56px -68px 0 rgba(15, 119, 121, .045);
    transform: skewY(-8deg);
}

.product-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 13px;
    color: var(--podio-800);
    background: linear-gradient(145deg, var(--podio-200), #e9fbf1);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.product-card h3 {
    margin: 1rem 0 .42rem;
    font-size: 1.08rem;
}

.product-card p {
    margin: 0 0 1rem;
    color: var(--ink-500);
    font-size: .86rem;
    line-height: 1.55;
}

.product-card .button {
    z-index: 1;
    align-self: flex-start;
    margin-top: auto;
}

.activity-list {
    display: grid;
    gap: 0;
}

.activity-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: .7rem;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid #edf2f0;
}

.activity-item:last-child {
    border-bottom: 0;
}

.activity-dot {
    width: 8px;
    height: 8px;
    margin-top: .38rem;
    border-radius: 2px;
    background: var(--podio-500);
}

.activity-item p {
    margin: 0;
    color: var(--ink-700);
    font-size: .82rem;
}

.activity-item time {
    color: var(--ink-500);
    font-size: .7rem;
}

.nav-link small {
    margin-left: auto;
    color: rgba(255, 255, 255, .5);
    font-size: .62rem;
    font-weight: 750;
}

.nav-link-disabled {
    cursor: not-allowed;
    opacity: .62;
}

.nav-link-disabled:hover {
    color: rgba(255, 255, 255, .72);
    background: transparent;
}

.filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: 1rem;
}

.filter-grid-four {
    grid-template-columns: 1.3fr 1.4fr 1fr 1fr auto;
}

.section-grid-wide {
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr);
}

.section-title-pad {
    padding: 1rem 1.1rem 0;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: 1rem;
    transition: border-color .15s ease, transform .15s ease;
}

.quick-action:hover {
    border-color: var(--podio-300);
    transform: translateY(-2px);
}

.quick-action div {
    display: grid;
    gap: .2rem;
}

.quick-action span:last-child {
    color: var(--ink-500);
    font-size: .76rem;
}

.choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem .9rem;
    margin: 0;
    padding: .85rem 1rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.choice-group legend {
    padding: 0 .35rem;
    color: var(--ink-700);
    font-size: .8rem;
    font-weight: 800;
}

.choice-group.compact {
    padding: .55rem .7rem .7rem;
}

.choice-group.compact .check-row {
    font-size: .72rem;
}

.stack-list {
    display: grid;
    gap: .75rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.inline-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 105px auto;
    align-items: end;
    gap: .6rem;
}

.inline-edit select {
    min-height: 44px;
    padding: .65rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--white);
}

.member-list {
    display: grid;
}

.member-row {
    display: grid;
    grid-template-columns: minmax(220px, .55fr) minmax(0, 1.45fr);
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
}

.member-row:last-child {
    border-bottom: 0;
}

.member-identity {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.member-identity div {
    display: grid;
    gap: .2rem;
}

.member-identity span:last-child {
    color: var(--ink-500);
    font-size: .76rem;
}

.member-form {
    display: grid;
    grid-template-columns: minmax(130px, .7fr) 110px minmax(200px, 1.25fr) minmax(180px, 1fr) auto;
    align-items: end;
    gap: .7rem;
}

.legal-document {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fafdfc;
}

.legal-document summary {
    padding: .85rem 1rem;
    color: var(--ink-700);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 800;
}

.legal-document .terms-box {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0 0 12px 12px;
}

.check-list {
    display: grid;
    gap: .7rem;
    margin: 1.5rem 0;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: .8rem;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.check-item div {
    display: grid;
    min-width: 0;
    gap: .2rem;
}

.check-item span:last-child {
    overflow-wrap: anywhere;
    color: var(--ink-500);
    font-size: .74rem;
}

.certificate-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 2rem;
    background:
        radial-gradient(circle at 10% 10%, rgba(166, 239, 193, .25), transparent 32%),
        var(--surface);
}

.certificate {
    width: min(920px, 100%);
    padding: clamp(2rem, 6vw, 4.5rem);
    border: 1px solid #cfe3df;
    border-radius: 28px;
    background: var(--white);
    box-shadow: var(--shadow);
}

.certificate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 3rem;
}

.certificate-header img {
    width: min(260px, 55%);
}

.certificate h1 {
    margin: 0;
    color: var(--podio-900);
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: -.05em;
}

.certificate-lead {
    max-width: 720px;
    color: var(--ink-700);
    font-size: 1.08rem;
    line-height: 1.7;
}

.certificate-data {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 2rem 0;
}

.certificate-data div {
    padding: 1rem;
    border-radius: 12px;
    background: var(--surface);
}

.certificate-data dt {
    color: var(--ink-500);
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.certificate-data dd {
    margin: .35rem 0 0;
    color: var(--ink-950);
    font-weight: 750;
}

.certificate-data .hash {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: .78rem;
}

.certificate-note {
    margin-top: 2rem;
    color: var(--ink-500);
    font-size: .78rem;
    line-height: 1.6;
}

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

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

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

    .quick-actions,
    .member-row {
        grid-template-columns: 1fr;
    }

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

    .member-form .choice-group {
        grid-column: span 2;
    }
}

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

    .auth-brand {
        display: none;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 100;
        left: 0;
        width: min(310px, 88vw);
        transform: translateX(-105%);
        transition: transform .2s ease;
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    body.menu-open::after {
        position: fixed;
        z-index: 90;
        inset: 0;
        content: "";
        background: rgba(4, 35, 37, .48);
    }

    .mobile-menu {
        display: inline-grid;
        width: 42px;
        height: 42px;
        place-items: center;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--white);
    }
}

@media (max-width: 620px) {
    .auth-main {
        align-items: start;
        padding: 1.4rem;
    }

    .form-grid,
    .metric-grid,
    .product-grid,
    .filter-grid,
    .filter-grid-four,
    .member-form,
    .inline-edit,
    .certificate-data {
        grid-template-columns: 1fr;
    }

    .member-form .choice-group {
        grid-column: auto;
    }

    .form-actions,
    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions .button span {
        display: none;
    }
}

@media print {
    .certificate-page {
        display: block;
        padding: 0;
        background: var(--white);
    }

    .certificate {
        width: 100%;
        border: 0;
        box-shadow: none;
    }

    .print-hide {
        display: none;
    }
}
