      *,
      *::before,
      *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      :root {
        --navy: #0f2035;
        --navy-mid: #1a3250;
        --navy-light: #243d63;
        --teal: #0e9e72;
        --teal-dark: #0b7a58;
        --teal-bg: #e0f5ed;
        --teal-text: #0b5c41;
        --amber: #c47a10;
        --amber-bg: #fef0d6;
        --amber-text: #7a4a06;
        --red: #b93030;
        --red-bg: #fbeaea;
        --red-text: #7a1e1e;
        --blue: #1860a8;
        --blue-bg: #e4f0fb;
        --blue-text: #0b3d78;
        /* identidade visual: verde de destaque + tons de verde claro (o tema escuro usa azul) */
        --accent: #12966a;
        --accent-dark: #0d7853;
        --accent-bg: #dff4ea;
        --accent-text: #0b5a3f;
        --accent-ring: rgba(18, 150, 106, 0.16);
        --mint: #d6f1e4;
        --mint-soft: #eef9f3;
        --gray-bg: #f1f8f4;
        --gray-border: #dbe7e1;
        --gray-muted: #8c94a4;
        --text-main: #1a2535;
        --text-sub: #5a6478;
        --text-hint: #9aa2b0;
        --white: #ffffff;
        --sidebar-w: 220px;
        --topbar-h: 58px;
        --font: "DM Sans", sans-serif;
        --mono: "DM Mono", monospace;
        --radius-sm: 6px;
        --radius-md: 10px;
        --radius-lg: 14px;
        --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.07);
        --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
      }

      html,
      body {
        height: 100%;
        font-family: var(--font);
        background: var(--gray-bg);
        color: var(--text-main);
        font-size: 14px;
        line-height: 1.5;
      }

      /* ── LAYOUT ── */
      .app {
        display: flex;
        height: 100vh;
        overflow: hidden;
      }

      /* Sidebar */
      .sidebar {
        width: var(--sidebar-w);
        background: var(--white);
        border-right: 1px solid var(--gray-border);
        display: flex;
        flex-direction: column;
        flex-shrink: 0;
        overflow: hidden;
      }
      .sidebar-logo {
        padding: 20px 18px 16px;
        background: var(--mint-soft);
        border-bottom: 1px solid var(--gray-border);
      }
      .sidebar-logo .logo-icon {
        width: 36px;
        height: 36px;
        background: var(--accent);
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 18px;
        color: #fff;
        margin-bottom: 10px;
      }
      .sidebar-logo .logo-name {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-main);
        letter-spacing: 0.02em;
      }
      .sidebar-logo .logo-sub {
        font-size: 11px;
        color: var(--text-hint);
        margin-top: 1px;
      }

      .nav-section {
        padding: 14px 10px 6px;
      }
      .nav-section-label {
        font-size: 10px;
        font-weight: 600;
        color: var(--text-hint);
        text-transform: uppercase;
        letter-spacing: 0.1em;
        padding: 0 8px;
        margin-bottom: 4px;
      }

      /* Módulos recolhidos: expandem ao passar o mouse (o módulo da página atual já vem aberto) */
      .nav-module {
        padding: 2px 10px;
      }
      .nav-module .nav-section-label {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 7px 8px;
        margin-bottom: 0;
        border-radius: var(--radius-sm);
        cursor: default;
        transition: color 0.15s, background 0.15s;
      }
      .nav-module:hover .nav-section-label,
      .nav-module.aberto .nav-section-label {
        color: var(--text-sub);
        background: var(--gray-bg);
      }
      .nav-module-seta {
        margin-left: auto;
        font-size: 9px;
        transition: transform 0.22s ease;
      }
      .nav-module:hover .nav-module-seta,
      .nav-module.aberto .nav-module-seta {
        transform: rotate(180deg);
      }
      .nav-module .nav-module-badge {
        margin-left: auto;
        background: #e24b4a;
        color: #fff;
        font-size: 10px;
        font-weight: 600;
        padding: 1px 6px;
        border-radius: 99px;
        min-width: 18px;
        text-align: center;
        letter-spacing: 0;
      }
      /* o aviso do módulo some quando ele abre, porque o item interno já mostra o seu */
      .nav-module .nav-module-badge + .nav-module-seta {
        margin-left: 6px;
      }
      .nav-module:hover .nav-module-badge,
      .nav-module.aberto .nav-module-badge {
        display: none;
      }
      .nav-module-itens {
        overflow: hidden;
        max-height: 0;
        opacity: 0;
        transition: max-height 0.22s ease, opacity 0.18s ease;
      }
      .nav-module:hover .nav-module-itens,
      .nav-module.aberto .nav-module-itens {
        max-height: 320px;
        opacity: 1;
        margin-top: 4px;
      }
      .nav-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 9px 10px;
        border-radius: var(--radius-sm);
        color: var(--text-sub);
        cursor: pointer;
        font-size: 13px;
        transition: all 0.15s;
        border: none;
        background: transparent;
        width: 100%;
        text-align: left;
      }
      .nav-item i {
        font-size: 15px;
        width: 18px;
        text-align: center;
      }
      .nav-item:hover {
        background: var(--gray-bg);
        color: var(--text-main);
      }
      .nav-item.active {
        background: var(--accent-bg);
        color: var(--accent-text);
        box-shadow: inset 3px 0 0 var(--accent);
        font-weight: 600;
      }
      .nav-item .badge {
        margin-left: auto;
        background: #e24b4a;
        color: #fff;
        font-size: 10px;
        font-weight: 600;
        padding: 1px 6px;
        border-radius: 99px;
        min-width: 18px;
        text-align: center;
      }

      .sidebar-footer {
        margin-top: auto;
        padding: 14px 18px;
        border-top: 1px solid var(--gray-border);
        font-size: 11px;
        color: var(--text-hint);
        text-align: center;
      }

      /* Main area */
      .main {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }

      /* Topbar */
      .topbar {
        height: var(--topbar-h);
        background: var(--white);
        border-bottom: 1px solid var(--gray-border);
        display: flex;
        align-items: center;
        padding: 0 24px;
        gap: 16px;
        flex-shrink: 0;
      }
      .topbar-title {
        font-size: 16px;
        font-weight: 600;
        flex: 1;
      }
      .topbar-search {
        display: flex;
        align-items: center;
        background: var(--gray-bg);
        border: 1px solid var(--gray-border);
        border-radius: var(--radius-md);
        padding: 7px 12px;
        gap: 8px;
      }
      .topbar-search i {
        color: var(--gray-muted);
        font-size: 13px;
      }
      .topbar-search input {
        border: none;
        background: transparent;
        font-size: 13px;
        color: var(--text-main);
        outline: none;
        width: 180px;
        font-family: var(--font);
      }
      .topbar-search input::placeholder {
        color: var(--gray-muted);
      }
      .topbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
      }
      .icon-btn {
        width: 34px;
        height: 34px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--gray-bg);
        border: 1px solid var(--gray-border);
        cursor: pointer;
        color: var(--text-sub);
        font-size: 14px;
        transition: all 0.15s;
        position: relative;
      }
      .icon-btn:hover {
        background: var(--gray-border);
      }
      .icon-btn .dot {
        position: absolute;
        top: 4px;
        right: 4px;
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: #e24b4a;
        border: 2px solid var(--white);
      }
      .user-avatar {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        background: var(--accent);
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        font-size: 12px;
        font-weight: 600;
        cursor: pointer;
      }

      /* Content */
      .content {
        flex: 1;
        overflow-y: auto;
        padding: 24px;
        background: var(--gray-bg);
      }

      /* Pages */
      .page {
        display: none;
        animation: fadeIn 0.2s ease;
      }
      .page.active {
        display: block;
      }
      @keyframes fadeIn {
        from {
          opacity: 0;
          transform: translateY(6px);
        }
        to {
          opacity: 1;
          transform: translateY(0);
        }
      }

      /* Metrics grid */
      .metrics {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
        margin-bottom: 24px;
      }
      .metric-card {
        background: var(--white);
        border-radius: var(--radius-lg);
        border: 1px solid var(--gray-border);
        padding: 16px 18px;
        box-shadow: var(--shadow-sm);
      }
      .metric-top {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        margin-bottom: 12px;
      }
      .metric-icon {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
      }
      .metric-icon.teal {
        background: var(--teal-bg);
        color: var(--teal-text);
      }
      .metric-icon.red {
        background: var(--red-bg);
        color: var(--red-text);
      }
      .metric-icon.amber {
        background: var(--amber-bg);
        color: var(--amber-text);
      }
      .metric-icon.blue {
        background: var(--blue-bg);
        color: var(--blue-text);
      }
      .metric-value {
        font-size: 28px;
        font-weight: 600;
        line-height: 1;
        margin-bottom: 4px;
      }
      .metric-value.ok {
        color: var(--teal);
      }
      .metric-value.warn {
        color: var(--amber);
      }
      .metric-value.danger {
        color: var(--red);
      }
      .metric-value.info {
        color: var(--blue);
      }
      .metric-label {
        font-size: 12px;
        color: var(--text-sub);
      }
      .metric-sub {
        font-size: 11px;
        color: var(--text-hint);
        margin-top: 2px;
      }

      /* Section header */
      .section-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 14px;
      }
      .section-title {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-sub);
        text-transform: uppercase;
        letter-spacing: 0.07em;
      }

      /* Cards */
      .card {
        background: var(--white);
        border-radius: var(--radius-lg);
        border: 1px solid var(--gray-border);
        box-shadow: var(--shadow-sm);
      }
      .card-body {
        padding: 18px 20px;
      }
      .card + .card {
        margin-top: 16px;
      }

      /* Alerts */
      .alerts-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 24px;
      }
      .alert-item {
        background: var(--white);
        border-radius: var(--radius-md);
        border: 1px solid var(--gray-border);
        border-left: 4px solid;
        padding: 12px 16px;
        display: flex;
        align-items: center;
        gap: 12px;
        box-shadow: var(--shadow-sm);
      }
      .alert-item.critical {
        border-left-color: var(--red);
      }
      .alert-item.warning {
        border-left-color: var(--amber);
      }
      .alert-item.info {
        border-left-color: var(--blue);
      }
      .alert-item.success {
        border-left-color: var(--teal);
      }
      .alert-icon {
        font-size: 18px;
        width: 24px;
        text-align: center;
        flex-shrink: 0;
      }
      .alert-icon.critical {
        color: var(--red);
      }
      .alert-icon.warning {
        color: var(--amber);
      }
      .alert-icon.info {
        color: var(--blue);
      }
      .alert-icon.success {
        color: var(--teal);
      }
      .alert-body {
        flex: 1;
      }
      .alert-title {
        font-size: 13px;
        font-weight: 600;
      }
      .alert-desc {
        font-size: 12px;
        color: var(--text-sub);
        margin-top: 2px;
      }
      .alert-time {
        font-size: 11px;
        color: var(--text-hint);
        white-space: nowrap;
      }
      .btn-dismiss {
        background: transparent;
        border: 1px solid var(--gray-border);
        border-radius: var(--radius-sm);
        padding: 4px 10px;
        font-size: 11px;
        color: var(--text-sub);
        cursor: pointer;
        font-family: var(--font);
        transition: all 0.15s;
      }
      .btn-dismiss:hover {
        background: var(--gray-bg);
      }

      /* Table */
      .table-wrap {
        overflow-x: auto;
      }
      table {
        width: 100%;
        border-collapse: collapse;
        font-size: 13px;
      }
      thead th {
        padding: 10px 14px;
        text-align: left;
        font-size: 11px;
        font-weight: 600;
        color: var(--text-sub);
        text-transform: uppercase;
        letter-spacing: 0.06em;
        background: var(--gray-bg);
        border-bottom: 1px solid var(--gray-border);
        white-space: nowrap;
      }
      tbody td {
        padding: 11px 14px;
        border-bottom: 1px solid var(--gray-border);
        vertical-align: middle;
      }
      tbody tr:last-child td {
        border-bottom: none;
      }
      tbody tr:hover td {
        background: var(--mint-soft);
      }

      /* Pill / badge */
      .pill {
        display: inline-block;
        padding: 3px 9px;
        border-radius: 99px;
        font-size: 11px;
        font-weight: 600;
      }
      .pill.ok {
        background: var(--teal-bg);
        color: var(--teal-text);
      }
      .pill.warn {
        background: var(--amber-bg);
        color: var(--amber-text);
      }
      .pill.danger {
        background: var(--red-bg);
        color: var(--red-text);
      }
      .pill.info {
        background: var(--blue-bg);
        color: var(--blue-text);
      }
      .pill.neutral {
        background: #eaecf0;
        color: #5a6478;
      }

      /* Progress bar */
      .prog-wrap {
        width: 90px;
        height: 6px;
        background: #e5e7eb;
        border-radius: 99px;
        overflow: hidden;
      }
      .prog-bar {
        height: 100%;
        border-radius: 99px;
        transition: width 0.4s;
      }

      /* Form elements */
      .form-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
      }
      .form-group {
        display: flex;
        flex-direction: column;
        gap: 5px;
      }
      .form-group.full {
        grid-column: 1 / -1;
      }
      .form-group.col3 {
        grid-column: span 1;
      }
      .form-label {
        font-size: 12px;
        font-weight: 600;
        color: var(--text-sub);
        letter-spacing: 0.02em;
      }
      .form-input,
      .form-select,
      .form-textarea {
        padding: 9px 12px;
        font-size: 13px;
        border: 1px solid var(--gray-border);
        border-radius: var(--radius-md);
        background: var(--white);
        color: var(--text-main);
        font-family: var(--font);
        outline: none;
        transition:
          border-color 0.15s,
          box-shadow 0.15s;
        width: 100%;
      }
      .form-input:focus,
      .form-select:focus,
      .form-textarea:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px var(--accent-ring);
      }
      .form-textarea {
        resize: vertical;
        min-height: 72px;
      }
      .form-row {
        display: flex;
        gap: 12px;
        align-items: flex-end;
        flex-wrap: wrap;
      }
      .form-row .form-group {
        flex: 1;
        min-width: 120px;
      }
      .form-actions {
        display: flex;
        gap: 10px;
        padding-top: 4px;
      }
      .form-msg {
        font-size: 13px;
        padding: 8px 0;
        min-height: 28px;
      }

      /* Buttons */
      .btn {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        padding: 9px 18px;
        border-radius: var(--radius-md);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        border: none;
        font-family: var(--font);
        transition: all 0.15s;
      }
      .btn-primary {
        background: var(--navy);
        color: #fff;
      }
      .btn-primary:hover {
        background: var(--navy-mid);
      }
      .btn-teal {
        background: var(--accent);
        color: #fff;
      }
      .btn-teal:hover {
        background: var(--accent-dark);
      }
      .btn-outline {
        background: transparent;
        color: var(--text-main);
        border: 1px solid var(--gray-border);
      }
      .btn-outline:hover {
        background: var(--gray-bg);
      }
      .btn-sm {
        padding: 6px 12px;
        font-size: 12px;
      }
      .btn-danger {
        background: var(--red-bg);
        color: var(--red-text);
      }
      .btn-danger:hover {
        background: #f5d0d0;
      }

      /* History items */
      .history-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
      }
      .history-item {
        background: var(--white);
        border-radius: var(--radius-md);
        border: 1px solid var(--gray-border);
        padding: 10px 14px;
        display: flex;
        align-items: center;
        gap: 12px;
      }
      .history-dot {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        flex-shrink: 0;
      }
      .history-dot.entrada {
        background: var(--teal-bg);
        color: var(--teal-text);
      }
      .history-dot.saida {
        background: var(--red-bg);
        color: var(--red-text);
      }
      .history-body {
        flex: 1;
      }
      .history-prod {
        font-size: 13px;
        font-weight: 500;
      }
      .history-meta {
        font-size: 11px;
        color: var(--text-hint);
        margin-top: 1px;
      }
      .history-qty {
        font-size: 14px;
        font-weight: 600;
      }
      .history-qty.entrada {
        color: var(--teal);
      }
      .history-qty.saida {
        color: var(--red);
      }

      /* Uso cards */
      .uso-card {
        background: var(--white);
        border-radius: var(--radius-lg);
        border: 1px solid var(--gray-border);
        padding: 18px 20px;
        margin-bottom: 12px;
        box-shadow: var(--shadow-sm);
      }
      .uso-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 14px;
      }
      .uso-name {
        font-size: 14px;
        font-weight: 600;
      }
      .uso-brand {
        font-size: 12px;
        color: var(--text-hint);
        margin-top: 2px;
      }
      .uso-stats {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        margin-top: 14px;
      }
      .uso-stat {
        background: var(--gray-bg);
        border-radius: var(--radius-md);
        padding: 10px 12px;
        text-align: center;
      }
      .uso-stat-label {
        font-size: 10px;
        color: var(--text-hint);
        text-transform: uppercase;
        letter-spacing: 0.06em;
      }
      .uso-stat-value {
        font-size: 18px;
        font-weight: 600;
        margin-top: 3px;
      }
      .uso-stat-unit {
        font-size: 11px;
        font-weight: 400;
        color: var(--text-sub);
      }

      /* Toasts */
      .toast-container {
        position: fixed;
        top: 18px;
        right: 18px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        z-index: 9999;
        pointer-events: none;
      }
      .toast {
        background: var(--navy);
        color: #fff;
        padding: 12px 16px;
        border-radius: var(--radius-md);
        font-size: 13px;
        max-width: 300px;
        display: flex;
        align-items: center;
        gap: 10px;
        box-shadow: var(--shadow-md);
        pointer-events: all;
        animation: slideIn 0.25s ease;
      }
      .toast.success {
        background: var(--teal-dark);
      }
      .toast.error {
        background: var(--red);
      }
      .toast.warn {
        background: var(--amber);
        color: var(--text-main);
      }
      @keyframes slideIn {
        from {
          opacity: 0;
          transform: translateX(30px);
        }
        to {
          opacity: 1;
          transform: translateX(0);
        }
      }
      @keyframes slideOut {
        from {
          opacity: 1;
        }
        to {
          opacity: 0;
          transform: translateX(30px);
        }
      }

      /* Modal */
      .modal-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 1000;
        align-items: center;
        justify-content: center;
      }
      .modal-overlay.open {
        display: flex;
      }
      .modal {
        background: var(--white);
        border-radius: var(--radius-lg);
        padding: 24px;
        width: 520px;
        max-width: 95vw;
        box-shadow: var(--shadow-md);
        animation: fadeIn 0.2s ease;
      }
      .modal-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 18px;
      }
      .modal-title {
        font-size: 16px;
        font-weight: 600;
      }
      .modal-close {
        width: 28px;
        height: 28px;
        border-radius: var(--radius-sm);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        background: var(--gray-bg);
        border: none;
        color: var(--text-sub);
        font-size: 14px;
        transition: all 0.15s;
      }
      .modal-close:hover {
        background: var(--gray-border);
      }

      /* Tabs inside modal */
      .modal-tabs {
        display: flex;
        gap: 4px;
        margin-bottom: 18px;
        border-bottom: 1px solid var(--gray-border);
      }
      .modal-tab {
        padding: 8px 16px;
        font-size: 13px;
        cursor: pointer;
        border: none;
        background: transparent;
        font-family: var(--font);
        color: var(--text-sub);
        border-bottom: 2px solid transparent;
        margin-bottom: -1px;
        transition: all 0.15s;
      }
      .modal-tab.active {
        color: var(--accent-text);
        border-bottom-color: var(--accent);
        font-weight: 600;
      }

      /* Detail rows */
      .detail-row {
        display: flex;
        padding: 8px 0;
        border-bottom: 1px solid var(--gray-border);
        gap: 12px;
      }
      .detail-row:last-child {
        border-bottom: none;
      }
      .detail-label {
        font-size: 12px;
        color: var(--text-sub);
        width: 140px;
        flex-shrink: 0;
      }
      .detail-value {
        font-size: 13px;
        font-weight: 500;
      }

      /* Empty state */
      .empty-state {
        text-align: center;
        padding: 40px 20px;
        color: var(--text-hint);
      }
      .empty-state i {
        font-size: 36px;
        margin-bottom: 10px;
        display: block;
      }
      .empty-state p {
        font-size: 13px;
      }

      /* Two-column layout for dashboard */
      .dash-grid {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 20px;
      }
      @media (max-width: 960px) {
        .dash-grid {
          grid-template-columns: 1fr;
        }
        .metrics {
          grid-template-columns: repeat(2, 1fr);
        }
      }

      /* Scrollbar */
      ::-webkit-scrollbar {
        width: 6px;
        height: 6px;
      }
      ::-webkit-scrollbar-track {
        background: transparent;
      }
      ::-webkit-scrollbar-thumb {
        background: var(--gray-border);
        border-radius: 99px;
      }

      /* Category tags */
      .cat-tag {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        padding: 2px 8px;
        border-radius: 99px;
        font-weight: 500;
      }
      .cat-Reagente {
        background: var(--blue-bg);
        color: var(--blue-text);
      }
      .cat-Consumível {
        background: #eef2ff;
        color: #3730a3;
      }
      .cat-EPIs {
        background: #fef9c3;
        color: #713f12;
      }
      .cat-Vidraria {
        background: #f0f4ff;
        color: #1e3a8a;
      }
      .cat-Outro {
        background: #f3f4f6;
        color: #374151;
      }

      /* Validade color */
      .val-vencido {
        color: var(--red);
        font-weight: 600;
      }
      .val-urgente {
        color: var(--amber);
        font-weight: 600;
      }
      .val-ok {
        color: var(--text-main);
      }

      /* Small text secondary */
      .text-hint {
        color: var(--text-hint);
      }
      .text-sub {
        color: var(--text-sub);
      }
      .fw600 {
        font-weight: 600;
      }

      /* ── CHECKLIST DE EXAMES ── */
      .checklist-section {
        margin-top: 18px;
        border-top: 1px solid var(--gray-border);
        padding-top: 16px;
      }
      .checklist-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 12px;
      }
      .checklist-title {
        font-size: 13px;
        font-weight: 600;
        color: var(--text-sub);
        display: flex;
        align-items: center;
        gap: 7px;
        text-transform: uppercase;
        letter-spacing: 0.06em;
      }
      .checklist-add-row {
        display: flex;
        gap: 8px;
        align-items: flex-end;
        background: var(--gray-bg);
        border-radius: var(--radius-md);
        padding: 12px 14px;
        margin-bottom: 12px;
        border: 1px dashed var(--gray-border);
      }
      .checklist-add-row .form-group {
        flex: 1;
        margin: 0;
      }
      .checklist-add-row .form-label {
        font-size: 11px;
        margin-bottom: 3px;
      }
      .checklist-add-row .form-input,
      .checklist-add-row .form-select {
        padding: 7px 10px;
        font-size: 12px;
      }

      .exam-list {
        display: flex;
        flex-direction: column;
        gap: 7px;
      }
      .exam-item {
        display: flex;
        align-items: center;
        gap: 12px;
        background: var(--white);
        border: 1px solid var(--gray-border);
        border-radius: var(--radius-md);
        padding: 10px 14px;
        transition: all 0.2s;
      }
      .exam-item.concluido-ok {
        border-left: 3px solid var(--teal);
        background: #f6fef9;
      }
      .exam-item.concluido-fail {
        border-left: 3px solid var(--red);
        background: #fef6f6;
      }
      .exam-item.pendente {
        border-left: 3px solid var(--gray-border);
      }

      /* Custom checkbox */
      .exam-checkbox-wrap {
        position: relative;
        flex-shrink: 0;
      }
      .exam-checkbox {
        display: none;
      }
      .exam-checkbox-label {
        width: 22px;
        height: 22px;
        border-radius: 6px;
        border: 2px solid var(--gray-border);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.15s;
        background: var(--white);
        font-size: 12px;
        color: transparent;
      }
      .exam-checkbox:checked + .exam-checkbox-label {
        background: var(--teal);
        border-color: var(--teal);
        color: #fff;
      }

      .exam-body {
        flex: 1;
      }
      .exam-name {
        font-size: 13px;
        font-weight: 500;
      }
      .exam-meta {
        font-size: 11px;
        color: var(--text-hint);
        margin-top: 1px;
      }
      .exam-name.riscado {
        text-decoration: line-through;
        color: var(--text-hint);
      }

      .exam-result-btns {
        display: flex;
        gap: 6px;
        flex-shrink: 0;
      }
      .result-btn {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        padding: 5px 11px;
        border-radius: var(--radius-sm);
        font-size: 11px;
        font-weight: 600;
        cursor: pointer;
        border: 1.5px solid;
        transition: all 0.15s;
        font-family: var(--font);
      }
      .result-btn.ok {
        border-color: var(--teal);
        color: var(--teal-text);
        background: var(--teal-bg);
      }
      .result-btn.ok:hover {
        background: #c4edd9;
      }
      .result-btn.fail {
        border-color: var(--red);
        color: var(--red-text);
        background: var(--red-bg);
      }
      .result-btn.fail:hover {
        background: #f5d0d0;
      }
      .result-btn.recoleta {
        border-color: var(--amber);
        color: var(--amber-text);
        background: var(--amber-bg);
      }
      .result-btn.recoleta:hover {
        background: #fce4b0;
      }
      .result-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
      }

      .exam-badge {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        font-size: 11px;
        font-weight: 600;
        padding: 3px 9px;
        border-radius: 99px;
        flex-shrink: 0;
      }
      .exam-badge.ok {
        background: var(--teal-bg);
        color: var(--teal-text);
      }
      .exam-badge.fail {
        background: var(--red-bg);
        color: var(--red-text);
      }
      .exam-badge.recoleta {
        background: var(--amber-bg);
        color: var(--amber-text);
      }
      .exam-badge.pendente {
        background: #eaecf0;
        color: var(--text-sub);
      }

      .checklist-summary {
        display: flex;
        gap: 10px;
        margin-bottom: 12px;
        flex-wrap: wrap;
      }
      .summary-chip {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-size: 12px;
        padding: 4px 10px;
        border-radius: 99px;
        border: 1px solid var(--gray-border);
        background: var(--white);
      }
      .summary-chip i {
        font-size: 11px;
      }
      .summary-chip.ok {
        border-color: var(--teal);
        background: var(--teal-bg);
        color: var(--teal-text);
      }
      .summary-chip.fail {
        border-color: var(--red);
        background: var(--red-bg);
        color: var(--red-text);
      }
      .summary-chip.recoleta {
        border-color: var(--amber);
        background: var(--amber-bg);
        color: var(--amber-text);
      }
      .summary-chip.pend {
        color: var(--text-sub);
      }

/* ── Ajustes adicionais para o backend PHP ── */
a.nav-item, a.icon-btn {
  text-decoration: none;
}
.flash {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.flash-ok {
  background: var(--teal-bg);
  color: var(--teal-text);
  border: 1px solid var(--teal);
}
.flash-erro {
  background: var(--red-bg);
  color: var(--red-text);
  border: 1px solid var(--red);
}
.field-error {
  color: var(--red-text);
  font-size: 12px;
  margin-top: 4px;
}

/* ── Tela de login / cadastro (fora do app logado) ── */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--accent-bg) 0%, var(--mint-soft) 55%, var(--mint) 100%);
  padding: 20px;
}
.auth-card {
  background: var(--white);
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 420px;
  padding: 34px 32px 28px;
}
.auth-card.wide {
  max-width: 560px;
}
.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.auth-logo .logo-icon {
  width: 40px;
  height: 40px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 19px;
}
.auth-logo .logo-name {
  font-size: 19px;
  font-weight: 600;
  color: var(--accent-text);
}
.auth-intro {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
  margin: 10px 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gray-border);
}
.auth-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-main);
}
.auth-footer {
  margin-top: 18px;
  font-size: 13px;
  text-align: center;
  color: var(--text-sub);
}
.auth-footer a {
  color: var(--accent-dark);
  font-weight: 500;
  text-decoration: none;
}
.badge-perm {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.badge-perm.admin { background: var(--blue-bg); color: var(--blue-text); }
.badge-perm.operador { background: var(--teal-bg); color: var(--teal-text); }
.badge-perm.visualizador { background: var(--gray-bg); color: var(--text-sub); border: 1px solid var(--gray-border); }

/* ── Importação de NF-e (entrada_xml.php) ── */
.flash-aviso {
  background: var(--amber-bg);
  color: var(--amber-text);
  border: 1px solid var(--amber);
  align-items: flex-start;
}
.nfe-lista {
  margin: 4px 0 0 18px;
  line-height: 1.6;
}
.nfe-resumo-nota {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px 20px;
  font-size: 13px;
}
.nfe-resumo-nota .rotulo {
  font-size: 11px;
  color: var(--text-hint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}
.nfe-chave {
  font-family: var(--mono);
  font-size: 12px;
  word-break: break-all;
}
.nfe-fornecedor-opcoes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
}
.nfe-fornecedor-opcoes label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.nfe-item {
  margin-bottom: 12px;
  transition: opacity 0.15s;
}
.nfe-item.ignorado {
  opacity: 0.55;
}
.nfe-item-topo {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.nfe-item-meta {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}
.nfe-ignorar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-sub);
  cursor: pointer;
  white-space: nowrap;
}
.nfe-dica {
  font-size: 11px;
  color: var(--teal-text);
  margin-top: 4px;
}
.nfe-unidade-produto {
  font-size: 12px;
  color: var(--text-sub);
}
.nfe-lotes {
  margin-top: 12px;
  border: 1px solid var(--gray-border);
  border-radius: var(--radius-md);
}
.nfe-lotes td {
  padding: 6px 10px;
}
.nfe-item-rodape {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 13px;
}
/* produto_form.php aberto pela importação: janela sem a barra lateral */
.modo-popup .sidebar {
  display: none;
}

/* ── Botão de troca de tema (topbar) ── */
.form-tema {
  display: flex;
  margin: 0;
}
button.icon-btn {
  font-family: var(--font);
}
.icone-ir-claro {
  display: none;
}
[data-tema="escuro"] .icone-ir-escuro {
  display: none;
}
[data-tema="escuro"] .icone-ir-claro {
  display: inline-block;
}

/* ── TEMA ESCURO ──
   Ativado por <html data-tema="escuro"> (preferência salva por usuário).
   Redefine as variáveis de cor; o restante do CSS continua valendo. */
[data-tema="escuro"] {
  color-scheme: dark;
  --white: #16202b;         /* superfície: cards, topbar, sidebar, campos */
  --gray-bg: #0e151d;       /* fundo da página */
  --gray-border: #263444;
  --gray-muted: #7b8a9a;
  --text-main: #e3eaf1;
  --text-sub: #a2b0bf;
  --text-hint: #6e7e8f;
  --accent: #4b91ea;
  --accent-dark: #3a7bd4;
  --accent-bg: #172f4d;
  --accent-text: #a3c8f6;
  --accent-ring: rgba(75, 145, 234, 0.25);
  --mint: #16392c;
  --mint-soft: #13221d;
  --teal: #25b886;
  --teal-dark: #1c9a6f;
  --teal-bg: #133629;
  --teal-text: #7adbb3;
  --amber: #e3a23c;
  --amber-bg: #3a2a10;
  --amber-text: #f1c67f;
  --red: #e25d5d;
  --red-bg: #3b1b1b;
  --red-text: #f3a6a6;
  --blue: #4b91ea;
  --blue-bg: #172f4d;
  --blue-text: #a3c8f6;
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
}
/* área do nome na sidebar: mesma superfície do resto da barra (sem o verde do tema claro) */
[data-tema="escuro"] .sidebar-logo {
  background: var(--white);
}
/* cores que estavam fixas no CSS acima */
[data-tema="escuro"] .pill.neutral,
[data-tema="escuro"] .exam-badge.pendente {
  background: #243140;
  color: var(--text-sub);
}
[data-tema="escuro"] .prog-wrap {
  background: var(--gray-border);
}
[data-tema="escuro"] .btn-danger:hover,
[data-tema="escuro"] .result-btn.fail:hover {
  background: #4d2222;
}
[data-tema="escuro"] .result-btn.ok:hover {
  background: #1a4a38;
}
[data-tema="escuro"] .result-btn.recoleta:hover {
  background: #4d3814;
}
[data-tema="escuro"] .exam-item.concluido-ok {
  background: #12261e;
}
[data-tema="escuro"] .exam-item.concluido-fail {
  background: #2a1616;
}
[data-tema="escuro"] .toast.warn {
  color: #1a2535;
}
[data-tema="escuro"] .cat-Consumível { background: #232a4d; color: #b4bcf5; }
[data-tema="escuro"] .cat-EPIs       { background: #3a3512; color: #efe08a; }
[data-tema="escuro"] .cat-Vidraria   { background: #1b2a4d; color: #a9c0f3; }
[data-tema="escuro"] .cat-Outro      { background: #252e39; color: #c3cad3; }
