:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --line: rgba(226, 232, 240, 0.78);
    --primary: #f1b813;
    --primary-dark: #dba400;
    --primary-text: #0b1a30;
    --blue: #0056b3;
    --blue-dark: #003f86;
    --blue-deep: #0b1a30;
    --blue-soft: #eef6ff;
    --danger: #d92d3a;
    --danger-soft: #fff1f2;
    --success: #14965f;
    --success-soft: #ecfdf3;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.04);
    --shadow-hover: 0 18px 44px rgba(15, 23, 42, 0.08);
    --radius-card: 16px;
    --radius-button: 12px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background-color: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: all 0.3s ease;
}

button,
input,
select,
textarea {
    font: inherit;
}

button,
.button,
summary {
    transition: all 0.3s ease;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 74px;
    padding: 14px clamp(16px, 4vw, 44px);
    background: linear-gradient(135deg, var(--blue-deep), var(--blue));
    color: #fff;
    box-shadow: 0 12px 34px rgba(11, 26, 48, 0.16);
}

.topbar span {
    display: block;
    color: rgba(255, 255, 255, 0.74);
    font-size: 13px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
    padding: 4px;
}

.topbar nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.welcome {
    color: rgba(255, 255, 255, 0.86);
    margin-right: 6px;
}

.topbar nav a,
.topbar nav .logout-form button,
.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    border: 0;
    border-radius: var(--radius-button);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 750;
}

.topbar nav a,
.topbar nav .logout-form button {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    backdrop-filter: blur(12px);
}

.topbar nav a:hover,
.topbar nav .logout-form button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.logout-form {
    margin: 0;
}

.primary,
button.primary {
    background: var(--primary);
    color: var(--primary-text);
    box-shadow: 0 10px 24px rgba(241, 184, 19, 0.18);
}

.primary:hover,
button.primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(241, 184, 19, 0.24);
}

.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.danger:hover {
    background: #fee2e2;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 50px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
}

.container {
    width: min(1180px, calc(100vw - 24px));
    margin: 24px auto 56px;
}

.section-head,
.filters,
.login-panel,
.property-form,
.table-wrap,
.dashboard-filters,
.chart-card,
.detail-hero,
.detail-card,
.alert {
    background-color: var(--surface);
    border: 0;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.drive-summary-grid .summary-card h2 {
    margin: 8px 0 6px;
    color: var(--blue);
    font-size: 28px;
    line-height: 1.05;
}

.drive-setup-head {
    padding: 16px 20px;
}

.drive-setup-head h1 {
    margin-bottom: 4px;
    font-size: 25px;
}

.drive-setup-head p {
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
}

.drive-summary-grid {
    gap: 12px;
}

.drive-summary-grid .summary-card {
    min-height: 94px;
    padding: 16px 18px;
}

.drive-summary-grid .summary-card span {
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.drive-summary-grid .summary-card strong {
    font-size: 22px;
}

.drive-summary-grid .summary-card p {
    font-size: 13px;
    line-height: 1.35;
}

.compact-form {
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.sync-drive-form {
    margin: 12px 0 0;
}

.drive-steps {
    margin: 0;
    padding-left: 20px;
    color: var(--muted);
}

.drive-steps li + li {
    margin-top: 8px;
}

.success-card {
    border: 1px solid rgba(20, 150, 95, 0.12);
    background: linear-gradient(180deg, #ffffff 0%, #f4fff8 100%);
}

.drive-status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 14px 18px;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow);
}

.drive-status-banner.ready {
    border: 1px solid rgba(20, 150, 95, 0.22);
    background: linear-gradient(135deg, #ecfdf3, #ffffff);
}

.drive-status-banner.pending {
    border: 1px solid rgba(241, 184, 19, 0.28);
    background: linear-gradient(135deg, #fff8df, #ffffff);
}

.drive-status-banner span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.drive-status-banner strong {
    display: block;
    margin-top: 4px;
    color: var(--blue-deep);
    font-size: 18px;
    line-height: 1.15;
}

.drive-setup-head + .drive-status-banner {
    margin-top: -4px;
}

.drive-action-summary .summary-card.green {
    border-left: 5px solid var(--success);
}

.drive-action-summary .summary-card.pink {
    border-left: 5px solid var(--danger);
}

.drive-preferences-form .check-row {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    background: #f8fbff;
}

.drive-detail-grid,
.drive-actions-grid {
    gap: 12px;
}

.drive-detail-grid .detail-card,
.drive-actions-grid .detail-card {
    padding: 18px;
}

.drive-detail-grid .detail-card h2,
.drive-actions-grid .detail-card h2 {
    margin-bottom: 12px;
    font-size: 20px;
}

.drive-detail-grid dl {
    gap: 8px 14px;
}

.drive-detail-grid dt,
.drive-detail-grid dd {
    font-size: 13px;
    line-height: 1.25;
}

.drive-actions-grid .muted,
.drive-actions-grid .form-note {
    font-size: 13px;
    line-height: 1.35;
}

.summary-card {
    min-height: 112px;
    padding: 22px;
    border-radius: var(--radius-card);
    background-color: #fff;
    color: var(--text);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.summary-card:hover,
.chart-card:hover,
.detail-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.summary-card span {
    display: block;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 850;
}

.summary-card strong {
    display: block;
    color: var(--blue);
    font-size: 40px;
    line-height: 1;
}

.summary-card p {
    margin: 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.summary-card.purple,
.summary-card.green,
.summary-card.pink,
.summary-card.cyan {
    background-color: #fff;
    background-image: none;
}

.summary-card.purple {
    border-top: 4px solid var(--blue);
}

.summary-card.green {
    border-top: 4px solid var(--success);
}

.summary-card.pink {
    border-top: 4px solid var(--danger);
}

.summary-card.cyan {
    border-top: 4px solid var(--primary);
}

.dashboard-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-summary .summary-card {
    position: relative;
    overflow: hidden;
    min-height: 118px;
}

.dashboard-summary .summary-card::after {
    content: "";
    position: absolute;
    right: 18px;
    top: 18px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #eef6ff;
}

.dashboard-summary .summary-card.purple {
    background: linear-gradient(135deg, var(--blue-deep), var(--blue-dark));
    color: #fff;
    border-top: 0;
}

.dashboard-summary .summary-card.purple span,
.dashboard-summary .summary-card.purple p {
    color: rgba(255, 255, 255, 0.72);
}

.dashboard-summary .summary-card.purple strong {
    color: #fff;
}

.dashboard-summary .summary-card.purple::after {
    background: rgba(255, 255, 255, 0.16);
}

h1 {
    margin: 0;
    color: var(--blue);
    font-size: 26px;
    line-height: 1.2;
    letter-spacing: 0;
}

h2 {
    color: var(--blue);
}

p {
    margin: 5px 0 0;
    color: var(--muted);
}

.filters {
    display: grid;
    grid-template-columns: minmax(160px, 210px) minmax(160px, 210px) 1fr auto auto auto;
    gap: 12px;
    margin-bottom: 18px;
    padding: 16px;
}

.dashboard-filters {
    display: grid;
    grid-template-columns: minmax(150px, 180px) minmax(150px, 180px) minmax(150px, 180px) minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
    margin-bottom: 18px;
    padding: 14px;
}

.dashboard-properties-filters {
    grid-template-columns: minmax(130px, 160px) minmax(130px, 160px) minmax(150px, 170px) minmax(170px, 210px) minmax(220px, 1fr) auto;
}

.dashboard-filters label {
    gap: 7px;
}

.dashboard-filters input,
.dashboard-filters select {
    min-height: 46px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.035);
}

.dashboard-filters button {
    min-height: 46px;
    padding-inline: 24px;
    background: var(--primary);
    color: var(--primary-text);
    box-shadow: 0 10px 24px rgba(241, 184, 19, 0.18);
}

.dashboard-filters button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(241, 184, 19, 0.24);
}

.filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-button);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-weight: 600;
    box-shadow: var(--shadow);
}

.filters-toggle:hover {
    border-color: var(--primary);
    background: rgba(241, 184, 19, 0.06);
}

.filters-toggle::before {
    content: "\25BC";
    font-size: 10px;
    transition: transform 0.2s ease;
}

.filters-toggle[aria-expanded="false"]::before {
    transform: rotate(-90deg);
}

.dashboard-filters-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.quick-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.quick-dates button {
    min-height: 34px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.15s ease;
    box-shadow: none;
}

.quick-dates button:hover {
    border-color: var(--primary);
    background: rgba(241, 184, 19, 0.08);
}

.export-bar {
    margin-bottom: 24px;
    padding: 16px 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dashboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.dashboard-tabs a {
    flex: 1;
    padding: 14px 20px;
    border-bottom: 3px solid transparent;
    color: var(--text-muted, var(--muted));
    text-align: center;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.dashboard-tabs a:hover {
    background: rgba(0, 86, 179, 0.04);
}

.dashboard-tabs a.active {
    border-bottom-color: var(--primary);
    background: rgba(0, 86, 179, 0.06);
    color: var(--blue-deep);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.chart-card {
    overflow: hidden;
    min-height: 280px;
    padding: 24px;
    transition: all 0.3s ease;
}

.chart-card-wide {
    grid-column: span 2;
}

.chart-card h2 {
    margin: 0 0 18px;
    color: var(--blue-deep);
    font-size: 19px;
    line-height: 1.2;
}

.chart-card-canvas {
    min-height: 340px;
}

.chart-card-donut {
    min-height: 340px;
}

.chart-card canvas {
    display: block;
    width: 100%;
    height: 230px !important;
    max-height: 230px;
    min-height: 0;
}

.chart-card-wide canvas {
    height: 240px !important;
    max-height: 240px;
}

.chart-card-donut canvas {
    height: 230px !important;
    max-height: 230px;
}

.chart-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.chart-head h2 {
    margin: 0 0 4px;
}

.chart-head p {
    margin: 0;
    font-size: 13px;
}

.chart-head span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 20px;
    background: #fff7d6;
    color: var(--primary-text);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

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

.bar-row {
    padding: 8px 0 12px;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.bar-row:hover {
    padding-inline: 10px;
    border-radius: 12px;
    background: #f8fbff;
}

.bar-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 650;
}

.bar-label span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #0f172a;
}

.bar-label strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 4px 12px;
    border-radius: 20px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 13px;
    font-weight: 900;
}

.bar-track {
    height: 8px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--blue-soft);
}

.bar-track span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--primary));
}

.chart-card-list .bar-list {
    gap: 0;
}

.chart-card-list .bar-row {
    display: grid;
    min-height: 54px;
    align-items: center;
    padding: 12px 0;
}

.chart-card-list .bar-label {
    margin-bottom: 0;
}

.chatbot-dashboard-filters {
    grid-template-columns: minmax(130px, 160px) minmax(130px, 160px) minmax(220px, 1.2fr) minmax(130px, 160px) minmax(220px, 1fr) auto;
}

.dashboard-summary-five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.dashboard-decision-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-compact .detail-card code {
    padding: 2px 6px;
    border-radius: 8px;
    background: #eef6ff;
    color: var(--blue);
    font-weight: 800;
}

.dashboard-decision-card,
.dashboard-focus-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: linear-gradient(135deg, #ffffff, #f8fbff);
    box-shadow: var(--shadow);
}

.dashboard-decision-card {
    padding: 18px;
}

.dashboard-decision-card span,
.dashboard-focus-copy span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-decision-card strong {
    display: block;
    margin-top: 8px;
    color: var(--blue-deep);
    font-size: 22px;
    line-height: 1.1;
}

.dashboard-decision-card p,
.dashboard-focus-card p {
    margin-top: 8px;
    color: var(--muted);
}

.dashboard-focus-card {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 20px;
    align-items: center;
    margin-bottom: 24px;
    padding: 22px;
}

.dashboard-focus-copy h2 {
    margin: 8px 0 0;
    color: var(--blue-deep);
    font-size: 28px;
    line-height: 1.1;
}

.dashboard-focus-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dashboard-focus-metrics div {
    padding: 14px 12px;
    border-radius: 16px;
    background: #eef6ff;
    text-align: center;
}

.dashboard-focus-metrics strong {
    display: block;
    color: var(--blue);
    font-size: 22px;
    line-height: 1.1;
}

.dashboard-focus-metrics span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.performance-list,
.signal-list,
.heat-list,
.recent-list {
    display: grid;
    gap: 10px;
}

.performance-row {
    display: grid;
    grid-template-columns: minmax(230px, 1.6fr) repeat(4, minmax(110px, 1fr));
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eef2f7;
}

.performance-row:last-child {
    border-bottom: 0;
}

.performance-row span {
    min-width: 0;
}

.performance-row strong {
    display: block;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.performance-row small {
    display: block;
    margin-top: 4px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.performance-head {
    padding-top: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.signal-item {
    padding: 14px;
    border: 1px solid #e5edf8;
    border-left: 4px solid var(--blue);
    border-radius: 16px;
    background: #ffffff;
}

.signal-item.attention {
    border-left-color: var(--danger);
    background: #fff7f7;
}

.signal-item.success {
    border-left-color: var(--success);
    background: #f4fff8;
}

.signal-item.neutral {
    border-left-color: var(--primary);
    background: #fffaf0;
}

.signal-item strong {
    color: var(--text);
}

.signal-item p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}

.heat-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 34px;
    gap: 10px;
    align-items: center;
    color: var(--text);
    font-size: 13px;
    font-weight: 750;
}

.heat-row div {
    overflow: hidden;
    height: 10px;
    border-radius: 999px;
    background: #eef4fb;
}

.heat-row i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--blue), var(--primary));
}

.heat-row strong {
    color: var(--blue-deep);
    text-align: right;
}

.recent-item {
    padding: 13px 0;
    border-bottom: 1px solid #eef2f7;
}

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

.recent-item > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.recent-item strong {
    color: var(--text);
}

.recent-item small,
.recent-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.recent-item p {
    display: -webkit-box;
    margin: 8px 0;
    overflow: hidden;
    color: var(--text);
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 86, 179, 0.14);
    border-radius: var(--radius-button);
    background: #fff;
    color: var(--text);
    outline: none;
}

select {
    appearance: none;
    padding-right: 42px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--blue-deep) 50%),
        linear-gradient(135deg, var(--blue-deep) 50%, transparent 50%),
        linear-gradient(to right, rgba(0, 86, 179, 0.14), rgba(0, 86, 179, 0.14));
    background-position:
        calc(100% - 20px) 50%,
        calc(100% - 14px) 50%,
        calc(100% - 38px) 50%;
    background-size:
        6px 6px,
        6px 6px,
        1px 24px;
    background-repeat: no-repeat;
    font-weight: 850;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(0, 86, 179, 0.48);
    box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.08);
}

textarea {
    resize: vertical;
}

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

.mobile-compact-zone,
.mobile-compact-type,
.mobile-compact-meta,
.mobile-compact-area {
    display: none;
}

.property-sections {
    display: grid;
    gap: 16px;
}

.property-section {
    overflow: hidden;
    border-radius: var(--radius-card);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.property-section summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    cursor: pointer;
    list-style: none;
}

.property-section summary::-webkit-details-marker {
    display: none;
}

.property-section summary::after {
    content: ">";
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 900;
    transition: transform 0.2s ease;
}

.property-section[open] summary::after {
    transform: rotate(90deg);
}

.property-section summary strong {
    display: block;
    color: var(--blue-deep);
    font-size: 19px;
}

.property-section summary small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.property-section.available {
    border-top: 4px solid var(--success);
}

.property-section.unavailable {
    border-top: 4px solid var(--danger);
}

.property-section .table-wrap {
    border-radius: 0;
    box-shadow: none;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 920px;
}

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

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

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: #f8fbff;
}

.subtext {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.details-cell {
    min-width: 210px;
}

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

.actions .button.small {
    min-width: 74px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 86, 179, 0.18);
    background: #edf5ff;
    color: var(--blue-deep);
    box-shadow: 0 8px 18px rgba(11, 26, 48, 0.06);
    white-space: nowrap;
}

.actions .button.small:hover {
    background: #dfeeff;
    color: var(--blue);
}

tbody tr.row-unavailable {
    background: var(--danger-soft);
}

tbody tr.row-unavailable:hover {
    background: #ffe4e6;
}

tbody tr.row-unavailable td {
    border-bottom-color: rgba(217, 45, 58, 0.16);
}

.inline-form select {
    min-width: 130px;
}

.small {
    min-height: 34px;
    padding: 6px 10px;
}

.empty {
    color: var(--muted);
    text-align: center;
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 16px;
}

.pagination a {
    min-width: 38px;
    padding: 8px 11px;
    border-radius: var(--radius-button);
    background: #fff;
    color: var(--blue);
    box-shadow: var(--shadow);
    text-align: center;
}

.pagination a.active {
    background: var(--blue);
    color: #fff;
}

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

.detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    margin-bottom: 14px;
}

.detail-hero h1 {
    margin: 2px 0;
    font-size: clamp(24px, 3vw, 34px);
}

.detail-hero p {
    margin: 0;
}

.detail-hero.unavailable {
    background: var(--danger-soft);
}

.eyebrow {
    color: var(--muted);
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

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

.status-pill {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    padding: 6px 12px;
    border-radius: var(--radius-button);
    background: var(--blue);
    color: #fff;
    font-weight: 850;
}

.detail-hero.unavailable .status-pill {
    background: var(--danger);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}

.detail-card {
    padding: 22px;
    margin-bottom: 18px;
}

.detail-card h2 {
    margin: 0 0 14px;
    font-size: 19px;
}

dl {
    display: grid;
    grid-template-columns: minmax(130px, 220px) 1fr;
    gap: 10px 16px;
    margin: 0;
}

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

dd {
    margin: 0;
}

.full-data {
    grid-template-columns: minmax(180px, 260px) 1fr;
}

.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.link-list a,
.link-list span {
    padding: 8px 10px;
    border-radius: var(--radius-button);
    background: var(--bg);
}

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

.history-list {
    display: grid;
    gap: 10px;
}

.history-list div {
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-weight: 700;
}

label.wide,
.form-actions {
    grid-column: 1 / -1;
}

.form-section,
.inventory-property-preview,
.signature-grid {
    grid-column: 1 / -1;
}

.inventory-step {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.78);
}

.inventory-step + .inventory-step {
    margin-top: 2px;
}

.inventory-step-head {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    gap: 10px;
}

.inventory-step-head > span {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-weight: 800;
}

.inventory-step-head h2,
.inventory-step-head p {
    margin: 0;
}

.inventory-step-head h2 {
    color: var(--blue-deep);
    font-size: 18px;
}

.inventory-step-head p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

.inventory-step .inventory-property-preview,
.inventory-step .form-section,
.inventory-step .signature-grid {
    grid-column: 1 / -1;
}

.inventory-step label small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.inventory-property-preview {
    display: grid;
    gap: 12px;
    padding: 18px;
    border-radius: var(--radius-card);
    background: var(--blue-soft);
}

.inventory-property-preview h2 {
    margin: 0;
    color: var(--blue-deep);
    font-size: 18px;
}

.inventory-property-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.inventory-property-summary span {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-radius: var(--radius-button);
    background: #fff;
    color: var(--text);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.035);
}

.inventory-property-summary strong {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.form-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 18px;
    border-radius: var(--radius-card);
    background: var(--bg);
}

.form-section h2 {
    grid-column: 1 / -1;
    margin: 0;
    font-size: 20px;
}

.section-note {
    grid-column: 1 / -1;
    margin: -4px 0 2px;
    color: var(--muted);
}

.property-wizard-head {
    min-height: auto;
    align-items: center;
    padding: 14px 18px;
}

.property-wizard-head h1 {
    margin: 0;
    font-size: clamp(22px, 2vw, 30px);
    line-height: 1.08;
}

.property-wizard-head .button {
    min-height: 40px;
    padding: 8px 16px;
}

.property-wizard {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    align-items: start;
    gap: 18px;
    padding: 18px;
}

.wizard-steps {
    position: sticky;
    top: 92px;
    display: grid;
    gap: 8px;
}

.wizard-steps button {
    justify-content: flex-start;
    min-height: 68px;
    padding: 10px;
    gap: 10px;
    border: 1px solid rgba(0, 86, 179, 0.1);
    background: #f8fbff;
    color: var(--text);
    text-align: left;
    box-shadow: none;
}

.wizard-steps button.active {
    border-color: rgba(0, 86, 179, 0.26);
    background: linear-gradient(135deg, #ffffff, #edf5ff);
    box-shadow: 0 12px 24px rgba(0, 86, 179, 0.08);
}

.wizard-steps span {
    width: 28px;
    height: 28px;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
}

.wizard-steps strong,
.wizard-steps small {
    display: block;
}

.wizard-steps small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    font-weight: 650;
}

.property-wizard-step {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    min-height: 430px;
    padding: 20px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(0, 86, 179, 0.08), transparent 34%),
        #fff;
}

.property-wizard-step.active {
    display: grid;
}

.wizard-step-copy {
    grid-column: 1 / -1;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.wizard-step-copy h2 {
    margin: 0 0 4px;
    color: var(--blue-deep);
    font-size: clamp(20px, 2vw, 26px);
}

.wizard-step-copy p {
    margin: 0;
    color: var(--muted);
}

.property-wizard label {
    position: relative;
}

.status-reason-block[hidden] {
    display: none !important;
}

.field-badge {
    justify-self: start;
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 86, 179, 0.08);
    color: var(--blue);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wizard-info-card,
.wizard-review-card,
.conditional-observation {
    padding: 14px;
    border: 1px solid rgba(0, 86, 179, 0.1);
    border-radius: 16px;
    background: #f8fbff;
}

.wizard-info-card strong,
.wizard-review-card h3 {
    color: var(--blue-deep);
}

.wizard-info-card p {
    margin: 6px 0 0;
    color: var(--muted);
}

.wizard-photo-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.wizard-photo-cta p {
    max-width: 680px;
}

.wizard-photo-cta .button {
    flex: 0 0 auto;
    white-space: nowrap;
}

.wizard-observation-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.wizard-inline-toggle {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--text);
    font-weight: 850;
}

.wizard-inline-toggle input {
    width: 18px;
    min-height: 18px;
    accent-color: var(--blue);
}

.observation-panel {
    display: none;
    margin-top: 10px;
}

.observation-panel.active {
    display: grid;
}

.conditional-observation.active {
    background: #fff;
    box-shadow: 0 10px 22px rgba(0, 86, 179, 0.06);
}

.wizard-review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 8px;
}

.wizard-review-grid span {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
}

.wizard-review-grid strong {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wizard-review-grid em {
    color: var(--text);
    font-style: normal;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.wizard-public-url {
    margin: 12px 0;
    padding: 10px;
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.wizard-public-url code {
    color: var(--blue);
    font-weight: 850;
}

.wizard-missing ul {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.wizard-missing li {
    padding: 5px 9px;
    border-radius: 999px;
    background: #fff7d6;
    color: #7a5700;
    font-size: 12px;
    font-weight: 850;
}

.wizard-missing li.ok {
    background: var(--success-soft);
    color: var(--success);
}

.wizard-actions {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.wizard-actions button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
}

.internal-notes-card {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.internal-notes-content {
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    color: var(--text);
    box-shadow: inset 0 0 0 1px var(--line);
    white-space: normal;
}

.inventory-space-builder {
    background: linear-gradient(180deg, rgba(224, 242, 254, 0.72), rgba(248, 250, 252, 0.92));
}

.space-toolbar {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 12px;
    align-items: end;
    padding: 14px;
    border-radius: var(--radius-button);
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}

.space-list {
    display: grid;
    grid-column: 1 / -1;
    gap: 14px;
}

.inventory-space-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.045);
}

.space-card-head {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.space-card-head h3 {
    margin: 0;
    color: var(--blue-deep);
    font-size: 18px;
}

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

.inventory-ok-badge {
    display: inline-flex;
    margin-top: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    background: #dcfce7;
    color: #166534;
    font-size: 12px;
    font-weight: 900;
}

.inventory-ok-badge.reviewed {
    background: #dbeafe;
    color: #1d4ed8;
}

.inventory-ok-badge.has-novelty {
    background: #fee2e2;
    color: #b91c1c;
}

.space-name-field,
.inventory-checklist {
    grid-column: 1 / -1;
}

.space-name-field {
    max-width: 560px;
}

.inventory-checklist {
    overflow: hidden;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 16px;
    background: #f8fbff;
}

.inventory-checklist summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 12px 16px;
    color: var(--blue-deep);
    font-weight: 900;
    cursor: pointer;
    list-style: none;
}

.inventory-checklist summary::-webkit-details-marker {
    display: none;
}

.inventory-checklist summary::after {
    content: '+';
    display: grid;
    width: 28px;
    height: 28px;
    margin-left: auto;
    place-items: center;
    border-radius: 50%;
    background: #e5efff;
    color: var(--blue);
    font-size: 20px;
}

.inventory-checklist[open] summary::after {
    content: '-';
}

.inventory-checklist summary span {
    color: var(--muted);
    font-size: 12px;
}

.inventory-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 16px 16px;
}

.inventory-check-field {
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: #fff;
}

.inventory-check-label {
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.inventory-choice-group {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.inventory-choice {
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.inventory-choice.selected {
    border-color: #16a34a;
    background: #dcfce7;
    color: #166534;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.1);
}

.inventory-observation-field {
    grid-column: 1 / -1;
    padding: 12px;
    border-radius: 14px;
    background: #fff7ed;
}

@media (max-width: 720px) {
    .inventory-space-card {
        grid-template-columns: minmax(0, 1fr);
        padding: 13px;
    }

    .space-card-head {
        align-items: flex-start;
    }

    .space-card-actions {
        justify-content: flex-end;
    }

    .inventory-check-grid {
        grid-template-columns: minmax(0, 1fr);
        padding: 0 10px 10px;
    }

    .inventory-checklist summary {
        padding: 11px 12px;
    }

    .inventory-choice {
        min-height: 42px;
        flex: 1 1 auto;
    }
}

.danger-light {
    border-color: rgba(220, 38, 38, 0.24);
    color: var(--danger);
}

.inventory-base-info,
.inventory-observations {
    display: grid;
    gap: 6px;
    margin-bottom: 14px;
    padding: 14px;
    border-radius: var(--radius-button);
    background: var(--blue-soft);
}

.inventory-observations {
    background: #fff7ed;
}

.inventory-base-info strong,
.inventory-observations strong {
    color: var(--blue-deep);
}

.inventory-base-info p,
.inventory-observations p {
    margin: 0;
}

.dynamic-area {
    display: grid;
    grid-column: 1 / -1;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.dynamic-area-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.dynamic-area-head h3 {
    margin: 0;
    color: var(--blue-deep);
    font-size: 17px;
}

.dynamic-area-head span {
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
}

.dynamic-area-list {
    display: grid;
    gap: 12px;
}

.dynamic-area-item {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.78);
}

.dynamic-area-item h4,
.dynamic-area-item .wide {
    grid-column: 1 / -1;
}

.dynamic-area-item h4 {
    margin: 0;
    color: var(--text);
    font-size: 16px;
}

.dynamic-empty {
    margin: 0;
    padding: 12px 14px;
    border-radius: var(--radius-button);
    background: rgba(255, 255, 255, 0.72);
}

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

.signature-grid-single {
    grid-template-columns: minmax(0, 1fr);
}

.signature-grid > div {
    padding: 18px;
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--shadow);
}

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

.signature-head h2 {
    margin: 0;
}

.signature-clear {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 13px;
}

.signature-pad {
    width: 100%;
    height: 190px;
    border-radius: var(--radius-button);
    background:
        linear-gradient(#fff, #fff) padding-box,
        linear-gradient(135deg, rgba(0, 86, 179, 0.24), rgba(241, 184, 19, 0.24)) border-box;
    border: 1px solid transparent;
    touch-action: none;
}

.print-signatures img {
    width: 100%;
    max-height: 180px;
    object-fit: contain;
    border-radius: var(--radius-button);
    background: #fff;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.media-grid a {
    padding: 12px;
    border-radius: var(--radius-button);
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 800;
}

.signing-link-card input[readonly] {
    color: var(--blue-deep);
    font-size: 14px;
    font-weight: 800;
}

.inline-form {
    margin-top: 14px;
}

.timeline {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.timeline article {
    display: grid;
    gap: 4px;
    padding: 14px;
    border-radius: var(--radius-button);
    background: var(--bg);
}

.timeline strong {
    color: var(--blue-deep);
}

.timeline span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.timeline p {
    margin: 0;
}

.public-sign-hero {
    background: linear-gradient(135deg, var(--blue-deep), var(--blue));
    color: #fff;
}

.public-sign-hero h1,
.public-sign-hero p,
.public-sign-hero .eyebrow {
    color: #fff;
}

.acceptance-text p {
    color: var(--text);
    line-height: 1.65;
}

.signing-form {
    margin-bottom: 28px;
}

.expediente-summary .summary-card {
    min-height: 76px;
    padding: 14px 16px;
}

.expediente-summary .summary-card span {
    margin-bottom: 8px;
    font-size: 13px;
}

.expediente-summary .summary-card strong {
    font-size: 30px;
}

.expediente-summary .summary-card p {
    font-size: 13px;
    line-height: 1.25;
}

.expediente-summary .summary-card:hover,
.property-tabs + .detail-card:hover,
.portal-photo-row:hover {
    transform: none;
    box-shadow: var(--shadow);
}

.property-detail-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto 22px;
}

.property-tabs,
.property-context-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.property-tabs a {
    padding: 12px 16px;
    border: 1px solid rgba(0, 86, 179, 0.18);
    border-radius: var(--radius-button);
    color: var(--blue-deep);
    background: #fff;
    font-weight: 900;
    box-shadow: var(--shadow-soft);
}

.property-tabs a.active {
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
    border-color: transparent;
}

.property-context-actions {
    justify-content: flex-end;
}

.property-context-button {
    min-height: 46px;
    padding: 12px 15px;
    border: 1px solid rgba(0, 86, 179, 0.16);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.property-context-button.inventory {
    color: #087443;
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
    border-color: rgba(21, 128, 61, 0.2);
}

.property-context-button.ticket {
    color: #b42318;
    background: linear-gradient(135deg, #fff1f2, #ffffff);
    border-color: rgba(220, 38, 38, 0.18);
}

.portal-photo-list {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.portal-photo-reorder-form {
    display: none;
}

.portal-photo-sortbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 86, 179, 0.1);
    border-radius: var(--radius-button);
    background: var(--bg);
}

.portal-photo-sortbar span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.portal-photo-sortbar button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.photo-bulk-delete-form {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(220, 38, 38, 0.14);
    border-radius: var(--radius-button);
    background: #fff7f7;
}

.photo-bulk-delete-form > span {
    margin-right: auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
}

.photo-bulk-delete-form button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.portal-photo-row {
    display: grid;
    grid-template-columns: 72px 116px minmax(230px, 1fr) 64px minmax(430px, 1.45fr) 86px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 86, 179, 0.12);
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.portal-photo-row.can-select {
    grid-template-columns: 44px 72px 116px minmax(210px, 1fr) 64px minmax(390px, 1.35fr) 126px;
}

.portal-photo-row.is-dragging {
    opacity: 0.62;
    cursor: grabbing;
    box-shadow: 0 20px 45px rgba(0, 86, 179, 0.18);
}

.photo-select {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 66px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
}

.photo-select input {
    width: 18px;
    height: 18px;
    accent-color: var(--danger);
}

.photo-order {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    min-height: 68px;
    border-radius: var(--radius-button);
    color: #fff;
    background: linear-gradient(135deg, var(--blue), var(--blue-deep));
}

.photo-order strong {
    font-size: 24px;
    line-height: 1;
}

.portal-photo-drag-handle {
    display: inline-grid;
    place-items: center;
    width: 30px;
    min-height: 20px;
    margin-top: 2px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.17);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    cursor: grab;
}

.portal-photo-drag-handle:active {
    cursor: grabbing;
}

.portal-photo-preview {
    display: grid;
    place-items: center;
    width: 116px;
    height: 68px;
    overflow: hidden;
    border-radius: var(--radius-button);
    background: var(--blue-soft);
}

.portal-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-photo-preview span {
    color: var(--muted);
    font-weight: 800;
}

.portal-photo-meta {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.portal-photo-meta strong {
    color: var(--blue-deep);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-photo-meta p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.file-flags span {
    padding: 5px 8px;
    border-radius: 999px;
    color: #fff;
    background: var(--green);
    font-size: 12px;
    font-weight: 900;
}

.file-flags a {
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--blue);
    background: var(--blue-soft);
    font-size: 12px;
    font-weight: 900;
}

.file-flags .cover {
    color: var(--blue-deep);
    background: var(--yellow);
}

.file-flags .muted-flag {
    color: var(--muted);
    background: var(--blue-soft);
}

.photo-edit-form {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 70px 76px 72px;
    align-items: end;
    align-self: end;
    gap: 10px;
    min-width: 0;
}

.photo-edit-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.photo-edit-form input {
    width: 100%;
}

.photo-edit-form .check-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.photo-edit-form button[type="submit"],
.portal-photo-row > .inline-form button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    min-height: 40px;
    padding: 8px 14px;
    border: 0;
    border-radius: var(--radius-button);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.photo-edit-form button[type="submit"] {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 86, 179, 0.14);
}

.photo-edit-form button[type="submit"]:hover {
    background: var(--blue-deep);
}

.portal-photo-row > .inline-form button.danger[type="submit"] {
    background: var(--danger-soft);
    color: var(--danger);
}

.portal-photo-row > .inline-form button.danger[type="submit"]:hover {
    background: #fee2e2;
}

.photo-delete-form {
    flex-wrap: wrap;
    gap: 8px;
}

.drive-delete-check {
    min-height: 34px;
    padding: 6px 8px;
    border-color: rgba(220, 38, 38, 0.16);
    background: #fff7f7;
    color: var(--danger);
    font-size: 12px;
    font-weight: 900;
}

.photo-move-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.portal-photo-row > .inline-form {
    display: flex;
    align-items: end;
    justify-content: center;
    align-self: end;
    margin: 0;
}

.photo-move-actions form {
    margin: 0;
}

.photo-move-actions button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

@media (max-width: 980px) {
    .portal-photo-row,
    .portal-photo-row.can-select {
        grid-template-columns: 54px 96px minmax(0, 1fr);
    }

    .portal-photo-row.can-select {
        grid-template-columns: 42px 54px 96px minmax(0, 1fr);
    }

    .photo-order {
        min-height: 68px;
    }

    .portal-photo-preview {
        width: 96px;
        height: 68px;
    }

    .photo-move-actions,
    .photo-edit-form,
    .portal-photo-row > .inline-form,
    .portal-photo-row > .button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .portal-photo-row,
    .portal-photo-row.can-select {
        grid-template-columns: 48px minmax(0, 1fr);
    }

    .photo-select {
        min-height: 44px;
    }

    .portal-photo-preview {
        grid-column: 1 / -1;
        width: 100%;
        height: 150px;
    }

    .photo-edit-form {
        grid-template-columns: 1fr;
    }

    .portal-photo-sortbar {
        align-items: stretch;
        flex-direction: column;
    }

    .photo-bulk-delete-form {
        align-items: stretch;
        flex-direction: column;
    }

    .photo-bulk-delete-form > span {
        margin-right: 0;
    }

    .portal-upload-form {
        grid-template-columns: 1fr;
    }
}

.compact-form {
    margin-top: 16px;
    padding: 16px;
    background: var(--bg);
    box-shadow: none;
}

.compact-form select {
    min-height: 50px;
    border: 2px solid rgba(0, 86, 179, 0.24);
    background-color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.portal-upload-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    margin-top: 14px;
    padding: 12px;
}

.portal-upload-form label {
    margin: 0;
}

.portal-upload-form input[type="file"] {
    min-height: 44px;
    padding: 8px 12px;
}

.portal-upload-form button {
    min-height: 44px;
    white-space: nowrap;
}

.check-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: var(--radius-button);
    background: #fff;
    color: var(--text);
    font-weight: 850;
}

.check-row input {
    width: auto;
    min-height: auto;
}

.form-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.expediente-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.expediente-item {
    display: grid;
    gap: 8px;
    padding: 16px;
    border-radius: var(--radius-card);
    background: #fff;
    box-shadow: var(--shadow);
}

.expediente-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.expediente-item strong {
    color: var(--blue-deep);
}

.file-provider {
    justify-self: start;
    margin: 0;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue);
    font-size: 12px;
    font-weight: 900;
}

.file-flags {
    justify-self: start;
    margin: 0;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--gold-soft);
    color: var(--blue-deep);
    font-size: 12px;
    font-weight: 900;
}

.expediente-item a {
    justify-self: start;
    padding: 7px 11px;
    border-radius: var(--radius-button);
    background: var(--blue-soft);
    color: var(--blue);
    font-weight: 850;
}

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

.card-title-row h2 {
    margin: 0;
}

.mini-list {
    display: grid;
    gap: 10px;
}

.mini-list a {
    display: grid;
    gap: 4px;
    padding: 12px;
    border-radius: var(--radius-button);
    background: var(--bg);
}

.mini-list a:hover {
    background: var(--blue-soft);
    transform: translateY(-2px);
}

.mini-list span {
    color: var(--muted);
    font-size: 13px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 8px;
}

.login-panel {
    width: min(430px, 100%);
    margin: 70px auto;
    padding: 26px;
}

.login-panel form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.alert {
    margin-bottom: 16px;
    padding: 13px 15px;
}

.alert.success {
    background: var(--success-soft);
    color: var(--success);
}

.alert.error {
    background: var(--danger-soft);
    color: var(--danger);
}

@media (max-width: 760px) {
    .topbar {
        position: sticky;
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
        padding: 12px 12px 10px;
    }

    .brand img {
        width: 44px;
        height: 44px;
    }

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

    .brand span {
        font-size: 12px;
    }

    .topbar nav {
        flex-wrap: nowrap;
        width: 100%;
        overflow-x: auto;
        padding: 2px 2px 8px;
        gap: 8px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    .topbar nav::-webkit-scrollbar {
        height: 5px;
    }

    .topbar nav::-webkit-scrollbar-thumb {
        background: rgba(255, 255, 255, 0.35);
        border-radius: 999px;
    }

    .welcome {
        flex: 0 0 auto;
        align-self: center;
        margin-right: 2px;
        white-space: nowrap;
        font-size: 12px;
    }

    .topbar nav a {
        flex: 0 0 auto;
        min-height: 36px;
        padding: 8px 11px;
        white-space: nowrap;
        font-size: 13px;
    }

    .section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .summary-grid,
    .dashboard-summary {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .summary-card,
    .dashboard-summary .summary-card {
        flex: 1 1 calc(33.333% - 4px);
        min-height: 58px;
        padding: 10px 10px 9px;
        border-radius: 16px;
    }

    .summary-card.cyan,
    .dashboard-summary .summary-card.cyan {
        flex: 1 1 100%;
    }

    .summary-card span {
        margin-bottom: 4px;
        font-size: 11px;
        line-height: 1.05;
    }

    .summary-card strong {
        font-size: 22px;
    }

    .summary-card p {
        font-size: 11px;
        line-height: 1.15;
    }

    .summary-card .summary-label-full,
    .dashboard-summary .summary-label-full {
        display: none !important;
    }

    .summary-card .summary-label-short,
    .dashboard-summary .summary-label-short {
        display: block !important;
        margin-bottom: 3px;
        font-size: 11px;
        line-height: 1.05;
    }

    .dashboard-summary .summary-card::after {
        width: 14px;
        height: 14px;
        right: 8px;
        top: 8px;
    }

    .chart-card,
    .detail-card,
    .inventory-property-preview,
    .expediente-item {
        padding: 12px;
        border-radius: 18px;
    }

    .detail-card h2,
    .inventory-property-preview h2 {
        margin-bottom: 8px;
        font-size: 15px;
    }

    .detail-grid {
        gap: 10px;
    }

    dl,
    .full-data {
        gap: 6px 10px;
    }

    dt {
        font-size: 12px;
        line-height: 1.1;
    }

    dd {
        font-size: 13px;
        line-height: 1.2;
    }

    .inventory-property-summary {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .link-list {
        gap: 6px;
    }

    .link-list a,
    .link-list span {
        padding: 5px 7px;
        font-size: 12px;
    }

    .filters,
    .dashboard-filters,
    .summary-grid,
    .detail-grid,
    .dashboard-grid,
    .property-form,
    .inventory-step,
    .form-section,
    .space-toolbar,
    .inventory-space-card,
    .dynamic-area-item,
    .signature-grid {
        grid-template-columns: 1fr;
    }

    .chart-card-wide {
        grid-column: auto;
    }

    table,
    thead,
    tbody,
    tr,
    th,
    td {
        display: block;
        min-width: 0;
        width: 100%;
    }

    thead {
        display: none;
    }

    tr {
        display: grid;
        grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
        gap: 5px 7px;
        padding: 8px 9px;
        border-bottom: 1px solid var(--line);
    }

    td {
        display: flex;
        flex-direction: column;
        gap: 1px;
        border-bottom: 0;
        padding: 0;
        min-width: 0;
    }

    td:nth-child(1) { grid-column: 1 / -1; grid-row: 1; }
    td:nth-child(2) { display: none; }
    td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
    td:nth-child(4) { display: none; }
    td:nth-child(5) { grid-column: 1; grid-row: 3; }
    td:nth-child(6) { display: none; }
    td:nth-child(7) { grid-column: 2; grid-row: 3; }

    td[data-label="Codigo"] strong,
    td[data-label="Zona / tipo"] strong {
        font-size: 16px;
        line-height: 1.05;
    }

    td[data-label="Codigo"] a {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 2px 6px;
    }

    td[data-label="Codigo"] .mobile-compact-zone {
        display: inline;
        color: var(--text);
        font-size: 15px;
        font-weight: 850;
        line-height: 1.08;
    }

    td[data-label="Codigo"] .mobile-compact-type {
        display: block;
        width: 100%;
        color: var(--muted);
        font-size: 12px;
        font-weight: 700;
        line-height: 1.05;
    }

    td[data-label="Zona / tipo"] {
        display: none;
    }

    td[data-label="Zona / tipo"] .subtext {
        display: block;
        margin-top: 0;
        color: var(--muted);
        font-size: 12px;
        line-height: 1.05;
    }

    td[data-label="Canon"],
    td[data-label="Detalles"],
    td[data-label="Estado"],
    td[data-label="Actualizado"] {
        font-size: 13px;
        line-height: 1.08;
    }

    td[data-label="Canon"] {
        font-size: 13px;
        line-height: 1.04;
    }

    td[data-label="Canon"] .mobile-compact-meta {
        display: inline;
        color: var(--text);
        font-size: 13px;
        font-weight: 750;
    }

    td[data-label="Canon"] .subtext {
        display: none;
    }

    .dashboard-filters-actions {
        align-items: stretch;
    }

    .quick-dates {
        justify-content: center;
    }

    .dashboard-tabs a {
        padding: 10px 12px;
        font-size: 13px;
    }

    td[data-label="Detalles"],
    td[data-label="Actualizado"] {
        display: none;
    }

    td[data-label="Estado"] {
        grid-column: 1;
        grid-row: 3;
    }

    td[data-label="Acciones"] {
        grid-column: 2;
        grid-row: 3;
    }

    .actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: center;
        gap: 4px;
    }

    .actions::before {
        content: none;
    }

    .actions .button.small {
        width: 100%;
        min-width: 0;
        min-height: 30px;
        padding: 6px 7px;
        font-size: 11px;
        justify-content: center;
    }

    .detail-hero,
    .hero-actions {
        flex-direction: column;
    }

    .detail-hero {
        gap: 8px;
        padding: 11px;
        margin-bottom: 10px;
        border-radius: 16px;
    }

    .detail-hero h1 {
        font-size: clamp(17px, 5.2vw, 22px);
        line-height: 1.02;
    }

    .detail-hero p {
        font-size: 12px;
        line-height: 1.14;
    }

    .hero-actions {
        gap: 6px;
    }

    .status-pill {
        min-height: 26px;
        padding: 4px 8px;
        font-size: 11px;
    }

    dl,
    .full-data {
        grid-template-columns: 1fr;
    }

    .container {
        width: min(100% - 16px, 1180px);
        margin-top: 12px;
    }

    .section-head h1 {
        font-size: clamp(19px, 5.6vw, 24px);
        line-height: 1.02;
    }

    .section-head h1 {
        font-size: clamp(20px, 5.8vw, 26px);
        line-height: 1.04;
    }

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

    .property-wizard {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }

    .wizard-steps {
        position: static;
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
        scroll-snap-type: x mandatory;
    }

    .wizard-steps button {
        min-width: 178px;
        min-height: 58px;
        scroll-snap-align: start;
    }

    .property-wizard-step {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 14px;
    }

    .wizard-observation-grid {
        grid-template-columns: 1fr;
    }

    .wizard-photo-cta {
        align-items: stretch;
        flex-direction: column;
    }

    .wizard-photo-cta .button {
        width: 100%;
    }

    .wizard-actions {
        grid-column: 1;
        flex-direction: column;
        justify-content: stretch;
    }

    .wizard-actions .button,
    .wizard-actions .primary,
    .wizard-actions button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .welcome {
        max-width: 128px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar nav a {
        padding-inline: 9px;
        font-size: 11px;
    }

    .summary-card strong {
        font-size: 20px;
    }

    .detail-hero h1 {
        font-size: 20px;
    }
}

@media print {
    .topbar,
    .hero-actions,
    .button,
    button {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .container {
        width: 100%;
        margin: 0;
    }

    .detail-card,
    .detail-hero,
    .signature-grid > div {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        break-inside: avoid;
    }
}
