/*
 * SPARES-CHAIN v6.3 - Sistema de Rastreabilidade de Sobressalentes
 * Autor: Jossian Brito
 *
 * Conceitos aplicados:
 * - Chain of Custody (Cadeia de Custódia)
 * - Compliance Tracking (Rastreamento de Conformidade)
 * - Three-Party Handoff (Transferência Tripla)
 * - Anomaly Detection (Detecção de Anomalias)
 */

/* ===== SVG ICON SYSTEM ===== */
.icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.125em;
    flex-shrink: 0;
}
.icon-sm { width: 0.875em; height: 0.875em; }
.icon-lg { width: 1.5em; height: 1.5em; }
.icon-xl { width: 2em; height: 2em; }
.icon-2xl { width: 2.5em; height: 2.5em; }
.icon-3xl { width: 3em; height: 3em; }
.icon-4xl { width: 4em; height: 4em; }

.panel-icon .icon {
    width: 1.25em;
    height: 1.25em;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    overflow-x: hidden;
    max-width: 100vw;
}

.hidden {
    display: none !important;
}

/* ===== CABEÇALHO ===== */
.header {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    border-bottom: 3px solid #00d4ff;
    backdrop-filter: blur(10px);
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
    flex: 1 1 420px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.user-badge {
    background: rgba(0, 212, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid #00d4ff;
    font-weight: bold;
}

.user-badge.transportadora {
    border-color: #ffa502;
    background: rgba(255, 165, 2, 0.2);
}

.user-badge.almox {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.2);
}

.user-badge.chefe-maq {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.16);
}

.user-badge.auditor {
    border-color: #ff6b81;
    background: rgba(255, 107, 129, 0.18);
}

.actor-switcher {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(49, 208, 255, 0.18);
}

.actor-switcher-label {
    color: #cfe9ff;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
}

.actor-switcher-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.actor-role-btn {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: #eef7ff;
    border-radius: 999px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.actor-role-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(49, 208, 255, 0.35);
}

.actor-role-btn.active {
    box-shadow: 0 0 0 3px rgba(49, 208, 255, 0.12);
}

.actor-role-btn[data-role="ALMOX"].active {
    background: rgba(0, 212, 255, 0.16);
    border-color: #00d4ff;
}

.actor-role-btn[data-role="TRANSPORTADORA"].active {
    background: rgba(255, 165, 2, 0.18);
    border-color: #ffa502;
}

.actor-role-btn[data-role="CHEFE_MAQ"].active {
    background: rgba(0, 255, 136, 0.16);
    border-color: #00ff88;
}

.actor-role-btn[data-role="AUDITOR"].active {
    background: rgba(255, 107, 129, 0.18);
    border-color: #ff6b81;
}

.logout-btn {
    background: #ff4757;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #ff3838;
    transform: scale(1.05);
}

.actor-login-trigger {
    background: linear-gradient(135deg, #31d0ff 0%, #1e88ff 100%);
}

.actor-login-trigger:hover {
    background: linear-gradient(135deg, #2bbcf2 0%, #146fe2 100%);
}

/* ===== CONTAINER PRINCIPAL ===== */
.container {
    max-width: 1800px;
    margin: 30px auto;
    padding: 0 20px;
    overflow-x: hidden;
}

.intro-section {
    background: rgba(0, 0, 0, 0.4);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    border: 2px solid #00d4ff;
    backdrop-filter: blur(5px);
}

.intro-section h1 {
    color: #00d4ff;
    margin-bottom: 15px;
    font-size: 32px;
}

/* ===== DASHBOARD KPIs ===== */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.kpi-card {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #00d4ff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.kpi-value {
    font-size: 36px;
    font-weight: bold;
    color: #00d4ff;
    margin: 10px 0;
}

.kpi-label {
    font-size: 14px;
    color: #aaa;
}

.kpi-card.success .kpi-value { color: #00ff88; }
.kpi-card.warning .kpi-value { color: #ffa502; }
.kpi-card.danger .kpi-value  { color: #ff4757; }

/* ===== PAINEL DE CONFORMIDADE ===== */
.compliance-panel {
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #ffa502;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
}

.compliance-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #ffa502;
}

.compliance-title {
    font-size: 24px;
    color: #ffa502;
    font-weight: bold;
}

.compliance-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
}

.compliance-item {
    background: rgba(255, 165, 2, 0.1);
    border: 2px solid #ffa502;
    border-radius: 8px;
    padding: 15px;
}

.compliance-item.critical {
    border-color: #ff4757;
    background: rgba(255, 71, 87, 0.1);
}

/* ===== GRID DE PAINÉIS ===== */
.panels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    max-width: 100%;
    overflow-x: hidden;
}

.panel {
    background: rgba(0, 0, 0, 0.5);
    border: 3px solid #00d4ff;
    border-radius: 15px;
    padding: 20px;
    min-height: 300px;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    overflow: hidden;
    max-width: 100%;
}

.panel.transportadora { border-color: #ffa502; }

.panel:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.3);
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #00d4ff;
}

.panel-header.transportadora { border-bottom-color: #ffa502; }

.panel-icon  { font-size: 32px; }
.panel-title { font-size: 20px; font-weight: bold; color: #00d4ff; }
.panel-title.transportadora { color: #ffa502; }

/* ===== ÁREA DE DROP ===== */
.drop-zone {
    background: rgba(0, 212, 255, 0.1);
    border: 3px dashed #00d4ff;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
}

.drop-zone.transportadora {
    background: rgba(255, 165, 2, 0.1);
    border-color: #ffa502;
}

.drop-zone.drag-over {
    background: rgba(0, 212, 255, 0.3);
    border-color: #00ff88;
    transform: scale(1.02);
}

.drop-zone > p {
    width: 100%;
}

/* ===== PEÇAS ARRASTÁVEIS ===== */
.spare-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #00d4ff;
    border-radius: 10px;
    padding: 15px;
    margin: 10px 0;
    cursor: move;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
}

.spare-item:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.5);
}

.spare-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.spare-item.installed {
    background: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
}

.spare-item.removed {
    background: linear-gradient(135deg, #ffa502 0%, #ff6348 100%);
}

.spare-item.in-transit {
    background: linear-gradient(135deg, #ffa502 0%, #ff9f43 100%);
    border-color: #ffa502;
}

.spare-item.non-compliant {
    border: 3px solid #ff4757;
    box-shadow: 0 0 15px rgba(255, 71, 87, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 71, 87, 0.5); }
    50%      { box-shadow: 0 0 25px rgba(255, 71, 87, 0.8); }
}

/* Peças dentro das prateleiras — tamanho reduzido */
.shelf-slot .spare-item   { padding: 8px; margin: 5px 0; font-size: 11px; max-width: 100%; overflow: hidden; }
.shelf-slot .spare-icon   { font-size: 24px; min-width: 24px; }
.shelf-slot .spare-info   { min-width: 0; flex: 1; }
.shelf-slot .spare-name   { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-slot .spare-code,
.shelf-slot .spare-status { font-size: 9px; }

.spare-icon   { font-size: 40px; flex-shrink: 0; }
.spare-info   { flex: 1; min-width: 0; }
.spare-name   { font-weight: bold; font-size: 16px; color: #00d4ff; overflow-wrap: anywhere; }
.spare-code   { font-size: 12px; color: #aaa; margin-top: 5px; word-break: break-word; }
.spare-status { font-size: 11px; color: #00ff88; margin-top: 3px; word-break: break-word; }

.spare-warning {
    position: absolute;
    top: -10px;
    right: -10px;
    background: #ff4757;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-5px); }
}

/* ===== MENU DE CONTEXTO ===== */
.context-menu {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00d4ff;
    border-radius: 8px;
    padding: 10px 0;
    min-width: 200px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
}

.context-menu.active { display: block; }

.context-menu-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.context-menu-item:hover { background: rgba(0, 212, 255, 0.2); }

.context-menu-separator {
    height: 1px;
    background: #333;
    margin: 5px 0;
}

/* ===== MODAL ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.modal.active { display: flex; }

.modal-content {
    background: rgba(20, 30, 50, 0.95);
    border: 3px solid #00d4ff;
    border-radius: 15px;
    padding: 30px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #00d4ff;
}

.modal-title { font-size: 24px; color: #00d4ff; }

.modal-close {
    background: #ff4757;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    color: white;
    cursor: pointer;
    font-weight: bold;
}

.actor-login-modal {
    max-width: 520px;
}

.actor-login-intro {
    color: #c3d2e6;
    line-height: 1.7;
    margin-bottom: 20px;
}

.actor-login-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 10px;
}

.actor-login-submit {
    width: auto;
    min-width: 180px;
}

/* ===== TOUR DE BOAS-VINDAS ===== */
.welcome-modal-content {
    max-width: 1080px;
    width: min(1080px, 94vw);
    max-height: 88vh;
    padding: 28px;
    border-color: #31d0ff;
    background:
        radial-gradient(circle at top left, rgba(0, 212, 255, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 165, 2, 0.16), transparent 32%),
        rgba(10, 18, 34, 0.96);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

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

.welcome-kicker {
    color: #8fdfff;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 12px;
    margin-bottom: 10px;
}

.welcome-title {
    font-size: clamp(28px, 4vw, 42px);
    line-height: 1.05;
    margin-bottom: 12px;
}

.welcome-subtitle {
    color: #b9c8de;
    max-width: 660px;
    font-size: 16px;
    line-height: 1.6;
}

.welcome-counter {
    padding: 12px 16px;
    border-radius: 999px;
    border: 1px solid rgba(49, 208, 255, 0.35);
    background: rgba(0, 0, 0, 0.24);
    color: #dff8ff;
    white-space: nowrap;
    font-weight: bold;
}

.welcome-dots {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
}

.welcome-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: rgba(185, 200, 222, 0.28);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.welcome-dot.active {
    background: linear-gradient(135deg, #31d0ff 0%, #00ff88 100%);
    box-shadow: 0 0 0 4px rgba(49, 208, 255, 0.14);
    transform: scale(1.2);
}

.welcome-carousel {
    position: relative;
    min-height: 430px;
}

.welcome-slide {
    display: none;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 24px;
    align-items: stretch;
    padding: 28px;
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(10, 28, 50, 0.95), rgba(13, 21, 38, 0.88));
    border: 1px solid rgba(49, 208, 255, 0.22);
    animation: welcomeFade 0.35s ease;
}

.welcome-slide.active {
    display: grid;
}

.welcome-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
}

.welcome-copy h3 {
    font-size: clamp(24px, 3vw, 34px);
    line-height: 1.1;
    color: #ffffff;
}

.welcome-copy p {
    color: #c8d4e4;
    font-size: 16px;
    line-height: 1.7;
}

.welcome-tag {
    display: inline-flex;
    width: fit-content;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 165, 2, 0.15);
    border: 1px solid rgba(255, 165, 2, 0.32);
    color: #ffcb6b;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.welcome-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.welcome-chip {
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(49, 208, 255, 0.1);
    border: 1px solid rgba(49, 208, 255, 0.22);
    color: #dff8ff;
    font-size: 13px;
}

.welcome-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

.welcome-list li {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #d4ddec;
}

.welcome-visual {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(18, 37, 65, 0.84), rgba(8, 14, 28, 0.78));
    border: 1px solid rgba(143, 223, 255, 0.12);
}

.welcome-ledger-card,
.welcome-stage-card,
.welcome-proof-box,
.welcome-start-card,
.welcome-timeline-card {
    border-radius: 20px;
    padding: 18px;
}

.welcome-ledger-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(49, 208, 255, 0.18);
    display: grid;
    gap: 8px;
}

.welcome-ledger-card.accent {
    border-color: rgba(255, 165, 2, 0.3);
    background: rgba(255, 165, 2, 0.08);
}

.welcome-ledger-card strong,
.welcome-stage-card strong,
.welcome-start-card strong {
    font-size: 20px;
}

.welcome-ledger-card small,
.welcome-stage-card small,
.welcome-proof-box small {
    color: #b4c7dd;
}

.welcome-ledger-label {
    color: #8fdfff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.welcome-ledger-arrow {
    font-size: 28px;
    text-align: center;
    color: #31d0ff;
}

.welcome-stage-card {
    display: grid;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.welcome-stage-card span {
    color: #8fdfff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.welcome-stage-card.secondary {
    border-color: rgba(49, 208, 255, 0.22);
}

.welcome-stage-card.warning {
    border-color: rgba(255, 165, 2, 0.26);
    background: rgba(255, 165, 2, 0.08);
}

.welcome-stage-card.accent {
    border-color: rgba(49, 208, 255, 0.28);
    background: rgba(49, 208, 255, 0.08);
}

.welcome-stage-card.success {
    border-color: rgba(0, 255, 136, 0.22);
    background: rgba(0, 255, 136, 0.08);
}

.welcome-stage-stack {
    display: grid;
    gap: 14px;
}

.welcome-chain-strip {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.welcome-chain-node {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 13px;
}

.welcome-chain-node.active {
    background: rgba(49, 208, 255, 0.12);
    border-color: rgba(49, 208, 255, 0.28);
    color: #dff8ff;
}

.welcome-chain-link {
    height: 2px;
    background: linear-gradient(90deg, rgba(49, 208, 255, 0.12), rgba(49, 208, 255, 0.8));
}

.welcome-proof-box {
    display: grid;
    gap: 8px;
    background: rgba(0, 0, 0, 0.26);
    border: 1px solid rgba(49, 208, 255, 0.14);
}

.welcome-proof-box.danger {
    border-color: rgba(255, 71, 87, 0.24);
    background: rgba(255, 71, 87, 0.08);
}

.welcome-timeline-card {
    display: grid;
    gap: 10px;
    background: linear-gradient(180deg, rgba(49, 208, 255, 0.1), rgba(255, 165, 2, 0.08));
    border: 1px solid rgba(49, 208, 255, 0.18);
}

.welcome-timeline-card div {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(10, 18, 34, 0.62);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.welcome-start-card {
    display: grid;
    gap: 16px;
    text-align: left;
    background:
        linear-gradient(135deg, rgba(0, 255, 136, 0.16), rgba(49, 208, 255, 0.14));
    border: 1px solid rgba(0, 255, 136, 0.24);
}

.welcome-start-card p {
    color: #d4e9e0;
    line-height: 1.7;
}

.welcome-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
}

.welcome-nav-btn,
.welcome-start-btn {
    border: none;
    cursor: pointer;
    border-radius: 16px;
    padding: 14px 22px;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.welcome-nav-btn {
    background: rgba(255, 255, 255, 0.06);
    color: #eef6ff;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.welcome-nav-btn:hover,
.welcome-start-btn:hover {
    transform: translateY(-1px);
}

.welcome-nav-btn[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.welcome-nav-btn-primary {
    background: linear-gradient(135deg, #31d0ff 0%, #1e88ff 100%);
    color: #071321;
    box-shadow: 0 14px 30px rgba(49, 208, 255, 0.18);
}

.welcome-start-btn {
    background: linear-gradient(135deg, #00ff88 0%, #31d0ff 100%);
    color: #071321;
    box-shadow: 0 16px 34px rgba(0, 255, 136, 0.2);
}

@keyframes welcomeFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FORMULÁRIOS ===== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #aaa; font-weight: bold; }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #00d4ff;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 14px;
}

/* ===== QR CODE SCANNER ===== */
.scanner-frame {
    width: 200px;
    height: 200px;
    border: 3px solid #00ff88;
    border-radius: 10px;
    position: relative;
    margin: 20px auto;
    overflow: hidden;
}

.scanner-line {
    width: 100%;
    height: 3px;
    background: #00ff88;
    position: absolute;
    top: 0;
    animation: scan 2s ease-in-out infinite;
    box-shadow: 0 0 10px #00ff88;
}

@keyframes scan {
    0%, 100% { top: 0; }
    50%      { top: calc(100% - 3px); }
}

.qr-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    opacity: 0.3;
}

/* ===== EQUIPAMENTOS ===== */
.equipment-slot {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #666;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    min-height: 80px;
    transition: all 0.3s;
}

.equipment-slot.filled {
    border-color: #00ff88;
    background: rgba(0, 255, 136, 0.1);
}

.equipment-slot.drag-over {
    border-color: #00d4ff;
    background: rgba(0, 212, 255, 0.2);
}

.equipment-label { font-size: 14px; color: #aaa; margin-bottom: 10px; }

/* ===== PRATELEIRAS ===== */
.shelf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 100%;
    overflow: hidden;
}

.shelf-slot {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #666;
    border-radius: 5px;
    padding: 10px;
    min-height: 60px;
    max-height: 120px;
    font-size: 12px;
    text-align: center;
    transition: all 0.3s;
    overflow: hidden;
    position: relative;
}

.shelf-slot > div:last-child {
    max-height: 80px;
    overflow-y: auto;
    overflow-x: hidden;
}

.shelf-slot.occupied {
    border-color: #ffa502;
    background: rgba(255, 165, 2, 0.1);
}

/* ===== LOG DE ATIVIDADES ===== */
.activity-log {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #00d4ff;
    border-radius: 10px;
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.history-timeline {
    display: grid;
    gap: 14px;
}

.history-item {
    padding: 16px;
    border-radius: 14px;
    border-left: 4px solid #00d4ff;
    background: rgba(0, 212, 255, 0.08);
    overflow-wrap: anywhere;
}

.history-item code,
.modal-content code {
    word-break: break-all;
}

.responsive-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.responsive-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}

.responsive-item-value-right {
    text-align: right;
}

.responsive-document-card {
    overflow-wrap: anywhere;
}

.report-shell {
    display: grid;
    gap: 20px;
}

.report-headline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    border-radius: 18px;
    border: 1px solid rgba(49, 208, 255, 0.2);
    background: linear-gradient(135deg, rgba(49, 208, 255, 0.12), rgba(0, 255, 136, 0.08));
}

.report-headline h3 {
    color: #ffffff;
    font-size: 26px;
    margin-bottom: 8px;
}

.report-headline p {
    color: #c8d7ea;
    line-height: 1.6;
}

.report-score {
    min-width: 150px;
    padding: 16px 18px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.24);
}

.report-score strong {
    display: block;
    font-size: 34px;
    line-height: 1;
    margin-bottom: 8px;
}

.report-score small {
    color: #d7e7f7;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 11px;
}

.report-score.excellent strong { color: #00ff88; }
.report-score.good strong { color: #31d0ff; }
.report-score.attention strong { color: #ffa502; }
.report-score.critical strong { color: #ff4757; }

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.report-card {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
}

.report-card h4 {
    color: #8fdfff;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.report-card strong {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
}

.report-card p {
    color: #c3d2e6;
    line-height: 1.6;
    font-size: 14px;
}

.report-section {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(49, 208, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
}

.report-section-title {
    color: #00d4ff;
    font-size: 18px;
    margin-bottom: 14px;
}

.report-list {
    list-style: none;
    display: grid;
    gap: 10px;
}

.report-list li {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.18);
    color: #d6e2f0;
    line-height: 1.6;
}

.report-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.report-badge.good {
    color: #0d2f1d;
    background: rgba(0, 255, 136, 0.9);
}

.report-badge.info {
    color: #062033;
    background: rgba(49, 208, 255, 0.9);
}

.report-badge.warn {
    color: #3c2700;
    background: rgba(255, 165, 2, 0.92);
}

.report-badge.bad {
    color: #3b0c13;
    background: rgba(255, 71, 87, 0.92);
}

.report-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.log-entry {
    padding: 10px;
    margin: 5px 0;
    border-left: 4px solid #00d4ff;
    background: rgba(0, 212, 255, 0.1);
    border-radius: 5px;
    font-size: 14px;
    animation: slideIn 0.3s ease-out;
}

.log-entry.warning { border-left-color: #ffa502; background: rgba(255, 165, 2, 0.1); }
.log-entry.success { border-left-color: #00ff88; background: rgba(0, 255, 136, 0.1); }
.log-entry.danger  { border-left-color: #ff4757; background: rgba(255, 71, 87, 0.1); }

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.log-timestamp { color: #00ff88; font-size: 12px; margin-right: 10px; }

/* ===== BOTÕES ===== */
.action-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    margin: 10px 5px;
    transition: all 0.3s;
}

.action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.action-btn.success {
    background: linear-gradient(135deg, #00ff88 0%, #00d4ff 100%);
}

/* ===== LOGIN SCREEN ===== */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-box {
    background: rgba(0, 0, 0, 0.7);
    padding: 40px;
    border-radius: 15px;
    border: 3px solid #00d4ff;
    backdrop-filter: blur(10px);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.login-box h2 { color: #00d4ff; margin-bottom: 30px; font-size: 28px; }

.input-group { margin-bottom: 20px; }
.input-group label { display: block; margin-bottom: 8px; color: #aaa; text-align: left; }

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #00d4ff;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    font-size: 16px;
}

.login-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 212, 255, 0.5);
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    .header {
        padding: 16px;
        align-items: flex-start;
    }
    .logo {
        font-size: 20px;
        flex-basis: 100%;
    }
    .user-info {
        width: 100%;
        justify-content: flex-start;
    }
    .actor-switcher {
        width: 100%;
    }
    .panels-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .panel {
        min-height: 260px;
        padding: 18px;
    }
    .drop-zone {
        min-height: 180px;
        padding: 22px;
    }
    .modal-content {
        width: min(94vw, 760px);
        max-height: 84vh;
    }
    .activity-log {
        max-height: 320px;
    }
    .report-headline {
        flex-direction: column;
    }
    .report-score {
        width: 100%;
        max-width: 220px;
    }
}

@media (max-width: 768px) {
    .panels-grid { grid-template-columns: 1fr; }
    .shelf-grid  { grid-template-columns: repeat(2, 1fr); }
    .dashboard   { grid-template-columns: repeat(2, 1fr); }
    .header {
        padding: 14px;
    }
    .logo {
        font-size: 18px;
    }
    .spare-item  {
        padding: 12px;
        font-size: 12px;
        align-items: flex-start;
    }
    .spare-icon  { font-size: 30px; }
    .user-info {
        justify-content: flex-start;
        width: 100%;
    }
    .user-info > .logout-btn,
    .user-badge {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .drop-zone {
        min-height: 160px;
        padding: 18px;
    }
    .panel-header {
        align-items: flex-start;
    }
    .action-btn {
        width: 100%;
        margin: 10px 0 0;
    }
    .modal {
        align-items: flex-start;
        padding: 12px 0;
    }
    .modal-content {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 24px);
        padding: 22px;
    }
    .responsive-meta-grid,
    .responsive-item-row {
        grid-template-columns: 1fr;
    }
    .responsive-item-value-right {
        text-align: left;
    }
    .report-actions {
        justify-content: stretch;
    }
    .report-actions .action-btn {
        width: 100%;
    }
    .welcome-hero,
    .welcome-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .welcome-slide {
        grid-template-columns: 1fr;
        min-height: auto;
        padding: 20px;
    }
    .welcome-carousel {
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .shelf-grid { grid-template-columns: 1fr; }
    .dashboard  { grid-template-columns: 1fr; }
    .container {
        padding: 0 12px;
    }
    .panel {
        padding: 16px;
    }
    .panel-title {
        font-size: 18px;
    }
    .actor-switcher,
    .actor-login-actions {
        flex-direction: column;
        align-items: stretch;
    }
    .actor-switcher-buttons {
        width: 100%;
    }
    .actor-role-btn {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }
    .spare-item {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .spare-icon {
        font-size: 28px;
    }
    .spare-warning {
        width: 26px;
        height: 26px;
        font-size: 16px;
        top: -8px;
        right: -8px;
    }
    .drop-zone {
        padding: 16px;
        min-height: 140px;
    }
    .modal-content {
        width: calc(100vw - 14px);
        padding: 18px;
        border-width: 2px;
    }
    .report-headline h3 {
        font-size: 22px;
    }
    .report-card strong {
        font-size: 24px;
    }
    .welcome-modal-content {
        padding: 18px;
    }
    .welcome-chain-strip {
        grid-template-columns: 1fr;
    }
    .welcome-chain-link {
        height: 18px;
        width: 2px;
        justify-self: center;
        background: linear-gradient(180deg, rgba(49, 208, 255, 0.12), rgba(49, 208, 255, 0.8));
    }
}
