:root {
    color-scheme: light;
    --surface: #fffaf6;
    --panel: #ffffff;
    --ink: #343c50;
    --muted: #71717c;
    --brand: #a43c5b;
    --brand-strong: #343c50;
    --line: #e6e2e6;
    --warning: #9a5a00;
    --critical: #a12d2d;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--surface);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: var(--brand); }

.page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
    background: #10231f;
    color: #f6faf8;
}

.navbar-brand {
    color: #f6faf8;
    font-weight: 700;
    text-decoration: none;
}

.nav-link {
    color: #d8e6e0;
    border-radius: 8px;
    margin: 0.25rem 0;
}

.nav-link.active, .nav-link:hover {
    background: #1d3a34;
    color: #ffffff;
}

.content {
    padding: clamp(1rem, 3vw, 2.5rem);
}

.wallet-shell {
    max-width: 1180px;
    margin: 0 auto;
}

.wallet-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 520px);
    gap: 1.5rem;
    align-items: stretch;
    margin-bottom: 1.5rem;
}

.wallet-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 4rem);
    line-height: 1;
    max-width: 720px;
}

.eyebrow {
    margin: 0 0 0.65rem;
    color: var(--brand);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0;
}

.hero-metrics, .quick-action, .dashboard-grid article, .template-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.hero-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    overflow: hidden;
}

.hero-metrics div {
    padding: 1.2rem;
    border-left: 1px solid var(--line);
}

.hero-metrics div:first-child { border-left: 0; }

.hero-metrics strong {
    display: block;
    font-size: clamp(1.25rem, 2vw, 1.8rem);
}

.hero-metrics span, .template-card span, .renewal-list small, .quick-action p, .review-list p {
    color: var(--muted);
}

.quick-action {
    display: grid;
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-color: #b7d7cd;
}

.quick-action h2, .dashboard-grid h2, .template-card h3 {
    margin-top: 0;
}

.template-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.template-card {
    padding: 1rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.dashboard-grid article {
    padding: 1.25rem;
}

.review-list, .renewal-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.review-list li, .renewal-list li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.favorite-list li {
    padding: 0;
}

.favorite-link {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 0.75rem;
    width: 100%;
    padding: 0.85rem;
    color: inherit;
    text-decoration: none;
}

.favorite-link:hover {
    background: #eef8f4;
}

.favorite-link.disabled {
    pointer-events: none;
}

.favorite-link strong,
.favorite-link small {
    display: block;
}

.renewal-list li {
    grid-template-columns: 110px minmax(0, 1fr);
}

.severity {
    min-width: 72px;
    text-align: center;
    border-radius: 999px;
    padding: 0.25rem 0.5rem;
    background: #fff4df;
    color: var(--warning);
    font-weight: 700;
    font-size: 0.82rem;
}

@media (max-width: 900px) {
    .page, .wallet-hero, .quick-action, .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .hero-metrics, .template-list {
        grid-template-columns: 1fr;
    }

    .hero-metrics div {
        border-left: 0;
        border-top: 1px solid var(--line);
    }

    .hero-metrics div:first-child { border-top: 0; }
}

.blazor-error-boundary {
    background: #a12d2d;
    color: white;
    padding: 1rem;
}

.template-list.compact {
    grid-template-columns: 1fr;
    margin-top: 1rem;
}

.prepared-card {
    background: #f9fbf8;
    border: 1px solid #b7d7cd;
    border-radius: 8px;
    padding: 1rem;
}

.prepared-card h3 {
    margin-top: 0;
}

.prepared-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.6rem;
}

.prepared-list li {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 0.75rem;
    align-items: start;
    padding: 0.75rem;
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.prepared-list li > span {
    display: inline-flex;
    justify-content: center;
    border-radius: 999px;
    padding: 0.2rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 700;
    background: #e5f3ee;
    color: var(--brand-strong);
}

.prepared-list li.not-selected > span {
    background: #f3eee5;
    color: #6d5633;
}

.prepared-list p {
    margin: 0.15rem 0 0;
    color: var(--muted);
}

.section-header {
    margin-bottom: 1rem;
}

.section-header h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.data-request-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 1rem;
}

.template-picker {
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.template-picker button {
    text-align: left;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    border-radius: 8px;
    padding: 0.95rem;
    cursor: pointer;
}

.template-picker button.active {
    border-color: #7ab8a8;
    background: #eef8f4;
}

.template-picker strong,
.template-picker span {
    display: block;
}

.template-picker span {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.data-request-workspace {
    display: grid;
    gap: 1rem;
}

.prepared-card.full {
    padding: 1rem;
}

.prepared-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.prepared-header h2,
.text-export h2 {
    margin: 0;
}

.primary-action {
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #ffffff;
    min-height: 42px;
    padding: 0 1rem;
    font-weight: 700;
    cursor: pointer;
}

.field-selector-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.field-selector-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    background: #ffffff;
}

.field-selector-list li.missing {
    opacity: 0.72;
}

.field-selector-list label {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
}

.field-selector-list input {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

.field-selector-list strong,
.field-selector-list small {
    display: block;
}

.field-selector-list small {
    margin-top: 0.15rem;
    color: var(--muted);
}

.field-selector-list em {
    font-style: normal;
    color: var(--muted);
    font-size: 0.82rem;
}

.text-export {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.text-export textarea {
    width: 100%;
    min-height: 220px;
    margin-top: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.85rem;
    resize: vertical;
    font: inherit;
    color: var(--ink);
    background: #fbfcfb;
}

@media (max-width: 900px) {
    .data-request-layout {
        grid-template-columns: 1fr;
    }

    .prepared-header {
        align-items: stretch;
        flex-direction: column;
    }
}

.contracts-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 1rem;
}

.contracts-list {
    display: grid;
    gap: 0.75rem;
    align-content: start;
}

.contracts-list button {
    text-align: left;
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--ink);
    border-radius: 8px;
    padding: 0.95rem;
    cursor: pointer;
}

.contracts-list button.active {
    border-color: #7ab8a8;
    background: #eef8f4;
}

.contracts-list strong,
.contracts-list span,
.contracts-list small {
    display: block;
}

.contracts-list span,
.contracts-list small {
    color: var(--muted);
    margin-top: 0.2rem;
}

.contract-detail {
    display: grid;
    gap: 1rem;
}

.contract-detail article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.contract-detail h2 {
    margin-top: 0;
}
.detail-heading {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.detail-heading h2 {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .detail-heading {
        flex-direction: column;
    }
}

.contract-detail dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.contract-detail dt {
    color: var(--muted);
    font-size: 0.82rem;
}

.contract-detail dd {
    margin: 0.15rem 0 0;
    font-weight: 700;
}

.price-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.5rem;
}

.price-history-list li {
    display: grid;
    grid-template-columns: 80px 1fr 90px;
    gap: 0.75rem;
    padding: 0.65rem;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.contract-detail textarea {
    width: 100%;
    min-height: 170px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.85rem;
    resize: vertical;
    font: inherit;
    background: #fbfcfb;
}

@media (max-width: 900px) {
    .contracts-layout,
    .contract-detail dl {
        grid-template-columns: 1fr;
    }
}

.calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.calendar-toolbar label {
    display: grid;
    gap: 0.3rem;
    color: var(--muted);
    font-weight: 700;
}

.calendar-toolbar input {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 0.75rem;
    color: var(--ink);
    background: #ffffff;
}

.calendar-agenda {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.calendar-agenda ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.7rem;
}

.calendar-agenda li {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 110px;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.8rem;
}

.calendar-agenda time {
    font-weight: 800;
    color: var(--brand-strong);
}

.calendar-agenda strong,
.calendar-agenda span {
    display: block;
}

.calendar-agenda span {
    color: var(--muted);
    margin-top: 0.15rem;
}

.calendar-agenda em {
    justify-self: end;
    font-style: normal;
    border-radius: 999px;
    background: #e5f3ee;
    color: var(--brand-strong);
    padding: 0.25rem 0.55rem;
    font-weight: 700;
    font-size: 0.82rem;
}

@media (max-width: 700px) {
    .calendar-agenda li {
        grid-template-columns: 1fr;
    }

    .calendar-agenda em {
        justify-self: start;
    }
}

.budget-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.budget-metrics article,
.charge-forecast {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.budget-metrics span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.budget-metrics strong {
    display: block;
    margin-top: 0.35rem;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.charge-forecast h2 {
    margin-top: 0;
}

.charge-forecast ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.charge-forecast li {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) 120px;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}

.charge-forecast time {
    color: var(--brand-strong);
    font-weight: 800;
}

.charge-forecast span {
    display: block;
    color: var(--muted);
}

.charge-forecast em {
    justify-self: end;
    font-style: normal;
    font-weight: 800;
}

@media (max-width: 700px) {
    .budget-metrics,
    .charge-forecast li {
        grid-template-columns: 1fr;
    }

    .charge-forecast em {
        justify-self: start;
    }
}

.search-box {
    margin-bottom: 1rem;
}

.search-box input {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 1rem;
    font: inherit;
    background: #ffffff;
    color: var(--ink);
}

.search-results {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.search-results ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.search-results li {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) 120px;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}

.search-results em {
    font-style: normal;
    border-radius: 999px;
    background: #e5f3ee;
    color: var(--brand-strong);
    padding: 0.25rem 0.55rem;
    font-weight: 700;
    text-align: center;
}

.search-results strong,
.search-results span {
    display: block;
}

.search-results span,
.search-results small {
    color: var(--muted);
}

.search-results small {
    justify-self: end;
}

@media (max-width: 700px) {
    .search-results li {
        grid-template-columns: 1fr;
    }

    .search-results em,
    .search-results small {
        justify-self: start;
    }
}

.documents-owner,
.documents-list {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.documents-owner span,
.documents-owner strong {
    display: block;
}

.documents-owner span {
    color: var(--muted);
    font-weight: 700;
}

.documents-list ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.65rem;
}

.documents-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 100px;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}

.documents-list strong,
.documents-list span {
    display: block;
}

.documents-list span,
.documents-list small {
    color: var(--muted);
}

.documents-list small {
    justify-self: end;
}

.notification-list {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.notification-list ol {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.75rem;
}

.notification-list li {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 110px;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.8rem;
}

.notification-list li > span {
    border-radius: 999px;
    padding: 0.25rem 0.55rem;
    text-align: center;
    font-weight: 800;
    background: #e5f3ee;
    color: var(--brand-strong);
}

.notification-list li.warning > span {
    background: #fff4df;
    color: #8a5200;
}

.notification-list li.critical > span {
    background: #ffe7e7;
    color: var(--critical);
}

.notification-list strong,
.notification-list p {
    display: block;
    margin: 0;
}

.notification-list p {
    color: var(--muted);
    margin-top: 0.15rem;
}

.notification-list time {
    justify-self: end;
    color: var(--muted);
    font-weight: 700;
}

@media (max-width: 700px) {
    .notification-list li {
        grid-template-columns: 1fr;
    }

    .notification-list time {
        justify-self: start;
    }
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.6rem;
}

.secondary-action {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--brand-strong);
    min-height: 42px;
    padding: 0 1rem;
    font-weight: 700;
    cursor: pointer;
}

.secondary-action:hover {
    border-color: #7ab8a8;
    background: #eef8f4;
}

.export-status {
    margin: 0.75rem 0 0;
    color: var(--brand-strong);
    font-weight: 700;
}
.entity-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.entity-grid article {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
}

.entity-grid header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.entity-grid h2 {
    margin: 0;
}

.entity-grid header span {
    min-width: 34px;
    border-radius: 999px;
    background: #e5f3ee;
    color: var(--brand-strong);
    text-align: center;
    padding: 0.25rem 0.55rem;
    font-weight: 800;
}

.entity-grid ol {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.65rem;
}

.entity-grid li {
    display: grid;
    gap: 0.15rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}

.entity-grid strong,
.entity-grid span,
.entity-grid small {
    display: block;
}

.entity-grid span,
.entity-grid small {
    color: var(--muted);
}
.entity-summary {
    min-width: 0;
}

.entity-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.entity-actions {
    margin-top: 0.55rem;
}

.entity-actions .secondary-action,
.entity-actions .danger-action {
    min-height: 34px;
    padding: 0 0.65rem;
}

@media (max-width: 900px) {
    .entity-grid {
        grid-template-columns: 1fr;
    }
}
.entity-editor {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.entity-editor header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.entity-editor h2 {
    margin: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
}

.form-grid label {
    display: grid;
    gap: 0.3rem;
    color: var(--muted);
    font-weight: 700;
}

.form-grid input,
.form-grid select {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 0.75rem;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.form-status {
    margin: 0.85rem 0 0;
    font-weight: 700;
}

.form-status.success {
    color: var(--brand-strong);
}

.form-status.error {
    color: var(--critical);
}

@media (max-width: 1000px) {
    .form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .entity-editor header,
    .editor-tabs,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .entity-editor header {
        align-items: stretch;
        flex-direction: column;
    }
}
.editor-tabs {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.editor-tabs button {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--ink);
    min-height: 38px;
    padding: 0 0.8rem;
    font-weight: 700;
    cursor: pointer;
}

.editor-tabs button.active,
.editor-tabs button:hover {
    border-color: #7ab8a8;
    background: #eef8f4;
    color: var(--brand-strong);
}

.form-submit {
    margin-top: 0.85rem;
}
.contract-editor {
    margin-bottom: 1rem;
}

.contract-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1000px) {
    .contract-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .contract-form-grid {
        grid-template-columns: 1fr;
    }
}
.offer-form {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.offer-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.offer-list {
    list-style: none;
    margin: 0.85rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.offer-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
}

.offer-list li.saving {
    border-color: #b7d7cd;
    background: #f4fbf8;
}

.offer-list strong,
.offer-list span,
.offer-list small {
    display: block;
}

.offer-list span,
.offer-list small {
    color: var(--muted);
}

.offer-list small {
    justify-self: end;
    font-weight: 800;
}

.offer-list li.saving small {
    color: var(--brand-strong);
}
.offer-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.offer-actions .secondary-action,
.offer-actions .danger-action {
    min-height: 34px;
    padding: 0 0.65rem;
}

@media (max-width: 900px) {
    .offer-form-grid,
    .offer-list li {
        grid-template-columns: 1fr;
    }

    .offer-list small,
    .offer-actions {
        justify-self: start;
    }
}
.document-upload {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.document-upload header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.document-upload h2 {
    margin: 0;
}

.documents-owner {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.documents-owner label {
    display: grid;
    gap: 0.35rem;
}

.documents-owner select,
.file-input input[type="file"] {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.55rem 0.75rem;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.document-form-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1000px) {
    .document-form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .documents-owner,
    .document-upload header,
    .document-form-grid {
        grid-template-columns: 1fr;
    }

    .document-upload header {
        align-items: stretch;
        flex-direction: column;
    }
}
.document-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.5rem;
}

.danger-action {
    border: 1px solid #e3b7b7;
    border-radius: 8px;
    background: #fff7f7;
    color: var(--critical);
    min-height: 42px;
    padding: 0 1rem;
    font-weight: 700;
    cursor: pointer;
}

.danger-action:hover {
    background: #ffe7e7;
}

@media (max-width: 700px) {
    .document-actions {
        justify-content: flex-start;
    }
}
.backup-panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.backup-panel header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.backup-panel h2 {
    margin: 0;
}

.backup-id-input {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-weight: 700;
}

.backup-id-input input {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 0.75rem;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.backup-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.85rem 0 0;
}

.backup-summary div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.75rem;
    min-width: 0;
}

.backup-summary dt {
    color: var(--muted);
    font-size: 0.82rem;
}

.backup-summary dd {
    margin: 0.15rem 0 0;
    font-weight: 800;
    overflow-wrap: anywhere;
}

@media (max-width: 700px) {
    .backup-panel header,
    .backup-summary {
        grid-template-columns: 1fr;
    }

    .backup-panel header {
        align-items: stretch;
        flex-direction: column;
    }
}
.contract-organization-header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.contract-organization-header h2 {
    margin: 0.15rem 0 0;
}

.tag-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border: 1px solid #b9d8cf;
    border-radius: 999px;
    background: #eef8f4;
    color: var(--brand-strong);
    padding: 0 0.7rem;
    font-size: 0.9rem;
    font-weight: 800;
}



.tag-color {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(11, 77, 68, 0.25);
    flex: 0 0 auto;
}

.tag-color-field input[type="color"] {
    width: 42px;
    min-width: 42px;
    padding: 0.2rem;
}
.tag-chip button {
    border: 0;
    background: transparent;
    color: var(--brand-strong);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0 0 0 0.45rem;
    text-decoration: underline;
}
.organization-create-form {
    margin-top: 0.75rem;
}

.organization-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: end;
}

.organization-form label {
    display: grid;
    gap: 0.35rem;
    color: var(--muted);
    font-weight: 700;
}

.organization-form select,
.organization-form input {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 0.75rem;
    color: var(--ink);
    background: #ffffff;
    font: inherit;
}

.secondary-action:disabled {
    cursor: default;
    opacity: 0.6;
}

@media (max-width: 640px) {
    .contract-organization-header,
    .organization-form {
        grid-template-columns: 1fr;
    }

    .contract-organization-header {
        display: grid;
    }
}









.document-preview, .document-sharing, .document-browser-actions { margin-top: 1rem; }
.document-preview img { display: block; max-width: 100%; max-height: 70vh; object-fit: contain; margin-top: 1rem; }
.document-preview pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 65vh; overflow: auto; padding: 1rem; background: var(--panel); border: 1px solid var(--line); }
.document-actions { flex-wrap: wrap; }

.calendar-month-grid { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:.35rem; margin:1rem 0; }
.calendar-month-grid article { border:1px solid #dbe5e1; border-radius:.5rem; padding:.4rem; min-height:5rem; overflow-wrap:anywhere; }
.calendar-month-grid article ul { padding-left:1rem; font-size:.8rem; }
.calendar-month-grid time { font-weight:700; }
@media(max-width:600px) { .calendar-month-grid article { padding:.2rem; min-height:3rem; } .calendar-month-grid article ul { padding-left:.65rem; font-size:.65rem; } }

.workspace-field { display:flex; flex-direction:column; gap:.4rem; min-width:0; }
.workspace-field > span:first-child { font-weight:600; }

.account-shell { max-width: 960px; margin: 0 auto; padding: 2rem 1.25rem; }
.account-brand { display: inline-block; margin-bottom: 1.5rem; font-size: 1.35rem; font-weight: 700; }
.registration-location { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1rem 0; }
.registration-location label { display: flex; flex-direction: column; gap: .4rem; }
.registration-location select { width: 100%; min-width: 0; padding: .65rem; border: 1px solid #bacbc4; border-radius: 8px; background: white; color: #173b2e; }
.registration-location small { grid-column: 1 / -1; }
.admin-count { padding: 1.25rem; background: #edf5f1; border-radius: .75rem; }
.admin-count strong { font-size: 2rem; margin-right: .5rem; }
.admin-table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.admin-table th, .admin-table td { padding: .9rem; text-align: left; border-bottom: 1px solid #dbe5e1; overflow-wrap: anywhere; }
.admin-table caption { caption-side: top; }
.admin-pagination { display: flex; justify-content: space-between; gap: 1rem; margin: 1rem 0 2rem; }
.admin-users form { margin-top: 1rem; }
@media (max-width: 600px) { .registration-location { grid-template-columns: 1fr; } }

/* Identity from docs/Diseños; shared by Web and MAUI. */
:root { --rose:#df6485; --pink:#ee9eb3; --sky:#b8d0dc; --mint:#b2e2d0; --yellow:#fbe5a4; --shadow:0 6px 16px #343c5012; }
* { box-sizing:border-box; }
button,input,select,textarea { font:inherit; }
button,a,input,select,textarea { touch-action:manipulation; }
:focus-visible { outline:3px solid #a43c5b; outline-offset:4px; }
a,button,p,dd,strong { overflow-wrap:anywhere; }
.page > main { min-width:0; }
h1,h2,h3 { font-weight:750; color:var(--ink); }
.home-heading { margin:.5rem 0 1.75rem; }
.home-heading h1 { font-size:clamp(1.85rem,4vw,3.2rem); letter-spacing:-.035em; margin:0 0 .4rem; }
.home-heading p { color:var(--muted); margin:0; font-size:1.05rem; }
.monthly-card { background:#32394e; color:#fffaf6; border-radius:24px; padding:clamp(1.3rem,3vw,2rem); margin-bottom:1.25rem; }
.monthly-card-top { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.monthly-card h2 { color:#efa9bc; font-size:.95rem; text-transform:uppercase; margin:0; letter-spacing:.025em; }
.monthly-card-top > span { flex-shrink:0; background:#4b5268; color:#dce9a9; border-radius:40px; padding:.6rem 1rem; font-weight:700; }
.monthly-total { display:block; font-size:clamp(2.4rem,6vw,4rem); line-height:1.2; margin:.8rem 0 .4rem; }
.monthly-card p { color:#d2d2dc; }
.monthly-card > a { display:flex; align-items:center; justify-content:space-between; color:#fffaf6; border-top:6px solid var(--rose); padding-top:1rem; font-weight:650; text-decoration:none; }
.monthly-card > a span { color:var(--yellow); font-size:1.5rem; }
.savings-banner { display:flex; align-items:center; gap:1rem; padding:1.25rem; background:#dce9a9; border-radius:22px; margin-bottom:1.25rem; }
.savings-icon { background:white; color:#3d6851; border-radius:50%; width:56px; height:56px; flex:0 0 56px; display:grid; place-items:center; font-size:2rem; }
.savings-banner div > span { display:block; text-transform:uppercase; color:#3d6851; font-size:.8rem; font-weight:750; }
.savings-banner strong { display:block; font-size:1.5rem; }
.charge-cards { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:1rem; margin-bottom:2rem; }
.charge-card { position:relative; display:flex; gap:.8rem; padding:1.1rem 1rem 2.5rem; background:white; color:var(--ink); text-decoration:none; border-radius:18px; box-shadow:var(--shadow); min-width:0; }
.charge-card:hover { color:var(--ink); box-shadow:0 7px 20px #343c5028; }
.charge-icon { width:42px; height:42px; background:var(--sky); border-radius:50%; flex:0 0 42px; display:grid; place-items:center; font-size:1.5rem; }
.charge-card h2 { margin:.25rem 0; font-size:1rem; }
.charge-card time { display:block; color:var(--muted); font-size:.9rem; }
.charge-card strong { display:block; font-size:1.25rem; margin-top:.4rem; }
.card-arrow { position:absolute; bottom:.3rem; right:1rem; color:#91b5c7; font-size:2rem; }
.dashboard-grid { margin-bottom:1.5rem; }
.dashboard-grid > article,.quick-action,.entity-grid > article,.contract-detail > article { border-radius:18px; border-color:transparent; box-shadow:var(--shadow); }
.dashboard-grid > article:first-child { border-top:7px solid var(--rose); }
.review-list li { background:#fff7f9; border:0; }
.review-list .severity { background:var(--pink); color:#343c50; }
.quick-action { background:#f0f3fc; margin-top:1.5rem; }
.quick-action .template-card { background:#ffffff80; border:0; border-radius:14px; }
.form-status[role=note] { font-size:.8rem; font-weight:500; margin:0 0 1rem; color:var(--muted); }
.primary-action { background:var(--ink); border-color:var(--ink); color:white; border-radius:9px; min-height:46px; }
.primary-action:hover { background:#48516b; color:white; }
.secondary-action { display:inline-flex; align-items:center; justify-content:center; text-decoration:none; border-radius:9px; }
.secondary-action:hover { background:#f8e8ee; border-color:var(--rose); }
.contract-editor-disclosure { margin-bottom:1.5rem; background:white; border-radius:18px; box-shadow:var(--shadow); overflow:hidden; }
.contract-editor-disclosure > summary { cursor:pointer; list-style:none; padding:1.25rem; background:var(--ink); color:white; font-weight:750; display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.contract-editor-disclosure > summary::-webkit-details-marker { display:none; }
.contract-editor-disclosure > summary span { font-size:1.5rem; color:var(--pink); }
.contract-editor { border:0; margin:0; border-radius:0; padding:1.5rem; }
.contract-editor .eyebrow { color:#a43c5b; }
.contract-editor header { margin-bottom:1.5rem; }
.contract-form-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:1.2rem 1rem; }
.contract-form-grid label > span { font-size:.72rem; text-transform:uppercase; color:var(--ink); }
.contract-form-grid input,.contract-form-grid select,.contract-form-grid textarea { width:100%; min-width:0; border:1px solid transparent; border-radius:7px; min-height:52px; font-weight:500; background:var(--mint); padding:.8rem; color:var(--ink); }
.contract-form-grid .field-identity input { background:#a8cde6; }
.contract-form-grid .field-price input,.contract-form-grid .field-price select { background:var(--yellow); }
.contract-form-grid .field-dates input,.contract-form-grid .field-dates select { background:#efa0b4; }
.contract-form-grid input[type=checkbox] { width:24px; height:24px; min-height:24px; accent-color:#a43c5b; justify-self:start; }
.contract-form-grid .field-notes { grid-column:1 / -1; }
.contract-form-grid textarea { background:#f0f3fc; min-height:140px; resize:vertical; }
.contract-editor form > fieldset > p { font-size:.85rem; color:var(--muted); }
.contracts-list button { border-radius:14px; background:white; border-color:var(--line); color:var(--ink); text-align:left; }
.contracts-list button.active { background:#fae4eb; border-color:var(--rose); color:var(--ink); }
.contract-overview { padding:0 !important; overflow:hidden; }
.contract-overview .detail-heading { background:var(--pink); padding:1.5rem; margin:0; flex-wrap:wrap; }
.contract-overview .detail-heading .eyebrow { color:var(--ink); }
.contract-overview .detail-heading h2 { text-transform:uppercase; font-size:1.4rem; }
.contract-overview .detail-heading .entity-actions { margin:0; }
.contract-overview > dl { padding:1.25rem; margin:0; }
.renewal-banner { background:#b63d61; color:white; margin:1.25rem; padding:1rem; border-radius:10px; }
.renewal-banner strong,.renewal-banner span { display:block; }
.contract-price { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:1rem; padding:1.25rem; }
.contract-price p { font-weight:750; text-transform:uppercase; margin:0; }
.contract-price strong { font-size:clamp(2rem,5vw,3.6rem); letter-spacing:-.035em; }
.contact-actions { display:flex; gap:.5rem; }
.contact-actions a { display:grid; place-items:center; min-height:48px; padding:.7rem 1rem; background:var(--ink); color:#c3d8e3; border-radius:9px; text-decoration:none; font-weight:650; }
.contract-notes { background:#f0f3fc; margin:0 1.25rem 1rem; padding:1.25rem; border-radius:10px; }
.contract-notes h3 { text-transform:uppercase; font-size:1rem; }
.contract-notes p { margin:0; white-space:pre-wrap; }
.price-chart { background:#f0f3fc; border-radius:12px; padding:1rem; margin:1rem 0; }
.price-bars { display:flex; align-items:end; gap:1rem; overflow-x:auto; padding-bottom:1rem; }
.price-bar-column { flex:1 0 86px; text-align:center; }
.price-bar-track { height:160px; display:flex; align-items:end; justify-content:center; }
.price-bar { background:var(--rose); width:min(48px,75%); }
.price-bar-column strong,.price-bar-column time { display:block; margin-top:.4rem; font-size:.85rem; }
.price-chart figcaption { font-size:.8rem; color:var(--muted); }
@media (max-width:1150px) { .charge-cards { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:900px) { .page > .sidebar { display:block; } .dashboard-grid { grid-template-columns:1fr; } }
@media (max-width:640px) {
 .home-heading { margin-top:0; } .home-heading p { font-size:.9rem; }
 .monthly-card-top { gap:.5rem; } .monthly-card h2 { font-size:.8rem; } .monthly-card-top > span { font-size:.8rem; padding:.5rem .65rem; }
 .charge-cards { gap:.75rem; } .charge-card { flex-direction:column; padding:1rem 1rem 2rem; } .charge-card strong { font-size:1.1rem; }
 .contract-editor { padding:1rem; } .contract-form-grid { grid-template-columns:minmax(0,1fr); }
 .contract-overview .detail-heading { padding:1rem; } .contract-overview dl { grid-template-columns:minmax(0,1fr); } .quick-action { grid-template-columns:minmax(0,1fr); }
}
