html,
body {
    font-family: Segoe UI, Arial, sans-serif;
    background: #f4f6f5;
    color: #1f2933;
}

a,
.btn-link {
    color: #0b6b48;
}

.btn-primary {
    color: #fff;
    background-color: #0f7a53;
    border-color: #0f7a53;
}

.btn-primary:hover {
    background-color: #0b6b48;
    border-color: #0b6b48;
}

.btn,
.form-control {
    border-radius: 6px;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    border-color: #0f7a53;
    box-shadow: 0 0 0 0.16rem rgba(15, 122, 83, 0.18);
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

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

.page-header h1 {
    font-size: 1.45rem;
    margin: 0;
    font-weight: 650;
}

.page-header p {
    color: #667085;
    margin: 0.25rem 0 0;
}

.admin-table-wrap,
.edit-surface,
.empty-state,
.qr-surface,
.login-panel {
    background: #fff;
    border: 1px solid #dbe4df;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

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

.admin-table {
    min-width: 1080px;
    margin-bottom: 0;
}

.admin-table th {
    color: #53625a;
    font-size: 0.74rem;
    text-transform: uppercase;
    white-space: nowrap;
    background: #f8faf9;
    border-bottom-color: #dbe4df;
}

.admin-table td {
    vertical-align: middle;
}

.muted {
    color: #667085;
    font-size: 0.8rem;
}

.action-cell {
    white-space: nowrap;
}

.action-cell .btn {
    margin: 0.12rem;
}

.edit-surface {
    padding: 1rem;
    margin-bottom: 1rem;
}

.form-section {
    margin-bottom: 1.25rem;
}

.form-section h2,
.edit-surface h2 {
    font-size: 1rem;
    margin-bottom: 0.85rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
}

.form-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 0.9rem;
}

.form-grid label,
.form-stack label {
    display: grid;
    gap: 0.3rem;
    font-weight: 600;
    color: #344054;
}

.form-grid small {
    color: #667085;
    font-weight: 400;
}

.toggle-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.9rem;
}

.toggle-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.form-actions {
    display: flex;
    gap: 0.75rem;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1rem;
    background:
        linear-gradient(135deg, rgba(15, 122, 83, 0.08), rgba(31, 41, 51, 0.02) 38%),
        #f4f6f5;
}

.login-panel {
    width: min(440px, 100%);
    padding: 1.55rem;
}

.login-panel h1 {
    font-size: 1.35rem;
    margin: 0;
    font-weight: 700;
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
}

.login-kicker {
    display: block;
    color: #607067;
    font-size: 0.78rem;
    font-weight: 650;
    text-transform: uppercase;
}

.login-copy {
    color: #607067;
    margin-bottom: 1rem;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    border-radius: 7px;
    background: #0f7a53;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
}

.brand-mark.large {
    width: 2.7rem;
    height: 2.7rem;
    font-size: 0.88rem;
}

.form-stack {
    display: grid;
    gap: 0.9rem;
}

.empty-state {
    padding: 1.4rem;
}

.empty-state h2 {
    font-size: 1.05rem;
}

.api-key-alert {
    display: grid;
    gap: 0.45rem;
}

.json-box {
    background: #17211c;
    color: #d8eee4;
    border-radius: 8px;
    padding: 1rem;
    overflow: auto;
    min-height: 160px;
}

.qr-surface {
    display: inline-flex;
    padding: 1rem;
}

.qr-surface img {
    width: min(320px, 80vw);
    height: auto;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.text-bg-info {
    color: #064e3b !important;
    background-color: #d9f4e8 !important;
}

.text-bg-success {
    background-color: #0f7a53 !important;
}

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "Ocurrio un error.";
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: .82rem;
    color: #64748b;
}

.sidebar-logo-wrap {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.85rem;
}

.form-text {
    display: block;
    margin-top: 4px;
    font-size: .82rem;
    color: #64748b;
}

.sidebar-brand {
    min-height: 88px;
    padding: 0.75rem 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand-inner {
    width: 100%;
    display: grid;
    justify-items: center;
    gap: 0.35rem;
}

.brand-lockup {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    color: #fff;
    text-decoration: none;
}

.sidebar-brand-mark {
    background: #ffffff;
    color: #0f7a53;
}

.brand-title {
    font-weight: 750;
    font-size: 1rem;
    line-height: 1;
}

.brand-subtitle {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-align: center;
}

.sidebar-nav {
    padding-top: 0.65rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.form-grid .form-control {
    min-height: 38px;
}

.form-grid input.form-control {
    height: 38px;
}

.form-grid label {
    align-content: start;
}

.edit-surface input.form-control {
    height: 38px;
    min-height: 38px;
}

.page {
    position: relative;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

.sidebar {
    background: #17211c;
}

.top-row {
    background-color: #ffffff;
    border-bottom: 1px solid #dbe4df;
    justify-content: flex-end;
    height: 3.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.top-context {
    color: #66736b;
    margin-right: auto;
    font-size: 0.86rem;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.8rem;
    padding: 0 0.65rem;
    border: 1px solid #dbe4df;
    border-radius: 999px;
    color: #1f2933;
    background: #f8faf9;
    font-size: 0.86rem;
}

.top-row a,
.top-row .btn-link {
    white-space: nowrap;
    margin-left: 1.5rem;
    text-decoration: none;
}

.top-row a:hover,
.top-row .btn-link:hover {
    text-decoration: underline;
}

.top-row a:first-child {
    overflow: hidden;
    text-overflow: ellipsis;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.navbar-toggler {
    appearance: none;
    cursor: pointer;
    width: 3.5rem;
    height: 2.5rem;
    color: white;
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.55%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") no-repeat center/1.75rem rgba(255, 255, 255, 0.1);
}

.navbar-toggler:checked {
    background-color: rgba(255, 255, 255, 0.5);
}

.sidebar .top-row {
    height: 3.5rem;
    background-color: rgba(0, 0, 0, 0.18);
}

.navbar-brand {
    font-size: 0.95rem;
}

.brand-lockup small {
    display: block;
    color: #a6b5ad;
    font-size: 0.72rem;
    font-weight: 500;
    margin-top: 0.12rem;
}

.bi {
    display: inline-block;
    position: relative;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.75rem;
    top: -1px;
    background-size: cover;
}

.bi-house-door-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-house-door-fill' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 14.5v-3.505c0-.245.25-.495.5-.495h2c.25 0 .5.25.5.5v3.5a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5v-7a.5.5 0 0 0-.146-.354L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293L8.354 1.146a.5.5 0 0 0-.708 0l-6 6A.5.5 0 0 0 1.5 7.5v7a.5.5 0 0 0 .5.5h4a.5.5 0 0 0 .5-.5Z'/%3E%3C/svg%3E");
}

.bi-plus-square-fill-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-plus-square-fill' viewBox='0 0 16 16'%3E%3Cpath d='M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H2zm6.5 4.5v3h3a.5.5 0 0 1 0 1h-3v3a.5.5 0 0 1-1 0v-3h-3a.5.5 0 0 1 0-1h3v-3a.5.5 0 0 1 1 0z'/%3E%3C/svg%3E");
}

.bi-list-nested-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-list-nested' viewBox='0 0 16 16'%3E%3Cpath fill-rule='evenodd' d='M4.5 11.5A.5.5 0 0 1 5 11h10a.5.5 0 0 1 0 1H5a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 3 7h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm-2-4A.5.5 0 0 1 1 3h10a.5.5 0 0 1 0 1H1a.5.5 0 0 1-.5-.5z'/%3E%3C/svg%3E");
}

.bi-person-badge-nav-menu {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='white' class='bi bi-person-badge' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 2a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1h-3zM11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0z'/%3E%3Cpath d='M4.5 0A2.5 2.5 0 0 0 2 2.5v11A2.5 2.5 0 0 0 4.5 16h7a2.5 2.5 0 0 0 2.5-2.5v-11A2.5 2.5 0 0 0 11.5 0h-7zM3 2.5A1.5 1.5 0 0 1 4.5 1h7A1.5 1.5 0 0 1 13 2.5v11a1.5 1.5 0 0 1-1.5 1.5h-7A1.5 1.5 0 0 1 3 13.5v-11z'/%3E%3C/svg%3E");
}

.nav-item {
    font-size: 0.9rem;
    padding-bottom: 0.5rem;
}

.nav-item:first-of-type {
    padding-top: 1rem;
}

.nav-item:last-of-type {
    padding-bottom: 1rem;
}

.nav-item .nav-link {
    color: #d9e4df;
    background: none;
    border: none;
    border-radius: 4px;
    height: 3rem;
    display: flex;
    align-items: center;
    line-height: 3rem;
    width: 100%;
}

.nav-item a.active {
    background-color: rgba(15, 122, 83, 0.28);
    border-left: 3px solid #24c57a;
    color: white;
}

.nav-item .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.nav-scrollable {
    display: none;
}

.navbar-toggler:checked ~ .nav-scrollable {
    display: block;
}

@media (max-width: 640.98px) {
    .top-row {
        justify-content: space-between;
    }

    .top-row a,
    .top-row .btn-link {
        margin-left: 0;
    }
}

@media (min-width: 641px) {
    .page {
        flex-direction: row;
    }

    .sidebar {
        width: 250px;
        height: 100vh;
        position: sticky;
        top: 0;
    }

    .top-row {
        position: sticky;
        top: 0;
        z-index: 1;
    }

    .top-row.auth a:first-child {
        flex: 1;
        text-align: right;
        width: 0;
    }

    .top-row,
    article {
        padding-left: 2rem !important;
        padding-right: 1.5rem !important;
    }

    .navbar-toggler {
        display: none;
    }

    .nav-scrollable {
        display: block;
        height: calc(100vh - 3.5rem);
        overflow-y: auto;
    }
}
