:root {
    --nav: #0f172a;
    --nav-soft: #1e293b;
    --bg: #f3f4f6;
    --card: #ffffff;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e5e7eb;
    --ok-bg: #dcfce7;
    --ok-text: #166534;
    --accent: #2563eb;
    --danger: #dc2626;
    --warning-bg: #fef3c7;
    --warning-text: #92400e;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

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

aside {
    background: var(--nav);
    color: white;
    padding: 30px 28px;
}

.brand-logo {
    display: block;
    width: 210px;
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
}

.version {
    font-size: 13px;
    color: #cbd5e1;
    margin-bottom: 34px;
    line-height: 1.35;
}

nav a {
    display: block;
    color: #f8fafc;
    text-decoration: none;
    padding: 13px 11px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 18px;
}

nav a.active,
nav a:hover {
    background: var(--nav-soft);
}

main {
    padding: 30px 36px 42px;
}

.top {
    display: grid;
    grid-template-columns: 1fr minmax(340px, 520px) auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 28px;
}

h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -0.5px;
}

.status {
    padding: 10px 16px;
    border-radius: 999px;
    background: var(--ok-bg);
    color: var(--ok-text);
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.agent-bar {
    background: white;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

.agent-bar span {
    font-weight: 700;
    color: var(--accent);
    white-space: nowrap;
}

.agent-bar input {
    border: 0;
    outline: 0;
    width: 100%;
    font-size: 15px;
    color: var(--text);
}

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

.card {
    background: var(--card);
    border-radius: 14px;
    padding: 24px 26px;
    min-height: 160px;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .10);
    border: 1px solid var(--border);
}

.card h2 {
    font-size: 21px;
    margin: 0 0 12px;
}

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

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

.module-header {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 26px;
    margin-bottom: 20px;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .08);
}

.module-header h2 {
    margin: 0 0 10px;
    font-size: 26px;
}

.module-header p {
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.45;
}

.table-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .08);
}

.table-title {
    padding: 18px 22px;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
}

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

th, td {
    padding: 14px 22px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    font-size: 15px;
}

th {
    color: var(--muted);
    font-weight: 700;
    background: #f8fafc;
}

.badge {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--warning-bg);
    color: var(--warning-text);
    font-weight: 700;
    font-size: 13px;
}

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

@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    aside { padding: 22px; }
    nav { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
    nav a { margin: 0; font-size: 16px; }
    main { padding: 24px; }
    .grid { grid-template-columns: 1fr; }
}

.user-box {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.user-name {
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
}

.logout-form {
    margin: 0;
}

.logout-btn {
    border: 0;
    background: #fee2e2;
    color: #991b1b;
    padding: 9px 14px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #0f172a;
    padding: 24px;
}

.login-card {
    width: 100%;
    max-width: 430px;
    background: white;
    border-radius: 18px;
    padding: 34px;
    box-shadow: 0 20px 80px rgba(0,0,0,.35);
}

.login-logo {
    width: 220px;
    display: block;
    margin-bottom: 24px;
    background: #0f172a;
    padding: 14px;
    border-radius: 12px;
}

.login-card h1 {
    font-size: 28px;
    margin: 0 0 8px;
}

.login-card p {
    margin: 0 0 22px;
    color: var(--muted);
}

.form-row {
    margin-bottom: 16px;
}

.form-row label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-row input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 13px 14px;
    font-size: 16px;
}

.primary-btn {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 13px 16px;
    background: #2563eb;
    color: white;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
}

.error-box {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-weight: 700;
}

@media (max-width: 1180px) {
    .user-box { justify-content: flex-start; }
}

.action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
}

.action-btn {
    display: inline-block;
    background: #2563eb;
    color: white;
    text-decoration: none;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
}

.secondary-btn {
    display: inline-block;
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
    border: 0;
    border-radius: 10px;
    padding: 11px 16px;
    font-weight: 700;
    cursor: pointer;
}

.form-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 24px 26px;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .08);
    max-width: 920px;
}

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

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

.form-field label {
    display: block;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 13px;
    font-size: 16px;
    background: white;
}

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

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
}

.validation-box {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-weight: 700;
}

@media (max-width: 760px) {
    .form-grid { grid-template-columns: 1fr; }
    .action-row { align-items: flex-start; flex-direction: column; }
}

.priority-critical {
    background: #fee2e2;
    color: #991b1b;
}

.priority-high {
    background: #ffedd5;
    color: #9a3412;
}

.priority-medium {
    background: #fef3c7;
    color: #92400e;
}

.priority-low {
    background: #e0f2fe;
    color: #075985;
}

.status-open {
    background: #fee2e2;
    color: #991b1b;
}

.status-progress {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-waiting {
    background: #fef3c7;
    color: #92400e;
}

.status-closed {
    background: #dcfce7;
    color: #166534;
}

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

.kpi {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    box-shadow: 0 1px 5px rgba(15, 23, 42, .08);
}

.kpi strong {
    display: block;
    font-size: 30px;
    margin-bottom: 4px;
}

.kpi span {
    color: var(--muted);
    font-weight: 700;
}

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

@media (max-width: 640px) {
    .kpi-row { grid-template-columns: 1fr; }
}

.upload-zone {
    border: 2px dashed #93c5fd;
    background: #eff6ff;
    border-radius: 16px;
    padding: 34px;
    text-align: center;
    cursor: pointer;
    transition: .15s ease;
}

.upload-zone:hover,
.upload-zone.drag-over {
    background: #dbeafe;
    border-color: #2563eb;
}

.upload-zone strong {
    display: block;
    font-size: 22px;
    margin-bottom: 8px;
}

.upload-zone span {
    color: #475569;
    font-size: 16px;
}

.file-list {
    margin-top: 18px;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px;
}

.file-list-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

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

.ocr-pill {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: #e0f2fe;
    color: #075985;
}

.ocr-pending { background: #fef3c7; color: #92400e; }
.ocr-processing { background: #dbeafe; color: #1d4ed8; }
.ocr-done { background: #dcfce7; color: #166534; }
.ocr-failed { background: #fee2e2; color: #991b1b; }

.file-small {
    color: #64748b;
    font-size: 13px;
}

.preview-box {
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 14px;
    padding: 18px;
    white-space: pre-wrap;
    font-family: Consolas, monospace;
    font-size: 14px;
    line-height: 1.45;
    max-height: 360px;
    overflow: auto;
}

.inline-form {
    display: inline;
}

.small-btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 700;
    cursor: pointer;
    background: #2563eb;
    color: white;
}

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

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

.info-strip {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-weight: 700;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 20px;
}

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

.meta-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.meta-label {
    color: var(--muted);
    font-weight: 700;
}

.meta-value {
    font-weight: 700;
}

.review-approved {
    background: #dcfce7;
    color: #166534;
}

.review-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.review-pending_review {
    background: #fef3c7;
    color: #92400e;
}

.button-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

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

.match-ok {
    background: #dcfce7;
    color: #166534;
}

.match-variance {
    background: #fee2e2;
    color: #991b1b;
}

.match-pending {
    background: #fef3c7;
    color: #92400e;
}

.match-partial {
    background: #dbeafe;
    color: #1d4ed8;
}

.timeline-card {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
}

.timeline-card strong {
    display: block;
    margin-bottom: 6px;
}

.status-planned { background:#dbeafe; color:#1d4ed8; }
.status-progress { background:#fef3c7; color:#92400e; }
.status-completed { background:#dcfce7; color:#166534; }
.status-blocked { background:#fee2e2; color:#991b1b; }

.status-for_review {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.evidence-ok {
    background: #dcfce7;
    color: #166534;
}

.evidence-missing {
    background: #fee2e2;
    color: #991b1b;
}

.evidence-not_checked {
    background: #fef3c7;
    color: #92400e;
}

.status-blocked {
    background: #fee2e2;
    color: #991b1b;
}

.status-submitted {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-approved {
    background: #dcfce7;
    color: #166534;
}

.status-rejected {
    background: #fee2e2;
    color: #991b1b;
}

.version {
    line-height: 1.35;
}

.version small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
}

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

.project-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 22px rgba(15,23,42,.04);
}

.project-card h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

.project-card .mini-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #e5e7eb;
    padding: 9px 0;
    font-size: 13px;
}

.project-card .mini-row:last-child {
    border-bottom: 0;
}

.project-card .mini-row strong {
    text-align: right;
}

.project-wide {
    grid-column: 1 / -1;
}

.progress-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-bar span {
    display: block;
    height: 100%;
    background: #1d4ed8;
    border-radius: 999px;
}

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

.command-grid {
    display: grid;
    grid-template-columns: 1.15fr .85fr;
    gap: 18px;
}

.command-panel {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 10px 22px rgba(15,23,42,.04);
}

.command-panel h3 {
    margin: 0 0 12px;
    font-size: 16px;
}

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

.command-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 14px;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    background: #f8fafc;
}

.command-item strong {
    display: block;
}

.command-item span {
    color: var(--muted);
    font-size: 12px;
}

.command-critical {
    border-color: #fecaca;
    background: #fff1f2;
}

.command-warning {
    border-color: #fde68a;
    background: #fffbeb;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.health-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.health-tile {
    background: #0f172a;
    color: white;
    border-radius: 14px;
    padding: 14px;
}

.health-tile strong {
    display: block;
    font-size: 22px;
}

.health-tile span {
    color: #cbd5e1;
    font-size: 12px;
}

@media (max-width: 1100px) {
    .command-grid,
    .health-strip {
        grid-template-columns: 1fr;
    }
}

.notification-unread {
    border-left: 5px solid #1d4ed8;
}

.notification-read {
    opacity: .74;
}

.outbox-queued {
    background: #fef3c7;
    color: #92400e;
}

.outbox-sent {
    background: #dcfce7;
    color: #166534;
}

.outbox-failed {
    background: #fee2e2;
    color: #991b1b;
}

.agent-global-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    background: #0f172a;
    border-radius: 16px;
    padding: 12px;
    margin-bottom: 18px;
    box-shadow: 0 12px 30px rgba(15,23,42,.12);
}

.agent-global-form input {
    width: 100%;
    border: 1px solid #334155;
    background: #1e293b;
    color: #fff;
    border-radius: 10px;
    padding: 12px 14px;
    outline: none;
}

.agent-global-form input::placeholder {
    color: #94a3b8;
}

.agent-global-form button {
    border: 0;
    border-radius: 10px;
    padding: 12px 16px;
    background: #2563eb;
    color: white;
    font-weight: 800;
    cursor: pointer;
}

.agent-grid {
    display: grid;
    grid-template-columns: .9fr 1.1fr;
    gap: 18px;
}

.agent-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.agent-card h3 {
    margin: 0 0 12px;
}

.agent-request-queued {
    border-left: 5px solid #f59e0b;
}

.agent-request-draft_ready {
    border-left: 5px solid #2563eb;
}

.agent-request-approved {
    border-left: 5px solid #16a34a;
}

.agent-request-rejected {
    border-left: 5px solid #dc2626;
}

.agent-payload {
    background: #0f172a;
    color: #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    white-space: pre-wrap;
    font-family: Consolas, monospace;
    font-size: 12px;
    max-height: 260px;
    overflow: auto;
}

@media (max-width: 1100px) {
    .agent-grid,
    .agent-global-form {
        grid-template-columns: 1fr;
    }
}

.people-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.people-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.people-card h3 {
    margin: 0 0 12px;
}

.hr-ok {
    background: #dcfce7;
    color: #166534;
}

.hr-review {
    background: #fef3c7;
    color: #92400e;
}

.hr-blocked {
    background: #fee2e2;
    color: #991b1b;
}

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

.status-ready {
    background: #dcfce7;
    color: #166534;
}

.hr-gate-ok {
    background: #dcfce7;
    color: #166534;
}

.hr-gate-risk {
    background: #fee2e2;
    color: #991b1b;
}

.hr-gate-review {
    background: #fef3c7;
    color: #92400e;
}

.gate-box {
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 14px;
    background: #f8fafc;
    margin-bottom: 12px;
}

.attendance-work {
    background: #dcfce7;
    color: #166534;
}

.attendance-absence {
    background: #fee2e2;
    color: #991b1b;
}

.attendance-leave {
    background: #dbeafe;
    color: #1d4ed8;
}

.attendance-standby {
    background: #fef3c7;
    color: #92400e;
}

.payroll-ready {
    background: #dcfce7;
    color: #166534;
}

.payroll-review {
    background: #fef3c7;
    color: #92400e;
}

.payroll-blocked {
    background: #fee2e2;
    color: #991b1b;
}

.asset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.asset-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.asset-card h3 {
    margin: 0 0 12px;
}

.asset-class-tool {
    background: #dbeafe;
    color: #1d4ed8;
}

.asset-class-machine {
    background: #fef3c7;
    color: #92400e;
}

.asset-class-vehicle {
    background: #dcfce7;
    color: #166534;
}

.asset-class-property {
    background: #ede9fe;
    color: #6d28d9;
}

.asset-status-available {
    background: #dcfce7;
    color: #166534;
}

.asset-status-assigned {
    background: #dbeafe;
    color: #1d4ed8;
}

.asset-status-service {
    background: #fef3c7;
    color: #92400e;
}

.asset-status-blocked {
    background: #fee2e2;
    color: #991b1b;
}

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

.asset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.asset-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.asset-card h3 {
    margin: 0 0 12px;
}

.asset-class-tool {
    background: #dbeafe;
    color: #1d4ed8;
}

.asset-class-machine {
    background: #fef3c7;
    color: #92400e;
}

.asset-class-vehicle {
    background: #dcfce7;
    color: #166534;
}

.asset-class-property {
    background: #ede9fe;
    color: #6d28d9;
}

.asset-status-available {
    background: #dcfce7;
    color: #166534;
}

.asset-status-assigned {
    background: #dbeafe;
    color: #1d4ed8;
}

.asset-status-service {
    background: #fef3c7;
    color: #92400e;
}

.asset-status-blocked {
    background: #fee2e2;
    color: #991b1b;
}

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

.compliance-critical {
    background: #fee2e2;
    color: #991b1b;
}

.compliance-warning {
    background: #fef3c7;
    color: #92400e;
}

.compliance-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.compliance-ok {
    background: #dcfce7;
    color: #166534;
}

.compliance-critical {
    background: #fee2e2;
    color: #991b1b;
}

.compliance-warning {
    background: #fef3c7;
    color: #92400e;
}

.compliance-info {
    background: #dbeafe;
    color: #1d4ed8;
}

.compliance-ok {
    background: #dcfce7;
    color: #166534;
}

.service-action-planned {
    background: #dbeafe;
    color: #1d4ed8;
}

.service-action-progress {
    background: #fef3c7;
    color: #92400e;
}

.service-action-completed {
    background: #dcfce7;
    color: #166534;
}

.service-action-cancelled {
    background: #fee2e2;
    color: #991b1b;
}

.rental-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.rental-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.rental-card h3 {
    margin: 0 0 12px;
}

.rental-active {
    background: #dcfce7;
    color: #166534;
}

.rental-draft {
    background: #fef3c7;
    color: #92400e;
}

.rental-returned {
    background: #dbeafe;
    color: #1d4ed8;
}

.rental-overdue,
.rental-blocked {
    background: #fee2e2;
    color: #991b1b;
}

.rental-idle {
    background: #ffedd5;
    color: #9a3412;
}

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

.fleet-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.fleet-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.fleet-card h3 {
    margin: 0 0 12px;
}

.fuel-ok {
    background: #dcfce7;
    color: #166534;
}

.fuel-review {
    background: #fef3c7;
    color: #92400e;
}

.fuel-warning {
    background: #ffedd5;
    color: #9a3412;
}

.fuel-critical {
    background: #fee2e2;
    color: #991b1b;
}

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

.evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.evidence-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.evidence-card h3 {
    margin: 0 0 12px;
}

.evidence-pending_review {
    background: #fef3c7;
    color: #92400e;
}

.evidence-approved {
    background: #dcfce7;
    color: #166534;
}

.evidence-rejected,
.evidence-missing {
    background: #fee2e2;
    color: #991b1b;
}

.evidence-draft {
    background: #dbeafe;
    color: #1d4ed8;
}

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

.evidence-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.evidence-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 18px;
}

.evidence-card h3 {
    margin: 0 0 12px;
}

.evidence-pending_review {
    background: #fef3c7;
    color: #92400e;
}

.evidence-approved {
    background: #dcfce7;
    color: #166534;
}

.evidence-rejected,
.evidence-missing {
    background: #fee2e2;
    color: #991b1b;
}

.evidence-draft {
    background: #dbeafe;
    color: #1d4ed8;
}

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

/* v0.34 responsive hardening */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

img,
svg,
video,
canvas {
    max-width: 100%;
    height: auto;
}

.app-shell,
.erp-shell,
.page-shell,
.layout,
.main-layout,
.workspace,
.content,
.main,
main {
    min-width: 0 !important;
    max-width: 100% !important;
}

.sidebar {
    width: clamp(220px, 15vw, 280px) !important;
    min-width: 220px;
    max-width: 280px;
}

.main,
.content,
.page-content,
.workspace {
    overflow-x: hidden;
}

.module-header,
.table-card,
.form-card,
.people-card,
.asset-card,
.rental-card,
.fleet-card,
.evidence-card,
.command-panel,
.agent-card {
    max-width: 100%;
    min-width: 0;
}

.table-card,
.people-card,
.asset-card,
.rental-card,
.fleet-card,
.evidence-card,
.command-panel,
.agent-card {
    overflow-x: auto;
}

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

.table-card table,
.people-card table,
.asset-card table,
.rental-card table,
.fleet-card table,
.evidence-card table {
    min-width: 760px;
}

.kpi-row,
.health-strip,
.command-grid,
.people-grid,
.asset-grid,
.rental-grid,
.fleet-grid,
.evidence-grid,
.agent-grid,
.form-grid,
.detail-grid,
.project-grid {
    min-width: 0;
}

.kpi-row {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

.health-strip {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
}

.form-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
}

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

.action-row,
.button-stack,
.quick-actions {
    flex-wrap: wrap;
}

.action-btn,
.secondary-btn,
.small-btn {
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .app-shell,
    .erp-shell,
    .page-shell,
    .layout,
    .main-layout {
        grid-template-columns: 1fr !important;
    }

    .sidebar {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        position: relative !important;
    }

    .sidebar nav,
    .sidebar-menu {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .sidebar a {
        flex: 0 0 auto;
    }

    main,
    .main,
    .content,
    .page-content {
        padding: 14px !important;
    }

    .command-grid,
    .people-grid,
    .asset-grid,
    .rental-grid,
    .fleet-grid,
    .evidence-grid,
    .agent-grid,
    .detail-grid,
    .project-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 760px) {
    .module-header h2 {
        font-size: 22px;
        line-height: 1.2;
    }

    .module-header p {
        font-size: 13px;
    }

    .action-row {
        display: grid !important;
        grid-template-columns: 1fr;
    }

    .action-btn,
    .secondary-btn,
    .small-btn,
    button {
        width: 100%;
        text-align: center;
    }

    .table-card,
    .people-card,
    .asset-card,
    .rental-card,
    .fleet-card,
    .evidence-card {
        padding: 12px !important;
    }
}
