/* Safety module layer. Loaded after style.css and green.css.
   Replaces missing Mobile Tech background images with the same colors,
   and enlarges tap targets for field techs. */

* { box-sizing: border-box; }

html, body {
    height: 100%;
}

body.safety-app {
    overflow: hidden;
    text-align: left;
    background: #d5d5d2 !important;
    color: #404040;
    font-size: 15px;
    line-height: 1.45;
}

#wrapper {
    min-width: 320px;
    height: 100%;
}

aside {
    background: #1b1b1b !important;
    z-index: 4;
    width: 260px;
}

aside section,
aside h2,
aside li,
aside label,
aside form div {
    background: #242424 !important;
}

aside h2 {
    color: #d7f5c4 !important;
    font-size: 12px !important;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 12px 16px !important;
}

aside li a,
aside li a:visited {
    padding: 14px 16px !important;
    font-size: 15px !important;
    color: #fff !important;
}

aside li.active a {
    color: #b6f58a !important;
}

aside li span,
aside li a:hover span {
    background: #52be1d !important;
    color: #fff !important;
    border-radius: 2px;
    min-width: 18px;
    text-align: center;
}

#content {
    z-index: 5;
    background: #e4e4e2 !important;
    left: 0;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#content.open {
    left: 260px !important;
}

#slideshow,
#main {
    background: #e4e4e2 !important;
}

#main {
    padding: 12px 10px 28px;
}

header {
    background: #2c2c2c !important;
    height: 48px;
}

.controls {
    background: transparent !important;
    box-shadow: none !important;
}

.controls a,
#nav-toggle {
    background: #3a3a3a !important;
    color: #fff !important;
    text-indent: 0 !important;
    width: auto !important;
    height: auto !important;
    min-height: 36px;
    line-height: 18px;
    padding: 8px 12px !important;
    font-weight: bold;
    font-size: 13px !important;
}

.header-title {
    float: right;
    color: #fff;
    margin: 14px 14px 0 0;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 13px;
}

#branding {
    height: auto !important;
    min-height: 64px;
    background: #ebebeb !important;
    overflow: hidden;
    padding: 0 0 8px;
}

#logo,
#logo:visited,
#logo:hover {
    float: none !important;
    display: block;
    margin: 12px 14px 0 !important;
    color: #3d8514 !important;
    font-weight: bold;
    font-size: 18px;
    line-height: 1.2;
    text-decoration: none;
}

#logo small {
    display: block;
    color: #666;
    font-size: 12px;
    font-weight: normal;
}

.who {
    margin: 4px 14px 0;
    color: #555;
    font-size: 13px;
}

.module {
    background: #fff;
    margin: 0 0 12px !important;
}

.module h3 {
    background: #ebebeb !important;
    color: #5d5d5d;
}

.module .pad {
    padding: 10px 12px 14px;
}

.module p {
    padding: 6px 0;
    font-size: 15px;
}

.demo-banner {
    background: #fff6d8;
    border: 1px solid #e3c56a;
    color: #5c4308;
    padding: 10px 12px;
    margin: 0 0 12px;
    font-size: 13px;
    line-height: 1.4;
}

.alert {
    padding: 10px 12px;
    margin: 0 0 12px;
    border-radius: 2px;
    font-size: 14px;
}

.alert.bad {
    background: #fde8e8;
    border: 1px solid #e3b1b1;
    color: #6d1212;
}

.alert.ok {
    background: #e7f6df;
    border: 1px solid #b7dba4;
    color: #24510f;
}

.alert.info,
.template-banner {
    background: #fff6d8;
    border: 1px solid #e3c56a;
    color: #5c4308;
    padding: 10px 12px;
    margin: 0 0 12px;
}

textarea,
input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="time"],
input[type="email"],
input[type="search"],
input[type="file"],
select,
textarea {
    width: 100% !important;
    max-width: 100%;
    font-size: 16px;
    min-height: 44px;
    padding: 10px;
    background: #fff;
}

textarea {
    min-height: 140px;
    line-height: 1.4;
}

input[type="checkbox"],
input[type="radio"] {
    width: 22px !important;
    height: 22px;
    min-height: 0;
    padding: 0;
    margin: 0 6px 0 0;
    vertical-align: middle;
}

input[type="submit"],
.button,
button.button,
a.button,
a.button:visited,
a.button:hover {
    min-height: 44px;
    font-size: 15px !important;
    padding: 12px 16px !important;
    background: #52be1d !important;
    border: 1px solid #3d8514 !important;
    color: #fff !important;
    display: inline-block;
    text-align: center;
    border-radius: 2px;
    text-shadow: 0 -1px 0 #3d8514;
    font-weight: bold;
    margin: 8px 8px 8px 0;
    width: auto !important;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
}

.button.secondary,
a.button.secondary {
    background: #5a5a5a !important;
    border-color: #333 !important;
    text-shadow: none;
}

.button.wide,
a.button.wide {
    display: block;
    width: 100% !important;
    margin-right: 0;
}

.actions {
    margin: 0 0 12px;
}

label {
    font-size: 13px;
    color: #666;
    padding-top: 8px;
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 2px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: #fff;
    line-height: 1.3;
}

.badge-met { background: #2f7d12; }
.badge-expiring_30 { background: #c45500; }
.badge-expiring_60 { background: #9a7209; }
.badge-expiring_90 { background: #6e6a12; }
.badge-expired,
.badge-missing,
.badge-not_qualified { background: #a32020; }
.badge-assigned { background: #1d4e89; }
.badge-muted, .badge-no_record { background: #777; }
.grade { display: inline-block; font-weight: bold; padding: 3px 8px; border-radius: 2px; color: #fff; font-size: 13px; }
.grade-ok { background: #2f7d12; }
.grade-warn { background: #c45500; }
.grade-bad { background: #a32020; }
.roster-alert {
    background: #6d1212;
    color: #fff;
    padding: 14px 14px 10px;
    margin: 0 0 12px;
}
.roster-alert h3 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 18px;
    line-height: 1.3;
    background: transparent !important;
}
.roster-alert p { margin: 0 0 8px; padding: 0; color: #fff; }
.roster-alert ol { margin: 0 0 8px 18px; padding: 0; }
.roster-alert li { margin: 0 0 4px; }
.roster-alert a, .roster-alert a:visited { color: #fff; font-weight: bold; }

.finding { border-left: 4px solid #a32020; background: #fff8f6; padding: 10px 12px; margin: 0 0 8px; }
.finding h4 { margin: 0 0 4px; font-size: 15px; color: #6d1212; }
.finding p { margin: 0; padding: 0; }
.badge-template { background: #8a5a00; }

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 4px;
}

a.stat,
a.stat:visited {
    flex: 1 1 46%;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-left: 4px solid #52be1d;
    padding: 10px 10px 8px;
    color: #333 !important;
    text-decoration: none;
    min-width: 140px;
}

a.stat b {
    display: block;
    font-size: 26px;
    line-height: 1.1;
    color: #24510f;
}

a.stat span {
    display: block;
    font-size: 12px;
    color: #555;
    font-weight: normal;
}

a.stat.bad { border-left-color: #a32020; }
a.stat.bad b { color: #a32020; }
a.stat.warn { border-left-color: #c45500; }
a.stat.warn b { color: #c45500; }

ul.rows {
    margin: 0;
    padding: 0;
    list-style: none;
}

.module ul.rows li,
ul.rows li {
    list-style: none !important;
    border-top: 1px solid #e0e0e0 !important;
    padding: 0 !important;
    font-weight: normal !important;
    font-size: 15px !important;
}

ul.rows li a.rowlink,
ul.rows li a.rowlink:visited {
    display: block;
    padding: 12px 4px;
    font-size: 16px;
    font-weight: bold;
    color: #243018 !important;
    text-decoration: none;
}

ul.rows li a.rowlink span.sub {
    display: block;
    font-weight: normal;
    color: #666;
    font-size: 13px;
    margin-top: 3px;
}

.prose h2 {
    color: #3d8514;
    font-size: 18px;
    padding: 12px 0 4px;
    font-weight: bold;
}

.prose h3 {
    background: transparent !important;
    border: 0 !important;
    color: #333 !important;
    font-size: 16px;
    padding: 10px 0 2px !important;
    text-shadow: none !important;
}

.prose p,
.prose li {
    font-size: 15px !important;
    font-weight: normal !important;
}

.module .prose ul,
.module .prose ol {
    margin: 6px 0 10px 18px;
    padding: 0;
}

.module .prose li {
    border: 0 !important;
    list-style: disc !important;
    padding: 3px 0 !important;
    margin-left: 4px;
}

.module .prose ol li {
    list-style: decimal !important;
}

.prose table,
.grid {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0 12px;
}

.prose th,
.prose td,
.grid th,
.grid td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    font-size: 13px;
    vertical-align: top;
}

.prose th,
.grid th {
    background: #f4f4f4;
    font-weight: bold;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.empty {
    color: #666;
    padding: 8px 0;
}

.meta {
    color: #666;
    font-size: 13px;
}

.check-item {
    border-top: 1px solid #e5e5e5;
    padding: 10px 0;
}

.check-q {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 8px;
}

.check-opts {
    display: flex;
    gap: 8px;
}

.check-opts label {
    flex: 1;
    text-align: center;
    border: 1px solid #ccc;
    background: #f7f7f7;
    padding: 8px 4px 10px;
    font-size: 14px;
    color: #333;
    min-height: 44px;
}

.check-opts label.on,
.check-opts label:has(input:checked) {
    background: #e5f6d8;
    border-color: #3d8514;
    color: #24510f;
}

.kv {
    margin: 0;
    padding: 0;
}

.kv div {
    padding: 6px 0;
    border-top: 1px solid #eee;
}

.kv b {
    display: block;
    color: #666;
    font-size: 12px;
    font-weight: normal;
}

.case-card {
    border: 1px solid #ddd;
    margin: 0 0 10px;
    background: #fff;
}

.case-card h4 {
    margin: 0;
    padding: 8px 10px;
    background: #f4f4f4;
    font-size: 14px;
}

.case-card .pad {
    padding: 8px 10px 10px;
}

.yn {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    font-weight: bold;
}

.yn.yes { color: #a32020; }
.yn.no { color: #888; }

.search-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.search-row input[type="search"],
.search-row input[type="text"] {
    flex: 1;
}

.chips a,
.chips a:visited {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 8px 10px;
    background: #f4f4f4;
    border: 1px solid #ccc;
    color: #333 !important;
    font-weight: bold;
    font-size: 13px;
    text-decoration: none;
}

.chips a.on {
    background: #52be1d;
    border-color: #3d8514;
    color: #fff !important;
}

.sig-line {
    border-bottom: 1px solid #333;
    height: 28px;
    margin-top: 12px;
}

.print-only { display: none; }

footer {
    background: #ebebeb;
}

.ack-bar {
    position: sticky;
    bottom: 0;
    background: #fff;
    border-top: 1px solid #ccc;
    padding: 8px 0 4px;
    margin-top: 12px;
}

.note {
    font-size: 13px;
    color: #555;
}

.quiz-option {
    display: block;
    margin: 0 0 10px;
    padding: 14px 12px;
    background: #fff;
    border: 1px solid #ccc;
    font-size: 17px;
}

.quiz-option input {
    margin-right: 8px;
}

.lesson-body p,
.lesson-image {
    margin: 0 0 12px;
}

.lesson-image {
    max-width: 100%;
    height: auto;
}

.video-frame {
    position: relative;
    margin: 0 0 12px;
    padding-top: 56.25%;
    background: #111;
}

.video-frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.cert {
    margin: 8px 0 16px;
    padding: 18px 16px;
    background: #fff;
    border: 3px solid #3d8514;
}

.cert h2 {
    margin: 4px 0 12px;
    color: #2f7d12;
}

.cert-kicker {
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 13px;
    color: #555;
}

.cert-name,
.cert-course {
    font-size: 22px;
    font-weight: bold;
}

.stack-form,
.due-form {
    margin-top: 10px;
}

.due-form input[type="date"] {
    max-width: 160px;
    display: inline-block;
}

.table-wrap {
    overflow-x: auto;
}

.rowblock {
    display: block;
    padding: 4px 0;
}

.filters select,
.filters input[type="submit"] {
    margin-bottom: 8px;
}

@media (min-width: 960px) {
    aside { position: fixed; }
    #content,
    #content.open {
        left: 260px !important;
        width: auto;
        right: 0;
    }
    #nav-toggle { display: none; }
    a.stat { flex: 1 1 18%; }
}

@media print {
    aside, header, .demo-banner, .no-print, .ack-bar, #nav-toggle, .actions, .chips {
        display: none !important;
    }
    body.safety-app, #wrapper, #content, #main {
        position: static !important;
        overflow: visible !important;
        height: auto !important;
        background: #fff !important;
        left: 0 !important;
        width: 100% !important;
    }
    .print-only { display: block; }
    .screen-only { display: none !important; }
    a.stat { break-inside: avoid; }
    .module { box-shadow: none; }
}
