* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--typography-texto-base-family, var(--font-family-base, "Segoe UI", Arial, sans-serif));
}

:root {
    --color-primary: #0b1a2c;
    --color-primary-hover: #c5a059;
    --color-background-start: #0b1a2c;
    --color-background-end: #13253d;
    --color-text: #0b1a2c;
    --color-text-muted: #64748b;
    --color-surface: #ffffff;
    --color-sidebar: #0b1a2c;
    --font-family-base: "Segoe UI", Arial, sans-serif;
    --font-family-heading: "Segoe UI", Arial, sans-serif;
}

body {
    min-height: 100vh;
    background: linear-gradient(120deg, var(--color-background-start), var(--color-background-end));
    color: var(--color-text);
}

body:has(.app-shell) {
    height: 100vh;
    overflow: hidden;
}

.auth-page {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: row;
}

.auth-panel-brand {
    width: 70%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    background: linear-gradient(135deg, var(--color-background-start) 0%, var(--color-primary-hover) 55%, var(--color-primary) 100%);
    color: #ffffff;
}

.auth-brand-content {
    max-width: 520px;
}

.auth-brand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.15);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
}

.auth-brand-title {
    margin-bottom: 16px;
    color: #ffffff;
    font-size: 2.4rem;
    line-height: 1.15;
    font-family: var(--font-family-heading, "Segoe UI", Arial, sans-serif);
}

.auth-brand-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
}

.auth-panel-form {
    width: 30%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 28px;
    background: var(--color-surface);
}

.auth-panel-form .auth-card {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.app-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    background: linear-gradient(120deg, var(--color-background-start), var(--color-background-end));
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    height: 100%;
    background: var(--color-sidebar);
    color: #e2e8f0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    transition: width 0.25s ease;
    z-index: 30;
    overflow: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: #ffffff;
    min-width: 0;
}

.sidebar-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.sidebar-brand-text {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.sidebar-collapse-btn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.sidebar-collapse-btn svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.25s ease;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-footer {
    padding: 12px 10px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: #cbd5e1;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-link svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
    flex-shrink: 0;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-link.is-active {
    background: var(--color-primary);
    color: #ffffff;
}

.sidebar-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-group-toggle {
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.sidebar-group-toggle .sidebar-chevron {
    width: 18px;
    height: 18px;
    fill: currentColor;
    margin-left: auto;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.sidebar-group.is-open .sidebar-group-toggle .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-subnav {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding-left: 20px;
    margin-left: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-group.is-open .sidebar-subnav {
    display: flex;
}

.sidebar-sublink {
    display: block;
    padding: 8px 12px;
    border-radius: 10px;
    text-decoration: none;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-sublink:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.sidebar-sublink.is-active {
    background: rgba(37, 99, 235, 0.22);
    color: #ffffff;
}

.app-shell.sidebar-collapsed .sidebar-group-toggle .sidebar-chevron,
.app-shell.sidebar-collapsed .sidebar-subnav {
    display: none;
}

.sidebar-link-danger {
    color: #fca5a5;
}

.sidebar-link-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fecaca;
}

.sidebar-label {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.app-shell.sidebar-collapsed .sidebar {
    width: 76px;
}

.app-shell.sidebar-collapsed .sidebar-brand-text,
.app-shell.sidebar-collapsed .sidebar-label {
    display: none;
}

.app-shell.sidebar-collapsed .sidebar-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 0;
}

.app-shell.sidebar-collapsed .sidebar-brand {
    justify-content: center;
    gap: 0;
}

.app-shell.sidebar-collapsed .sidebar-collapse-btn {
    width: 36px;
    height: 36px;
}

.app-shell.sidebar-collapsed .sidebar-collapse-btn svg {
    transform: rotate(180deg);
}

.app-shell.sidebar-collapsed .sidebar-nav,
.app-shell.sidebar-collapsed .sidebar-footer {
    align-items: center;
    padding-inline: 0;
}

.app-shell.sidebar-collapsed .sidebar-link {
    justify-content: center;
    align-items: center;
    gap: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    margin-inline: auto;
}

.app-main {
    flex: 1;
    min-width: 0;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.app-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    color: #ffffff;
}

.sidebar-mobile-toggle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    margin: 0;
    padding: 10px;
    cursor: pointer;
}

.sidebar-mobile-toggle span {
    width: 100%;
    height: 3px;
    border-radius: 20px;
    background: var(--color-surface);
}

.app-topbar-user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.app-topbar-name {
    font-size: 14px;
    font-weight: 600;
}

.app-topbar-level {
    font-size: 12px;
    opacity: 0.85;
}

.app-content {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
}

.sidebar-backdrop {
    display: none;
}

.dashboard-card {
    width: 100%;
    max-width: none;
    flex: 1;
    min-height: calc(100vh - 32px);
    margin: 0;
    background: var(--color-surface);
    border-radius: 18px;
    padding: 28px 32px;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.25);
}

.auth-card {
    width: 100%;
    background: var(--color-surface);
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.25);
}

.register-card {
    max-width: none;
}

h1,
h2,
h3 {
    font-family: var(--typography-titulos-family, var(--font-family-heading, "Segoe UI", Arial, sans-serif));
    font-weight: var(--typography-titulos-weight, 600);
}

h1 {
    margin-bottom: 8px;
    color: var(--color-text);
}

.subtitle {
    margin-bottom: 20px;
    color: var(--color-text-muted);
}

.form-grid {
    display: grid;
    gap: 10px;
}

.two-cols {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.two-cols .full-width {
    grid-column: 1 / -1;
}

label {
    display: block;
    margin-bottom: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    box-sizing: border-box;
    background: var(--color-surface);
}

textarea {
    min-height: 88px;
    resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(197, 160, 89, 0.25);
}

.password-field {
    position: relative;
}

.password-field input {
    padding-right: 44px;
}

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.password-toggle:hover {
    background: #f1f5f9;
    color: #334155;
}

.password-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

button,
.logout-btn {
    margin-top: 8px;
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    text-decoration: none;
    border-radius: 12px;
    padding: 12px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

button:hover,
.logout-btn:hover {
    background: var(--color-primary-hover);
}

.switch-link {
    margin-top: 12px;
    font-size: 14px;
    color: var(--color-text-muted);
}

.switch-link a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 12px;
}

.user-profile {
    display: flex;
    gap: 16px;
    align-items: center;
}

.user-profile img,
.avatar-fallback {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: 700;
    color: var(--color-text);
}

.user-data p {
    margin-top: 6px;
    color: #334155;
}

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

.users-card th,
.users-card td {
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    padding: 10px 8px;
    font-size: 14px;
}

.users-card th {
    color: var(--color-text-muted);
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}

.list-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.colors-save-form {
    margin: 0;
}

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

.mt-16 {
    margin-top: 16px;
}

.link-action {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.check-row input {
    width: auto;
}

.settings-section {
    margin-top: 8px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.settings-section-header {
    margin-bottom: 18px;
}

.settings-section-header h2 {
    margin-bottom: 6px;
    font-size: 1.15rem;
    color: var(--color-text);
}

.settings-section-header p {
    color: var(--color-text-muted);
    font-size: 14px;
}

.color-field-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-field-row input[type="color"] {
    width: 38px;
    height: 32px;
    padding: 2px;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid #dbe2ea;
    border-radius: 6px;
}

.color-field-row input[type="text"] {
    flex: 1;
}

.field-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.subtitle code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
}

table code {
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 6px;
}

.color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #dbe2ea;
    vertical-align: middle;
    margin-right: 8px;
}

.typography-preview {
    display: inline-block;
    line-height: 1;
}

.table-inline-input {
    width: 100%;
    min-width: 120px;
    border: 1px solid #dbe2ea;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 14px;
    outline: none;
}

.table-inline-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.table-placeholder {
    color: var(--color-text-muted);
    font-size: 13px;
}

.color-row-new,
.color-row.is-editing {
    background: #f8fafc;
}

.color-row-view-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.color-row-view-swatch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.color-row .color-row-edit {
    display: none !important;
}

.color-row.is-editing .color-row-edit {
    display: block !important;
}

.color-row.is-editing .color-field-row.color-row-edit {
    display: flex !important;
}

.color-row.is-editing .color-row-view {
    display: none !important;
}

.color-row-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.btn-save-inline {
    margin: 0;
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-save-inline:hover {
    background: var(--color-primary-hover);
}

.btn-cancel-inline {
    margin: 0;
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    background: #f1f5f9;
    color: var(--color-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.btn-cancel-inline:hover {
    background: #e2e8f0;
}

.table-empty-row td {
    color: var(--color-text-muted);
    text-align: center;
    padding: 24px 12px;
}

.token-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.inline-form {
    display: inline;
    margin: 0;
}

.btn-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: #dc2626;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-edit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--color-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-edit svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.btn-edit:hover {
    background: #eff6ff;
    color: var(--color-primary-hover);
}

.btn-edit:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-delete svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.btn-delete:hover {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:focus-visible {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

.token-form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    margin-top: 8px;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.token-form {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

@media (max-width: 900px) {
    .auth-page {
        flex-direction: column;
    }

    .auth-panel-brand,
    .auth-panel-form {
        width: 100%;
    }

    .auth-panel-brand {
        min-height: 42vh;
        padding: 32px 24px;
    }

    .auth-brand-title {
        font-size: 2rem;
    }

    .auth-panel-form {
        flex: 1;
        padding: 32px 24px 40px;
    }

    .app-shell {
        flex-direction: column;
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    }

    .app-shell.sidebar-mobile-open .sidebar {
        transform: translateX(0);
        box-shadow: 8px 0 30px rgba(15, 23, 42, 0.35);
    }

    .app-shell.sidebar-mobile-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 20;
    }

    .app-main {
        height: 100%;
        min-height: 0;
        overflow-y: auto;
    }

    .app-topbar {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 10;
        background: linear-gradient(120deg, var(--color-background-start), var(--color-background-end));
    }

    .app-content {
        padding: 12px;
    }

    .dashboard-card {
        min-height: calc(100vh - 76px);
        padding: 20px 16px;
        border-radius: 14px;
    }

    .app-shell.sidebar-collapsed .sidebar {
        width: 260px;
    }

    .app-shell.sidebar-collapsed .sidebar-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 18px 16px;
    }

    .app-shell.sidebar-collapsed .sidebar-brand {
        gap: 12px;
    }

    .app-shell.sidebar-collapsed .sidebar-collapse-btn {
        width: 34px;
        height: 34px;
    }

    .app-shell.sidebar-collapsed .sidebar-brand-text,
    .app-shell.sidebar-collapsed .sidebar-label {
        display: block;
    }

    .app-shell.sidebar-collapsed .sidebar-nav,
    .app-shell.sidebar-collapsed .sidebar-footer {
        align-items: stretch;
        padding-inline: 10px;
    }

    .app-shell.sidebar-collapsed .sidebar-link {
        justify-content: flex-start;
        gap: 12px;
        width: auto;
        height: auto;
        padding: 11px 12px;
        margin-inline: 0;
    }
}

@media (max-width: 720px) {
    .two-cols {
        grid-template-columns: 1fr;
    }

    .user-profile {
        flex-direction: column;
        align-items: flex-start;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-icon-gear {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0b1a2c;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.btn-icon-gear svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.btn-icon-gear:hover {
    color: #c5a059;
    border-color: #c5a059;
    background: #fffbeb;
}

.card-settings-title {
    margin: 8px 0 0;
    font-size: 1.05rem;
}

.color-input-row {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 8px;
    align-items: center;
}

.color-input-row input[type="color"] {
    width: 48px;
    height: 42px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
}

.card-icon-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.card-icon-option {
    width: 56px;
    height: 56px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
    color: #64748b;
    font-size: 0.7rem;
}

.card-icon-option.is-selected {
    border-color: #c5a059;
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.25);
    background: #fff;
    color: #0b1a2c;
}

.card-icon-preview {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
}

.card-icon-preview .sys-icon,
.card-icon-preview svg {
    width: 24px;
    height: 24px;
}

.image-position-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.image-position-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px;
    background: #fff;
    cursor: pointer;
    display: grid;
    gap: 10px;
    justify-items: center;
}

.image-position-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.image-position-card.is-selected {
    border-color: #c5a059;
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.25);
}

.image-position-preview {
    width: 100%;
    height: 84px;
    border-radius: 10px;
    background: #f1f5f9;
    display: grid;
    overflow: hidden;
}

.image-position-preview.is-top {
    grid-template-rows: 1.1fr 1fr;
}

.image-position-preview.is-left,
.image-position-preview.is-right {
    grid-template-columns: 1fr 1.1fr;
}

.image-position-preview.is-right .image-position-media {
    order: 2;
}

.image-position-media {
    background: #cbd5e1;
}

.image-position-body {
    background: #fff;
}

@media (max-width: 820px) {
    .image-position-options {
        grid-template-columns: 1fr;
    }
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
}

.btn-primary {
    background: var(--color-primary-hover);
    color: #fff;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--color-text);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.data-table th,
.data-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--color-text-muted);
    font-weight: 600;
}

.table-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.table-actions a,
.link-danger {
    color: var(--color-primary);
    background: none;
    border: 0;
    cursor: pointer;
    font: inherit;
    padding: 0;
}

.link-danger { color: #b91c1c; }
.inline-form { display: inline; }
.badge-soft {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(197, 160, 89, 0.18);
    color: #8a6a2f;
    font-size: 0.75rem;
}

.imovel-form { display: grid; gap: 14px; }
.form-section {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    background: #f8fafc;
}

.form-section summary {
    cursor: pointer;
    font-weight: 700;
    margin-bottom: 12px;
}

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

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

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 12px;
}

.nested-section {
    margin-top: 12px;
    background: #fff;
}

.page-sections {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.page-section-placeholder {
    padding: 18px 16px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
}

.page-section-placeholder .subtitle {
    margin: 0;
}

.page-section-placeholder .subtitle + .subtitle {
    margin-top: 6px;
}

.why-item-block {
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
}

.form-actions { margin-top: 8px; }
.full-width { grid-column: 1 / -1; }

.hero-preview {
    margin: 8px 0 12px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    max-width: 480px;
}

.hero-preview img {
    display: block;
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.icon-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.icon-admin-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px;
    display: grid;
    gap: 8px;
    justify-items: start;
    position: relative;
}

.icon-admin-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    margin: 0;
}

.icon-delete-btn {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: color .15s ease, background .15s ease;
}

.icon-delete-btn:hover {
    color: #b91c1c;
    background: #fef2f2;
}

.icon-admin-preview {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.sys-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}

.sys-icon svg,
.icon-admin-preview svg {
    width: 36px;
    height: 36px;
    display: block;
}

.sys-icon-tint {
    display: block;
    width: 36px;
    height: 36px;
    background: var(--icon-tint, #c5a059);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.icon-picker {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 18px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
}

.icon-picker-side {
    display: grid;
    gap: 12px;
    align-content: start;
}

.icon-picker-preview-lg {
    width: 100%;
    aspect-ratio: 1;
    max-height: 160px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    display: grid;
    place-items: center;
    color: var(--picker-color, #c5a059);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.icon-picker-preview-lg .sys-icon,
.icon-picker-preview-lg svg,
.icon-picker-preview-lg .sys-icon-tint {
    width: 64px;
    height: 64px;
}

.icon-picker-empty {
    color: #94a3b8;
    font-size: 0.9rem;
}

.icon-picker-selected-name {
    margin: 0;
    font-weight: 600;
    color: #0b1a2c;
    text-align: center;
}

.icon-color-row {
    display: grid;
    gap: 8px;
}

.icon-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.icon-color-swatch {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #cbd5e1;
    background: var(--swatch);
    cursor: pointer;
    padding: 0;
}

.icon-color-swatch.is-active {
    box-shadow: 0 0 0 2px #0b1a2c;
}

.icon-color-custom {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    overflow: hidden;
    border: 1px dashed #94a3b8;
    display: grid;
    place-items: center;
    cursor: pointer;
    background:
        linear-gradient(45deg, #ef4444, transparent 50%),
        linear-gradient(135deg, #22c55e, transparent 50%),
        linear-gradient(225deg, #3b82f6, transparent 50%),
        #f8fafc;
}

.icon-color-custom input {
    width: 40px;
    height: 40px;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.icon-picker-main {
    min-width: 0;
    display: grid;
    gap: 12px;
}

.icon-picker-toolbar {
    display: flex;
    gap: 12px;
    align-items: center;
}

.icon-picker-toolbar input[type="search"] {
    flex: 1;
    margin: 0;
}

.icon-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 10px;
    max-height: 360px;
    overflow: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.icon-picker-option {
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 12px 8px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    text-align: center;
    font-size: 0.75rem;
    color: #64748b;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.icon-picker-option:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.icon-picker-option.is-selected {
    border-color: var(--picker-color, #c5a059);
    background: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--picker-color, #c5a059) 28%, transparent);
    color: #0b1a2c;
    font-weight: 600;
}

.icon-picker-preview {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: var(--picker-color, #c5a059);
}

.icon-picker-preview .sys-icon,
.icon-picker-preview svg,
.icon-picker-preview .sys-icon-tint {
    width: 28px;
    height: 28px;
}

@media (max-width: 820px) {
    .icon-picker {
        grid-template-columns: 1fr;
    }
}

.app-shell.sidebar-collapsed .sidebar-group[data-sidebar-group="site"] .sidebar-chevron,
.app-shell.sidebar-collapsed .sidebar-group[data-sidebar-group="site"] .sidebar-subnav,
.app-shell.sidebar-collapsed .sidebar-group[data-sidebar-group="imoveis"] .sidebar-chevron,
.app-shell.sidebar-collapsed .sidebar-group[data-sidebar-group="imoveis"] .sidebar-subnav {
    display: none;
}


.foto-grid,
.foto-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 10px;
}

.foto-item,
.foto-preview-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.foto-item.is-principal {
    border-color: var(--color-primary-hover);
    box-shadow: 0 0 0 2px rgba(197, 160, 89, 0.25);
}

.foto-item img,
.foto-preview-item img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.foto-item-actions {
    display: grid;
    gap: 6px;
    padding: 10px;
}

.foto-destaque,
.foto-excluir {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    margin: 0;
}

.foto-excluir { color: #b91c1c; }

.foto-preview-item span {
    display: block;
    padding: 8px 10px;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 900px) {
    .form-grid-2,
    .form-grid-3,
    .checkbox-grid {
        grid-template-columns: 1fr;
    }
}

