:root {
    --navy-950: #071f38;
    --navy-900: #0b2748;
    --navy-800: #11385f;
    --blue-600: #1676d2;
    --blue-500: #2789e5;
    --blue-100: #eaf4ff;
    --canvas: #f4f7fb;
    --surface: #ffffff;
    --text: #162438;
    --muted: #67758a;
    --border: #e2e8f0;
    --success: #20865a;
    --danger: #c33d47;
    --shadow-sm: 0 8px 24px rgba(20, 42, 72, 0.07);
    --shadow-md: 0 18px 48px rgba(12, 38, 67, 0.13);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --sidebar-width: 272px;
    color-scheme: light;
}

/* Import cost v0.5 */

.cost-stat-grid {
    display: grid;
    margin-bottom: 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.cost-subnav {
    display: flex;
    margin: -20px 0 22px;
    padding: 5px;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    gap: 4px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: var(--shadow-sm);
}

.cost-subnav a {
    padding: 10px 13px;
    border-radius: 8px;
    color: #607086;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.cost-subnav a.active {
    color: #ffffff;
    background: var(--blue-600);
}

.cost-stat-grid article {
    display: flex;
    min-height: 112px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    flex-direction: column;
    justify-content: center;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cost-stat-grid span {
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.cost-stat-grid strong {
    color: var(--navy-900);
    font-size: clamp(18px, 2vw, 24px);
}

.cost-stat-grid .cost-stat-primary {
    border-color: #b9d9f4;
    color: #ffffff;
    background: linear-gradient(135deg, #1376d1, #0b5799);
}

.cost-stat-grid .cost-stat-primary span,
.cost-stat-grid .cost-stat-primary strong {
    color: #ffffff;
}

.cost-panel {
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.cost-panel-header {
    display: flex;
    min-height: 72px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.cost-panel-header > div,
.cost-panel-header > div > div {
    min-width: 0;
}

.cost-panel-header > div:first-child {
    display: flex;
    align-items: center;
    gap: 11px;
}

.cost-panel-header h2 {
    margin: 0;
    color: #21364f;
    font-size: 16px;
}

.cost-panel-header p {
    margin: 4px 0 0;
    color: #7d8a9c;
    font-size: 11px;
    line-height: 1.4;
}

.cost-step,
.cost-declaration-index {
    display: grid;
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 9px;
    color: #ffffff;
    background: var(--blue-600);
    font-size: 12px;
    font-weight: 800;
    place-items: center;
}

.cost-search {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cost-search input {
    width: min(330px, 34vw);
    height: 44px;
    padding: 0 13px;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    outline: 0;
}

.cost-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.cost-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.cost-table th {
    padding: 12px 14px;
    color: #67768b;
    background: #f7f9fc;
    font-size: 10px;
    font-weight: 800;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.cost-table td {
    padding: 13px 14px;
    border-top: 1px solid #edf1f5;
    color: #34465d;
    vertical-align: middle;
}

.cost-table td strong,
.cost-table td small {
    display: block;
}

.cost-table td small {
    margin-top: 4px;
    color: #8a97a7;
    font-size: 9px;
}

.cost-row-link {
    color: var(--blue-600);
    font-weight: 800;
    white-space: nowrap;
}

.cost-pagination {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
}

.cost-form {
    padding-bottom: 20px;
}

.cost-form-section {
    overflow: visible;
}

.cost-form-section > .form-grid,
.cost-form-section > .cost-table-wrap,
.cost-form-section > .cost-declarations,
.cost-form-section > .cost-auto-fees {
    margin: 20px 22px 22px;
}

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

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

.cost-entry-table {
    min-width: 1120px;
}

.cost-entry-table th,
.cost-entry-table td {
    padding: 8px;
}

.cost-entry-table input,
.cost-entry-table select {
    width: 100%;
    min-width: 92px;
    height: 40px;
    padding: 0 9px;
    border: 1px solid #d7e0e9;
    border-radius: 8px;
    outline: 0;
    background: #ffffff;
}

.cost-entry-table input:focus,
.cost-entry-table select:focus,
.cost-search input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 3px rgba(39, 137, 229, 0.11);
}

.cost-entry-table input:disabled {
    color: #8995a5;
    background: #eef2f6;
}

.cost-invoice-control {
    min-width: 180px;
}

.cost-invoice-control b,
.cost-invoice-control small {
    display: block;
}

.cost-invoice-control small {
    margin-top: 4px;
    color: #7e8b9c;
    font-size: 9px;
    line-height: 1.45;
}

.cost-remove,
.cost-remove-text {
    border: 0;
    color: #b63843;
    background: transparent;
    font-weight: 800;
    cursor: pointer;
}

.cost-remove {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: #fff0f1;
    font-size: 19px;
}

.cost-declarations {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cost-declaration-entry {
    overflow: hidden;
    border: 1px solid #d5e1ec;
    border-radius: 14px;
    background: #fbfdff;
}

.cost-declaration-entry > header {
    display: flex;
    padding: 14px 16px;
    border-bottom: 1px solid #e2e9f0;
    align-items: center;
    justify-content: space-between;
}

.cost-declaration-entry > header > div {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cost-declaration-entry > .form-grid,
.cost-declaration-entry > .cost-table-wrap,
.cost-declaration-entry > .cost-declaration-control,
.cost-declaration-entry > .cost-add-article {
    margin: 16px;
}

.cost-declaration-control {
    display: flex;
    min-height: 35px;
    padding: 9px 11px;
    border-radius: 9px;
    align-items: center;
    gap: 10px;
    color: #65768a;
    background: #eef4fa;
    font-size: 10px;
}

.cost-control {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 20px;
    color: #667589;
    background: #edf1f5;
    font-size: 9px;
    font-weight: 850;
    white-space: nowrap;
}

.cost-control.ok {
    color: #176f4a;
    background: #e5f7ee;
}

.cost-control.warn {
    color: #946014;
    background: #fff1d6;
}

.cost-auto-fees:empty {
    display: none;
}

.cost-auto-fees {
    display: flex;
    padding: 13px 15px;
    border: 1px solid #cfe2f4;
    border-radius: 11px;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 18px;
    color: #36536f;
    background: #f0f7fd;
    font-size: 11px;
}

.cost-auto-fees span {
    padding-left: 14px;
    border-left: 1px solid #c9dbea;
}

.cost-result {
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid #b8d8f2;
    border-radius: var(--radius-md);
    background: #f5faff;
    box-shadow: var(--shadow-sm);
}

.cost-result > header {
    display: flex;
    padding: 23px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: #ffffff;
}

.cost-result h2 {
    margin: 0;
    color: var(--navy-900);
}

.cost-result > header > strong {
    color: var(--blue-600);
    font-size: clamp(24px, 3vw, 34px);
}

.cost-result-grid {
    display: grid;
    padding: 16px 22px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.cost-result-grid div {
    padding: 13px;
    border-radius: 10px;
    background: #ffffff;
}

.cost-result-grid span,
.cost-result-grid strong {
    display: block;
}

.cost-result-grid span {
    margin-bottom: 6px;
    color: #7c8999;
    font-size: 9px;
}

.cost-result-grid strong {
    color: #263b52;
    font-size: 13px;
}

.cost-warnings {
    padding: 0 22px 20px;
    color: #8b5b17;
    font-size: 11px;
}

.cost-warnings ul,
.cost-warning-panel ul {
    margin: 8px 0 0 18px;
    padding: 0;
}

.cost-all-good {
    display: block;
    padding: 11px 13px;
    border-radius: 9px;
    color: #176f4a;
    background: #e7f8ef;
    font-weight: 750;
}

.cost-form-actions {
    display: flex;
    padding: 10px 0 20px;
    justify-content: flex-end;
    gap: 10px;
}

.cost-warning-panel {
    margin-bottom: 18px;
    padding: 16px 19px;
    border: 1px solid #efd49b;
    border-radius: 12px;
    color: #875913;
    background: #fff7e6;
    font-size: 12px;
}

.cost-declaration-detail .cost-table {
    min-width: 1300px;
}

.cost-delete-form {
    display: flex;
    margin-top: 24px;
    justify-content: flex-end;
}

.cost-simple-form {
    padding: 22px;
}

.cost-simple-actions {
    display: flex;
    margin-top: 18px;
    justify-content: flex-end;
}

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

.supplier-card {
    padding: 17px;
    border: 1px solid #e0e7ee;
    border-radius: 13px;
    background: #ffffff;
}

.supplier-card.inactive {
    opacity: 0.58;
    background: #f4f6f8;
}

.supplier-card > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.supplier-card header strong,
.supplier-card header small {
    display: block;
}

.supplier-card header small,
.supplier-card header > span {
    margin-top: 4px;
    color: #8290a1;
    font-size: 9px;
}

.supplier-card dl {
    display: grid;
    margin: 15px 0 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.supplier-card dt {
    color: #8a96a6;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.supplier-card dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
    color: #33465b;
    font-size: 10px;
}

.supplier-card details {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #edf1f4;
}

.supplier-card summary {
    color: var(--blue-600);
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.supplier-edit-form {
    display: grid;
    margin-top: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.supplier-edit-form input,
.supplier-edit-form select {
    min-width: 0;
    height: 39px;
    padding: 0 9px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
}

.supplier-edit-form .secondary-button,
.supplier-edit-form .check-row {
    min-height: 39px;
}

.cost-currency-note {
    margin: -10px 0 18px;
    color: #8491a2;
    font-size: 9px;
}

.payment-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.payment-actions form {
    margin: 0;
}

.button-link {
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.article-base-table {
    min-width: 1450px;
}

.article-history summary {
    color: var(--blue-600);
    font-weight: 800;
    cursor: pointer;
}

.article-history[open] > div {
    position: absolute;
    z-index: 20;
    right: 34px;
    width: min(1450px, calc(100vw - 390px));
    max-height: 600px;
    padding: 12px;
    overflow: auto;
    border: 1px solid #d7e2ec;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
}

/* Base articles card compatibility: keep percentage badges readable. */
.article-cost-item .cost-share {
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
}

.article-history table {
    width: 100%;
    border-collapse: collapse;
}

.article-history th,
.article-history td {
    padding: 8px;
    border-bottom: 1px solid #edf1f5;
    font-size: 10px;
    white-space: nowrap;
}

/* Import cost v0.5.1 — dashboard, history and separated calculation result */

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

.cost-dashboard-action {
    display: grid;
    min-height: 142px;
    padding: 20px;
    border: 1px solid #dbe5ee;
    border-radius: 16px;
    grid-template-columns: 46px 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: 14px;
    color: #17365d;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cost-dashboard-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.cost-dashboard-action-icon {
    display: grid;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    grid-row: 1 / 3;
    align-self: center;
    color: #ffffff;
    background: #1f6fb2;
    font-size: 19px;
    font-weight: 900;
    place-items: center;
}

.cost-dashboard-action strong {
    align-self: end;
    font-size: 15px;
    text-transform: uppercase;
}

.cost-dashboard-action small {
    margin-top: 6px;
    color: #748297;
    font-size: 10px;
    line-height: 1.45;
}

.cost-dashboard-action.action-new {
    border-color: #8fbce3;
    color: #ffffff;
    background: linear-gradient(135deg, #1f6fb2, #164b7d);
}

.cost-dashboard-action.action-new .cost-dashboard-action-icon {
    color: #17365d;
    background: #ffffff;
}

.cost-dashboard-action.action-new small {
    color: #dcecff;
}

.cost-dashboard-action.action-history .cost-dashboard-action-icon { background: #6d7882; }
.cost-dashboard-action.action-articles .cost-dashboard-action-icon { background: #548235; }
.cost-dashboard-action.action-payments .cost-dashboard-action-icon { background: #c65911; font-size: 11px; }

.cost-dashboard-kpis,
.cost-history-kpis {
    display: grid;
    margin-bottom: 18px;
    gap: 10px;
}

.cost-dashboard-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cost-dashboard-kpis article,
.cost-history-kpis article,
.cost-monthly-summary article {
    display: flex;
    min-width: 0;
    min-height: 92px;
    padding: 14px;
    border: 1px solid #dce5ed;
    border-radius: 13px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.cost-dashboard-kpis span,
.cost-history-kpis span,
.cost-monthly-summary span {
    color: #6c7a8d;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.cost-dashboard-kpis strong,
.cost-history-kpis strong,
.cost-monthly-summary strong {
    margin-top: 6px;
    color: #17365d;
    font-size: clamp(14px, 1.35vw, 18px);
}

.cost-dashboard-kpis small,
.cost-history-kpis small,
.cost-monthly-summary small {
    margin-top: 5px;
    color: #718197;
    font-size: 9px;
    font-weight: 750;
}

.cost-dashboard-kpis .is-primary,
.cost-history-kpis .is-primary {
    border-color: #b5d7f5;
    background: #edf7ff;
}

.cost-dashboard-total {
    padding: 9px 13px;
    border-radius: 18px;
    color: #175f9e;
    background: #e8f4ff;
    font-size: 12px;
    white-space: nowrap;
}

.cost-share-cell {
    display: flex;
    min-width: 250px;
    align-items: center;
    gap: 10px;
}

.cost-share {
    width: min(280px, 24vw);
    height: 8px;
    overflow: hidden;
    border-radius: 20px;
    background: #e9eef3;
}

.cost-share span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1f6fb2, #56a3df);
}

.cost-empty-cell {
    padding: 25px !important;
    color: #7f8b9c !important;
    text-align: center !important;
}

.cost-year-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cost-year-filter label {
    color: #77869a;
    font-size: 10px;
    font-weight: 800;
}

.cost-year-filter select {
    height: 40px;
    padding: 0 34px 0 11px;
    border: 1px solid #d3dde7;
    border-radius: 9px;
    color: #17365d;
    background: #ffffff;
    font-weight: 800;
}

.cost-monthly-summary {
    display: grid;
    padding: 16px 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.cost-monthly-summary article {
    min-height: 82px;
    box-shadow: none;
    background: #f7f9fb;
}

.cost-monthly-layout {
    display: grid;
    padding: 0 20px 20px;
    grid-template-columns: minmax(560px, 1.25fr) minmax(380px, 0.75fr);
    align-items: stretch;
    gap: 16px;
}

.cost-monthly-table {
    min-width: 720px;
}

.cost-month-pill {
    display: inline-grid;
    min-width: 27px;
    height: 25px;
    padding: 0 7px;
    border-radius: 20px;
    color: #175f9e;
    background: #e7f3fe;
    font-size: 10px;
    font-weight: 850;
    place-items: center;
}

.cost-monthly-chart {
    padding: 16px;
    border: 1px solid #e0e7ee;
    border-radius: 12px;
    background: #fbfcfe;
}

.cost-chart-legend {
    display: flex;
    margin-bottom: 13px;
    justify-content: flex-end;
    gap: 14px;
    color: #65768a;
    font-size: 9px;
    font-weight: 750;
}

.cost-chart-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cost-chart-legend i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.cost-chart-legend i.purchase,
.cost-chart-row span.purchase { background: #6c8ebf; }
.cost-chart-legend i.real,
.cost-chart-row span.real { background: #548235; }

.cost-chart-row {
    display: grid;
    min-height: 28px;
    grid-template-columns: 30px 1fr 1fr 42px;
    align-items: center;
    gap: 7px;
}

.cost-chart-row > b,
.cost-chart-row > small {
    color: #69798c;
    font-size: 8px;
    text-transform: uppercase;
}

.cost-chart-row > div {
    height: 7px;
    overflow: hidden;
    border-radius: 10px;
    background: #e8edf2;
}

.cost-chart-row > div span {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
}

.cost-history-filter-panel {
    overflow: visible;
}

.cost-history-filter {
    display: grid;
    padding: 13px;
    grid-template-columns: 180px 180px minmax(300px, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.cost-history-filter label span {
    display: block;
    margin-bottom: 6px;
    color: #344962;
    font-size: 10px;
    font-weight: 850;
}

.cost-history-filter select,
.cost-history-filter input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid #ccd8e3;
    border-radius: 9px;
    outline: 0;
    background: #ffffff;
}

.cost-history-filter select:focus,
.cost-history-filter input:focus {
    border-color: #1f6fb2;
    box-shadow: 0 0 0 3px rgba(31, 111, 178, 0.1);
}

.cost-history-kpis {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.cost-history-kpis article {
    min-height: 90px;
    padding: 11px;
}

.cost-history-table {
    min-width: 1900px;
}

.cost-history-table th,
.cost-history-table td {
    text-align: center;
    white-space: nowrap;
}

.cost-history-table td:nth-child(3) {
    max-width: 190px;
    text-align: left;
    white-space: normal;
}

.cost-dossier-link {
    color: #135b96;
    font-weight: 850;
    text-decoration: underline;
}

.cost-history-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.cost-history-actions a,
.cost-history-actions button {
    display: inline-flex;
    min-height: 34px;
    padding: 0 10px;
    border: 0;
    border-radius: 8px;
    align-items: center;
    color: #ffffff;
    font-size: 10px;
    font-weight: 850;
    cursor: pointer;
}

.cost-history-actions form { margin: 0; }
.cost-action-view { background: #17365d; }
.cost-action-edit { background: #1f6fb2; }
.cost-action-pdf { background: #c65911; }
.cost-action-excel { background: #207567; }
.cost-history-actions button { border: 1px solid #e5a5aa; color: #b52b35; background: #ffffff; }

.cost-calculate-button {
    min-height: 46px;
    padding: 0 22px;
    border: 0;
    border-radius: 10px;
    color: #ffffff;
    background: #548235;
    font-weight: 850;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(84, 130, 53, 0.18);
}

.cost-result-final {
    margin-top: 4px;
    border: 2px solid #d6b656;
    background: #fffdf3;
}

.cost-result-final > header {
    border-bottom: 1px solid #ede1ae;
}

.cost-result-final > header p {
    margin: 5px 0 0;
    color: #77869a;
    font-size: 10px;
}

.cost-result-details {
    display: grid;
    padding: 0 22px 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.cost-result-details > article {
    padding: 15px;
    border: 1px solid #e4d9a8;
    border-radius: 11px;
    background: #ffffff;
}

.cost-result-details h3,
.cost-result-table-title h3 {
    margin: 0;
    color: #17365d;
    font-size: 13px;
}

.cost-result-line {
    display: flex;
    min-height: 36px;
    padding: 8px 0;
    border-bottom: 1px solid #edf0f3;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #43566e;
    font-size: 10px;
}

.cost-result-line:last-child { border-bottom: 0; }
.cost-result-line span small { display: block; margin-top: 3px; color: #8591a0; }
.cost-result-empty { color: #8490a0; font-size: 10px; }

.cost-result-table-title {
    display: flex;
    padding: 17px 22px;
    border-top: 1px solid #ede1ae;
    align-items: center;
    justify-content: space-between;
}

.cost-result-table-title p {
    margin: 4px 0 0;
    color: #78869a;
    font-size: 10px;
}

.cost-final-articles-table {
    min-width: 1380px;
}

.cost-final-articles-table th {
    color: #ffffff;
    background: #17365d;
}

.cost-final-articles-table td:nth-last-child(-n + 2) {
    background: #fffbea;
}

.cost-saved-result {
    margin-bottom: 18px;
}

.cost-declaration-control-table {
    min-width: 1150px;
}

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

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

    .cost-dashboard-menu,
    .cost-dashboard-kpis,
    .cost-history-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cost-monthly-layout {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 700px) {
    .cost-stat-grid,
    .cost-form-grid-3,
    .cost-form-grid-4,
    .cost-result-grid {
        grid-template-columns: 1fr;
    }

    .cost-dashboard-menu,
    .cost-dashboard-kpis,
    .cost-history-kpis,
    .cost-monthly-summary,
    .cost-result-details,
    .cost-history-filter {
        grid-template-columns: 1fr;
    }

    .cost-panel-header,
    .cost-result > header,
    .cost-form-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .cost-panel-header .secondary-button,
    .cost-form-actions .primary-button,
    .cost-form-actions .secondary-button,
    .cost-form-actions .cost-calculate-button {
        width: 100%;
    }

    .cost-dashboard-action {
        min-height: 116px;
    }

    .cost-monthly-layout {
        padding-right: 12px;
        padding-left: 12px;
    }

    .cost-search {
        width: 100%;
    }

    .cost-search input {
        min-width: 0;
        width: 100%;
    }

    .cost-form-section > .form-grid,
    .cost-form-section > .cost-table-wrap,
    .cost-form-section > .cost-declarations,
    .cost-form-section > .cost-auto-fees {
        margin-right: 14px;
        margin-left: 14px;
    }

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

    .supplier-card dl {
        grid-template-columns: 1fr;
    }

    .article-history[open] > div {
        position: fixed;
        inset: 70px 10px 20px;
        width: auto;
        max-height: none;
    }
}

@media print {
    .sidebar,
    .mobile-bar,
    .header-actions,
    .cost-delete-form {
        display: none !important;
    }

    .main-content {
        margin: 0 !important;
        padding: 0 !important;
    }

    .cost-panel,
    .detail-card,
    .cost-stat-grid article {
        break-inside: avoid;
        box-shadow: none;
    }
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.11em;
    text-transform: uppercase;
}

.eyebrow-light {
    color: #9bcfff;
}

/* Login */

.guest-body {
    background: var(--surface);
}

.login-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: minmax(360px, 44%) 1fr;
}

.login-visual {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    color: #ffffff;
    background:
        radial-gradient(circle at 83% 18%, rgba(54, 149, 234, 0.32), transparent 27%),
        linear-gradient(145deg, #0c3158 0%, var(--navy-950) 72%);
}

.login-visual::before,
.login-visual::after {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 50%;
    content: "";
}

.login-visual::before {
    width: 520px;
    height: 520px;
    right: -280px;
    top: 20%;
}

.login-visual::after {
    width: 340px;
    height: 340px;
    left: -190px;
    bottom: -120px;
}

.login-visual-content {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100%;
    padding: 54px clamp(34px, 5vw, 76px) 40px;
    flex-direction: column;
}

.login-brand,
.brand,
.mobile-brand {
    display: flex;
    align-items: center;
}

.login-brand {
    gap: 14px;
}

.login-brand img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.login-brand span,
.brand span {
    display: flex;
    flex-direction: column;
}

.login-brand strong {
    font-size: 22px;
    letter-spacing: 0.04em;
}

.login-brand small {
    margin-top: 3px;
    color: #aac5df;
    font-size: 12px;
}

.login-message {
    margin: auto 0;
    max-width: 490px;
}

.login-message h1 {
    margin: 0;
    font-size: clamp(38px, 4.5vw, 64px);
    font-weight: 750;
    letter-spacing: -0.045em;
    line-height: 1.03;
}

.login-message p {
    max-width: 420px;
    margin: 24px 0 0;
    color: #bfd1e1;
    font-size: 17px;
    line-height: 1.7;
}

.login-copyright {
    margin: 0;
    color: #7894af;
    font-size: 12px;
}

.login-panel {
    display: grid;
    min-height: 100vh;
    padding: 44px clamp(24px, 7vw, 110px);
    place-items: center;
    background:
        radial-gradient(circle at 100% 0, #edf6ff 0, transparent 28%),
        #ffffff;
}

.login-card {
    width: min(100%, 460px);
}

.login-mobile-logo {
    display: none;
}

.login-card h2 {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(32px, 4vw, 45px);
    letter-spacing: -0.04em;
}

.login-subtitle {
    margin: 12px 0 30px;
    color: var(--muted);
    font-size: 15px;
}

.form-alert,
.flash {
    padding: 13px 15px;
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.form-alert {
    margin-bottom: 20px;
    border: 1px solid #f3c9ce;
    color: #9e2834;
    background: #fff3f4;
}

.login-form {
    display: flex;
    flex-direction: column;
}

.field-label {
    margin: 0 0 8px;
    color: #33445a;
    font-size: 13px;
    font-weight: 700;
}

.input-wrap + .field-label {
    margin-top: 19px;
}

.input-wrap {
    position: relative;
    display: flex;
    height: 52px;
    align-items: center;
}

.input-wrap > svg {
    position: absolute;
    left: 16px;
    width: 20px;
    color: #8492a5;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 100%;
    padding: 0 48px;
    border: 1px solid #d7dfe9;
    border-radius: 12px;
    outline: 0;
    color: var(--text);
    background: #ffffff;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.input-wrap input::placeholder {
    color: #a0aabc;
}

.input-wrap input:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(22, 118, 210, 0.11);
}

.password-toggle {
    position: absolute;
    right: 8px;
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #718096;
    background: transparent;
    cursor: pointer;
    place-items: center;
}

.password-toggle:hover {
    color: var(--blue-600);
    background: var(--blue-100);
}

.password-toggle svg {
    width: 20px;
}

.check-row {
    display: flex;
    margin: 19px 0 23px;
    align-items: center;
    gap: 9px;
    color: #516176;
    font-size: 13px;
    cursor: pointer;
}

.check-row input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--blue-600);
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 11px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 750;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue-600), #0f65b5);
    box-shadow: 0 9px 20px rgba(22, 118, 210, 0.22);
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(22, 118, 210, 0.3);
}

.primary-button svg,
.secondary-button svg {
    width: 19px;
    height: 19px;
}

.primary-button-full {
    width: 100%;
    min-height: 53px;
}

.secondary-button {
    border: 1px solid var(--border);
    color: #405169;
    background: #ffffff;
}

.secondary-button:hover {
    border-color: #bed7ee;
    color: var(--blue-600);
    background: #f8fbff;
}

.login-help {
    margin: 26px 0 0;
    color: #8490a1;
    font-size: 12px;
    text-align: center;
}

/* Application shell */

.app-body {
    background: var(--canvas);
}

.sidebar {
    position: fixed;
    z-index: 30;
    top: 0;
    bottom: 0;
    left: 0;
    display: flex;
    width: var(--sidebar-width);
    padding: 25px 18px 20px;
    flex-direction: column;
    color: #ffffff;
    background:
        radial-gradient(circle at 35% 4%, rgba(41, 136, 222, 0.18), transparent 24%),
        linear-gradient(180deg, var(--navy-900), var(--navy-950));
    box-shadow: 8px 0 30px rgba(10, 31, 53, 0.08);
}

.brand {
    min-height: 58px;
    padding: 0 10px 22px;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand img {
    width: 43px;
    height: 43px;
    border-radius: 12px;
}

.brand strong {
    font-size: 18px;
    letter-spacing: 0.055em;
}

.brand small {
    margin-top: 2px;
    color: #8da9c3;
    font-size: 11px;
}

.main-nav {
    overflow-y: auto;
    margin: 16px -4px 20px;
    padding: 0 4px;
    scrollbar-width: thin;
}

.nav-label {
    margin: 10px 11px 7px;
    color: #7691aa;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.nav-label-spaced {
    margin-top: 24px;
}

.nav-link {
    display: flex;
    min-height: 46px;
    margin: 3px 0;
    padding: 0 12px;
    border-radius: 10px;
    align-items: center;
    gap: 12px;
    color: #b8c9da;
    font-size: 13px;
    font-weight: 650;
    transition: color 150ms ease, background 150ms ease;
}

.nav-link > svg {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
}

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

.nav-link.active {
    color: #ffffff;
    background: linear-gradient(135deg, rgba(39, 137, 229, 0.85), rgba(22, 118, 210, 0.64));
    box-shadow: 0 7px 18px rgba(0, 0, 0, 0.13);
}

.nav-badge {
    margin-left: auto;
    padding: 3px 6px;
    border-radius: 10px;
    color: #91c6f5;
    background: rgba(52, 151, 235, 0.12);
    font-size: 9px;
}

.sidebar-user {
    display: flex;
    min-height: 64px;
    margin-top: auto;
    padding: 13px 9px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
    gap: 10px;
}

.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue-500), #165c9d);
    font-size: 14px;
    font-weight: 800;
    place-items: center;
}

.avatar-small {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 12px;
}

.user-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.user-copy strong {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-copy small {
    margin-top: 2px;
    color: #829db7;
    font-size: 10px;
}

.logout-button,
.icon-button {
    display: grid;
    padding: 0;
    border: 0;
    cursor: pointer;
    place-items: center;
}

.logout-button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: #91a9c0;
    background: transparent;
}

.logout-button:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.07);
}

.logout-button svg {
    width: 19px;
}

.main-content {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: 48px clamp(28px, 5vw, 72px) 60px;
}

.mobile-bar,
.sidebar-overlay {
    display: none;
}

.flash-success {
    margin-bottom: 20px;
    border: 1px solid #bfe5d2;
    color: #176d48;
    background: #edfbf4;
}

.flash-error {
    margin-bottom: 20px;
    border: 1px solid #f0c3c8;
    color: #9e2834;
    background: #fff1f2;
}

.page-header {
    display: flex;
    margin-bottom: 40px;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.page-header h1 {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(30px, 3.5vw, 44px);
    letter-spacing: -0.04em;
    line-height: 1.08;
}

.page-header p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.compact-header {
    align-items: center;
}

.section-heading {
    display: flex;
    margin-bottom: 18px;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.section-heading h2 {
    margin: 0;
    color: #1c2e45;
    font-size: 20px;
}

.section-heading p {
    margin: 5px 0 0;
    color: #7a8798;
    font-size: 12px;
}

.date-chip {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 20px;
    color: #68778a;
    background: rgba(255, 255, 255, 0.65);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

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

.module-card {
    position: relative;
    display: flex;
    min-height: 142px;
    padding: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    align-items: center;
    gap: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: border-color 170ms ease, box-shadow 170ms ease, transform 170ms ease;
}

.module-card::after {
    position: absolute;
    width: 90px;
    height: 90px;
    right: -45px;
    bottom: -55px;
    border-radius: 50%;
    content: "";
    background: #eff6fd;
}

.module-card:hover {
    border-color: #c7def2;
    box-shadow: 0 16px 34px rgba(20, 54, 88, 0.11);
    transform: translateY(-2px);
}

.module-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border-radius: 15px;
    place-items: center;
}

.module-icon svg {
    width: 29px;
    height: 29px;
}

.module-icon-navy {
    color: #1b4b76;
    background: #eaf1f8;
}

.module-icon-green {
    color: #16865a;
    background: #e9f8f1;
}

.module-icon-violet {
    color: #7959c7;
    background: #f1edfb;
}

.module-icon-blue {
    color: #1c76c8;
    background: #eaf4ff;
}

.module-icon-orange {
    color: #c56b22;
    background: #fff2e7;
}

.module-icon-cyan {
    color: #168397;
    background: #e8f8fa;
}

.module-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.module-topline {
    display: flex;
    margin-bottom: 9px;
    align-items: center;
    gap: 10px;
}

.module-topline strong {
    color: #172b44;
    font-size: 16px;
}

.module-copy > span:last-child {
    color: #748196;
    font-size: 12px;
    line-height: 1.55;
}

.status-dot {
    padding: 4px 7px;
    border-radius: 20px;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

.status-available {
    color: #1c7951;
    background: #e8f8f0;
}

.status-construction {
    color: #9a641a;
    background: #fff4dc;
}

.status-future {
    color: #6e7888;
    background: #eef1f5;
}

.module-arrow {
    position: relative;
    z-index: 1;
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    color: #9aa8b8;
}

.empty-card {
    grid-column: 1 / -1;
    padding: 42px;
    border: 1px dashed #cdd7e3;
    border-radius: var(--radius-md);
    text-align: center;
    background: rgba(255, 255, 255, 0.55);
}

.empty-card h3 {
    margin: 0 0 8px;
}

.empty-card p {
    margin: 0;
    color: var(--muted);
}

.security-note {
    display: flex;
    margin-top: 22px;
    padding: 17px 19px;
    border: 1px solid #d9e8f6;
    border-radius: 13px;
    align-items: center;
    gap: 13px;
    color: #24405e;
    background: #f4f9fe;
}

.security-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    color: var(--blue-600);
    background: #e3f1ff;
    place-items: center;
}

.security-icon svg {
    width: 21px;
}

.security-note > span:last-child {
    display: flex;
    flex-direction: column;
}

.security-note strong {
    font-size: 12px;
}

.security-note small {
    margin-top: 3px;
    color: #6b7c90;
    font-size: 11px;
}

.construction-card {
    display: flex;
    min-height: 430px;
    padding: clamp(32px, 6vw, 70px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0, #eef7ff, transparent 38%),
        #ffffff;
    box-shadow: var(--shadow-sm);
}

.construction-icon {
    display: grid;
    width: 78px;
    height: 78px;
    margin-bottom: 25px;
    border-radius: 21px;
    place-items: center;
}

.construction-icon svg {
    width: 38px;
}

.construction-card h2 {
    margin: 0;
    color: var(--navy-900);
    font-size: clamp(25px, 3vw, 35px);
    letter-spacing: -0.035em;
}

.construction-card > p {
    max-width: 570px;
    margin: 14px auto 0;
    color: var(--muted);
    line-height: 1.7;
}

.next-step {
    display: flex;
    max-width: 560px;
    width: 100%;
    margin-top: 30px;
    padding: 16px 18px;
    border: 1px solid #d5e8f9;
    border-radius: 12px;
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    text-align: left;
    background: #f3f9ff;
}

.next-step strong {
    color: var(--blue-600);
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.next-step span {
    color: #52667d;
    font-size: 13px;
}

/* Clients and machine park */

.resource-header {
    margin-bottom: 24px;
}

.resource-header .primary-button {
    flex: 0 0 auto;
}

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

.metric-card {
    display: flex;
    min-height: 104px;
    padding: 19px 20px;
    border: 1px solid var(--border);
    border-radius: 14px;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.metric-card > span:last-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.metric-card strong {
    color: var(--navy-900);
    font-size: 25px;
    letter-spacing: -0.03em;
}

.metric-card small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.metric-icon {
    display: grid;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 13px;
    place-items: center;
}

.metric-icon svg {
    width: 23px;
    height: 23px;
}

.metric-icon-blue {
    color: #1676d2;
    background: #eaf4ff;
}

.metric-icon-green {
    color: #20865a;
    background: #e9f8f1;
}

.metric-icon-violet {
    color: #7959c7;
    background: #f1edfb;
}

.filter-bar {
    display: flex;
    margin-bottom: 18px;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 14px;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.82);
}

.search-control {
    position: relative;
    display: flex;
    min-width: 240px;
    height: 44px;
    flex: 1;
    align-items: center;
}

.search-control svg {
    position: absolute;
    left: 14px;
    width: 19px;
    color: #8492a5;
    pointer-events: none;
}

.search-control input,
.select-control select {
    width: 100%;
    height: 44px;
    border: 1px solid #d9e1eb;
    border-radius: 10px;
    outline: 0;
    color: var(--text);
    background: #ffffff;
}

.search-control input {
    padding: 0 15px 0 43px;
}

.search-control input:focus,
.select-control select:focus,
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--blue-500);
    box-shadow: 0 0 0 4px rgba(22, 118, 210, 0.1);
}

.select-control {
    display: flex;
    min-width: 185px;
    align-items: center;
    gap: 9px;
}

.select-control > span {
    color: #637287;
    font-size: 11px;
    font-weight: 750;
}

.select-control select {
    min-width: 115px;
    padding: 0 30px 0 12px;
}

.filter-submit {
    min-height: 44px;
}

.text-button {
    padding: 10px 8px;
    color: var(--blue-600);
    font-size: 12px;
    font-weight: 750;
}

.text-button:hover {
    text-decoration: underline;
}

.data-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.data-card-header {
    display: flex;
    min-height: 72px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
}

.data-card-header h2 {
    margin: 0;
    color: #1c2e45;
    font-size: 17px;
}

.data-card-header p {
    margin: 4px 0 0;
    color: #8190a3;
    font-size: 11px;
}

.client-list,
.machine-list {
    display: flex;
    flex-direction: column;
}

.client-row,
.machine-row {
    display: flex;
    min-height: 76px;
    padding: 14px 20px;
    border-bottom: 1px solid #edf1f5;
    align-items: center;
    gap: 14px;
    transition: background 150ms ease;
}

.client-row:last-child,
.machine-row:last-child {
    border-bottom: 0;
}

.client-row:hover,
.machine-row:hover {
    background: #f8fbfe;
}

.client-avatar {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #ffffff;
    background: linear-gradient(135deg, #2789e5, #145b9d);
    font-size: 15px;
    font-weight: 850;
    place-items: center;
}

.client-main,
.machine-main {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.client-title-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.client-title-line strong,
.machine-main strong {
    overflow: hidden;
    color: #20344d;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.client-meta {
    display: flex;
    margin-top: 6px;
    flex-wrap: wrap;
    gap: 6px 13px;
}

.client-meta small,
.machine-main small,
.machine-site {
    color: #7b899a;
    font-size: 10px;
}

.client-meta small + small::before {
    margin-right: 13px;
    color: #c0c9d4;
    content: "•";
}

.machine-count {
    display: flex;
    min-width: 67px;
    flex-direction: column;
    text-align: center;
}

.machine-count strong {
    color: #29445f;
    font-size: 17px;
}

.machine-count small {
    color: #8a97a7;
    font-size: 9px;
}

.row-arrow {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    color: #a4afbc;
}

.status-pill {
    display: inline-flex;
    min-height: 23px;
    padding: 4px 8px;
    border-radius: 20px;
    align-items: center;
    justify-content: center;
    color: #536176;
    background: #eef1f5;
    font-size: 9px;
    font-style: normal;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.status-pill-actif,
.status-pill-en_service {
    color: #16724b;
    background: #e6f7ee;
}

.status-pill-prospect,
.status-pill-a_arret {
    color: #99621a;
    background: #fff2d7;
}

.status-pill-inactif,
.status-pill-hors_service {
    color: #687587;
    background: #edf0f4;
}

.status-pill-en_panne {
    color: #ab303c;
    background: #fdebed;
}

.status-pill-large {
    min-height: 34px;
    padding: 8px 13px;
    font-size: 10px;
}

.empty-state {
    display: flex;
    min-height: 300px;
    padding: 42px 20px;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.empty-state-compact {
    min-height: 250px;
}

.empty-state-icon {
    display: grid;
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
    border-radius: 16px;
    color: var(--blue-600);
    background: var(--blue-100);
    place-items: center;
}

.empty-state-icon svg {
    width: 27px;
    height: 27px;
}

.empty-state h3 {
    margin: 0;
    color: #24384f;
    font-size: 17px;
}

.empty-state p {
    margin: 7px 0 19px;
    color: var(--muted);
    font-size: 12px;
}

.pagination-bar {
    display: flex;
    margin-top: 17px;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    color: #6f7d90;
    font-size: 11px;
}

.pagination-bar a,
.pagination-disabled {
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #ffffff;
}

.pagination-bar a:hover {
    border-color: #bfd8ee;
    color: var(--blue-600);
}

.pagination-disabled {
    color: #a8b1bd;
    background: #f4f6f8;
}

.resource-form {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.form-alert-wide {
    display: flex;
    margin: 20px 22px 0;
    flex-direction: column;
    gap: 3px;
}

.form-section {
    padding: 26px 28px 30px;
    border-bottom: 1px solid var(--border);
}

.form-section > header {
    display: flex;
    margin-bottom: 23px;
    align-items: flex-start;
    gap: 12px;
}

.form-section > header > span:last-child,
.selected-client-card > span:last-child {
    display: flex;
    flex-direction: column;
}

.form-section header strong {
    color: #23364e;
    font-size: 14px;
}

.form-section header small {
    margin-top: 3px;
    color: #8190a3;
    font-size: 11px;
}

.form-step {
    display: grid;
    width: 27px;
    height: 27px;
    flex: 0 0 auto;
    border-radius: 9px;
    color: #ffffff;
    background: var(--blue-600);
    font-size: 11px;
    font-weight: 850;
    place-items: center;
}

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

.form-field {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
}

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

.form-field > span {
    color: #44556b;
    font-size: 11px;
    font-weight: 750;
}

.form-field b {
    color: var(--danger);
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid #d8e0ea;
    border-radius: 10px;
    outline: 0;
    color: var(--text);
    background: #ffffff;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.form-field input,
.form-field select {
    height: 46px;
    padding: 0 13px;
}

.form-field textarea {
    min-height: 94px;
    padding: 12px 13px;
    line-height: 1.55;
    resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder {
    color: #a6b0bd;
}

.form-actions {
    display: flex;
    padding: 20px 28px;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    background: #f8fafc;
}

.selected-client-card {
    display: flex;
    margin: 24px 28px 0;
    padding: 16px;
    border: 1px solid #d9e8f6;
    border-radius: 13px;
    align-items: center;
    gap: 12px;
    background: #f4f9fe;
}

.selected-client-card small {
    color: #7790a8;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.selected-client-card strong {
    margin-top: 3px;
    color: #223b56;
    font-size: 13px;
}

.selected-client-card em {
    margin-top: 2px;
    color: #718398;
    font-size: 10px;
    font-style: normal;
}

.resource-detail-header {
    align-items: center;
}

.resource-detail-header .eyebrow {
    display: block;
    margin: 6px 0 7px;
}

.breadcrumb-link {
    color: var(--blue-600);
    font-size: 11px;
    font-weight: 750;
}

.breadcrumb-link::before {
    margin-right: 6px;
    content: "‹";
}

.header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 9px;
}

.detail-grid {
    display: grid;
    margin-bottom: 16px;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
    gap: 16px;
}

.detail-card,
.note-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.detail-card {
    overflow: hidden;
}

.detail-card > header {
    display: flex;
    min-height: 62px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.detail-card h2 {
    margin: 0;
    color: #263a51;
    font-size: 14px;
}

.info-list {
    display: grid;
    margin: 0;
    padding: 8px 20px 17px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 26px;
}

.info-list-compact {
    grid-template-columns: 1fr;
}

.info-list > div {
    min-width: 0;
    padding: 13px 0;
    border-bottom: 1px solid #edf1f5;
}

.info-list > div:nth-last-child(-n + 2),
.info-list-compact > div:last-child {
    border-bottom: 0;
}

.info-list dt {
    margin-bottom: 5px;
    color: #8390a0;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.info-list dd {
    overflow-wrap: anywhere;
    margin: 0;
    color: #30445c;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-line;
}

.note-card {
    padding: 19px 21px;
}

.note-card strong {
    color: #33485f;
    font-size: 11px;
}

.note-card p {
    margin: 7px 0 0;
    color: #6e7d90;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-line;
}

.resource-section-heading {
    margin: 31px 0 15px;
}

.machine-row {
    min-height: 82px;
}

.machine-icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #7959c7;
    background: #f1edfb;
    place-items: center;
}

.machine-icon svg {
    width: 22px;
    height: 22px;
}

.machine-main small {
    margin-top: 5px;
}

.machine-site {
    width: 145px;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.audit-note {
    margin: 18px 0 0;
    color: #8a96a6;
    font-size: 10px;
    text-align: right;
}

.machine-hero-card {
    display: flex;
    min-height: 108px;
    margin-bottom: 16px;
    padding: 20px 22px;
    border: 1px solid #d9e8f6;
    border-radius: var(--radius-md);
    align-items: center;
    gap: 15px;
    background: linear-gradient(125deg, #f7fbff, #eef7ff);
}

.machine-hero-icon {
    display: grid;
    width: 58px;
    height: 58px;
    flex: 0 0 auto;
    border-radius: 16px;
    color: #ffffff;
    background: linear-gradient(135deg, var(--blue-500), #155fa4);
    place-items: center;
}

.machine-hero-icon svg {
    width: 29px;
    height: 29px;
}

.machine-hero-card > span:nth-child(2) {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.machine-hero-card > span:nth-child(2) small {
    color: #6f89a3;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.machine-hero-card > span:nth-child(2) strong {
    margin-top: 4px;
    overflow: hidden;
    color: #173a5c;
    font-size: 17px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.machine-hero-card > span:nth-child(2) em {
    margin-top: 3px;
    color: #71879d;
    font-size: 10px;
    font-style: normal;
}

.history-button {
    position: relative;
    padding-right: 60px;
    cursor: default;
    opacity: 0.78;
}

.history-button small {
    position: absolute;
    top: -7px;
    right: 7px;
    padding: 3px 6px;
    border-radius: 9px;
    color: #8a601c;
    background: #fff0cf;
    font-size: 8px;
    font-weight: 850;
}

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

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

.danger-button {
    display: inline-flex;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid #edc7cb;
    border-radius: 11px;
    align-items: center;
    justify-content: center;
    color: #ad3540;
    background: #fff5f6;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
    transition: border-color 150ms ease, color 150ms ease, background 150ms ease;
}

.danger-button:hover {
    border-color: #d99098;
    color: #8f202b;
    background: #ffecef;
}

.header-actions form {
    margin: 0;
}

.photo-upload-grid,
.machine-photo-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.photo-upload-card,
.photo-gallery-card {
    min-width: 0;
    padding: 18px;
    border: 1px solid #dce5ef;
    border-radius: 14px;
    background: #fbfdff;
}

.photo-upload-card-nameplate {
    background: #fffdf8;
}

.photo-upload-card > header,
.photo-gallery-card > header {
    display: flex;
    align-items: center;
    gap: 11px;
}

.photo-upload-card > header > span:last-child,
.photo-gallery-card > header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.photo-upload-card header strong,
.photo-gallery-card header strong {
    color: #2b4058;
    font-size: 12px;
}

.photo-upload-card header small,
.photo-gallery-card header small {
    margin-top: 2px;
    color: #8492a4;
    font-size: 9px;
}

.photo-upload-icon {
    display: grid;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    color: var(--blue-600);
    background: var(--blue-100);
    place-items: center;
}

.photo-upload-icon svg {
    width: 20px;
    height: 20px;
}

.photo-upload-card > p {
    min-height: 36px;
    margin: 13px 0;
    color: #6f7f92;
    font-size: 10px;
    line-height: 1.55;
}

.upload-actions {
    display: flex;
    gap: 8px;
}

.upload-button {
    position: relative;
    display: inline-flex;
    min-height: 40px;
    padding: 0 12px;
    overflow: hidden;
    border: 1px solid #bcd8f0;
    border-radius: 10px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    color: #176bb5;
    background: #eef7ff;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

.upload-button-secondary {
    border-color: #d9e1ea;
    color: #52667d;
    background: #ffffff;
}

.upload-button:hover {
    border-color: var(--blue-500);
}

.upload-button.is-loading {
    cursor: wait;
    opacity: 0.65;
}

.upload-button svg {
    width: 17px;
    height: 17px;
}

.upload-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.upload-hint {
    display: block;
    margin-top: 11px;
    color: #8a97a7;
    font-size: 8px;
}

.photo-preview-grid {
    display: grid;
    margin-top: 12px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
}

.photo-preview-grid:empty {
    display: none;
}

.photo-preview-item {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e1e7ee;
    border-radius: 9px;
    background: #ffffff;
}

.photo-preview-item img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 0.78;
    object-fit: cover;
}

.photo-preview-item small {
    display: block;
    padding: 5px;
    overflow: hidden;
    color: #77869a;
    font-size: 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.photo-preview-warning {
    grid-column: 1 / -1;
    padding: 8px 10px;
    border-radius: 8px;
    color: #9b6218;
    background: #fff2d8;
    font-size: 9px;
}

.machine-photo-section {
    margin-bottom: 16px;
}

.machine-photo-section .resource-section-heading {
    margin-top: 26px;
}

.photo-gallery-card {
    padding: 17px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.photo-gallery-card > header {
    margin-bottom: 12px;
}

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

.photo-tile {
    position: relative;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #e1e7ee;
    border-radius: 10px;
    background: #edf2f7;
}

.photo-tile > a {
    display: block;
}

.photo-tile img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 0.78;
    object-fit: cover;
    transition: transform 170ms ease;
}

.photo-tile:hover img {
    transform: scale(1.025);
}

.photo-tile form {
    position: absolute;
    top: 6px;
    right: 6px;
}

.photo-tile button {
    display: grid;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: rgba(133, 32, 43, 0.88);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    place-items: center;
}

@media (max-width: 1050px) {
    :root {
        --sidebar-width: 244px;
    }

    .main-content {
        padding-right: 30px;
        padding-left: 30px;
    }

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

    .machine-site {
        display: none;
    }

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

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

@media (max-width: 820px) {
    :root {
        --mobile-bar-height: 66px;
    }

    .login-shell {
        display: block;
    }

    .login-visual {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        padding: 34px 22px;
    }

    .login-mobile-logo {
        display: flex;
        margin-bottom: 58px;
        align-items: center;
        gap: 10px;
        color: var(--navy-900);
        letter-spacing: 0.04em;
    }

    .login-mobile-logo img {
        width: 42px;
        height: 42px;
        border-radius: 11px;
    }

    .mobile-bar {
        position: fixed;
        z-index: 25;
        top: 0;
        right: 0;
        left: 0;
        display: flex;
        height: var(--mobile-bar-height);
        padding: 0 17px;
        border-bottom: 1px solid var(--border);
        align-items: center;
        justify-content: space-between;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(12px);
    }

    .mobile-brand {
        gap: 8px;
        color: var(--navy-900);
        font-size: 14px;
        letter-spacing: 0.04em;
    }

    .mobile-brand img {
        width: 32px;
        height: 32px;
        border-radius: 9px;
    }

    .icon-button {
        width: 38px;
        height: 38px;
        border-radius: 9px;
        background: #f0f4f8;
    }

    .icon-button span {
        display: block;
        width: 17px;
        height: 2px;
        margin: 2px 0;
        border-radius: 2px;
        background: var(--navy-900);
    }

    .sidebar {
        width: min(86vw, 300px);
        transform: translateX(-102%);
        transition: transform 220ms ease;
    }

    .sidebar-overlay {
        position: fixed;
        z-index: 29;
        inset: 0;
        background: rgba(3, 17, 30, 0.48);
        opacity: 0;
        transition: opacity 220ms ease;
    }

    .sidebar-open {
        overflow: hidden;
    }

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

    .sidebar-open .sidebar-overlay {
        display: block;
        opacity: 1;
    }

    .main-content {
        margin-left: 0;
        padding: calc(var(--mobile-bar-height) + 31px) 18px 42px;
    }

    .page-header {
        margin-bottom: 30px;
        align-items: flex-start;
        flex-direction: column;
    }

    .page-header .primary-button,
    .page-header .secondary-button {
        width: 100%;
    }

    .compact-header {
        align-items: flex-start;
    }

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

    .metric-card {
        min-height: 88px;
    }

    .filter-bar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .search-control {
        width: 100%;
        flex: 1 0 100%;
    }

    .select-control {
        flex: 1;
    }

    .header-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
    }

    .header-actions .primary-button,
    .header-actions .secondary-button,
    .header-actions .status-pill {
        width: 100%;
    }

    .resource-detail-header {
        align-items: flex-start;
    }

    .machine-hero-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .history-button {
        width: 100%;
    }

    .header-actions form,
    .header-actions .danger-button {
        width: 100%;
    }

    .photo-upload-grid,
    .machine-photo-groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .login-panel {
        align-items: start;
    }

    .login-card h2 {
        font-size: 34px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .module-card {
        min-height: 0;
        padding: 19px 17px;
        align-items: flex-start;
        gap: 13px;
    }

    .module-icon {
        width: 49px;
        height: 49px;
        border-radius: 13px;
    }

    .module-icon svg {
        width: 24px;
    }

    .module-topline {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }

    .module-arrow {
        display: none;
    }

    .security-note {
        align-items: flex-start;
    }

    .construction-card {
        min-height: 390px;
        padding: 30px 20px;
    }

    .filter-bar {
        flex-direction: column;
    }

    .select-control {
        width: 100%;
    }

    .select-control select {
        flex: 1;
    }

    .filter-submit,
    .filter-bar .text-button {
        width: 100%;
        text-align: center;
    }

    .client-row,
    .machine-row {
        padding: 14px;
        gap: 10px;
    }

    .client-avatar,
    .machine-icon {
        width: 39px;
        height: 39px;
        border-radius: 11px;
    }

    .client-title-line {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .client-meta small + small::before {
        display: none;
    }

    .machine-count,
    .machine-row > .status-pill {
        display: none;
    }

    .form-section {
        padding: 23px 18px 26px;
    }

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

    .form-field-wide,
    .form-field-full {
        grid-column: auto;
    }

    .form-actions {
        padding: 17px 18px;
        align-items: stretch;
        flex-direction: column-reverse;
    }

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

    .selected-client-card {
        margin: 18px 18px 0;
    }

    .info-list {
        grid-template-columns: 1fr;
    }

    .info-list > div,
    .info-list > div:nth-last-child(-n + 2) {
        border-bottom: 1px solid #edf1f5;
    }

    .info-list > div:last-child {
        border-bottom: 0;
    }

    .resource-section-heading .secondary-button {
        width: 100%;
    }

    .machine-detail-grid,
    .detail-grid-notes {
        grid-template-columns: 1fr;
    }

    .machine-hero-card > span:nth-child(2) strong {
        white-space: normal;
    }

    .upload-actions {
        flex-direction: column;
    }

    .upload-button {
        width: 100%;
    }

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

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

/* Intervention reports */

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

.metric-icon-orange {
    color: #bd641e;
    background: #fff0e3;
}

.report-list {
    display: flex;
    flex-direction: column;
}

.report-row {
    display: flex;
    min-height: 82px;
    padding: 14px 20px;
    border-bottom: 1px solid #edf1f5;
    align-items: center;
    gap: 14px;
    transition: background 150ms ease;
}

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

.report-row:hover {
    background: #f8fbfe;
}

.report-icon,
.report-summary-icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    border-radius: 12px;
    color: #c56b22;
    background: #fff2e7;
    place-items: center;
}

.report-icon svg,
.report-summary-icon svg {
    width: 22px;
    height: 22px;
}

.report-main {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.report-main > span {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
}

.report-main strong {
    color: #20344d;
    font-size: 13px;
}

.report-main em {
    overflow: hidden;
    color: #9a602a;
    font-size: 10px;
    font-style: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-main small {
    margin-top: 5px;
    overflow: hidden;
    color: #7b899a;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-technician,
.report-date {
    color: #758398;
    font-size: 10px;
}

.report-technician {
    width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-date {
    width: 75px;
}

.status-pill-report-brouillon {
    color: #9b6218;
    background: #fff2d8;
}

.status-pill-report-valide {
    color: #16724b;
    background: #e6f7ee;
}

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

.report-add-button {
    min-width: 180px;
}

.is-disabled {
    cursor: not-allowed;
    opacity: 0.48;
    pointer-events: none;
}

.conditional-field[hidden] {
    display: none;
}

.report-context-card {
    display: flex;
    margin: 24px 28px 0;
    padding: 17px 19px;
    border: 1px solid #d9e8f6;
    border-radius: 13px;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #f7fbff, #eef7ff);
}

.report-context-item {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
}

.report-context-item small {
    color: #7590aa;
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.report-context-item strong {
    margin-top: 4px;
    overflow: hidden;
    color: #173a5c;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-context-item em {
    margin-top: 3px;
    color: #74899e;
    font-size: 9px;
    font-style: normal;
}

.report-context-separator {
    color: #8fa8bf;
    font-size: 24px;
}

.technician-fieldset {
    padding: 0;
    border: 0;
}

.technician-fieldset legend {
    margin-bottom: 10px;
    color: #44556b;
    font-size: 11px;
    font-weight: 750;
}

.technician-choice-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.technician-choice-grid label {
    display: flex;
    padding: 9px 11px;
    border: 1px solid #dce4ed;
    border-radius: 9px;
    align-items: center;
    gap: 7px;
    color: #52657b;
    background: #fff;
    font-size: 10px;
    cursor: pointer;
}

.technician-choice-grid input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--blue-600);
}

.report-photo-block {
    margin-top: 20px;
}

.report-photo-block .photo-upload-card {
    max-width: none;
}

.photo-upload-required header b {
    color: var(--danger);
}

.existing-photo-grid {
    display: grid;
    margin-top: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
}

.saved-photo-badge {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 3px 5px;
    border-radius: 7px;
    color: #176d48;
    background: rgba(237, 251, 244, 0.94);
    font-size: 7px;
    font-weight: 800;
}

.work-checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.work-check-row {
    display: grid;
    min-height: 57px;
    padding: 9px 11px;
    border: 1px solid #e0e7ef;
    border-radius: 11px;
    grid-template-columns: minmax(180px, 1fr) 165px minmax(170px, 0.8fr);
    align-items: center;
    gap: 9px;
    background: #fbfdff;
}

.work-check-row strong {
    color: #30465e;
    font-size: 11px;
}

.work-check-row select,
.work-check-row input,
.part-row input,
.part-row select {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #d8e0ea;
    border-radius: 8px;
    outline: 0;
    color: var(--text);
    background: #fff;
    font-size: 10px;
}

.report-spaced-field {
    margin-top: 18px;
}

.switch-card {
    display: flex;
    padding: 14px 16px;
    border: 1px solid #dce5ef;
    border-radius: 12px;
    align-items: center;
    gap: 11px;
    background: #f9fbfd;
    cursor: pointer;
}

.switch-card > input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0;
    accent-color: var(--blue-600);
}

.switch-card > span {
    display: flex;
    flex-direction: column;
}

.switch-card strong {
    color: #2c435b;
    font-size: 12px;
}

.switch-card small {
    margin-top: 3px;
    color: #7b899a;
    font-size: 9px;
}

.parts-panel {
    margin-top: 16px;
}

.parts-panel[hidden] {
    display: none;
}

.parts-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.part-row {
    display: grid;
    padding: 11px;
    border: 1px solid #e0e7ef;
    border-radius: 11px;
    grid-template-columns: 1.3fr 1fr 80px 140px 30px;
    align-items: end;
    gap: 8px;
    background: #fbfdff;
}

.part-row label {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.part-row label > span {
    color: #718096;
    font-size: 8px;
    font-weight: 750;
}

.part-remove-button {
    display: grid;
    width: 30px;
    height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #ad3540;
    background: #fff0f2;
    font-size: 18px;
    cursor: pointer;
    place-items: center;
}

.add-part-button {
    margin-top: 10px;
}

.report-parts-photo-grid {
    margin-top: 17px;
}

.report-sticky-actions {
    position: sticky;
    z-index: 5;
    bottom: 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -9px 25px rgba(12, 38, 67, 0.07);
}

.autosave-indicator {
    margin-right: auto;
    color: #718096;
    font-size: 9px;
}

.history-button-active {
    padding-right: 50px;
    cursor: pointer;
    opacity: 1;
}

.history-button-active small {
    top: 50%;
    min-width: 24px;
    text-align: center;
    transform: translateY(-50%);
}

.report-summary-hero {
    display: flex;
    min-height: 94px;
    margin-bottom: 16px;
    padding: 18px 21px;
    border: 1px solid #f0ddcc;
    border-radius: var(--radius-md);
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #fffdfb, #fff6ed);
}

.report-summary-icon {
    width: 54px;
    height: 54px;
    color: #fff;
    background: linear-gradient(135deg, #e18437, #b95a17);
}

.report-summary-hero > span:nth-child(2),
.report-summary-link {
    display: flex;
    flex-direction: column;
}

.report-summary-hero > span:nth-child(2) {
    min-width: 0;
    flex: 1;
}

.report-summary-hero small {
    color: #99714f;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.report-summary-hero strong {
    margin-top: 4px;
    color: #47331f;
    font-size: 15px;
}

.report-summary-hero em {
    margin-top: 3px;
    color: #997e68;
    font-size: 9px;
    font-style: normal;
}

.report-summary-link {
    min-width: 180px;
    text-align: right;
}

.report-detail-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
}

.report-section-card {
    overflow: hidden;
    margin-top: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.report-section-card > header {
    display: flex;
    min-height: 64px;
    padding: 15px 19px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    gap: 11px;
}

.report-section-card > header > span {
    display: grid;
    width: 29px;
    height: 29px;
    flex: 0 0 auto;
    border-radius: 9px;
    color: #fff;
    background: var(--blue-600);
    font-size: 10px;
    font-weight: 850;
    place-items: center;
}

.report-section-card > header div {
    display: flex;
    flex-direction: column;
}

.report-section-card h2 {
    margin: 0;
    color: #263a51;
    font-size: 14px;
}

.report-section-card header p {
    margin: 3px 0 0;
    color: #7a899b;
    font-size: 10px;
}

.report-section-alert {
    border-color: #e9b7bc;
}

.report-section-alert > header {
    background: #fff4f5;
}

.report-section-alert > header > span {
    background: var(--danger);
}

.report-copy-grid {
    display: grid;
    padding: 18px 20px;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px;
}

.report-copy-grid article,
.report-measure-grid article {
    display: flex;
    flex-direction: column;
}

.report-copy-grid small,
.report-measure-grid small,
.report-long-copy small {
    color: #8390a0;
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.report-copy-grid strong,
.report-measure-grid strong {
    margin-top: 6px;
    color: #30445c;
    font-size: 12px;
}

.report-copy-grid p,
.report-long-copy p {
    margin: 6px 0 0;
    color: #52657b;
    font-size: 11px;
    line-height: 1.65;
    white-space: pre-line;
}

.report-check-list {
    display: flex;
    padding: 15px 20px 0;
    flex-direction: column;
    gap: 7px;
}

.report-check-list > div {
    display: grid;
    padding: 9px 11px;
    border-radius: 9px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    background: #f7f9fc;
}

.report-check-list strong {
    color: #33485f;
    font-size: 10px;
}

.report-check-list small {
    grid-column: 1 / -1;
    color: #7a899b;
    font-size: 9px;
}

.work-result {
    padding: 4px 7px;
    border-radius: 12px;
    color: #687587;
    background: #e9edf2;
    font-size: 8px;
    font-weight: 800;
}

.work-result-fait {
    color: #176d48;
    background: #e5f7ee;
}

.work-result-non_fait {
    color: #a02e3a;
    background: #fdebed;
}

.report-long-copy {
    padding: 17px 20px 20px;
}

.report-parts-list {
    display: grid;
    padding: 17px 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.report-parts-list article {
    display: flex;
    padding: 11px;
    border: 1px solid #e3e9f0;
    border-radius: 9px;
    flex-direction: column;
}

.report-parts-list strong {
    color: #30445c;
    font-size: 10px;
}

.report-parts-list small,
.report-parts-list span {
    margin-top: 4px;
    color: #7a899b;
    font-size: 8px;
}

.report-measure-grid {
    display: grid;
    padding: 18px 20px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.report-measure-grid article {
    padding: 12px;
    border-radius: 9px;
    background: #f5f8fb;
}

.report-photo-groups {
    display: grid;
    padding: 18px 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.report-photo-group {
    padding: 13px;
    border: 1px solid #e1e7ee;
    border-radius: 11px;
}

.report-photo-group > header {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
    justify-content: space-between;
}

.report-photo-group > header strong {
    color: #33485f;
    font-size: 10px;
}

.report-photo-group > header small {
    color: #8190a3;
    font-size: 8px;
}

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

.signature-result-grid article {
    display: flex;
    min-height: 145px;
    padding: 14px;
    border: 1px solid #e1e7ee;
    border-radius: 11px;
    flex-direction: column;
}

.signature-result-grid small {
    color: #8190a3;
    font-size: 8px;
    text-transform: uppercase;
}

.signature-result-grid strong {
    margin-top: 5px;
    color: #30445c;
    font-size: 11px;
}

.signature-result-grid img {
    display: block;
    max-width: 240px;
    max-height: 85px;
    margin: auto;
    object-fit: contain;
}

.signature-result-grid p {
    margin: auto 0;
    color: #6e7d90;
    font-size: 10px;
}

.signature-result-grid .stamp-result {
    max-height: 110px;
}

.report-share-card {
    display: flex;
    margin-top: 16px;
    padding: 17px 19px;
    border: 1px solid #cfe4d9;
    border-radius: 13px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: #f3fbf7;
}

.report-share-card > span {
    display: flex;
    flex-direction: column;
}

.report-share-card strong {
    color: #24543e;
    font-size: 12px;
}

.report-share-card small {
    margin-top: 3px;
    color: #6c897b;
    font-size: 9px;
}

.report-share-card > div {
    display: flex;
    gap: 8px;
}

.share-whatsapp {
    color: #147448;
}

.validation-alert {
    display: flex;
    margin-bottom: 18px;
    flex-direction: column;
    gap: 3px;
}

.validation-blocked-card {
    display: flex;
    min-height: 400px;
    padding: 40px 24px;
    border: 1px solid #efd1b4;
    border-radius: var(--radius-lg);
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    background: #fffaf5;
}

.validation-blocked-icon {
    display: grid;
    width: 58px;
    height: 58px;
    border-radius: 17px;
    color: #fff;
    background: #d8792d;
    font-size: 28px;
    font-weight: 850;
    place-items: center;
}

.validation-blocked-card h2 {
    margin: 18px 0 0;
    color: #573b24;
}

.validation-blocked-card p {
    margin: 7px 0 0;
    color: #87694e;
}

.validation-blocked-card ul {
    margin: 17px 0 22px;
    padding: 0;
    color: #7d5735;
    list-style-position: inside;
    line-height: 1.8;
}

.validation-form {
    display: grid;
    gap: 16px;
}

.signature-card {
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: #fff;
    box-shadow: var(--shadow-sm);
}

.signature-card > header {
    display: flex;
    margin-bottom: 18px;
    align-items: center;
    gap: 10px;
}

.signature-card > header > span {
    display: grid;
    width: 29px;
    height: 29px;
    border-radius: 9px;
    color: #fff;
    background: var(--blue-600);
    font-size: 10px;
    font-weight: 850;
    place-items: center;
}

.signature-card > header div {
    display: flex;
    flex-direction: column;
}

.signature-card > header strong {
    color: #293f57;
    font-size: 13px;
}

.signature-card > header small {
    margin-top: 3px;
    color: #8190a3;
    font-size: 9px;
}

.signature-pad {
    position: relative;
    width: 100%;
    height: 190px;
    overflow: hidden;
    border: 2px dashed #c7d4e2;
    border-radius: 12px;
    background: #fbfdff;
}

.signature-pad canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.signature-pad button {
    position: absolute;
    right: 9px;
    bottom: 9px;
    padding: 6px 10px;
    border: 1px solid #d8e0ea;
    border-radius: 7px;
    color: #6d7e92;
    background: rgba(255, 255, 255, .93);
    font-size: 9px;
    cursor: pointer;
}

.signature-help {
    display: block;
    margin-top: 7px;
    color: #8190a3;
    font-size: 8px;
}

.client-signature-fields,
.client-signature-reason,
.stamp-upload-field {
    margin-top: 17px;
}

.client-signature-fields[hidden],
.client-signature-reason[hidden] {
    display: none;
}

.signature-pad-client {
    margin-top: 15px;
}

.validation-warning {
    padding: 17px 19px;
    border: 1px solid #edc7cb;
    border-radius: 12px;
    color: #8e3038;
    background: #fff4f5;
}

.validation-warning strong {
    font-size: 11px;
    text-transform: uppercase;
}

.validation-warning p {
    margin: 5px 0 0;
    font-size: 10px;
    line-height: 1.6;
}

.validation-actions {
    display: flex;
    padding: 4px 0 0;
    justify-content: flex-end;
    gap: 9px;
}

/* Client portal v0.6.0 */
.portal-body {
    background: #f1f5f9;
}

.portal-sidebar {
    background: linear-gradient(180deg, #081f39 0%, #0b2b4d 100%);
}

.portal-company-chip {
    display: grid;
    margin: 8px 18px 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    color: #fff;
    background: rgba(255, 255, 255, .07);
    grid-template-columns: 40px 1fr;
    gap: 2px 10px;
}

.portal-company-chip > span {
    display: grid;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: #0b2748;
    background: #fff;
    font-weight: 900;
    place-items: center;
    grid-row: 1 / 3;
}

.portal-company-chip strong {
    overflow: hidden;
    align-self: end;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.portal-company-chip small {
    color: #9eb2c7;
    font-size: 10px;
}

.portal-welcome {
    display: flex;
    margin-bottom: 24px;
    padding: 30px 32px;
    border-radius: 20px;
    align-items: center;
    justify-content: space-between;
    color: #fff;
    background: linear-gradient(120deg, #0b2748, #1268ad);
    box-shadow: 0 18px 42px rgba(11, 39, 72, .16);
}

.portal-welcome .eyebrow {
    color: #8fd0ff;
}

.portal-welcome h1 {
    margin: 7px 0 5px;
    font-size: clamp(27px, 4vw, 42px);
}

.portal-welcome p {
    margin: 0;
    color: #d5e7f6;
}

.portal-welcome .date-chip {
    border-color: rgba(255, 255, 255, .2);
    color: #fff;
    background: rgba(255, 255, 255, .1);
}

.portal-kpi-grid {
    display: grid;
    margin-bottom: 22px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.portal-kpi-grid > a,
.portal-kpi-grid > article {
    position: relative;
    display: grid;
    min-height: 178px;
    padding: 20px;
    overflow: hidden;
    border: 1px solid #dce5ed;
    border-radius: 17px;
    color: #102b4e;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(25, 55, 85, .06);
}

.portal-kpi-grid .module-icon {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
}

.portal-kpi-grid small {
    align-self: end;
    color: #6f8094;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.portal-kpi-grid strong {
    margin-top: 8px;
    font-size: 31px;
}

.portal-kpi-grid em {
    align-self: end;
    color: #1676d2;
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
}

.portal-last-intervention {
    color: #fff !important;
    background: linear-gradient(145deg, #126d52, #0a8f67) !important;
}

.portal-last-intervention small,
.portal-last-intervention span {
    color: #d4f3e7;
}

.portal-last-intervention strong {
    font-size: 24px;
}

.portal-last-intervention a {
    align-self: end;
    color: #fff;
    font-size: 11px;
    font-weight: 900;
}

.portal-two-columns {
    display: grid;
    margin-bottom: 22px;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.portal-list-card {
    padding: 0;
    overflow: hidden;
}

.portal-list-card > header,
.portal-gallery-card > header {
    display: flex;
    padding: 19px 21px;
    border-bottom: 1px solid #e5ebf0;
    align-items: center;
    justify-content: space-between;
}

.portal-list-card > header h2,
.portal-gallery-card > header h2 {
    margin: 0;
    color: #102b4e;
    font-size: 15px;
}

.portal-list-card > header p,
.portal-gallery-card > header p {
    margin: 4px 0 0;
    color: #728196;
    font-size: 11px;
}

.portal-list-card > header a {
    color: #1676d2;
    font-size: 11px;
    font-weight: 900;
    text-decoration: none;
}

.portal-activity-list > a,
.portal-document-list > a {
    display: grid;
    min-height: 72px;
    padding: 11px 18px;
    border-bottom: 1px solid #edf1f4;
    align-items: center;
    color: #102b4e;
    text-decoration: none;
    gap: 12px;
}

.portal-activity-list > a {
    grid-template-columns: 45px 1fr 18px;
}

.portal-document-list > a {
    grid-template-columns: 45px 1fr auto;
}

.portal-activity-list > a:hover,
.portal-document-list > a:hover {
    background: #f7fbff;
}

.portal-activity-list svg {
    width: 17px;
    fill: none;
    stroke: #7890a7;
    stroke-width: 2;
}

.activity-date {
    display: grid;
    width: 44px;
    height: 48px;
    border-radius: 10px;
    color: #126ab7;
    background: #edf6ff;
    text-align: center;
    place-content: center;
}

.activity-date strong {
    font-size: 16px;
}

.activity-date small {
    font-size: 8px;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-activity-list a > span:nth-child(2) strong,
.portal-document-list a > span:nth-child(2) strong {
    display: block;
    font-size: 12px;
}

.portal-activity-list a > span:nth-child(2) small,
.portal-document-list a > span:nth-child(2) small {
    display: block;
    margin-top: 4px;
    color: #718196;
    font-size: 10px;
}

.document-type-chip {
    display: grid;
    width: 43px;
    height: 34px;
    border-radius: 8px;
    color: #fff;
    background: #1676d2;
    font-size: 9px;
    font-weight: 900;
    place-items: center;
}

.document-type-bl { background: #8a55c7; }
.document-type-bc { background: #b57313; }

.portal-help-card {
    display: flex;
    padding: 18px 20px;
    border: 1px solid #cde6d9;
    border-radius: 15px;
    align-items: center;
    color: #125d46;
    background: #effaf5;
    gap: 13px;
}

.portal-help-card strong,
.portal-help-card small {
    display: block;
}

.portal-help-card small {
    margin-top: 3px;
    color: #4f796b;
}

.portal-filter-bar {
    display: grid;
    margin-bottom: 17px;
    padding: 15px;
    border: 1px solid #dce5ed;
    border-radius: 15px;
    align-items: end;
    background: #fff;
    grid-template-columns: minmax(220px, 1fr) 220px auto auto;
    gap: 11px;
}

.portal-filter-wide {
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.2fr) 220px 110px auto;
}

.portal-filter-bar label span {
    display: block;
    margin-bottom: 6px;
    color: #617287;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-filter-bar input,
.portal-filter-bar select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d4dee8;
    border-radius: 9px;
    color: #15314f;
    background: #fff;
    font-size: 13px;
}

.portal-machine-grid {
    display: grid;
    margin-bottom: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 15px;
}

.portal-machine-grid > a {
    position: relative;
    display: grid;
    min-height: 265px;
    padding: 21px;
    border: 1px solid #dce5ed;
    border-radius: 17px;
    color: #102b4e;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(25, 55, 85, .05);
}

.portal-machine-grid > a:hover {
    border-color: #9dc9ef;
    transform: translateY(-2px);
}

.portal-machine-grid .status-pill {
    position: absolute;
    top: 19px;
    right: 19px;
}

.portal-machine-icon {
    display: grid;
    width: 52px;
    height: 52px;
    margin-bottom: 18px;
    border-radius: 14px;
    color: #1676d2;
    background: #eaf5ff;
    place-items: center;
}

.portal-machine-icon svg {
    width: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.portal-machine-grid > a > small {
    color: #6f8094;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-machine-grid h2 {
    margin: 6px 0 15px;
    font-size: 18px;
}

.portal-machine-grid dl {
    display: grid;
    margin: 0;
    grid-template-columns: 1fr 1fr 75px;
    gap: 8px;
}

.portal-machine-grid dt {
    color: #8a98a8;
    font-size: 9px;
    text-transform: uppercase;
}

.portal-machine-grid dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-size: 11px;
    font-weight: 800;
}

.portal-machine-grid em {
    display: flex;
    margin-top: 17px;
    align-items: center;
    align-self: end;
    color: #1676d2;
    font-size: 11px;
    font-style: normal;
    font-weight: 900;
    gap: 4px;
}

.portal-machine-grid em svg {
    width: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.portal-empty-wide {
    grid-column: 1 / -1;
}

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

.portal-machine-summary article {
    padding: 18px;
    border: 1px solid #dce5ed;
    border-radius: 14px;
    background: #fff;
}

.portal-machine-summary small,
.portal-machine-summary strong {
    display: block;
}

.portal-machine-summary small {
    margin-bottom: 7px;
    color: #728196;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.portal-machine-summary strong {
    color: #102b4e;
    font-size: 16px;
}

.portal-gallery-card {
    margin-bottom: 18px;
}

.portal-gallery-card .machine-photo-groups {
    padding: 18px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.portal-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.portal-table th {
    padding: 13px 16px;
    border-bottom: 1px solid #dce5ed;
    color: #65778b;
    background: #f6f9fc;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .035em;
    text-align: left;
    text-transform: uppercase;
    white-space: nowrap;
}

.portal-table td {
    padding: 15px 16px;
    border-bottom: 1px solid #e9eef3;
    color: #2b4059;
    font-size: 12px;
    vertical-align: middle;
}

.portal-table tbody tr:last-child td {
    border-bottom: 0;
}

.portal-table tbody tr:hover {
    background: #f8fbfe;
}

.portal-table td > strong {
    color: #173451;
}

.portal-table td > small {
    display: block;
    margin-top: 4px;
    color: #77879a;
    font-size: 10px;
}

.portal-document-tabs {
    display: flex;
    margin-bottom: 15px;
    padding: 6px;
    border: 1px solid #dce5ed;
    border-radius: 13px;
    background: #fff;
    gap: 5px;
}

.portal-document-tabs a {
    flex: 1;
    padding: 11px;
    border-radius: 9px;
    color: #5d7085;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
    text-decoration: none;
}

.portal-document-tabs a.active {
    color: #fff;
    background: #1676d2;
}

.portal-profile-grid {
    display: grid;
    align-items: start;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr);
    gap: 17px;
}

.portal-profile-form {
    margin: 0;
}

.portal-profile-form > header {
    padding: 22px 24px 0;
}

.portal-profile-form > .form-grid {
    padding: 0 24px;
}

.portal-profile-form .form-grid.three-columns {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portal-profile-form hr {
    margin: 24px;
    border: 0;
    border-top: 1px solid #e3e9ef;
}

.portal-profile-form header h2 {
    margin: 0;
    color: #102b4e;
    font-size: 16px;
}

.portal-profile-form header p {
    margin: 5px 0 18px;
    color: #728196;
    font-size: 11px;
}

.portal-profile-form > .flash {
    margin: 20px 24px 0;
}

.portal-password-alert {
    display: flex;
    margin-bottom: 16px;
    padding: 15px 18px;
    border: 1px solid #f0d28b;
    border-radius: 12px;
    color: #704d08;
    background: #fff8e4;
    gap: 10px;
}

.portal-access-card {
    margin: 18px 0;
    padding: 20px;
    border: 1px solid #cfe0ef;
    border-radius: 16px;
    background: #f8fbfe;
}

.portal-access-card > header {
    display: flex;
    margin-bottom: 16px;
    align-items: center;
    justify-content: space-between;
}

.portal-access-card h2,
.portal-access-form h3,
.portal-user-list h3 {
    margin: 4px 0;
    color: #102b4e;
}

.portal-access-card p {
    margin: 4px 0 0;
    color: #65778b;
}

.portal-access-grid {
    display: grid;
    grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
    gap: 15px;
}

.portal-access-form,
.portal-user-list {
    padding: 16px;
    border: 1px solid #dde6ee;
    border-radius: 12px;
    background: #fff;
}

.portal-access-form .form-field {
    margin: 12px 0;
}

.portal-user-list article {
    display: grid;
    padding: 10px 0;
    border-bottom: 1px solid #edf1f4;
    align-items: center;
    grid-template-columns: 38px minmax(140px, 1fr) auto auto auto;
    gap: 9px;
}

.portal-user-list article > span:nth-child(2) strong,
.portal-user-list article > span:nth-child(2) small {
    display: block;
}

.portal-user-list article > span:nth-child(2) small {
    margin-top: 3px;
    color: #728196;
    font-size: 9px;
}

.temporary-password-box {
    display: flex;
    margin-bottom: 15px;
    padding: 14px 16px;
    border: 1px solid #abd7c4;
    border-radius: 12px;
    align-items: center;
    color: #0d6045;
    background: #ecfaf4;
    gap: 13px;
}

.temporary-password-box strong {
    padding: 7px 11px;
    border-radius: 7px;
    color: #fff;
    background: #0b7d59;
    font: 700 15px monospace;
    letter-spacing: 1px;
}

.temporary-password-box small {
    color: #457866;
}

.muted-copy {
    color: #7a899a;
    font-size: 11px;
}

.document-status-impayee {
    color: #a12832;
    background: #fff0f1;
}

.document-status-payee {
    color: #08734d;
    background: #e6f7ef;
}

.document-status-partiellement_payee {
    color: #8a5900;
    background: #fff4d8;
}

@media (max-width: 1200px) {
    .portal-kpi-grid,
    .portal-machine-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .portal-filter-wide {
        grid-template-columns: 1fr 1fr;
    }

    .portal-filter-wide .primary-button {
        width: max-content;
    }
}

@media (max-width: 850px) {
    .portal-two-columns,
    .portal-profile-grid,
    .portal-access-grid {
        grid-template-columns: 1fr;
    }

    .portal-filter-bar {
        grid-template-columns: 1fr 1fr;
    }

    .portal-user-list article {
        grid-template-columns: 38px 1fr auto;
    }

    .portal-user-list article form {
        grid-column: span 1;
    }

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

@media (max-width: 600px) {
    .portal-welcome {
        padding: 23px 20px;
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
    }

    .portal-kpi-grid,
    .portal-machine-grid,
    .portal-machine-summary,
    .portal-filter-bar,
    .portal-filter-wide {
        grid-template-columns: 1fr;
    }

    .portal-document-tabs {
        flex-direction: column;
    }

    .portal-machine-grid dl {
        grid-template-columns: 1fr 1fr;
    }

    .portal-access-card > header,
    .temporary-password-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .portal-user-list article {
        grid-template-columns: 38px 1fr;
    }

    .portal-user-list article > .status-pill,
    .portal-user-list article form {
        grid-column: 2;
    }
}

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

    .report-technician {
        display: none;
    }

    .work-check-row {
        grid-template-columns: minmax(160px, 1fr) 150px;
    }

    .work-check-row input {
        grid-column: 1 / -1;
    }

    .part-row {
        grid-template-columns: 1fr 1fr 80px;
    }

    .part-row label:nth-child(4) {
        grid-column: 1 / 3;
    }

    .part-remove-button {
        grid-column: 3;
        grid-row: 2;
    }
}

@media (max-width: 820px) {
    .report-date {
        display: none;
    }

    .report-detail-grid,
    .report-photo-groups {
        grid-template-columns: 1fr;
    }

    .report-share-card {
        align-items: stretch;
        flex-direction: column;
    }

    .report-share-card > div {
        flex-wrap: wrap;
    }

    .report-share-card .secondary-button {
        flex: 1;
    }
}

@media (max-width: 560px) {
    .metric-grid-four {
        grid-template-columns: 1fr;
    }

    .report-choice-line {
        grid-template-columns: 1fr;
    }

    .report-add-button {
        width: 100%;
    }

    .report-context-card {
        margin: 18px 18px 0;
        align-items: flex-start;
        flex-direction: column;
    }

    .report-context-separator {
        display: none;
    }

    .work-check-row,
    .part-row {
        grid-template-columns: 1fr;
    }

    .work-check-row input,
    .part-row label:nth-child(4),
    .part-remove-button {
        grid-column: auto;
        grid-row: auto;
    }

    .part-remove-button {
        width: 100%;
    }

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

    .autosave-indicator {
        margin: 0;
        text-align: center;
    }

    .report-summary-hero {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .report-summary-link {
        width: 100%;
        padding-left: 68px;
        text-align: left;
    }

    .report-copy-grid,
    .report-parts-list,
    .report-measure-grid,
    .signature-result-grid {
        grid-template-columns: 1fr;
    }

    .report-main em,
    .report-row > .status-pill {
        display: none;
    }

    .report-row {
        padding: 13px;
        gap: 9px;
    }

    .validation-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

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