:root {
    --bg: #f8fafc;
    --card: #ffffff;
    --line: #e2e8f0;
    --line-strong: #cbd5e1;
    --txt: #0f172a;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --brand: #498536;
    --brand-2: #5e9d4c;
    --brand-soft: #eef8ea;
    --brand-ring: rgba(73, 133, 54, 0.18);
    --warn: #c41807;
    --danger: #c41807;
    --warn-soft: #fef3c7;
    --warn-text: #92400e;
    --success-soft: #dcfce7;
    --success-text: #166534;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--txt);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    overflow-x: hidden;
}

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

.layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 260px 1fr;
}

.side {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color: #e5e7eb;
    padding: 22px 14px;
    overflow: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 8px;
}

.brand span {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
}

.side nav {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.side nav a {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 14px;
    color: #cbd5e1;
    padding: 12px 13px;
    border-radius: 10px;
    position: relative;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.side nav a i {
    width: 16px;
    text-align: center;
    opacity: 0.95;
}

.side nav a:hover,
.side nav a.active {
    background: rgba(73, 133, 54, 0.2);
    color: #f8fafc;
    transform: translateX(2px);
}

.side nav a.active::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.side-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin: 10px 0;
}

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

.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    padding: 14px 22px;
    display: flex;
    justify-content: flex-end;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
}

.content {
    padding: 24px;
    display: grid;
    gap: 16px;
}

.builder-content {
    max-width: 1320px;
    margin: 0 auto;
    width: 100%;
}

.page-head h2,
.page-head-row h2 {
    margin: 0;
    font-size: 24px;
}

.page-head p,
.page-head-row p {
    margin: 6px 0 0;
    color: var(--muted);
}

.page-head-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.page-head-txt {
    min-width: 0;
}

.btn {
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 10px 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #3b6f2c);
    box-shadow: 0 10px 20px rgba(73, 133, 54, 0.2);
}

.btn-secondary {
    color: #111827;
    background: #fff;
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
}

.btn-icon {
    padding: 6px 10px;
}

.btn-icon + .btn-icon {
    margin-left: 6px;
}

.status-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
}

.status-pill-published {
    background: rgba(73, 133, 54, 0.12);
    color: #365f2b;
}

.status-pill-draft {
    background: rgba(196, 24, 7, 0.14);
    color: #8f180d;
}

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

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

.kpi {
    background: var(--card);
    border: 1px solid #edf2f7;
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    box-shadow: var(--shadow-xs);
}

.kpi h3 {
    margin: 4px 0 12px;
    font-size: 28px;
}

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

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
}

.kpi-icon-success {
    background: rgba(73, 133, 54, 0.14);
    color: var(--brand);
}

.kpi-icon-warning {
    background: rgba(196, 24, 7, 0.12);
    color: var(--danger);
}

.kpi-link {
    font-size: 13px;
    color: var(--brand);
    font-weight: 600;
}

.chart-panel,
.panel {
    background: var(--card);
    border: 1px solid #edf2f7;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.chart-head,
.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
}

.chart-head-left,
.panel-head-left {
    display: flex;
    gap: 9px;
    align-items: center;
}

.chart-head-right {
    display: flex;
    gap: 8px;
}

.chart-select {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
}

.chart-export-btn {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 8px 10px;
    font-weight: 600;
}

.chart-body {
    padding: 14px;
}

.chart-canvas-wrap {
    height: 330px;
}

.panel-body {
    padding: 16px;
}

.quick-panels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.status-row {
    display: flex;
    justify-content: space-between;
    padding: 9px 0;
    border-bottom: 1px dashed #eef2f7;
}

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

.status-label {
    display: flex;
    gap: 8px;
    align-items: center;
    color: #374151;
    font-size: 14px;
}

.status-icon-success { color: var(--brand); }
.status-icon-warning { color: var(--danger); }
.status-icon-info { color: var(--brand); }
.status-icon-accent { color: var(--danger); }

.badge-ok,
.badge-pend {
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge-ok {
    background: rgba(73, 133, 54, 0.12);
    color: #365f2b;
}

.badge-pend {
    background: rgba(196, 24, 7, 0.14);
    color: #8f180d;
}

.mini-table,
table.display {
    width: 100%;
    border-collapse: collapse;
}

.mini-table th,
.mini-table td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}

.table-wrap {
    overflow: auto;
}

.login-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

.left {
    padding: 34px;
    color: #fff;
    background: radial-gradient(circle at 0 0, #0ea5e9 0, #0f172a 58%);
    display: flex;
    flex-direction: column;
}

.left-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.left-logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}

.left-body {
    margin: auto 0;
}

.left-body h1 {
    font-size: 54px;
    line-height: 1.04;
    margin: 0 0 14px;
}

.left-body p {
    max-width: 520px;
    color: #bfdbfe;
}

.left-features {
    margin-top: 20px;
    display: grid;
    gap: 8px;
}

.left-feature {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 14px;
}

.left-foot {
    color: #cbd5e1;
    font-size: 12px;
}

.right {
    display: grid;
    place-items: center;
    padding: 22px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 24px;
}

.card-logo {
    width: 54px;
    height: 54px;
    border-radius: 12px;
}

.card-title h2 {
    margin: 14px 0 4px;
}

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

.login-field {
    margin-top: 14px;
}

.login-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #374151;
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.input-wrap input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 11px 10px 11px 34px;
}

.btn-login {
    width: 100%;
    margin-top: 14px;
}

.divider {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
}

/* LOTO module styles */
.loto-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.page-head-row .loto-actions {
    padding: 6px;
    background: #f8fafc;
    border: 1px solid #e9eff6;
    border-radius: 12px;
    max-width: 100%;
    justify-content: flex-end;
}

.builder-bottom-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
}

.clients-form-actions {
    justify-content: flex-end;
}

.loto-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.loto-tab {
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    color: #475569;
    transition: all 0.2s ease;
}

.loto-tab.active {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, var(--brand), #3f772f);
    box-shadow: 0 6px 16px rgba(73, 133, 54, 0.24);
}

.loto-grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-3);
}

.loto-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-3);
}

.field {
    display: grid;
    gap: 7px;
}

.field label {
    font-size: 13px;
    color: #334155;
    font-weight: 600;
}

.required-star {
    color: #dc2626;
}

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

.field input,
.field textarea,
.field select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    min-height: 42px;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

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

.step-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--line);
}

.step-table th,
.step-table td {
    border: 0;
    border-bottom: 1px solid #edf2f7;
    padding: 10px;
    vertical-align: top;
}

.step-table th {
    background: #f8fafc;
    text-align: left;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #475569;
    font-weight: 700;
    white-space: nowrap;
}

.step-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

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

.step-table input,
.step-table select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    padding: 8px 9px;
    background: #fff;
}

.lockout-header-box {
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.lockout-header-grid {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 6px;
}

.lockout-header-grid input {
    border: 1px solid #94a3b8;
    background: rgba(255, 255, 255, 0.7);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
}

.badge-warning {
    color: var(--warn-text);
    background: var(--warn-soft);
}

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

.builder-note {
    margin-top: 8px;
}

.logo-thumb {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    object-fit: cover;
    background: #f8fafc;
}

.builder-logo-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.muted-small {
    font-size: 12px;
    color: #6b7280;
}

.equipment-photo-preview {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.equipment-photo-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    object-fit: cover;
    box-shadow: var(--shadow-xs);
}

.file-upload-zone {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: linear-gradient(180deg, #fbfdff 0%, #f8fafc 100%);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.file-upload-zone:hover,
.file-upload-zone.is-dragover {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
    background: var(--brand-soft);
}

.file-upload-zone:focus-visible {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-ring);
}

.file-upload-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: rgba(73, 133, 54, 0.12);
    flex-shrink: 0;
}

.file-upload-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.file-upload-copy strong {
    font-size: 13px;
    color: #1e293b;
    overflow-wrap: anywhere;
}

.file-upload-copy span {
    font-size: 12px;
    color: #64748b;
    overflow-wrap: anywhere;
}

.file-upload-btn {
    margin-left: auto;
}

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

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

.sequence-title {
    font-size: 14px;
    color: #0f172a;
    font-weight: 600;
}

.th-step-meta { width: 360px; }
.th-verification { width: 150px; }
.th-delete { width: 90px; text-align: center; }
.th-step { width: 75px; }
.th-action { width: 220px; }

.row-delete-btn {
    padding: 6px 10px;
    min-width: 38px;
    justify-content: center;
}

.step-color-row {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.step-color-label {
    font-size: 11px;
    color: #334155;
}

.step-color-input {
    width: 34px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
}

.logo-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-input-row input[type="file"] {
    flex: 1;
}

/* DataTables polish */
.app-data-table {
    width: 100% !important;
}

div.dataTables_wrapper,
div.dt-container {
    padding-top: 4px;
}

div.dataTables_wrapper div.dataTables_filter input,
div.dataTables_wrapper div.dataTables_length select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
    margin-left: 8px;
}

div.dt-container .dt-search input,
div.dt-container .dt-length select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 10px;
    background: #fff;
}

div.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px !important;
}

div.dt-container .dt-paging .dt-paging-button {
    border-radius: 8px !important;
}

div.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, var(--brand), #3b6f2c) !important;
    color: #fff !important;
    border-color: transparent !important;
}

div.dt-container .dt-paging .dt-paging-button.current {
    background: linear-gradient(135deg, var(--brand), #3b6f2c) !important;
    color: #fff !important;
    border-color: transparent !important;
}

table.dataTable > thead > tr > th,
table.dataTable > thead > tr > td {
    background: #f8fafc !important;
    color: #475569;
    border-bottom: 1px solid #e2e8f0 !important;
    border-top: 0 !important;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    font-size: 11px;
    font-weight: 700;
}

table.dataTable tbody tr:hover {
    background: #f7fbf5;
}

table.dataTable tbody td {
    border-left: 0 !important;
    border-right: 0 !important;
    border-color: #edf2f7 !important;
}

table.dataTable tbody tr:nth-child(even) {
    background: #fcfdff;
}

div.dt-container .dt-search input:focus,
div.dt-container .dt-length select:focus,
div.dataTables_wrapper div.dataTables_filter input:focus,
div.dataTables_wrapper div.dataTables_length select:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(73, 133, 54, 0.16);
}

table.dataTable.no-footer {
    border-bottom: 1px solid #e5e7eb !important;
}

.hidden-export {
    position: fixed;
    left: -99999px;
    top: 0;
    z-index: -1;
}

.pdf-page-break {
    page-break-after: always;
}

/* Printable Brady style pages */
.print-wrap {
    display: grid;
    place-items: center;
    padding: 20px;
}

.a4-page {
    width: 210mm;
    min-height: 297mm;
    background: #fff;
    border: 1px solid #cbd5e1;
    padding: 9mm 8mm;
    font-family: Arial, sans-serif;
    color: #111;
}

.sheet-title {
    margin: 0 0 8px;
    font-size: 21px;
    text-align: center;
    border: 1px solid #111;
    padding: 8px;
    letter-spacing: 0.2px;
}

.sheet-top {
    display: grid;
    grid-template-columns: 120px 1fr 140px;
    border: 1px solid #111;
}

.sheet-top > div {
    padding: 8px;
    border-right: 1px solid #111;
}

.sheet-top > div:last-child {
    border-right: 0;
}

.sheet-key {
    font-size: 10px;
    color: #374151;
    text-transform: uppercase;
}

.sheet-val {
    font-size: 13px;
    font-weight: 700;
}

.front-sheet {
    padding: 6mm 6mm 8mm;
    --front-left-col: 136px;
    --front-image-cols: 1fr 1fr 1fr;
    font-family: Arial, sans-serif;
}

.front-top-band {
    display: grid;
    grid-template-columns: var(--front-left-col) 1fr;
    border: 1px solid #1f2937;
    border-bottom: 0;
    min-height: 30px;
}

.front-stripes {
    background: repeating-linear-gradient(
        -40deg,
        #dc2626 0,
        #dc2626 6px,
        #fff 6px,
        #fff 12px
    );
}

.front-brand-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.front-client-logo {
    width: auto;
    max-width: 110px;
    height: 22px;
    object-fit: contain;
    flex: 0 0 auto;
}

.front-title {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.1;
    display: flex;
    align-items: center;
}

.front-meta-grid {
    display: grid;
    grid-template-columns: 52px 84px 1fr 1fr;
    border: 1px solid #1f2937;
    border-top: 0;
    font-size: 10px;
    align-items: stretch;
}

.meta-label-col,
.meta-value-col,
.meta-main-col {
    border-right: 1px solid #1f2937;
}

.meta-label-col {
    background: #f4f4f5;
}

.meta-value-col,
.meta-main-col {
    background: #fff;
}

.meta-main-col:last-child {
    border-right: 0;
}

.meta-label-col > div,
.meta-value-col > div,
.meta-main-row {
    min-height: 19px;
    padding: 2px 6px;
    border-bottom: 1px solid #1f2937;
    display: flex;
    align-items: center;
}

.meta-label-col > div:last-child,
.meta-value-col > div:last-child,
.meta-main-col .meta-main-row:last-child {
    border-bottom: 0;
}

.meta-label-col > div {
    font-weight: 700;
}

.meta-main-row {
    justify-content: space-between;
    gap: 8px;
    line-height: 1;
}

.meta-main-label {
    color: #374151;
    font-weight: 700;
}

.front-meta-grid strong,
.front-meta-grid span,
.front-meta-grid > div > div {
    line-height: 1;
}

.front-caution-grid {
    display: grid;
    grid-template-columns: var(--front-left-col) 52px 1fr;
    border: 1px solid #1f2937;
    border-top: 0;
    align-items: stretch;
}

.lockout-points-panel {
    background: #1f2937;
    color: #fff;
    border-right: 1px solid #1f2937;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
}

.lockout-points-label {
    font-size: 10px;
    font-weight: 700;
}

.lockout-points-panel strong {
    font-size: 32px;
    line-height: 0.9;
}

.front-note-label {
    border-right: 1px solid #1f2937;
    padding: 4px 6px;
    font-size: 10px;
    font-weight: 700;
    color: #c2410c;
    background: #fff4c2;
    display: flex;
    align-items: center;
}

.front-note-content {
    padding: 4px 8px;
    font-size: 10px;
    line-height: 1.15;
    background: #ffffff;
    display: flex;
    align-items: center;
}

.front-location-line {
    border: 1px solid #1f2937;
    border-top: 0;
    padding: 0 8px;
    font-size: 10px;
    font-weight: 700;
    min-height: 22px;
    display: flex;
    align-items: center;
    line-height: 1;
    white-space: nowrap;
}

.front-image-head {
    display: grid;
    grid-template-columns: var(--front-image-cols);
    border: 1px solid #1f2937;
    border-top: 0;
    border-bottom: 0;
    margin-top: 0;
}

.front-image-head > div {
    border-right: 1px solid #1f2937;
    min-height: 22px;
    display: grid;
    place-items: center;
    font-size: 10px;
    font-weight: 700;
    background: #f3f4f6;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.front-image-head > div:last-child {
    border-right: 0;
}

.front-sheet .front-image-grid {
    margin-top: 0;
    gap: 0;
    grid-template-columns: var(--front-image-cols);
    border: 1px solid #1f2937;
    border-top: 0;
}

.front-sheet .front-image-grid .shot {
    min-height: 28mm;
    border: 0;
    border-right: 1px solid #1f2937;
}

.front-sheet .front-image-grid .shot:last-child {
    border-right: 0;
}

.steps-title-band {
    margin-top: 8px;
    background: #111827;
    color: #fff;
    border: 1px solid #1f2937;
    border-bottom: 0;
    padding: 3px 6px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
}

.front-sheet .steps-table {
    margin-top: 0;
    font-size: 10px;
    table-layout: fixed;
}

.front-sheet .steps-table thead th {
    background: #ffffff;
    color: #111;
    padding: 5px 6px;
    font-size: 10px;
}

.front-sheet .steps-table td {
    padding: 4px 6px;
    background: #fff;
    line-height: 1.2;
}

.front-sheet .steps-table tbody td:first-child {
    padding: 3px;
}

.front-step-meta {
    color: #fff;
    border-radius: 0;
    padding: 4px 6px;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.front-step-meta-main {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

.front-step-meta-sub {
    font-size: 10px;
    line-height: 1.2;
    opacity: 0.95;
}

.image-grid {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 6px;
}

.shot {
    border: 1px solid #111;
    min-height: 52mm;
    position: relative;
    overflow: hidden;
}

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

.tag {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.steps-table {
    margin-top: 8px;
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.steps-table th,
.steps-table td {
    border: 1px solid #111;
    padding: 7px;
    vertical-align: top;
}

.steps-table thead th {
    background: #0f172a;
    color: #fff;
}

.energy-cell {
    font-weight: 700;
}

.back-block {
    border: 1px solid #111;
    margin-top: 8px;
}

.back-sheet {
    padding: 7mm 6mm 8mm;
    font-family: Arial, sans-serif;
}

.back-sheet .back-block {
    margin-top: 6px;
    border: 1px solid #1f2937;
}

.back-sheet .back-block:first-child {
    margin-top: 0;
}

.back-head {
    background: #f3f4f6;
    border-bottom: 1px solid #111;
    padding: 7px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
}

.back-sheet .back-head {
    background: #111827;
    border-bottom: 1px solid #1f2937;
    color: #fff;
    padding: 5px 7px;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-align: center;
}

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

.back-table th,
.back-table td {
    border: 1px solid #111;
    padding: 6px;
}

.back-sheet .back-table {
    font-size: 10px;
    table-layout: fixed;
}

.back-sheet .back-table th,
.back-sheet .back-table td {
    border: 1px solid #1f2937;
    padding: 5px 6px;
    vertical-align: top;
}

.back-sheet .back-table th {
    background: #f8fafc;
    font-weight: 700;
}

.back-sheet .back-table thead th {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 10px;
}

.back-col-main { width: 220px; }
.back-col-step { width: 60px; text-align: center; }
.back-col-action { width: 180px; }

.back-energy-band {
    margin-top: 6px;
    border: 1px solid #1f2937;
    background: #f8fafc;
    padding: 6px 8px;
    font-size: 10px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.back-energy-band strong {
    font-size: 10px;
}

@media print {
    body {
        background: #fff;
    }

    .print-wrap {
        padding: 0;
    }

    .a4-page {
        border: 0;
        margin: 0;
    }
}

@media (max-width: 1080px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .side {
        display: none;
    }

    .kpis,
    .loto-grid-2,
    .loto-grid-3,
    .quick-panels {
        grid-template-columns: 1fr;
    }

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

    .left {
        display: none;
    }
}
