:root {
    --blue-900: #0d3762;
    --blue-800: #164f86;
    --blue-700: #2e609b;
    --green-700: #2f9d67;
    --green-100: #e7f6ee;
    --ink: #14253b;
    --muted: #5d6f86;
    --line: #d8e2ee;
    --surface: #ffffff;
    --surface-soft: #f5f8fb;
    --danger: #b93636;
    --warning: #b7791f;
    --shadow: 0 18px 45px rgba(13, 55, 98, 0.12);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: linear-gradient(135deg, #174b77 0%, #2f9d67 100%);
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
}

a {
    color: var(--blue-800);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 22px clamp(18px, 5vw, 72px);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--blue-900);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 50px;
    height: 50px;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue-800), var(--green-700));
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 22px;
    line-height: 1.1;
}

.brand small {
    color: var(--green-700);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.top-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.top-nav a,
.link-button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--blue-900);
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.top-nav a.active,
.top-nav a:hover,
.link-button:hover {
    background: var(--green-100);
    border-color: #bde3ce;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 34px auto;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 28px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 14px;
}

.hero-panel,
.panel,
.page-heading {
    border: 1px solid rgba(216, 226, 238, 0.95);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--shadow);
}

.hero-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 28px;
    align-items: end;
    margin-bottom: 22px;
    padding: clamp(28px, 4vw, 48px);
}

.hero-panel h1,
.page-heading h1 {
    max-width: 780px;
    margin: 0;
    color: #102947;
    font-size: clamp(34px, 6vw, 64px);
    line-height: 1.02;
}

.hero-panel p,
.page-heading p {
    max-width: 760px;
    margin: 14px 0 0;
    color: #324b67;
    font-size: 18px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--blue-800);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tier-strip {
    display: grid;
    gap: 10px;
    min-width: 220px;
}

.tier-strip span {
    padding: 10px 14px;
    border-radius: 6px;
    background: var(--surface-soft);
    color: var(--blue-900);
    font-weight: 800;
    text-align: center;
}

.auth-grid,
.content-grid,
.dashboard-grid {
    display: grid;
    gap: 22px;
}

.auth-grid {
    grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.65fr);
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 22px;
}

.content-grid.wide-left {
    grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.75fr);
    align-items: start;
}

.dashboard-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 22px 0;
}

.panel,
.page-heading {
    padding: clamp(22px, 3vw, 34px);
}

.panel h2,
.page-heading h1 {
    margin-top: 0;
}

.panel h2 {
    margin-bottom: 14px;
    color: var(--blue-900);
    font-size: 28px;
    line-height: 1.15;
}

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

label {
    display: grid;
    gap: 7px;
    color: #29415e;
    font-weight: 800;
}

label span {
    font-size: 13px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid #bdcad9;
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid rgba(47, 157, 103, 0.18);
    border-color: var(--green-700);
}

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

.primary-button,
.secondary-button,
.small-button,
.danger-button,
.muted-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 16px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.primary-button {
    background: var(--blue-800);
    color: #fff;
}

.primary-button:hover {
    background: var(--blue-900);
}

.secondary-button,
.small-button {
    background: #eef4fa;
    border-color: #cbdae8;
    color: var(--blue-900);
}

.muted-button {
    background: #f6f8fa;
    border-color: #d8e2ee;
    color: #3e526a;
}

.danger-button {
    background: #fff1f1;
    border-color: #efb4b4;
    color: var(--danger);
}

.small-button {
    min-height: 34px;
    padding: 6px 10px;
    font-size: 13px;
}

.danger-form {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}

.tier-list {
    display: grid;
    gap: 14px;
}

.tier-list div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.tier-list strong,
.tier-list span {
    display: block;
}

.tier-list span {
    margin-top: 4px;
    color: var(--blue-800);
    font-weight: 800;
}

.tier-list p {
    margin: 8px 0 0;
    color: var(--muted);
}

.tier-list.compact div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.stat-panel {
    display: grid;
    gap: 8px;
}

.stat-panel span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.stat-panel strong {
    color: var(--blue-900);
    font-size: 26px;
}

.details-list {
    display: grid;
    gap: 12px;
    margin: 0;
}

.details-list div {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.details-list dt {
    color: var(--muted);
    font-weight: 800;
}

.details-list dd {
    margin: 0;
}

.address-block {
    color: #304a67;
    font-style: normal;
}

.section-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

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

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

th,
td {
    padding: 13px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.muted,
.empty-state {
    color: var(--muted);
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.search-form {
    display: flex;
    gap: 8px;
    min-width: min(100%, 360px);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    background: #eef4fa;
    color: var(--blue-900);
    font-size: 13px;
    font-weight: 800;
}

.status-pill.active {
    background: var(--green-100);
    color: #20754b;
}

.status-pill.pending,
.status-pill.paused {
    background: #fff6de;
    color: var(--warning);
}

.status-pill.suspended,
.status-pill.cancelled {
    background: #fff1f1;
    color: var(--danger);
}

.flash {
    margin-bottom: 18px;
    padding: 13px 16px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
    font-weight: 700;
}

.flash.success {
    border-color: #bde3ce;
    background: var(--green-100);
    color: #1f7048;
}

.flash.error {
    border-color: #efb4b4;
    background: #fff1f1;
    color: var(--danger);
}

.flash.info {
    border-color: #bdd2e8;
    background: #eef4fa;
    color: var(--blue-900);
}

@media (max-width: 900px) {
    .site-header,
    .site-footer,
    .section-title-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-nav {
        justify-content: flex-start;
    }

    .hero-panel,
    .auth-grid,
    .content-grid,
    .content-grid.wide-left,
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .tier-strip {
        min-width: 0;
    }
}

@media (max-width: 620px) {
    .page-shell {
        width: min(100% - 20px, 1180px);
        margin-top: 18px;
    }

    .site-header {
        padding: 18px 14px;
    }

    .brand strong {
        font-size: 18px;
    }

    .hero-panel h1,
    .page-heading h1 {
        font-size: 36px;
    }

    .form-row,
    .details-list div {
        grid-template-columns: 1fr;
    }

    .search-form {
        width: 100%;
        flex-direction: column;
    }
}

