/* =========================================================
   IMS Frontend CSS — cleaned version
   Colors:
   Navy:   #071b33
   Orange: #f97316
   Bg:     #f4f7fb
   ========================================================= */

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f7fb;
    color: #1f2937;
    line-height: 1.6;
}

img {
    max-width: 100%;
}

a {
    color: inherit;
}

/* Header / navigation */
header {
    background: #071b33;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.navbar {
    max-width: 1500px;
    margin: auto;
    padding: 18px 35px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.logo span {
    color: #f97316;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 10px;
    border-radius: 6px;
    transition: 0.25s;
}

.nav-links a:hover {
    background: #123b68;
    color: white;
}

.admin-link {
    background: #f97316;
    color: white !important;
    font-weight: bold;
}

.admin-link:hover {
    background: #ea580c !important;
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #071b33;
    min-width: 330px;
    list-style: none;
    padding: 10px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    z-index: 2000;
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
}

.dropdown:hover .dropdown-menu {
    display: block;
}

/* Hero */
.hero,
.page-hero {
    background:
        linear-gradient(rgba(7, 27, 51, 0.88), rgba(7, 27, 51, 0.88)),
        url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?q=80&w=1600&auto=format&fit=crop");
    background-size: cover;
    background-position: center;
    color: white;
}

.hero {
    text-align: center;
    padding: 125px 30px;
}

.page-hero {
    padding: 90px 35px;
}

.page-hero-inner {
    max-width: 1400px;
    margin: auto;
}

.hero-badge {
    display: inline-block;
    background: rgba(249, 115, 22, 0.18);
    color: #fed7aa;
    border: 1px solid rgba(249, 115, 22, 0.55);
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 22px;
}

.hero h1 {
    font-size: 54px;
    line-height: 1.12;
    margin-bottom: 22px;
}

.page-hero h1 {
    font-size: 48px;
    margin-bottom: 16px;
}

.hero p,
.page-hero p {
    max-width: 900px;
    font-size: 19px;
    opacity: 0.95;
}

.hero p {
    margin: 0 auto 35px;
    font-size: 20px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.breadcrumb {
    color: #fed7aa;
    font-size: 14px;
    margin-bottom: 18px;
}

.breadcrumb a {
    color: #fed7aa;
    text-decoration: none;
    font-weight: bold;
}

/* Layout */
.section {
    max-width: 1450px;
    margin: auto;
    padding: 70px 35px;
}

.section-title {
    text-align: center;
    margin-bottom: 45px;
}

.section-title h2 {
    font-size: 38px;
    color: #e97b2d;
    margin-bottom: 10px;
}

.section-title p {
    color: #64748b;
    font-size: 18px;
}

.layout {
    display: grid;
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.layout main {
    min-width: 0;
}

.grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 28px;
}

.side-card,
.content-card,
.card,
.summary-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    border-top: 5px solid #f97316;
}

.side-card,
.content-card {
    min-width: 0;
}

.side-card {
    padding: 26px;
}

.content-card {
    padding: 34px;
    margin-bottom: 30px;
}

.side-card h3,
.content-card h2 {
    color: #071b33;
}

.content-card h2 {
    font-size: 30px;
    margin-bottom: 22px;
}

.card {
    padding: 32px;
    transition: 0.25s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.13);
}

.card-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #071b33;
    color: white;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 999px;
    font-weight: bold;
    margin-bottom: 18px;
}

.card h3 {
    color: #071b33;
    font-size: 23px;
    margin-bottom: 14px;
}

.card p {
    color: #475569;
    margin-bottom: 20px;
}

.card a {
    color: #f97316;
    text-decoration: none;
    font-weight: bold;
}

.card a:hover {
    text-decoration: underline;
}

.info-section {
    background: white;
    padding: 80px 35px;
}

.info-container {
    max-width: 1200px;
    margin: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 45px;
    align-items: center;
}

.info-container h2 {
    font-size: 38px;
    color: #071b33;
    margin-bottom: 20px;
}

.info-container p {
    color: #475569;
    margin-bottom: 18px;
}

.checklist {
    background: #f4f7fb;
    padding: 28px;
    border-radius: 16px;
    border-left: 5px solid #f97316;
}

.checklist div {
    padding: 12px 0;
    border-bottom: 1px solid #dbe3ef;
    font-weight: bold;
    color: #071b33;
}

.checklist div:last-child {
    border-bottom: none;
}

/* Text and metadata */
.meta {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 14px;
}

.empty {
    background: white;
    border-radius: 16px;
    padding: 28px;
    color: #64748b;
    border-left: 5px solid #f97316;
}

.info-item {
    margin-bottom: 15px;
}

.info-label {
    display: block;
    font-size: 13px;
    color: #64748b;
    font-weight: bold;
    margin-bottom: 3px;
}

.info-value {
    color: #1f2937;
}

.text-block {
    margin-bottom: 18px;
}

.text-block strong {
    display: block;
    color: #071b33;
    margin-bottom: 5px;
}

/* Badges */
.badge {
    display: inline-block;
    background: #071b33;
    color: white;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 6px;
    margin-bottom: 6px;
}

.badge-orange {
    background: #f97316;
}

/* Buttons */
.btn,
.button,
button.button,
a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    text-decoration: none !important;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button,
button.button,
a.button {
    background: #071b33;
    color: #ffffff !important;
    border: 1px solid #071b33;
}

.button:hover,
button.button:hover,
a.button:hover {
    background: #0b2748;
    box-shadow: 0 8px 18px rgba(7, 27, 51, 0.18);
    transform: translateY(-1px);
}

.button-secondary,
a.button-secondary,
button.button-secondary {
    background: #ffffff;
    color: #071b33 !important;
    border: 1px solid #cbd5e1;
}

.button-secondary:hover,
a.button-secondary:hover,
button.button-secondary:hover {
    background: #f8fafc;
    color: #071b33 !important;
}

.btn {
    padding: 14px 28px;
    border-radius: 9px;
}

.btn-primary {
    background: #f97316;
    color: white;
}

.btn-primary:hover {
    background: #ea580c;
}

.btn-secondary {
    background: white;
    color: #071b33;
}

.btn-secondary:hover {
    background: #e5eaf3;
}

/* Scoped links inside content */
.section a:not(.button):not(.btn),
.content-card a:not(.button):not(.btn),
.page-hero a:not(.button):not(.btn) {
    color: #f97316;
    font-weight: 700;
}

.section a:not(.button):not(.btn):hover,
.content-card a:not(.button):not(.btn):hover,
.page-hero a:not(.button):not(.btn):hover {
    text-decoration: underline;
}

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

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

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

.form-group label {
    font-weight: bold;
    color: #071b33;
    margin-bottom: 7px;
}

.form-group input,
.form-group select,
.form-group textarea,
.risk-table input,
.risk-table select,
.risk-table textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: Arial, Helvetica, sans-serif;
    color: #071b33;
    background: #ffffff;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.risk-table input:focus,
.risk-table select:focus,
.risk-table textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

.form-group textarea,
.risk-table textarea {
    resize: vertical;
}

.checkbox-list {
    gap: 12px;
}

.checkbox-list label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: normal;
}

.checkbox-list input {
    width: auto;
}

/* Summary */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 22px;
    margin-bottom: 34px;
}

.summary-card {
    padding: 26px;
}

.summary-card span {
    display: block;
    color: #64748b;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
}

.summary-card strong {
    color: #071b33;
    font-size: 34px;
}

/* Document content */
.document-content {
    color: #1f2937;
    font-size: 17px;
}

.document-content p {
    margin-bottom: 16px;
}

.document-content ul,
.document-content ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

.document-content h1,
.document-content h2,
.document-content h3 {
    color: #071b33;
    margin: 24px 0 12px;
}

.file-link {
    display: inline-block;
    margin-top: 20px;
    background: #071b33;
    color: white;
    text-decoration: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: bold;
}

.file-link:hover {
    background: #123b68;
}

/* Document explorer */
.document-explorer {
    margin-top: 24px;
    max-height: 720px;
    overflow-y: auto;
}

.explorer-area {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.explorer-area:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.explorer-area-title {
    color: #071b33;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 10px;
}

.explorer-folder {
    margin-bottom: 10px;
    padding-left: 8px;
}

.explorer-folder-title {
    color: #475569;
    font-weight: bold;
    font-size: 13px;
    margin-bottom: 6px;
}

.explorer-files {
    display: grid;
    gap: 5px;
    padding-left: 10px;
}

.explorer-file {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: #334155;
    text-decoration: none;
    font-size: 13px;
    padding: 7px 8px;
    border-radius: 8px;
    border-left: 3px solid transparent;
}

.explorer-file:hover {
    background: #f8fafc;
    color: #071b33;
}

.explorer-file.active {
    background: #fff7ed;
    border-left-color: #f97316;
    color: #071b33;
}

.explorer-file strong {
    color: #071b33;
    font-size: 12px;
}

.explorer-file-icon {
    line-height: 1.3;
}

/* Tables */
.risk-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.risk-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.risk-table th {
    text-align: left;
    background: #071b33;
    color: white;
    padding: 12px;
    font-size: 14px;
    white-space: normal;
}

.risk-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    font-size: 14px;
    white-space: normal;
}

.risk-table tr:nth-child(even) {
    background: #f8fafc;
}

.risk-score {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 999px;
    background: #f97316;
    color: white;
    font-weight: bold;
    min-width: 38px;
    text-align: center;
}

.calculated-risk {
    min-height: 46px;
    border-radius: 10px;
    background: #e5e7eb;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    padding: 12px;
    font-size: 18px;
}

/* Risk form */
.risk-form-row {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #f97316;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 22px;
}

.risk-form-row h3 {
    color: #071b33;
    margin-bottom: 20px;
}

/* Editable tables / incident actions */
.risk-table td form {
    margin: 0;
    min-width: 230px;
}

.risk-table td form select {
    max-width: 180px;
    margin-bottom: 8px;
}

.risk-table td form textarea {
    max-width: 260px;
    min-height: 52px;
    font-size: 13px;
}

.risk-table td form button {
    margin-top: 2px;
}

.risk-table button.button-secondary {
    width: auto;
    min-width: 95px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
}

/* Risk assessment create table polish */
.risk-table input[type="text"] {
    width: 100%;
    min-height: 38px;
}

.risk-table textarea {
    width: 100%;
    min-height: 68px;
}

/* Required documents */
.required-documents-box {
    margin-top: 10px;
}

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

.document-list-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-left: 5px solid #f97316;
    border-radius: 12px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: center;
}

.document-list-item strong {
    display: block;
    color: #071b33;
    margin-bottom: 4px;
}

.document-list-item span {
    color: #64748b;
    font-size: 14px;
}

.document-list-item a {
    color: #f97316;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.document-list-item a:hover {
    text-decoration: underline;
}

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

.signature-box {
    border: 1px solid #d1d5db;
    border-left: 5px solid #f97316;
    border-radius: 12px;
    padding: 22px;
    background: #f8fafc;
    min-height: 190px;
}

.signature-box strong {
    display: block;
    color: #071b33;
    margin-bottom: 18px;
    font-size: 18px;
}

.signature-box p {
    margin-bottom: 18px;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 8px;
}

/* Current work map */
.site-map {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: 0;
    height: auto;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    background:
        linear-gradient(90deg, rgba(7, 27, 51, 0.06) 1px, transparent 1px),
        linear-gradient(rgba(7, 27, 51, 0.06) 1px, transparent 1px),
        #eef3f8;
    background-size: 40px 40px;
    border: 2px solid #d1dbe8;
    border-radius: 18px;
    overflow: hidden;
}

.site-map::before {
    content: "Internal site map - schematic overview";
    position: absolute;
    left: 20px;
    bottom: 16px;
    color: #64748b;
    font-size: 13px;
    z-index: 1;
}

.site-map-label {
    position: absolute;
    background: #071b33;
    color: white;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
}

.site-map-label-north {
    top: 16px;
    right: 16px;
}

.site-zone {
    position: absolute;
    border: 2px dashed rgba(7, 27, 51, 0.25);
    background: rgba(255, 255, 255, 0.55);
    border-radius: 18px;
    padding: 12px;
    color: #071b33;
    font-weight: bold;
    font-size: 14px;
}

.zone-storage {
    left: 8%;
    top: 16%;
    width: 34%;
    height: 32%;
}

.zone-process {
    left: 36%;
    top: 24%;
    width: 32%;
    height: 32%;
}

.zone-workshop {
    left: 58%;
    top: 48%;
    width: 27%;
    height: 28%;
}

.zone-loading {
    left: 20%;
    top: 62%;
    width: 32%;
    height: 24%;
}

.zone-office {
    left: 70%;
    top: 10%;
    width: 22%;
    height: 24%;
}

.work-radius {
    position: absolute;
    transform: translate(-50%, -50%);
    aspect-ratio: 1 / 1;
    height: auto !important;
    border: 2px dashed rgba(249, 115, 22, 0.75);
    background: rgba(249, 115, 22, 0.12);
    border-radius: 999px;
    pointer-events: none;
    z-index: 6;
}

.work-radius-exclusion {
    border: 2px solid rgba(220, 38, 38, 0.75);
    background: rgba(220, 38, 38, 0.13);
}

.work-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #64748b;
    color: white;
    border: 3px solid white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
}

.work-marker span {
    position: relative;
    z-index: 2;
}

.marker-low {
    background: #22c55e;
}

.marker-medium {
    background: #eab308;
}

.marker-high {
    background: #f97316;
}

.marker-critical {
    background: #dc2626;
}

.marker-closed {
    outline: 4px solid rgba(220, 38, 38, 0.35);
    animation: markerPulse 1.8s infinite;
}

@keyframes markerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45);
    }

    70% {
        box-shadow: 0 0 0 14px rgba(220, 38, 38, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
    }
}

.work-marker-popup {
    display: none;
    position: absolute;
    left: 42px;
    top: -12px;
    width: 280px;
    background: white;
    color: #1f2937;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    border-left: 5px solid #f97316;
    z-index: 30;
}

.work-marker:hover .work-marker-popup {
    display: block;
}

.work-marker-popup strong {
    display: block;
    color: #071b33;
    margin-bottom: 5px;
}

.work-marker-popup em {
    display: block;
    font-style: normal;
    color: #334155;
    margin-bottom: 8px;
}

.work-marker-popup small {
    display: block;
    color: #64748b;
    margin-top: 4px;
}

.work-marker-popup a {
    display: inline-block;
    margin-top: 10px;
    color: #f97316;
    font-weight: bold;
    text-decoration: none;
}

.work-marker-popup a:hover {
    text-decoration: underline;
}

.closed-text {
    color: #dc2626 !important;
    font-weight: bold;
}

.map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 18px;
    color: #334155;
    font-size: 14px;
}

.map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
}

.legend-ring {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 4px solid rgba(220, 38, 38, 0.45);
}

/* Risk matrix */
.matrix-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 34px;
    align-items: start;
}

.risk-matrix {
    display: grid;
    grid-template-columns: 130px repeat(5, 1fr);
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    overflow: hidden;
    background: white;
    margin-top: 12px;
}

.matrix-corner,
.matrix-header,
.matrix-cell {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 255, 255, 0.55);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    font-weight: bold;
    position: relative;
    text-align: center;
}

.matrix-corner,
.matrix-header {
    background: #071b33;
    color: white;
    font-size: 13px;
    padding: 8px;
}

.matrix-cell {
    color: #071b33;
    font-size: 15px;
}

.matrix-low {
    background: #bbf7d0;
}

.matrix-medium {
    background: #fde68a;
}

.matrix-high {
    background: #fdba74;
}

.matrix-critical {
    background: #f87171;
    color: white;
}

.matrix-marker {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #071b33;
    color: white;
    border: 3px solid white;
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
}

.matrix-summary {
    margin-top: 14px;
    color: #334155;
}

.matrix-summary strong {
    color: #071b33;
}

/* Risk colors used by older score tables */
.risk-low {
    background: #86efac !important;
    color: #064e3b !important;
}

.risk-medium {
    background: #fde047 !important;
    color: #713f12 !important;
}

.risk-high {
    background: #fb923c !important;
    color: #7c2d12 !important;
}

.risk-critical {
    background: #ef4444 !important;
    color: white !important;
}

.risk-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.legend-item {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    font-weight: bold;
    font-size: 13px;
}

/* Footer */
footer {
    background: #071b33;
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 50px;
}

footer span {
    color: #f97316;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .side-card {
        order: -1;
    }

    .content-card > div[style*="display:flex"] {
        flex-direction: column;
        align-items: stretch !important;
    }
}

@media (max-width: 950px) {
    .navbar {
        flex-direction: column;
        gap: 18px;
    }

    .hero h1 {
        font-size: 38px;
    }

    .page-hero h1 {
        font-size: 36px;
    }

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

    .dropdown-menu {
        position: static;
        min-width: 100%;
        box-shadow: none;
        border-radius: 8px;
        margin-top: 8px;
    }

    .risk-matrix {
        grid-template-columns: 95px repeat(5, 1fr);
    }

    .matrix-corner,
    .matrix-header,
    .matrix-cell {
        min-height: 44px;
        font-size: 12px;
    }
}

@media (max-width: 900px) {
    .risk-table td form select,
    .risk-table td form textarea {
        max-width: 100%;
    }
}

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

    .button,
    button.button,
    a.button,
    .btn {
        width: 100%;
    }

    .risk-table td form {
        min-width: 220px;
    }

    .site-zone {
        font-size: 11px;
        padding: 8px;
    }

    .work-marker-popup {
        left: -120px;
        top: 42px;
        width: 250px;
    }
}

@media (max-width: 700px) {
    .document-list-item {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 85px 20px;
    }

    .hero h1 {
        font-size: 31px;
    }

    .hero p {
        font-size: 17px;
    }

    .section,
    .page-hero,
    .info-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .content-card,
    .side-card {
        padding: 18px;
    }

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

    .site-map::before {
        display: none;
    }
}
/* =========================================================
   95B Responsive frontend patch
   Mobile layout without grid menu
   ========================================================= */

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.section,
.page-hero,
.info-section {
    width: 100%;
}

.content-card,
.side-card,
.card,
.summary-card,
.risk-form-row {
    max-width: 100%;
}

.layout,
.info-container,
.form-grid,
.summary-grid,
.grid,
.card-grid,
.matrix-layout,
.signature-grid {
    min-width: 0;
}

.layout > *,
.info-container > *,
.form-grid > *,
.summary-grid > *,
.grid > *,
.card-grid > *,
.matrix-layout > *,
.signature-grid > * {
    min-width: 0;
}

/* Tables should scroll inside their wrapper */
.risk-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.risk-table {
    width: 100%;
    min-width: 900px;
}

/* Forms inside tables should not force the whole page too wide */
.risk-table td form {
    min-width: 0;
}

.risk-table input,
.risk-table select,
.risk-table textarea {
    max-width: 100%;
}

/* Better responsive navbar */
@media (max-width: 1100px) {
    .navbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 16px 20px;
    }

    .logo {
        font-size: 22px;
        white-space: normal;
    }

    .nav-links {
        width: 100%;
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: visible;
        padding-bottom: 6px;
        scrollbar-width: thin;
    }

    .nav-links li {
        flex: 0 0 auto;
    }

    .nav-links a {
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
        font-size: 13px;
        padding: 8px 10px;
    }

    .dropdown-menu {
        position: absolute;
        min-width: 280px;
    }
}

@media (max-width: 650px) {
    .navbar {
        padding: 14px 14px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-links a {
        font-size: 12px;
        padding: 7px 9px;
    }
}

/* Layout responsive */
@media (max-width: 1100px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .side-card {
        order: -1;
    }

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

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

@media (max-width: 760px) {
    .section {
        padding: 42px 16px;
    }

    .page-hero {
        padding: 56px 16px;
    }

    .info-section {
        padding: 56px 16px;
    }

    .hero {
        padding: 80px 16px;
    }

    .hero h1 {
        font-size: 32px;
    }

    .page-hero h1 {
        font-size: 32px;
    }

    .hero p,
    .page-hero p {
        font-size: 16px;
    }

    .content-card,
    .side-card,
    .card,
    .summary-card {
        padding: 20px;
        border-radius: 14px;
    }

    .content-card h2 {
        font-size: 24px;
    }

    .section-title h2 {
        font-size: 28px;
    	color: #f97316;
    }

    .grid,
    .card-grid,
    .summary-grid,
    .form-grid,
    .signature-grid {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn,
    .button,
    a.button,
    button.button {
        width: 100%;
    }
}

/* Risk matrix responsive */
@media (max-width: 760px) {
    .risk-matrix-wrapper {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .risk-matrix {
        grid-template-columns: 82px repeat(5, minmax(42px, 1fr));
        min-width: 520px;
    }

    .matrix-corner,
    .matrix-header,
    .matrix-cell {
        min-height: 42px;
        font-size: 11px;
        padding: 5px;
    }

    .matrix-marker {
        width: 24px;
        height: 24px;
        font-size: 11px;
    }
}

/* Current Work map responsive */
@media (max-width: 760px) {
    .site-map {
        max-width: 100%;
        min-width: 0;
        border-radius: 14px;
    }

    .site-zone {
        font-size: 10px;
        padding: 6px;
        border-radius: 12px;
    }

    .site-map::before {
        display: none;
    }

    .work-marker {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .work-marker-popup {
        left: -105px;
        top: 38px;
        width: 240px;
    }
}

/* Very small screens */
@media (max-width: 430px) {
    .section,
    .page-hero,
    .info-section {
        padding-left: 12px;
        padding-right: 12px;
    }

    .content-card,
    .side-card,
    .card,
    .summary-card {
        padding: 16px;
    }

    .risk-table {
        min-width: 780px;
    }

    .risk-matrix {
        min-width: 500px;
    }
}

/* =========================================================
   95C Mobile hamburger menu
   ========================================================= */

.nav-toggle {
    display: none;
    background: #f97316;
    color: white;
    border: 1px solid #f97316;
    border-radius: 10px;
    padding: 9px 13px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.nav-toggle:hover {
    background: #ea580c;
}

@media (max-width: 900px) {
    .navbar {
        position: relative;
        flex-direction: row;
        align-items: center;
        gap: 14px;
        padding: 16px 20px;
    }

    .nav-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 16px;
        right: 16px;
        background: #071b33;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 0 0 16px 16px;
        box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
        padding: 12px;
        z-index: 3000;
    }

    .nav-links.nav-links-open {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links a {
        display: block;
        width: 100%;
        padding: 11px 12px;
        text-align: left;
        border-radius: 10px;
        font-size: 14px;
    }

    .nav-links a:hover {
        background: #123b68;
    }

    .dropdown {
        width: 100%;
    }

    .dropdown-menu {
        position: static;
        display: block;
        min-width: 0;
        width: 100%;
        margin-top: 6px;
        padding: 6px;
        box-shadow: none;
        border-radius: 10px;
        background: #0b2748;
    }

    .dropdown-menu a {
        font-size: 13px;
        padding-left: 18px;
    }
}

@media (max-width: 520px) {
    .navbar {
        padding: 14px 14px;
    }

    .logo {
        font-size: 20px;
    }

    .nav-toggle {
        padding: 8px 11px;
        font-size: 20px;
    }

    .nav-links {
        left: 10px;
        right: 10px;
    }
}