* {
    box-sizing: border-box;
}

:root {
    --bg: #f5f7f9;
    --card: #ffffff;
    --text: #17202a;
    --muted: #6b7683;
    --border: #e2e7ec;
    --blue: #1570ef;
    --green: #14804a;
    --red: #c9362b;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

.login-card {
    width: 100%;
    max-width: 430px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 42px;
    box-shadow: 0 18px 50px rgba(25, 38, 52, .08);
}

.brand-mark {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: var(--blue);
    color: white;
    border-radius: 12px;
    font-weight: 800;
    font-size: 22px;
}

.brand-mark.small {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 18px;
}

.login-card h1 {
    margin: 24px 0 6px;
    font-size: 30px;
}

.tagline,
.login-footer {
    color: var(--muted);
}

.login-form {
    margin-top: 30px;
}

.login-form label {
    display: block;
    margin-bottom: 18px;
    font-size: 14px;
    font-weight: 600;
}

.login-form input {
    width: 100%;
    margin-top: 8px;
    padding: 13px 14px;
    border: 1px solid #cfd6dd;
    border-radius: 9px;
    font: inherit;
}

.login-form input:focus {
    outline: 2px solid rgba(21, 112, 239, .15);
    border-color: var(--blue);
}

button {
    width: 100%;
    border: 0;
    border-radius: 9px;
    padding: 14px;
    background: var(--blue);
    color: white;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
}

.login-footer {
    margin: 28px 0 0;
    text-align: center;
    font-size: 12px;
}

.alert.error {
    margin-top: 20px;
    padding: 12px;
    border-radius: 8px;
    background: #fff0ef;
    color: var(--red);
    font-size: 14px;
}

.topbar {
    min-height: 72px;
    background: white;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5%;
}

.brand,
.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand span,
.user-area span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

.user-area {
    text-align: right;
}

.user-area a {
    margin-left: 12px;
    color: var(--blue);
    text-decoration: none;
    font-size: 13px;
}

.container {
    width: min(1180px, 90%);
    margin: 42px auto;
}

.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 28px;
}

.page-heading h1 {
    margin: 4px 0 6px;
    font-size: 32px;
}

.page-heading > div > p:last-child {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    color: var(--blue);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
}

.system-status {
    background: white;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13px;
}

.system-status span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--green);
    border-radius: 50%;
    margin-right: 6px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card,
.panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 14px;
}

.stat-card {
    padding: 22px;
}

.stat-card p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.stat-card strong {
    display: block;
    margin: 8px 0 5px;
    font-size: 32px;
}

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

.panel {
    padding: 24px;
}

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

.panel-header h2 {
    margin: 4px 0 0;
}

.panel-header > span {
    color: var(--muted);
    font-size: 13px;
}

.equipment-row {
    display: grid;
    grid-template-columns: 90px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 17px 4px;
    border-bottom: 1px solid var(--border);
}

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

.equipment-code {
    font-weight: 800;
    color: var(--blue);
}

.equipment-info span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    margin-top: 4px;
}

.status-badge {
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

.status-badge.operational {
    color: var(--green);
    background: #eaf7f0;
}

.status-badge.attention,
.status-badge.maintenance {
    color: #946200;
    background: #fff6dc;
}

.status-badge.offline {
    color: var(--red);
    background: #fff0ef;
}

@media (max-width: 760px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-heading {
        display: block;
    }

    .system-status {
        display: inline-block;
        margin-top: 18px;
    }

    .user-area > div {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 28px 22px;
    }

    .container {
        width: 92%;
        margin-top: 25px;
    }

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

    .equipment-row {
        grid-template-columns: 65px 1fr;
    }

    .status-badge {
        grid-column: 2;
        justify-self: start;
    }
}

.language-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 22px 0;
}

.language-switcher a {
    min-width: 38px;
    padding: 7px 9px;
    border: 1px solid var(--border);
    border-radius: 7px;
    color: var(--muted);
    background: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
}

.language-switcher a:hover {
    border-color: #b9c5d0;
    color: var(--text);
}

.language-switcher a.active {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.dashboard-languages {
    margin: 0 20px 0 auto;
}

@media (max-width: 600px) {
    .topbar {
        padding: 10px 4%;
    }

    .dashboard-languages {
        margin-left: auto;
        margin-right: 8px;
    }

    .dashboard-languages a {
        min-width: 31px;
        padding: 6px;
    }
}

.handover-panel {
    max-width: 760px;
}

.handover-summary {
    padding: 24px 4px;
    line-height: 1.65;
}

.handover-meta {
    margin-top: 18px;
    color: var(--muted);
    font-size: 12px;
}

.empty-state {
    padding: 30px 4px;
}

.empty-state strong {
    font-size: 18px;
}

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

.accept-shift-form {
    margin-top: 6px;
    max-width: 280px;
}

.active-text {
    color: var(--green);
    font-size: 25px !important;
}

.scan-label {
    color: var(--blue);
}

.equipment-link {
    color: inherit;
    text-decoration: none;
}

.equipment-link:hover {
    background: #f8fafc;
}

.operator-stats {
    margin-bottom: 24px;
}

.back-link {
    display: inline-block;
    margin-bottom: 24px;
    color: var(--blue);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
}

.equipment-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    margin-bottom: 24px;
}

.equipment-hero h1 {
    margin: 5px 0 0;
    font-size: 38px;
}

.equipment-hero h2 {
    margin: 5px 0;
    font-size: 21px;
}

.equipment-hero p:last-child {
    color: var(--muted);
}

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

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

.detail-card span {
    display: block;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 12px;
}

.detail-card strong {
    font-size: 15px;
}

.equipment-action {
    display: flex;
    justify-content: flex-end;
    margin: 18px 0 24px;
}

.primary-action {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 9px;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.observation-item {
    padding: 20px 4px;
    border-bottom: 1px solid var(--border);
}

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

.observation-top {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.observation-item p {
    line-height: 1.55;
}

.observation-meta {
    color: var(--muted);
    font-size: 12px;
}

.severity-badge {
    padding: 5px 9px;
    border-radius: 15px;
    font-size: 11px;
    font-weight: 800;
}

.severity-info {
    background: #eaf2ff;
    color: var(--blue);
}

.severity-attention {
    background: #fff6dc;
    color: #946200;
}

.severity-high,
.severity-critical {
    background: #fff0ef;
    color: var(--red);
}

@media (max-width: 760px) {
    .equipment-detail-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .equipment-hero {
        display: block;
    }

    .equipment-hero .status-badge {
        display: inline-block;
        margin-top: 10px;
    }
}

.observation-container {
    max-width: 900px;
}

.observation-form-panel {
    max-width: 760px;
}

.observation-form {
    display: grid;
    gap: 22px;
}

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

.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid #cfd6dd;
    border-radius: 9px;
    background: #fff;
    padding: 13px 14px;
    color: var(--text);
    font: inherit;
}

.form-field textarea {
    resize: vertical;
    line-height: 1.5;
}

.form-field select:focus,
.form-field textarea:focus {
    outline: 2px solid rgba(21, 112, 239, .12);
    border-color: var(--blue);
}

.severity-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
}

.severity-option {
    position: relative;
    cursor: pointer;
}

.severity-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.severity-option span {
    display: block;
    padding: 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.severity-option input:checked + span {
    border-color: var(--blue);
    background: #edf5ff;
    color: var(--blue);
}

.observation-evidence-placeholder {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 18px;
    border: 1px dashed #c7d0d9;
    border-radius: 10px;
    background: #fafbfc;
}

.observation-evidence-placeholder p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.observation-evidence-placeholder > span {
    white-space: nowrap;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

@media (max-width: 600px) {
    .severity-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.eyebrow {
    text-transform: uppercase;
}

.field-hint {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.form-field input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fafbfc;
}

.observation-photo {
    margin: 16px 0;
    max-width: 520px;
}

.observation-photo img {
    display: block;
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.evidence-integrity {
    margin-top: 8px;
    padding: 9px 11px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
}

.evidence-integrity span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.evidence-integrity code {
    display: block;
    overflow-wrap: anywhere;
    font-size: 10px;
}

.photo-optimization-status {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f7fafc;
    color: var(--text);
    font-size: 12px;
    line-height: 1.5;
}

.photo-optimization-status small {
    color: var(--muted);
}

.observation-photo {
    width: 100%;
    max-width: 520px;
    overflow: hidden;
}

.observation-photo img {
    width: 100%;
    height: auto;
    max-width: 100%;
    display: block;
}

.voice-recorder {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fafbfc;
}

.voice-button {
    width: auto;
    min-width: 190px;
    padding: 11px 16px;
}

.voice-button.danger {
    background: #b42318;
}

.voice-status {
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.voice-status small {
    color: var(--muted);
}

#voicePreview {
    width: 100%;
    margin-top: 12px;
}
