:root {
    --bg: #f4f7f8;
    --bg-soft: #eef5f6;
    --card: #ffffff;
    --text: #14212b;
    --muted: #637381;
    --muted-2: #8493a1;
    --primary: #1f6f78;
    --primary-dark: #185860;
    --primary-soft: #e6f3f4;
    --border: #dde6ea;
    --border-strong: #c7d5dc;
    --warning: #946200;
    --warning-bg: #fff7dc;
    --danger: #b42318;
    --danger-bg: #fff1f0;
    --success: #0f766e;
    --success-bg: #e7f7f4;
    --info: #1d4ed8;
    --info-bg: #eff6ff;
    --dark: #26323c;
    --dark-bg: #edf0f2;
    --shadow: 0 18px 46px rgba(20, 33, 43, 0.08);
    --shadow-soft: 0 10px 28px rgba(20, 33, 43, 0.06);
    --radius: 20px;
    --radius-sm: 12px;
    --sidebar-width: 292px;
    --topbar-height: 78px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 120, 0.08), transparent 32%),
        linear-gradient(180deg, #f8fbfc 0%, var(--bg) 100%);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
}

body.no-scroll,
body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--primary);
}

img {
    max-width: 100%;
    height: auto;
}

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

button {
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
}

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

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #f8fbfc;
}

tr:last-child td {
    border-bottom: 0;
}

td strong {
    color: var(--text);
}

label {
    display: block;
    margin: 0 0 7px;
    color: var(--text);
    font-size: 13px;
    font-weight: 800;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #ffffff;
    color: var(--text);
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input,
select {
    min-height: 46px;
    padding: 0 13px;
}

textarea {
    min-height: 126px;
    padding: 12px 13px;
    resize: vertical;
}

textarea.small,
.field textarea.small {
    min-height: 82px;
}

select[multiple] {
    min-height: 142px;
    padding: 10px 13px;
}

input[type="file"] {
    padding: 11px 13px;
    min-height: auto;
    background: #ffffff;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    min-height: auto;
}

input:focus,
select:focus,
textarea:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: rgba(31, 111, 120, 0.62);
    box-shadow: 0 0 0 4px rgba(31, 111, 120, 0.11);
}

input[readonly],
textarea[readonly],
select[disabled] {
    background: #f7fafb;
    color: var(--muted);
    cursor: not-allowed;
}

.layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 26px 20px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    box-shadow: 10px 0 34px rgba(20, 33, 43, 0.04);
    z-index: 30;
}

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #d6e1e6;
    border-radius: 999px;
}

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

.brand-logo,
.rp-logo {
    display: block;
    max-width: 210px;
    max-height: 54px;
    object-fit: contain;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), #2fa5a7);
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 14px 30px rgba(31, 111, 120, 0.24);
}

.brand-title,
.brand-name {
    display: block;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.1;
}

.brand-subtitle {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.user-card {
    padding: 15px;
    margin: 0 0 22px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbfc 100%);
}

.user-name {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 900;
}

.user-meta {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.nav,
.nav-section {
    display: grid;
    gap: 6px;
    margin: 0 0 20px;
}

.nav-title {
    margin: 18px 0 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.nav a,
.nav-link,
.module-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 14px;
    color: #30404d;
    font-size: 14px;
    font-weight: 800;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav a:hover,
.nav a.active,
.nav-link:hover,
.nav-link.active,
.module-link:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
    transform: translateX(2px);
}

.nav-badge {
    min-width: 22px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--soft, var(--bg-soft));
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.sidebar-footer {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 12px;
}

.sidebar-footer strong {
    display: block;
    color: var(--text);
    font-weight: 900;
}

.sidebar-footer span {
    display: block;
    margin-top: 4px;
}

.logout-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    margin-top: 16px;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--danger-bg);
    color: var(--danger);
    font-weight: 900;
}

.logout-link:hover {
    background: #ffe4e1;
    color: var(--danger);
}

.main {
    min-width: 0;
    padding: 28px;
}

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

.page-title h1,
h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(26px, 3vw, 38px);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.page-title p,
.topbar p,
.subtitle {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.top-actions,
.actions,
.form-actions,
.toolbar-actions,
.submit-row,
.filters-actions,
.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.btn,
.button,
button.button,
.btn-primary,
.button-primary,
.btn-soft,
.btn-muted,
.button-muted,
.action-link,
.small-link,
.mini-link,
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 15px;
    border: 0;
    border-radius: 13px;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.1;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.btn:hover,
.button:hover,
.action-link:hover,
.small-link:hover,
.mini-link:hover,
.page-link:hover {
    transform: translateY(-1px);
}

.btn-primary,
.button-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(31, 111, 120, 0.18);
}

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

.btn-soft,
.btn-muted,
.button-muted {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--primary-dark);
}

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

.action-link,
.small-link,
.mini-link {
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--primary-dark);
    font-size: 12px;
}

.page-link {
    min-width: 40px;
    min-height: 38px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
}

.page-link.active,
.pagination-links span.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
}

.page-link.disabled,
.pagination-links span.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.card,
.panel-card,
.form-card,
.form-panel,
.context-card,
.filters-card,
.entries-card,
.incidents-card,
.changes-card,
.validations-card,
.certifications-card,
.invoices-card,
.documents-card,
.notifications-card,
.materials-card,
.hero-card,
.selector-card,
.side-panel,
.summary-card,
.meta-card,
.amount-box,
.metadata-box,
.readonly-box,
.answer-box,
.question-box,
.message-box,
.info-box,
.economic-box,
.kpi,
.stat-card,
.detail,
.status-box,
.file-card,
.linked-card,
.comment,
.timeline-item,
.event-item,
.evidence-item,
.item,
.record,
.interaction,
.example,
.project-context,
.security-note {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.card,
.panel-card,
.form-card,
.form-panel,
.context-card,
.filters-card,
.entries-card,
.incidents-card,
.changes-card,
.validations-card,
.certifications-card,
.invoices-card,
.documents-card,
.notifications-card,
.materials-card,
.hero-card,
.selector-card,
.side-panel {
    padding: 22px;
}

.card + .card,
.panel-card + .panel-card,
.section + .section {
    margin-top: 18px;
}

.card-header,
.entries-header,
.incidents-header,
.changes-header,
.validations-header,
.certifications-header,
.invoices-header,
.documents-header,
.notifications-header,
.materials-header,
.table-head,
.table-top,
.section-header,
.record-head,
.comment-head,
.timeline-head,
.item-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.card-header h2,
.entries-header h2,
.incidents-header h2,
.changes-header h2,
.validations-header h2,
.certifications-header h2,
.invoices-header h2,
.documents-header h2,
.notifications-header h2,
.materials-header h2,
.table-head h2,
.table-top h2,
.section-header h2,
.card h2 {
    margin: 0;
    color: var(--text);
    font-size: 19px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.card-header p,
.card > p,
.entries-header span,
.incidents-header span,
.changes-header span,
.validations-header span,
.certifications-header span,
.invoices-header span,
.documents-header span,
.notifications-header span,
.materials-header span,
.table-head p,
.table-top p,
.section-header p,
.card-subtitle,
.card-subtitle,
.table-desc {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.card-title,
.table-title {
    margin: 0;
    color: var(--text);
    font-size: 18px;
    font-weight: 900;
}

.card-subtitle {
    display: block;
}

.card-body {
    margin-top: 14px;
}

.grid,
.grid-2,
.grid-3,
.grid-4,
.grid-stats,
.stats-grid,
.summary-grid,
.content-grid,
.context-grid,
.hero-grid,
.info-grid,
.kpi-grid,
.economic-grid,
.details-grid,
.meta-grid,
.amount-row,
.filters,
.filters-form,
.filters-grid,
.form-grid,
.form-grid-3,
.checkbox-grid,
.file-grid,
.selector-form {
    display: grid;
    gap: 16px;
}

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

.grid-2,
.content-grid,
.hero-grid,
.selector-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3,
.grid-stats,
.stats-grid,
.summary-grid,
.info-grid,
.kpi-grid,
.economic-grid,
.form-grid-3,
.meta-grid,
.filters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.details-grid,
.context-grid,
.amount-row,
.file-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filters,
.filters-form {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
}

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

.form-grid .full,
.field.full,
.full {
    grid-column: 1 / -1;
}

.field {
    min-width: 0;
}

.field label {
    margin-bottom: 7px;
}

.hint,
.help,
.section-note,
.note,
.small {
    color: var(--muted);
    font-size: 12px;
}

.help,
.hint {
    margin-top: 6px;
}

.section-note,
.note {
    margin: 10px 0 0;
}

.alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-weight: 700;
}

.alert ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.alert-danger {
    border-color: #ffc9c4;
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    border-color: #bce8df;
    background: var(--success-bg);
    color: var(--success);
}

.alert-warning {
    border-color: #f3d98c;
    background: var(--warning-bg);
    color: var(--warning);
}

.alert-info {
    border-color: #bfdbfe;
    background: var(--info-bg);
    color: var(--info);
}

.badge,
.badge-soft,
.badge-warning,
.badge-danger,
.badge-success,
.badge-info,
.badge-dark,
.badge-outline,
.code-pill,
.section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 25px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    white-space: nowrap;
}

.badge,
.badge-soft {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.badge-warning {
    background: var(--warning-bg);
    color: var(--warning);
}

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

.badge-success {
    background: var(--success-bg);
    color: var(--success);
}

.badge-info {
    background: var(--info-bg);
    color: var(--info);
}

.badge-dark {
    background: var(--dark-bg);
    color: var(--dark);
}

.badge-outline,
.code-pill {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--muted);
}

.badges {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
}

.table-wrap table {
    min-width: 760px;
}

.empty,
.empty-state,
.empty-message,
.empty-side {
    padding: 22px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.62);
    color: var(--muted);
    text-align: center;
}

.empty strong,
.empty-state strong,
.empty-message strong {
    display: block;
    color: var(--text);
    font-size: 16px;
    margin-bottom: 5px;
}

.empty p,
.empty-state p,
.empty-message p {
    margin: 0;
    color: var(--muted);
}

.stat-card,
.kpi,
.summary-card,
.info-box,
.economic-box,
.amount-box,
.status-item,
.detail,
.context-item,
.meta-item {
    padding: 16px;
}

.stat-label,
.kpi span,
.summary-card span,
.info-box h3,
.economic-box span,
.context-label,
.meta-label,
.detail-label,
.status-label,
.amount span,
.detail-row span:first-child {
    display: block;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.stat-value,
.kpi strong,
.summary-card strong,
.economic-box strong,
.context-value,
.meta-value,
.detail-value,
.status-value,
.amount strong,
.money,
.amount,
.detail-row span:last-child {
    display: block;
    color: var(--text);
    font-size: 20px;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.detail-value.normal {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0;
}

.context-list,
.detail-list,
.module-list,
.entry-list,
.incident-list,
.change-list,
.validation-list,
.certification-list,
.invoice-list,
.document-list,
.notification-list,
.material-list,
.item-list,
.evidence-list,
.event-list,
.comment-list,
.linked-list,
.timeline,
.timeline-list,
.rules,
.examples,
.toc {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.entry,
.incident,
.change,
.validation,
.certification,
.invoice,
.document,
.notification,
.material {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.entry:last-child,
.incident:last-child,
.change:last-child,
.validation:last-child,
.certification:last-child,
.invoice:last-child,
.document:last-child,
.notification:last-child,
.material:last-child,
.record:last-child {
    border-bottom: 0;
}

.entry-top,
.incident-top,
.change-top,
.validation-top,
.certification-top,
.invoice-top,
.document-top,
.notification-top,
.material-top {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 7px;
}

.entry-title-wrap,
.incident-title-wrap,
.change-title-wrap,
.validation-title-wrap,
.certification-title-wrap,
.invoice-title-wrap,
.document-title-wrap,
.notification-title-wrap,
.material-title-wrap,
.title-line,
.project-title-line,
.user-title,
.payment-title,
.cert-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.entry-title,
.incident-title,
.change-title,
.validation-title,
.certification-title,
.invoice-title,
.document-title,
.notification-title,
.material-title,
.project-title,
.task-title,
.record-title,
.item-title,
.evidence-title,
.linked-card strong,
.timeline-item strong,
.comment strong {
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
}

.entry-title a:hover,
.incident-title a:hover,
.change-title a:hover,
.validation-title a:hover,
.certification-title a:hover,
.invoice-title a:hover,
.document-title a:hover,
.notification-title a:hover,
.material-title a:hover,
.project-title:hover,
.task-title:hover {
    color: var(--primary);
}

.entry-body,
.incident-body,
.change-body,
.validation-body,
.certification-body,
.invoice-body,
.document-body,
.notification-body,
.material-body,
.record-body,
.item-text,
.description,
.entry-content {
    margin-top: 8px;
    color: var(--text);
}

.entry-meta,
.incident-meta,
.change-meta,
.validation-meta,
.certification-meta,
.invoice-meta,
.document-meta,
.notification-meta,
.material-meta,
.record-meta,
.item-meta,
.evidence-meta,
.interaction-meta,
.task-meta,
.cover-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.entry-links,
.incident-links,
.change-links,
.validation-links,
.certification-links,
.invoice-links,
.document-links,
.notification-links,
.material-links,
.link-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.entry-date,
.incident-date,
.change-date,
.validation-date,
.certification-date,
.invoice-date,
.document-date,
.notification-date,
.material-date {
    min-width: 92px;
    color: var(--muted);
    font-size: 12px;
    text-align: right;
}

.entry-date strong,
.incident-date strong,
.change-date strong,
.validation-date strong,
.certification-date strong,
.invoice-date strong,
.document-date strong,
.notification-date strong,
.material-date strong {
    display: block;
    color: var(--text);
    font-size: 13px;
}

.notification.unread {
    padding-left: 14px;
    border-left: 4px solid var(--primary);
    background: linear-gradient(90deg, rgba(31, 111, 120, 0.06), transparent 60%);
}

.progress,
.progress-wrap,
.progress-bar {
    overflow: hidden;
    height: 9px;
    border-radius: 999px;
    background: #e4ecef;
}

.progress span,
.progress-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), #2fa5a7);
}

.progress-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.progress-cell {
    min-width: 140px;
}

.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.nowrap {
    white-space: nowrap;
}

.strong {
    font-weight: 950;
}

.project-code {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.checks,
.checkbox-list {
    display: grid;
    gap: 10px;
}

.check,
.checkbox,
.check-option,
.checkbox-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #ffffff;
}

.check input,
.checkbox input,
.check-option input,
.checkbox-line input {
    margin-top: 3px;
    flex: 0 0 auto;
}

.check strong,
.check-option strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.check span,
.check-option span,
.checkbox-line span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.checkbox-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.context-card,
.filters-card {
    margin-bottom: 18px;
}

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

.project-context strong {
    display: block;
    color: var(--text);
    font-weight: 950;
}

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

.form-actions,
.submit-row {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}

.pagination,
.pagination-links,
.pagination-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pagination-info {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.pagination-links {
    justify-content: flex-end;
}

.pagination-links a,
.pagination-links span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    font-size: 13px;
    font-weight: 900;
}

.pagination-links a:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.json-box,
.code-box {
    overflow-x: auto;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #0f172a;
    color: #e2e8f0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    line-height: 1.55;
}

.readonly-box,
.message-box,
.question-box,
.answer-box {
    padding: 16px;
    background: #f8fbfc;
}

.message-box.empty-message {
    border-style: dashed;
    color: var(--muted);
}

.rules li {
    padding-left: 4px;
    color: var(--muted);
}

.interaction {
    padding: 16px;
}

.interaction + .interaction {
    margin-top: 12px;
}

.interaction strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
}

.interaction p {
    margin: 0;
    color: var(--text);
}

.example {
    padding: 14px;
    color: var(--muted);
    cursor: pointer;
}

.example:hover {
    border-color: rgba(31, 111, 120, 0.36);
    color: var(--primary-dark);
}

.file-card {
    padding: 16px;
}

.file-card h3 {
    margin: 0 0 7px;
    font-size: 15px;
}

.file-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.linked-card,
.timeline-item,
.comment,
.event-item,
.evidence-item,
.item {
    padding: 14px;
    box-shadow: none;
}

.linked-card:hover {
    border-color: rgba(31, 111, 120, 0.4);
    background: #f8fbfc;
}

.linked-card span,
.timeline-item span,
.timeline-item p,
.comment p {
    display: block;
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.timeline-date {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.timeline-title {
    margin-top: 3px;
    color: var(--text);
    font-weight: 950;
}

.timeline-body {
    margin-top: 5px;
    color: var(--muted);
}

.toolbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(14px);
}

.toolbar strong {
    color: var(--text);
    font-weight: 950;
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 30px;
}

.cover {
    min-height: 64vh;
    display: grid;
    align-content: space-between;
    gap: 30px;
    padding: 42px;
    border-radius: 28px;
    background: linear-gradient(135deg, #ffffff 0%, #edf7f8 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.cover-title h1 {
    margin: 0;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1;
}

.cover-title p {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 18px;
}

.cover-footer {
    color: var(--muted);
    font-size: 13px;
}

.section {
    padding: 26px;
    border: 1px solid var(--border);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.section h2,
.section h3 {
    margin: 0 0 12px;
}

.section-intro {
    margin: 0 0 18px;
    color: var(--muted);
}

.section.break-before {
    break-before: page;
}

.toc a {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--primary-dark);
    font-weight: 800;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.brand-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 54px;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.24), transparent 28%),
        linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #ffffff;
}

.brand-panel::after {
    content: "";
    position: absolute;
    right: -160px;
    bottom: -160px;
    width: 360px;
    height: 360px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
}

.brand-panel h1 {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 42px 0 20px;
    color: #ffffff;
    font-size: clamp(36px, 5vw, 66px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.brand-panel p {
    position: relative;
    z-index: 1;
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 17px;
}

.feature-list {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 12px;
    max-width: 620px;
    margin: 36px 0 0;
}

.feature-item {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
}

.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 42px;
    box-shadow: none;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.form-card {
    width: 100%;
    max-width: 470px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.form-card h2 {
    margin: 0;
    font-size: 28px;
}

.form-card .intro {
    margin: 8px 0 22px;
    color: var(--muted);
}

.security-note {
    margin-top: 18px;
    padding: 14px;
    color: var(--muted);
    font-size: 12px;
    box-shadow: none;
}

.security-note strong {
    color: var(--text);
}

.link {
    color: var(--primary);
    font-weight: 900;
}

.link:hover {
    color: var(--primary-dark);
}

.mobile-header,
.mobile-nav,
.mobile-menu-note,
.menu-backdrop {
    display: none;
}

.mobile-header {
    position: sticky;
    top: 0;
    z-index: 50;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 68px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px);
}

.mobile-brand {
    display: flex;
    align-items: center;
    min-width: 0;
}

.mobile-brand img {
    display: block;
    max-width: 178px;
    max-height: 44px;
    object-fit: contain;
}

.mobile-menu-button,
.hamburger,
.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: var(--shadow-soft);
}

.mobile-menu-button span,
.hamburger span,
.menu-toggle span {
    position: relative;
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.mobile-menu-button span::before,
.mobile-menu-button span::after,
.hamburger span::before,
.hamburger span::after,
.menu-toggle span::before,
.menu-toggle span::after {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.18s ease, top 0.18s ease, opacity 0.18s ease;
}

.mobile-menu-button span::before,
.hamburger span::before,
.menu-toggle span::before {
    top: -7px;
}

.mobile-menu-button span::after,
.hamburger span::after,
.menu-toggle span::after {
    top: 7px;
}

body.menu-open .mobile-menu-button span,
body.menu-open .hamburger span,
body.menu-open .menu-toggle span {
    background: transparent;
}

body.menu-open .mobile-menu-button span::before,
body.menu-open .hamburger span::before,
body.menu-open .menu-toggle span::before {
    top: 0;
    transform: rotate(45deg);
    background: var(--primary-dark);
}

body.menu-open .mobile-menu-button span::after,
body.menu-open .hamburger span::after,
body.menu-open .menu-toggle span::after {
    top: 0;
    transform: rotate(-45deg);
    background: var(--primary-dark);
}

.menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(15, 23, 42, 0.42);
}

body.menu-open .menu-backdrop {
    display: block;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary-dark);
    font-weight: 950;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.amount-row span,
.amount-row strong {
    display: block;
}

.amount-row strong {
    margin-top: 4px;
}

.type-help {
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f8fbfc;
}

.type-help strong {
    display: block;
    color: var(--text);
}

.type-help p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.cover-meta,
.grid-2,
.grid-3 {
    align-items: stretch;
}

.break-before {
    break-before: page;
}

@media (max-width: 1280px) {
    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filters,
    .filters-form,
    .filters-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    :root {
        --sidebar-width: 286px;
    }

    .mobile-header {
        display: flex;
    }

    .layout {
        display: block;
        min-height: 100vh;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 45;
        width: min(86vw, var(--sidebar-width));
        max-width: 330px;
        height: 100vh;
        padding: 22px 18px;
        transform: translateX(-105%);
        transition: transform 0.22s ease;
        box-shadow: 18px 0 40px rgba(20, 33, 43, 0.18);
    }

    body.menu-open .sidebar {
        transform: translateX(0);
    }

    .main {
        padding: 20px 16px 32px;
    }

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

    .top-actions,
    .actions {
        justify-content: flex-start;
    }

    .grid,
    .grid-2,
    .grid-3,
    .grid-4,
    .grid-stats,
    .stats-grid,
    .summary-grid,
    .content-grid,
    .context-grid,
    .hero-grid,
    .info-grid,
    .kpi-grid,
    .economic-grid,
    .details-grid,
    .meta-grid,
    .amount-row,
    .filters,
    .filters-form,
    .filters-grid,
    .form-grid,
    .form-grid-3,
    .checkbox-grid,
    .file-grid,
    .selector-form {
        grid-template-columns: 1fr;
    }

    .card,
    .panel-card,
    .form-card,
    .form-panel,
    .context-card,
    .filters-card,
    .entries-card,
    .incidents-card,
    .changes-card,
    .validations-card,
    .certifications-card,
    .invoices-card,
    .documents-card,
    .notifications-card,
    .materials-card,
    .hero-card,
    .selector-card,
    .side-panel,
    .section {
        padding: 18px;
        border-radius: 18px;
    }

    .card-header,
    .entries-header,
    .incidents-header,
    .changes-header,
    .validations-header,
    .certifications-header,
    .invoices-header,
    .documents-header,
    .notifications-header,
    .materials-header,
    .table-head,
    .table-top,
    .section-header,
    .record-head,
    .comment-head,
    .timeline-head,
    .item-head,
    .entry-top,
    .incident-top,
    .change-top,
    .validation-top,
    .certification-top,
    .invoice-top,
    .document-top,
    .notification-top,
    .material-top,
    .project-context {
        flex-direction: column;
        align-items: flex-start;
    }

    .entry-date,
    .incident-date,
    .change-date,
    .validation-date,
    .certification-date,
    .invoice-date,
    .document-date,
    .notification-date,
    .material-date {
        min-width: 0;
        text-align: left;
    }

    .btn,
    .button,
    button.button,
    .btn-primary,
    .button-primary,
    .btn-soft,
    .btn-muted,
    .button-muted {
        width: 100%;
    }

    .top-actions .btn,
    .actions .btn,
    .form-actions .btn,
    .submit-row .btn {
        width: 100%;
    }

    .pagination,
    .pagination-links,
    .pagination-actions {
        justify-content: flex-start;
    }

    .login-shell {
        grid-template-columns: 1fr;
    }

    .brand-panel {
        min-height: auto;
        padding: 34px 24px;
    }

    .brand-panel h1 {
        margin-top: 26px;
    }

    .form-panel {
        padding: 24px 16px;
    }

    .toolbar {
        position: static;
        flex-direction: column;
        align-items: stretch;
    }

    .page {
        padding: 18px 14px;
    }

    .cover {
        min-height: auto;
        padding: 26px 20px;
        border-radius: 22px;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 14px;
    }

    .main {
        padding: 18px 12px 28px;
    }

    .page-title h1,
    h1 {
        font-size: 27px;
    }

    .page-title p,
    .topbar p,
    .subtitle {
        font-size: 14px;
    }

    .brand-logo,
    .rp-logo {
        max-width: 185px;
    }

    .mobile-brand img {
        max-width: 154px;
    }

    .card,
    .panel-card,
    .form-card,
    .form-panel,
    .context-card,
    .filters-card,
    .entries-card,
    .incidents-card,
    .changes-card,
    .validations-card,
    .certifications-card,
    .invoices-card,
    .documents-card,
    .notifications-card,
    .materials-card,
    .hero-card,
    .selector-card,
    .side-panel,
    .section {
        padding: 16px;
        border-radius: 16px;
    }

    .stat-value,
    .kpi strong,
    .summary-card strong,
    .economic-box strong,
    .context-value,
    .meta-value,
    .detail-value,
    .status-value,
    .amount strong,
    .money,
    .amount {
        font-size: 18px;
    }

    th,
    td {
        padding: 12px 10px;
    }

    .table-wrap {
        border-radius: 15px;
    }

    .entry,
    .incident,
    .change,
    .validation,
    .certification,
    .invoice,
    .document,
    .notification,
    .material {
        padding: 14px 0;
    }

    .form-actions,
    .submit-row {
        margin-top: 16px;
    }

    .login-shell {
        min-height: 100vh;
    }

    .brand-panel {
        padding: 28px 18px;
    }

    .brand-panel h1 {
        font-size: 34px;
    }

    .brand-panel p {
        font-size: 15px;
    }

    .form-card {
        padding: 22px;
    }
}


/* ==========================================================
   ReformaProtegida - Capa de simplificación UX
   Panel cliente, diario tipo muro, partidas, pagos,
   documentos y Asistente de Obra.
   ========================================================== */

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

.btn-sm,
.btn-small {
    min-height: 34px;
    padding: 7px 11px;
    border-radius: 11px;
    font-size: 12px;
}

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

.actions-field {
    display: flex;
    align-items: end;
}

.actions-field .btn,
.actions-field .button {
    width: 100%;
}

.module-link {
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(20, 33, 43, 0.035);
}

.module-link > div {
    min-width: 0;
}

.module-link strong {
    display: block;
    color: var(--text);
    font-weight: 950;
}

.module-link span {
    color: var(--muted);
}

.module-link div > span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.module-link:hover strong {
    color: var(--primary-dark);
}

.side-panel {
    display: grid;
    gap: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.side-panel .card {
    margin-top: 0;
}

.meta-list {
    display: grid;
    gap: 9px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.meta-list li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.meta-list li:last-child {
    border-bottom: 0;
}

.meta-list strong {
    color: var(--text);
    font-weight: 950;
    text-align: right;
}

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

.document-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.document-card:hover {
    border-color: rgba(31, 111, 120, 0.36);
    transform: translateY(-1px);
}

.doc-thumb,
.attachment-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 148px;
    margin-bottom: 13px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: linear-gradient(135deg, #f8fbfc, var(--primary-soft));
    color: var(--primary-dark);
    font-weight: 950;
}

.doc-thumb img,
.attachment-thumb img {
    width: 100%;
    height: 100%;
    min-height: 148px;
    object-fit: cover;
}

.document-card h3,
.document-card .document-title {
    margin: 0;
    color: var(--text);
    font-size: 15px;
    font-weight: 950;
    line-height: 1.25;
}

.document-card p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.document-card .actions,
.document-card .row-actions {
    margin-top: auto;
    padding-top: 14px;
    justify-content: flex-start;
}

.entry-list .entry,
.item-list .item,
.timeline-list .timeline-item {
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.entry-list .entry {
    padding: 18px;
}

.entry-top {
    align-items: flex-start;
}

.entry-body {
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
}

.entry-body p:first-child,
.item-text p:first-child {
    margin-top: 0;
}

.entry-body p:last-child,
.item-text p:last-child {
    margin-bottom: 0;
}

.entry-links a,
.entry-links .mini-link,
.entry-links .action-link {
    background: #ffffff;
}

.readonly-box {
    color: var(--text);
    line-height: 1.6;
}

.detail,
.item,
.status-box {
    box-shadow: none;
}

.detail .badge,
.item .badge,
.module-link .badge {
    vertical-align: middle;
}

/* =========================
   Asistente de Obra
   ========================= */

.assistant-page-shell {
    display: grid;
    gap: 18px;
}

.assistant-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 26px;
    background:
        radial-gradient(circle at top right, rgba(31, 111, 120, 0.12), transparent 38%),
        linear-gradient(135deg, #ffffff 0%, #f0f8f9 100%);
    box-shadow: var(--shadow-soft);
}

.assistant-hero-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.assistant-main-avatar,
.assistant-message-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--primary), #2fa5a7);
    color: #ffffff;
    font-weight: 950;
    box-shadow: 0 12px 24px rgba(31, 111, 120, 0.16);
}

.assistant-kicker {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 6px;
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.assistant-kicker-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.assistant-chat-title,
.assistant-hero h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(25px, 3vw, 36px);
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.assistant-chat-meta,
.assistant-project-meta,
.assistant-composer-note,
.assistant-privacy-note {
    margin-top: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.assistant-hero-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.assistant-project-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.assistant-project-selector {
    display: grid;
    gap: 7px;
}

.assistant-project-quickstatus,
.assistant-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.assistant-pill,
.assistant-pill-soft,
.assistant-pill-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 30px;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 950;
    white-space: nowrap;
}

.assistant-pill,
.assistant-pill-soft {
    background: var(--primary-soft);
    color: var(--primary-dark);
}

.assistant-pill-dark {
    background: var(--dark-bg);
    color: var(--dark);
}

.assistant-info-grid,
.assistant-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.assistant-info-card,
.assistant-stat {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

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

.assistant-info-card-full {
    grid-column: 1 / -1;
}

.assistant-section-title {
    margin: 0 0 12px;
    color: var(--text);
    font-size: 16px;
    font-weight: 950;
}

.assistant-stat span,
.assistant-info-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.assistant-stat strong,
.assistant-info-card strong {
    display: block;
    margin-top: 6px;
    color: var(--text);
    font-size: 19px;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.assistant-chat-wrap {
    display: grid;
    grid-template-rows: auto minmax(420px, 62vh) auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 26px;
    background: #ffffff;
    box-shadow: var(--shadow);
}

.assistant-chat-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(248, 251, 252, 0.92);
}

.assistant-chat-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    padding: 20px;
    background:
        radial-gradient(circle at top left, rgba(31, 111, 120, 0.05), transparent 30%),
        #fbfdfe;
}

.assistant-empty,
.assistant-welcome {
    max-width: 760px;
    margin: auto;
    padding: 24px;
    border: 1px dashed var(--border-strong);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--muted);
    text-align: center;
}

.assistant-empty strong,
.assistant-welcome strong {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-size: 20px;
    font-weight: 950;
}

.assistant-empty-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.assistant-message {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 11px;
    max-width: 86%;
}

.assistant-message-user {
    align-self: flex-end;
    grid-template-columns: minmax(0, 1fr) 42px;
    margin-left: auto;
}

.assistant-message-user .assistant-message-avatar {
    grid-column: 2;
    grid-row: 1;
    background: var(--dark-bg);
    color: var(--dark);
    box-shadow: none;
}

.assistant-message-user .assistant-message-content {
    grid-column: 1;
    grid-row: 1;
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.assistant-message-bot .assistant-message-content {
    background: #ffffff;
}

.assistant-message-content {
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.assistant-message-author {
    display: block;
    margin-bottom: 5px;
    font-size: 12px;
    font-weight: 950;
    opacity: 0.8;
}

.assistant-message-content p {
    margin: 0 0 9px;
}

.assistant-message-content p:last-child {
    margin-bottom: 0;
}

.assistant-message-status {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.assistant-composer-shell {
    padding: 14px;
    border-top: 1px solid var(--border);
    background: #ffffff;
}

.assistant-composer {
    display: grid;
    gap: 10px;
}

.assistant-input-line {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.assistant-input-line textarea {
    min-height: 50px;
    max-height: 170px;
    resize: vertical;
    border-radius: 16px;
}

.assistant-attach-button,
.assistant-send-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    border: 0;
    border-radius: 16px;
    font-weight: 950;
}

.assistant-attach-button {
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--primary-dark);
}

.assistant-send-button {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(31, 111, 120, 0.17);
}

.assistant-send-button:hover {
    background: var(--primary-dark);
}

.assistant-hidden-file,
.assistant-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.assistant-attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.assistant-suggestions-block {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow-soft);
}

.assistant-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.assistant-suggestion {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary-dark);
    font-size: 13px;
    font-weight: 900;
}

.assistant-suggestion:hover {
    background: var(--primary-soft);
    border-color: rgba(31, 111, 120, 0.3);
}

.assistant-task-list,
.assistant-money-list {
    display: grid;
    gap: 10px;
}

.assistant-task-item {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: #f8fbfc;
}

.assistant-task-item strong {
    display: block;
    color: var(--text);
    font-weight: 950;
}

.assistant-task-item span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 1280px) {
    .document-grid,
    .attachment-grid,
    .assistant-info-grid,
    .assistant-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .assistant-chat-wrap {
        grid-template-rows: auto minmax(380px, 58vh) auto;
    }
}

@media (max-width: 980px) {
    .assistant-hero,
    .assistant-project-strip {
        grid-template-columns: 1fr;
    }

    .assistant-hero-actions,
    .assistant-project-quickstatus,
    .assistant-status {
        justify-content: flex-start;
    }

    .assistant-info-grid,
    .assistant-stats-grid,
    .document-grid,
    .attachment-grid {
        grid-template-columns: 1fr;
    }

    .assistant-info-card-wide,
    .assistant-info-card-full {
        grid-column: auto;
    }

    .assistant-chat-wrap {
        grid-template-rows: auto minmax(360px, 58vh) auto;
        border-radius: 20px;
    }

    .assistant-message,
    .assistant-message-user {
        max-width: 96%;
    }

    .assistant-input-line {
        grid-template-columns: auto minmax(0, 1fr) auto;
    }
}

@media (max-width: 640px) {
    .module-link {
        align-items: flex-start;
        padding: 13px;
    }

    .module-link > span:last-child {
        display: none;
    }

    .meta-list li {
        display: block;
    }

    .meta-list strong {
        display: block;
        margin-top: 4px;
        text-align: left;
    }

    .assistant-hero {
        padding: 18px;
        border-radius: 20px;
    }

    .assistant-hero-main {
        align-items: flex-start;
    }

    .assistant-main-avatar {
        width: 42px;
        height: 42px;
        border-radius: 15px;
    }

    .assistant-chat-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .assistant-chat-body {
        padding: 14px;
    }

    .assistant-message,
    .assistant-message-user {
        grid-template-columns: 1fr;
        max-width: 100%;
    }

    .assistant-message-avatar,
    .assistant-message-user .assistant-message-avatar {
        display: none;
    }

    .assistant-message-content,
    .assistant-message-user .assistant-message-content {
        grid-column: 1;
        grid-row: auto;
    }

    .assistant-input-line {
        grid-template-columns: 1fr;
    }

    .assistant-attach-button,
    .assistant-send-button {
        width: 100%;
    }

    .assistant-suggestions {
        display: grid;
        grid-template-columns: 1fr;
    }
}

@media print {
    html,
    body {
        background: #ffffff !important;
    }

    body {
        color: #111827;
        font-size: 12px;
    }

    .sidebar,
    .mobile-header,
    .menu-backdrop,
    .top-actions,
    .actions,
    .toolbar,
    .btn,
    .button,
    .logout-link,
    .selector-card,
    .filters-card,
    .pagination,
    .pagination-links,
    .pagination-actions {
        display: none !important;
    }

    .layout {
        display: block;
    }

    .main,
    .page {
        padding: 0;
        margin: 0;
        max-width: none;
    }

    .card,
    .panel-card,
    .hero-card,
    .section,
    .summary-card,
    .meta-card,
    .info-box,
    .economic-box,
    .kpi {
        box-shadow: none !important;
        break-inside: avoid;
    }

    .section.break-before,
    .break-before {
        break-before: page;
    }

    a {
        color: #111827;
        text-decoration: none;
    }

    .table-wrap {
        overflow: visible;
    }

    .table-wrap table {
        min-width: 0;
    }
}