:root {
    --ink: #14231e;
    --muted: #6a7772;
    --paper: #f4f7f5;
    --surface: #ffffff;
    --line: #dfe8e3;
    --green: #167c5a;
    --green-dark: #0e5f44;
    --green-soft: #e3f4ed;
    --navy: #17364b;
    --amber: #b46b17;
    --amber-soft: #fff1d8;
    --danger: #b73a4c;
    --shadow: 0 14px 40px rgba(28, 52, 43, 0.07);
    --radius: 18px;
}

html {
    background: var(--paper);
}

body {
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    min-height: 100vh;
}

code,
pre,
.identifier-input {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

a {
    color: var(--green-dark);
}

.app-body {
    background:
        radial-gradient(circle at 95% 0%, rgba(39, 148, 109, 0.07), transparent 24rem),
        var(--paper);
}

.app-navbar {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    min-height: 4.75rem;
    position: sticky;
    top: 0;
    z-index: 30;
}

.app-navbar .navbar-item {
    color: #4b5b55;
    font-size: 0.92rem;
    font-weight: 650;
}

.app-navbar .navbar-start > .navbar-item {
    border-radius: 10px;
    margin: 0.65rem 0.15rem;
}

.app-navbar .navbar-start > .navbar-item:hover,
.app-navbar .navbar-start > .navbar-item.is-active {
    background: var(--green-soft);
    color: var(--green-dark);
}

.brand-lockup {
    align-items: center;
    display: flex;
    gap: 0.7rem;
    margin-right: 2rem;
}

.brand-lockup > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-lockup strong {
    color: var(--ink);
    font-size: 1.08rem;
    letter-spacing: -0.02em;
}

.brand-lockup small {
    color: var(--muted);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    margin-top: 0.22rem;
}

.brand-mark {
    align-items: center;
    background: var(--green);
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(22, 124, 90, 0.2);
    color: white;
    display: inline-flex;
    flex: 0 0 auto;
    font-family: Georgia, serif;
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 700;
    height: 2.35rem;
    justify-content: center;
    width: 2.35rem;
}

.brand-mark-large {
    border-radius: 16px;
    font-size: 1.7rem;
    height: 3.25rem;
    width: 3.25rem;
}

.admin-chip {
    display: flex;
    gap: 0.65rem;
}

.admin-chip > span:last-child {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.admin-chip small {
    color: var(--muted);
    font-size: 0.66rem;
    font-weight: 500;
}

.admin-chip strong {
    color: var(--ink);
    font-size: 0.82rem;
}

.admin-avatar,
.table-avatar {
    align-items: center;
    background: #e7efeb;
    border: 1px solid #d8e4de;
    border-radius: 50%;
    color: var(--green-dark);
    display: inline-flex;
    flex: 0 0 auto;
    font-weight: 800;
    height: 2.2rem;
    justify-content: center;
    width: 2.2rem;
}

.app-main {
    padding: 2.25rem 1.5rem 4rem;
}

.app-container {
    max-width: 1440px;
}

.app-notification {
    border: 1px solid currentColor;
    border-radius: 12px;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

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

.page-heading .title,
.record-heading .title {
    color: var(--ink);
    letter-spacing: -0.045em;
    margin-bottom: 0.45rem !important;
}

.page-heading .subtitle {
    color: var(--muted);
    margin: 0;
}

.eyebrow {
    color: var(--green);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.16em;
    margin-bottom: 0.48rem;
}

.back-link {
    color: var(--muted);
    display: inline-block;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1.15rem;
}

.button {
    border-radius: 10px;
    font-weight: 720;
}

.button.is-primary {
    background: var(--green);
}

.button.is-primary:hover {
    background: var(--green-dark);
}

.stats-grid {
    margin-bottom: 0.75rem !important;
}

.metric-card,
.mini-stat {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-height: 150px;
    overflow: hidden;
    padding: 1.35rem 1.45rem;
    position: relative;
}

.metric-card::after {
    border-radius: 50%;
    content: "";
    height: 6.5rem;
    opacity: 0.9;
    position: absolute;
    right: -2.2rem;
    top: -2.3rem;
    width: 6.5rem;
}

.metric-card-green::after { background: #d7f1e7; }
.metric-card-blue::after { background: #dcecf5; }
.metric-card-amber::after { background: #fff0d2; }
.metric-card-violet::after { background: #e9e1f8; }

.metric-label,
.mini-stat > span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.metric-card > strong {
    color: var(--ink);
    font-size: clamp(2rem, 3vw, 2.65rem);
    letter-spacing: -0.055em;
    line-height: 1;
    margin: auto 0 0.4rem;
    position: relative;
    z-index: 1;
}

.metric-card > small,
.mini-stat > small {
    color: var(--muted);
    font-size: 0.78rem;
}

.panel-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    height: 100%;
    padding: 1.5rem;
}

.dashboard-columns {
    margin-bottom: 0.75rem !important;
}

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

.panel-card-header .title {
    color: var(--ink);
    margin: 0 !important;
}

.soft-badge {
    background: #edf3f0;
    border-radius: 999px;
    color: #51645c;
    display: inline-block;
    font-size: 0.67rem;
    font-weight: 750;
    padding: 0.32rem 0.62rem;
}

.payment-list {
    display: flex;
    flex-direction: column;
}

.payment-item {
    align-items: center;
    border-bottom: 1px solid #edf1ef;
    color: var(--ink);
    display: flex;
    gap: 0.95rem;
    padding: 0.82rem 0;
}

.payment-item:first-child {
    padding-top: 0;
}

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

.payment-item:hover .payment-main > strong {
    color: var(--green);
}

.date-tile {
    align-items: center;
    background: var(--green-soft);
    border-radius: 10px;
    color: var(--green-dark);
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    height: 3.25rem;
    justify-content: center;
    line-height: 1;
    width: 3.25rem;
}

.date-tile small {
    font-size: 0.58rem;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.date-tile strong {
    font-size: 1.25rem;
    margin-top: 0.2rem;
}

.payment-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.payment-main small {
    color: var(--muted);
    margin-top: 0.18rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payment-main code,
.endpoint-card code,
.service-card code {
    background: #eff4f1;
    color: var(--green-dark);
}

.payment-amount {
    white-space: nowrap;
}

.endpoint-card {
    background:
        linear-gradient(145deg, rgba(20, 35, 30, 0.96), rgba(23, 54, 75, 0.96)),
        var(--ink);
    border: 0;
    color: #dbe6e1;
    overflow: hidden;
    position: relative;
}

.endpoint-card::after {
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
    height: 14rem;
    position: absolute;
    right: -7rem;
    top: -7rem;
    width: 14rem;
}

.endpoint-card .eyebrow {
    color: #70dab5;
}

.endpoint-card .title {
    color: white;
}

.endpoint-card > p:not(.eyebrow, .help) {
    color: #adbfB7;
}

.endpoint-preview {
    align-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    display: flex;
    gap: 0.75rem;
    margin: 1.3rem 0 0.75rem;
    min-width: 0;
    padding: 0.75rem;
}

.endpoint-preview span {
    background: #56c89e;
    border-radius: 5px;
    color: #123629;
    font-size: 0.62rem;
    font-weight: 900;
    padding: 0.28rem 0.42rem;
}

.endpoint-preview code {
    background: none;
    color: white;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.endpoint-card pre {
    background: #0b1d17;
    border-radius: 10px;
    color: #70dab5;
    font-size: 0.85rem;
    margin: 0;
    padding: 0.9rem;
}

.endpoint-card .help {
    color: #90aaa0;
    margin-top: 0.75rem;
}

.endpoint-card .help code {
    background: none;
    color: #70dab5;
}

.app-table {
    background: transparent;
    color: var(--ink);
}

.app-table thead th {
    border-bottom: 1px solid var(--line);
    color: #77847f;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    padding: 0.7rem 0.75rem;
    text-transform: uppercase;
}

.app-table td {
    border-bottom: 1px solid #edf1ef;
    padding: 0.9rem 0.75rem;
    vertical-align: middle;
}

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

.client-link {
    align-items: center;
    color: var(--ink);
    display: flex;
    gap: 0.7rem;
}

.client-link > span:last-child,
.client-link:not(:has(.table-avatar)) {
    flex-direction: column;
}

.client-link strong,
.client-link small {
    display: block;
}

.client-link small,
.cell-stack small,
.subtle {
    color: var(--muted);
    font-size: 0.74rem;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.64rem 0;
}

.activity-dot {
    background: var(--green);
    border: 4px solid var(--green-soft);
    border-radius: 50%;
    flex: 0 0 auto;
    height: 0.9rem;
    margin-top: 0.18rem;
    width: 0.9rem;
}

.activity-item > div {
    display: flex;
    flex-direction: column;
}

.activity-item strong {
    font-size: 0.82rem;
}

.activity-item small {
    color: var(--muted);
    font-size: 0.7rem;
    margin-top: 0.17rem;
}

.empty-state {
    align-items: center;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 230px;
    padding: 2rem;
    text-align: center;
}

.empty-state.compact {
    min-height: 100px;
    padding: 1rem;
}

.empty-state strong {
    color: var(--ink);
    font-size: 1.05rem;
}

.empty-state p {
    margin: 0.35rem 0 1rem;
}

.empty-icon {
    align-items: center;
    background: var(--green-soft);
    border-radius: 50%;
    color: var(--green);
    display: flex;
    font-size: 1.5rem;
    height: 3.2rem;
    justify-content: center;
    margin-bottom: 0.8rem;
    width: 3.2rem;
}

.filter-card {
    height: auto;
    margin-bottom: 1rem;
    padding: 1rem;
}

.filter-form {
    align-items: center;
    display: flex;
    gap: 0.65rem;
}

.filter-form .field {
    margin: 0;
}

.search-field {
    flex: 1;
}

.status-field {
    width: 210px;
}

.input,
.textarea,
.select select {
    border-color: #cfddd6;
    border-radius: 10px;
    box-shadow: none;
    color: var(--ink);
}

.input:focus,
.textarea:focus,
.select select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 0.15rem rgba(22, 124, 90, 0.12);
}

.table-card {
    height: auto;
    padding: 0.7rem 1.15rem;
}

.clients-table .table-avatar {
    height: 2.6rem;
    width: 2.6rem;
}

.cell-stack {
    display: flex;
    flex-direction: column;
}

.service-count strong {
    color: var(--green-dark);
}

.status-pill {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 0.68rem;
    font-weight: 800;
    gap: 0.35rem;
    padding: 0.34rem 0.65rem;
}

.status-pill::before {
    background: currentColor;
    border-radius: 50%;
    content: "";
    height: 0.38rem;
    width: 0.38rem;
}

.status-pill.is-activo {
    background: var(--green-soft);
    color: var(--green-dark);
}

.status-pill.is-inactivo {
    background: #f9e6e9;
    color: var(--danger);
}

.form-section {
    height: auto;
    margin-bottom: 1.25rem;
    padding: 1.75rem;
}

.form-section-heading {
    align-items: flex-start;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
}

.form-section-heading > span {
    align-items: center;
    background: var(--green-soft);
    border-radius: 10px;
    color: var(--green-dark);
    display: flex;
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 850;
    height: 2.3rem;
    justify-content: center;
    width: 2.3rem;
}

.form-section-heading .title {
    margin: 0 0 0.2rem !important;
}

.form-section-heading p {
    color: var(--muted);
    font-size: 0.82rem;
}

.label {
    color: #36463f;
    font-size: 0.78rem;
    font-weight: 750;
}

.required {
    color: var(--danger);
}

.help {
    color: var(--muted);
}

.form-actions {
    align-items: center;
    display: flex;
    gap: 0.7rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.record-heading {
    align-items: center;
}

.record-title-row {
    align-items: center;
    display: flex;
    gap: 1.1rem;
}

.record-avatar {
    align-items: center;
    background: var(--navy);
    border-radius: 18px;
    color: white;
    display: flex;
    flex: 0 0 auto;
    font-family: Georgia, serif;
    font-size: 2rem;
    font-style: italic;
    height: 5.2rem;
    justify-content: center;
    width: 5.2rem;
}

.record-status-line {
    align-items: center;
    display: flex;
    gap: 0.7rem;
    margin-bottom: 0.55rem;
}

.record-number {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.record-title-row h1 {
    margin-bottom: 0.2rem !important;
}

.record-title-row p {
    color: var(--muted);
    font-size: 0.83rem;
}

.record-actions {
    align-items: center;
    display: flex;
    gap: 0.6rem;
}

.record-stats {
    margin-top: 0.5rem;
}

.mini-stat {
    min-height: 110px;
}

.mini-stat > strong {
    color: var(--ink);
    font-size: 1.75rem;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin: auto 0 0.2rem;
}

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

.service-card {
    border: 1px solid var(--line);
    border-radius: 15px;
    padding: 1.15rem;
}

.service-card.is-muted {
    background: #fbf8f8;
}

.service-card-top {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.client-suspended-note {
    color: var(--muted);
    display: block;
    font-size: 0.65rem;
    margin-top: 0.25rem;
}

.service-price {
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 800;
}

.service-price small {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 500;
}

.service-card h3 {
    color: var(--ink);
    font-size: 1.12rem;
    font-weight: 800;
    margin-top: 1rem;
}

.service-card > p {
    color: var(--muted);
    font-size: 0.78rem;
}

.identifier-box {
    align-items: center;
    background: #f3f7f5;
    border: 1px dashed #c6d7cf;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    margin: 1rem 0;
    padding: 0.7rem 0.8rem;
}

.identifier-box > div {
    display: flex;
    flex-direction: column;
}

.identifier-box small {
    color: var(--muted);
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.identifier-box code {
    background: transparent;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 750;
    padding: 0.15rem 0 0;
}

.copy-button {
    background: white;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--green-dark);
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 750;
    padding: 0.35rem 0.55rem;
}

.service-meta {
    display: grid;
    gap: 0.7rem;
    grid-template-columns: 1fr 1fr;
}

.service-meta > span {
    display: flex;
    flex-direction: column;
}

.service-meta small {
    color: var(--muted);
    font-size: 0.63rem;
}

.service-meta strong {
    font-size: 0.79rem;
}

.service-description {
    border-top: 1px solid var(--line);
    margin-top: 0.85rem;
    padding-top: 0.75rem;
}

.service-actions {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
    padding-top: 0.85rem;
}

.detail-card {
    height: auto;
}

.detail-list > div {
    border-bottom: 1px solid #edf1ef;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0;
}

.detail-list > div:first-child {
    padding-top: 0;
}

.detail-list > div:last-child {
    border: 0;
    padding-bottom: 0;
}

.detail-list dt {
    color: var(--muted);
    font-size: 0.65rem;
    font-weight: 750;
    letter-spacing: 0.05em;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
}

.detail-list dd {
    color: var(--ink);
    font-size: 0.83rem;
    overflow-wrap: anywhere;
}

.address-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.address-card {
    border-bottom: 1px solid var(--line);
    padding-bottom: 0.8rem;
}

.address-card:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.address-card > div {
    align-items: center;
    display: flex;
    gap: 0.5rem;
}

.address-card p {
    color: #4e5d57;
    font-size: 0.78rem;
    line-height: 1.5;
    margin: 0.4rem 0;
}

.address-card > small {
    color: var(--muted);
    display: block;
    font-size: 0.7rem;
    margin-bottom: 0.35rem;
}

.address-card > a {
    font-size: 0.7rem;
    font-weight: 750;
}

.public-body {
    background: #ecf2ef;
}

.public-main {
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(420px, 1.1fr);
    min-height: 100vh;
}

.auth-aside {
    background:
        radial-gradient(circle at 20% 80%, rgba(91, 219, 171, 0.18), transparent 18rem),
        linear-gradient(145deg, #102d26, #173d4c);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: clamp(2.5rem, 7vw, 7rem);
    position: relative;
}

.auth-aside::after {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    content: "";
    height: 28rem;
    position: absolute;
    right: -16rem;
    top: -10rem;
    width: 28rem;
}

.auth-aside .eyebrow {
    color: #6dd6af;
}

.auth-aside h1 {
    font-size: clamp(2.7rem, 5vw, 5rem);
    font-weight: 760;
    letter-spacing: -0.06em;
    line-height: 0.98;
    margin-bottom: 1.7rem;
}

.auth-aside h1 em {
    color: #74dcb5;
    font-family: Georgia, serif;
    font-weight: 400;
}

.auth-aside > p:not(.eyebrow) {
    color: #bfd1ca;
    font-size: 1rem;
    line-height: 1.7;
    max-width: 30rem;
}

.auth-feature {
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.13);
    display: flex;
    gap: 0.8rem;
    margin-top: 3rem;
    max-width: 30rem;
    padding-top: 1.5rem;
}

.feature-dot {
    background: #65d7ac;
    border: 5px solid rgba(101, 215, 172, 0.15);
    border-radius: 50%;
    height: 1.2rem;
    width: 1.2rem;
}

.auth-feature > div {
    display: flex;
    flex-direction: column;
}

.auth-feature small {
    color: #a9beb6;
}

.auth-panel {
    align-self: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(25, 57, 46, 0.12);
    justify-self: center;
    max-width: 520px;
    padding: clamp(2rem, 5vw, 4rem);
    width: calc(100% - 3rem);
}

.auth-panel-wide {
    grid-column: 1 / -1;
    max-width: 740px;
}

.auth-brand {
    align-items: center;
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.auth-brand .title {
    color: var(--ink);
    margin: 0 !important;
}

.auth-brand .eyebrow {
    margin-bottom: 0.25rem;
}

.auth-footnote {
    color: var(--muted);
    font-size: 0.7rem;
    margin-top: 1.5rem;
    text-align: center;
}

@media (max-width: 1023px) {
    .app-navbar .navbar-menu {
        border-top: 1px solid var(--line);
        box-shadow: 0 15px 30px rgba(26, 53, 43, 0.08);
    }

    .app-navbar .navbar-start > .navbar-item {
        margin: 0.2rem 0.7rem;
    }

    .service-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-main {
        padding: 1.5rem 0.85rem 3rem;
    }

    .page-heading,
    .record-heading {
        align-items: stretch;
        flex-direction: column;
        gap: 1rem;
    }

    .page-heading .title,
    .record-heading .title {
        font-size: 2rem;
    }

    .filter-form,
    .record-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .status-field {
        width: 100%;
    }

    .record-actions form,
    .record-actions .button {
        width: 100%;
    }

    .record-title-row {
        align-items: flex-start;
    }

    .record-avatar {
        border-radius: 14px;
        height: 3.7rem;
        width: 3.7rem;
    }

    .record-number {
        display: none;
    }

    .panel-card,
    .form-section {
        padding: 1.15rem;
    }

    .form-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-actions .button {
        width: 100%;
    }

    .auth-shell {
        display: block;
        padding: 1rem 0;
    }

    .auth-aside {
        display: none;
    }

    .auth-panel {
        border-radius: 18px;
        margin: 1rem auto;
        padding: 2rem 1.4rem;
    }
}

@media (max-width: 480px) {
    .record-title-row {
        gap: 0.75rem;
    }

    .record-title-row h1 {
        font-size: 1.65rem;
    }

    .service-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .service-actions form,
    .service-actions .button {
        width: 100%;
    }

    .payment-amount {
        display: none;
    }
}
