/* ========================================================================= */
/* VARIÁVEIS - VISUAL ERP / CORPORATIVO                                       */
/* ========================================================================= */
:root {
    /* Cores primárias (Azul corporativo) */
    --primary:        #1e40af;
    --primary-light:  #2563eb;
    --primary-hover:  #1d4ed8;
    --primary-dim:    #dbeafe;
    --primary-dark:   #1e3a8a;

    /* Cores de estado */
    --success:        #16a34a;
    --success-hover:  #15803d;
    --success-light:  #22c55e;
    --success-bg:     #dcfce7;

    --warning:        #ea580c;
    --warning-hover:  #c2410c;
    --warning-light:  #f97316;
    --warning-bg:     #fed7aa;

    --danger:         #dc2626;
    --danger-hover:   #b91c1c;
    --danger-light:   #ef4444;
    --danger-bg:      #fee2e2;

    --info:           #0284c7;
    --info-hover:     #0369a1;
    --info-light:     #0ea5e9;
    --info-bg:        #e0f2fe;

    /* Fundos (Tema Claro) */
    --bg-page:        #e5e7eb;
    --bg-surface:     #ffffff;
    --bg-elevated:    #f3f4f6;
    --bg-header:      #f9fafb;
    --bg-input:       #ffffff;
    --bg-row-stripe:  #f9fafb;
    --bg-row-hover:   #eff6ff;
    --bg-row-active:  #dbeafe;
    --bg-toolbar:     #eef2f7;

    /* Textos */
    --text-primary:   #111827;
    --text-secondary: #374151;
    --text-muted:     #6b7280;
    --text-disabled:  #9ca3af;
    --text-on-primary:#ffffff;
    --text-label:     #1f2937;

    /* Bordas */
    --border:         #d1d5db;
    --border-strong:  #9ca3af;
    --border-light:   #e5e7eb;
    --border-focus:   #2563eb;

    /* Sombras (sutis, estilo Windows) */
    --shadow-sm:      0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md:      0 2px 4px rgba(0, 0, 0, 0.10);
    --shadow-lg:      0 4px 12px rgba(0, 0, 0, 0.15);
    --shadow-inset:   inset 0 1px 2px rgba(0, 0, 0, 0.05);

    /* Cantos (pouco arredondados - estilo ERP) */
    --r-sm:           2px;
    --r-md:           3px;
    --r-lg:           4px;

    /* Fontes (estilo Windows) */
    --font-sans:      'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-mono:      'Consolas', 'Courier New', monospace;

    /* Transições */
    --t-fast:         100ms ease;
    --t-base:         180ms ease;

    --select-arrow-svg: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23374151%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-6.5%200-12.3%203.2-16.1%208.1-3.9%204.9-3.9%2011.6%200%2016.5l123%20123.1a17.6%2017.6%200%200%200%2012.7%205.1c4.8%200%209.6-1.8%2012.7-5.1L287%2085.9a17.4%2017.4%200%200%200%200-16.5z%22%2F%3E%3C%2Fsvg%3E');
}

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

html {
    font-size: 13px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 0;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

::-webkit-scrollbar { width: 14px; height: 14px; }
::-webkit-scrollbar-track { background: #f1f1f1; border: 1px solid #e0e0e0; }
::-webkit-scrollbar-thumb { 
    background: #c1c1c1; 
    border-radius: 0; 
    border: 2px solid #f1f1f1; 
}
::-webkit-scrollbar-thumb:hover { background: #a8a8a8; }
::-webkit-scrollbar-button { background: #e0e0e0; height: 14px; width: 14px; }

/* ========================================================================= */
/* HEADER (Barra superior estilo ERP)                                         */
/* ========================================================================= */
.app-header {
    background: linear-gradient(180deg, #f9fafb 0%, #e5e7eb 100%);
    border-bottom: 1px solid var(--border-strong);
    padding: 6px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: var(--r-sm);
    border: 1px solid var(--primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    letter-spacing: -0.5px;
}

.brand-info h1 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-info small {
    display: block;
    font-size: 0.68rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 1px;
}

.beta-tag {
    display: inline-block;
    font-size: 0.58rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(180deg, var(--warning-light) 0%, var(--warning) 100%);
    padding: 1px 6px;
    border-radius: var(--r-sm);
    letter-spacing: 0.5px;
    border: 1px solid var(--warning-hover);
    text-transform: uppercase;
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    box-shadow: var(--shadow-inset);
}

.user-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    border: 1px solid var(--primary-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
}

.user-status-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 1px #fff, 0 0 0 2px var(--success);
}

/* ========================================================================= */
/* CONTAINER                                                                   */
/* ========================================================================= */
.app-container {
    max-width: 100%;
    margin: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ========================================================================= */
/* CARD (Estilo "aba/painel" do ERP)                                          */
/* ========================================================================= */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ========================================================================= */
/* INPUT GROUP (Toolbar de filtros estilo ERP)                                */
/* ========================================================================= */
.input-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: stretch;
    background: var(--bg-toolbar);
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
}

.input-group input,
.input-group select {
    flex: 1;
    min-width: 110px;
    padding: 5px 8px;
    border-radius: var(--r-sm);
    border: 1px solid var(--border-strong);
    font-family: var(--font-sans);
    font-size: 0.83rem;
    font-weight: 400;
    outline: none;
    background: var(--bg-input);
    color: var(--text-primary);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
    box-shadow: var(--shadow-inset);
    height: 28px;
    color-scheme: light;
}

.input-group input::placeholder { 
    color: var(--text-disabled);
    font-style: italic;
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px var(--border-focus), var(--shadow-inset);
    background: var(--bg-input);
}

.input-group input:read-only {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
}

.input-group input[readonly].retra-active {
    background: var(--danger-bg);
    border-color: var(--danger);
    box-shadow: 0 0 0 1px var(--danger);
    color: var(--danger-hover);
    font-weight: 700;
    text-align: center;
    letter-spacing: 0.5px;
}

.input-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: var(--select-arrow-svg);
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 10px;
    padding-right: 22px;
    cursor: pointer;
}

#pessoasNaLinha {
    flex: 0.4;
    min-width: 100px;
    max-width: 140px;
    text-align: center;
}

#numeroLote {
    flex: 0.6;
    min-width: 120px;
    max-width: 200px;
    text-align: center;
    border: 1px dashed var(--info) !important;
    background: var(--info-bg) !important;
    color: var(--info-hover) !important;
}

#numeroLote::placeholder {
    color: var(--info);
    font-style: italic;
    opacity: 0.8;
}

#numeroLote:focus {
    border: 1px solid var(--info) !important;
    box-shadow: 0 0 0 1px var(--info) !important;
    background: #fff !important;
}

.input-group button {
    padding: 5px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--primary-hover);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    transition: filter var(--t-fast);
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
    height: 28px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.input-group button:hover {
    filter: brightness(1.1);
    border-color: var(--primary-dark);
}

.input-group button:active { filter: brightness(0.95); }

.input-group button:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    filter: grayscale(0.5);
}

#btnCarregarOp, #btnRetrabalho {
    flex: 0.1;
    min-width: 100px;
    height: 28px;
    font-size: 0.78rem;
}

/* ========================================================================= */
/* BARRA DE STATUS (Estilo "informações da tela" do ERP)                       */
/* ========================================================================= */
.status-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    font-size: 0.78rem;
    background: var(--bg-elevated);
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-inset);
}

.status-bar > span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    background: var(--bg-surface);
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.status-bar strong {
    color: var(--primary);
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ========================================================================= */
/* LISTA DE HORÁRIOS (Grid de produção estilo ERP)                            */
/* ========================================================================= */
.list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(115px, 1fr));
    gap: 5px;
}

.row {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 8px 4px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    transition: all var(--t-fast);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 3px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.row:hover:not(.active) {
    transform: none;
    border-color: var(--primary);
    background: var(--bg-row-hover);
    box-shadow: 0 0 0 1px var(--primary-light);
}

.row.active {
    background: linear-gradient(180deg, var(--primary-dim) 0%, #bfdbfe 100%);
    color: var(--primary-hover);
    border: 1px solid var(--primary);
    box-shadow: 0 0 0 1px var(--primary), 0 1px 3px rgba(30, 64, 175, 0.2);
}

.row .prod-count {
    font-size: 1.8em;
    color: var(--text-primary);
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-mono);
}

.row.active .prod-count { color: var(--primary-hover); }

.row .defect-count {
    font-size: 0.72em;
    font-weight: 600;
    color: var(--danger);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    opacity: 0.9;
}

.row .defect-count:hover {
    opacity: 1;
    text-decoration: none;
    color: var(--danger-hover);
}

.row.active .defect-count { color: var(--danger-hover); }


/* ========================================================================= */
/* HORÁRIO JÁ APONTADO — V7.4                                               */
/* ========================================================================= */
.row.completed {
    border-color: rgba(34, 197, 94, 0.58);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.08);
}

.row.completed:hover {
    border-color: #22c55e;
}

.row .completed-badge {
    position: absolute;
    top: 7px;
    right: 8px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #16a34a;
    color: #ffffff;
    border: 1px solid rgba(134, 239, 172, 0.75);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.10), 0 3px 9px rgba(0, 0, 0, 0.32);
    font-size: 0.68rem;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

.row.completed .hour-label {
    padding-right: 22px;
}

.row.completed.active .completed-badge {
    background: #16a34a;
    color: #fff;
}

/* ========================================================================= */
/* CONTROLES (BOTÕES GRANDES estilo toolbar ERP)                              */
/* ========================================================================= */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 8px;
}

.control-group {
    display: flex;
    gap: 5px;
}

.bigbtn {
    padding: 9px 10px;
    border-radius: var(--r-sm);
    border: 1px solid;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: filter var(--t-fast);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    letter-spacing: 0.1px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    height: 38px;
}

.bigbtn i { font-size: 1em; }

.bigbtn:hover { filter: brightness(1.08); }
.bigbtn:active { filter: brightness(0.92); }
.bigbtn:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    filter: grayscale(0.5);
}

.big-add    { 
    background: linear-gradient(180deg, var(--success-light) 0%, var(--success) 100%); 
    border-color: var(--success-hover);
}
.big-sub    { 
    background: linear-gradient(180deg, var(--warning-light) 0%, var(--warning) 100%); 
    border-color: var(--warning-hover);
}
.big-reset  { 
    background: linear-gradient(180deg, var(--danger-light) 0%, var(--danger) 100%); 
    border-color: var(--danger-hover);
}
.big-admin  { 
    background: linear-gradient(180deg, var(--info-light) 0%, var(--info) 100%); 
    border-color: var(--info-hover);
}
.big-defect { 
    background: linear-gradient(180deg, var(--danger-light) 0%, var(--danger-light) 100%); 
    border-color: var(--danger);
}
.big-stop   { 
    background: linear-gradient(180deg, #fb923c 0%, #ea580c 100%); 
    border-color: #c2410c;
}

.big-retra-active {
    background: linear-gradient(180deg, var(--danger-light) 0%, var(--danger) 100%) !important;
    color: #fff !important;
    border: 1px solid #fff !important;
    box-shadow: 0 0 0 2px var(--danger) !important;
}

/* ========================================================================= */
/* MODAIS (Estilo janela do ERP - header azul, corpo branco)                  */
/* ========================================================================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity var(--t-base);
    padding: 20px;
}
.modal.show { opacity: 1; display: flex; }

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-md);
    padding: 0;
    width: 95%;
    max-width: 850px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transform: translateY(-15px) scale(0.98);
    transition: transform var(--t-base);
    display: flex;
    flex-direction: column;
}

/* Título do modal (BARRA AZUL no topo - estilo ERP) - aplica a h2 e h3 */
.modal-content h2,
.modal-content h3 {
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    color: var(--text-on-primary) !important;
    text-align: left !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 0 !important;
    padding: 8px 14px !important;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%) !important;
    border-bottom: 1px solid var(--primary-hover) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    border-top-left-radius: var(--r-md);
    border-top-right-radius: var(--r-md);
}

.modal-content h2 i,
.modal-content h3 i { 
    color: #fff !important; 
    font-size: 0.9rem !important; 
}

.modal.show .modal-content { transform: translateY(0) scale(1); }

.modal-close {
    position: absolute;
    top: 4px; right: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    cursor: pointer;
    width: 26px; height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--r-sm);
    transition: all var(--t-fast);
    z-index: 10;
    line-height: 1;
    padding: 0;
}
.modal-close:hover { 
    color: #fff; 
    background: rgba(220, 38, 38, 0.8);
    border-color: #b91c1c;
}

/* Modal Admin - Resumo */
#resumoAdmin {
    padding: 12px 14px;
    flex: 1;
    overflow-y: auto;
}

#resumoAdmin p {
    font-size: 0.83rem;
    margin: 3px 0;
    color: var(--text-secondary);
    padding: 5px 9px;
    background: var(--bg-elevated);
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    display: flex;
    gap: 6px;
}

#resumoAdmin p b { 
    color: var(--text-primary); 
    min-width: 170px;
    font-weight: 600;
}

#resumoAdmin table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    border-radius: var(--r-sm);
    overflow: hidden;
    border: 1px solid var(--border-strong);
    font-size: 0.82rem;
    background: var(--bg-surface);
}

#resumoAdmin th, #resumoAdmin td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border-light);
    text-align: center;
}

#resumoAdmin th {
    background: linear-gradient(180deg, #f3f4f6 0%, #e5e7eb 100%);
    color: var(--text-primary);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.4px;
    border-bottom: 1px solid var(--border-strong);
}

#resumoAdmin tr:nth-child(even) td { background: var(--bg-row-stripe); }
#resumoAdmin tr:hover td { background: var(--bg-row-hover); }
#resumoAdmin tr:last-child td { border-bottom: none; }
#resumoAdmin th:last-child, #resumoAdmin td:last-child { border-right: none; }

.totalBox {
    margin: 8px 14px 0;
    text-align: center;
    background: var(--success-bg);
    color: var(--success-hover);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 12px;
    border-radius: var(--r-sm);
    border: 1px solid var(--success);
    border-left: 3px solid var(--success-hover);
    flex-shrink: 0;
}

#btnSalvarBanco {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 10px 14px 14px;
    padding: 8px 16px;
    border: 1px solid var(--success-hover);
    border-radius: var(--r-sm);
    background: linear-gradient(180deg, var(--success-light) 0%, var(--success) 100%);
    color: #fff;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter var(--t-fast);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

#btnSalvarBanco:hover { 
    filter: brightness(1.1);
}

/* Modais de Ação (Editar, Parada) - mais compactos */
.modal-action .modal-content {
    max-width: 420px;
}

#modalEditar .modal-content > p,
#modalEditar .modal-content > input,
#modalEditar .modal-content > button,
#modalParada .modal-content > select,
#modalParada .modal-content > button {
    margin-left: 14px;
    margin-right: 14px;
    width: calc(100% - 28px);
    box-sizing: border-box;
}

#modalEditar .modal-content > p { margin-top: 12px; }
#modalEditar .modal-content > input { margin-top: 8px; }
#modalEditar .modal-content > button { margin-top: 12px; margin-bottom: 14px; }

#modalParada .modal-content > select { margin-top: 8px; }
#modalParada .modal-content > select:first-of-type { margin-top: 12px; }
#modalParada .modal-content > button { margin-top: 14px; margin-bottom: 14px; }

.modal-action input,
.modal-action select {
    padding: 5px 8px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    font-size: 0.85rem;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: all var(--t-fast);
    box-shadow: var(--shadow-inset);
    height: 30px;
    color-scheme: light;
}

.modal-action input:focus,
.modal-action select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px var(--border-focus);
    outline: none;
}

.modal-action select {
    appearance: none;
    -webkit-appearance: none;
    background-image: var(--select-arrow-svg);
    background-repeat: no-repeat;
    background-position: right 7px center;
    background-size: 10px;
    padding-right: 22px;
    cursor: pointer;
}

.modal-action button {
    padding: 8px 16px;
    border: 1px solid var(--primary-hover);
    border-radius: var(--r-sm);
    font-size: 0.88rem;
    cursor: pointer;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    color: #fff;
    font-weight: 600;
    transition: filter var(--t-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    height: 32px;
}

.modal-action button:hover { 
    filter: brightness(1.1);
}

#horaEditar {
    color: #ffd86b !important;
    font-size: 0.92rem;
    margin-bottom: 4px;
    padding: 9px 12px;
    background: linear-gradient(180deg, #18140c 0%, #0f0d09 100%) !important;
    border: 1px solid #8f742b !important;
    border-left: 4px solid #d6aa36 !important;
    border-radius: var(--r-sm);
    text-align: center;
    font-weight: 800;
    letter-spacing: .25px;
    text-shadow: 0 1px 0 #000, 0 0 10px rgba(214,170,54,.18);
    box-shadow: inset 0 0 0 1px rgba(255,216,107,.035), 0 2px 8px rgba(0,0,0,.22);
}

/* ========================================================================= */
/* MODAL DE STATUS DE ENVIO                                                    */
/* ========================================================================= */
#modalStatusEnvio .status-envio-content {
    max-width: 420px;
    padding: 24px;
    text-align: center;
    border: 1px solid var(--border-strong);
    overflow: visible;
}

.status-icon {
    font-size: 2.8em;
    height: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
    color: var(--primary);
}

.status-title {
    font-size: 1rem !important;
    color: var(--text-primary) !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin-bottom: 6px !important;
    font-weight: 700 !important;
    background: none !important;
    padding: 0 !important;
    border: none !important;
    text-shadow: none !important;
    justify-content: center !important;
    border-radius: 0 !important;
}

.status-message {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.4;
}

.loading-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    display: block;
    border: 1px solid var(--border);
}

.loading-bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 3px;
    position: absolute;
    top: 0;
    left: -30%;
    animation: loadingAnim 1.5s infinite linear;
}

@keyframes loadingAnim {
    0% { left: -30%; }
    100% { left: 100%; }
}

#modalStatusEnvio.success .status-envio-content {
    border-color: var(--success);
}
#modalStatusEnvio.success #statusTitle {
    color: var(--success-hover) !important;
}
#modalStatusEnvio.success #statusIcon {
    color: var(--success) !important;
}
#modalStatusEnvio.success #loadingBar { display: none; }

#modalStatusEnvio.error .status-envio-content {
    border-color: var(--danger);
}
#modalStatusEnvio.error #statusTitle {
    color: var(--danger-hover) !important;
}
#modalStatusEnvio.error #statusIcon {
    color: var(--danger) !important;
}
#modalStatusEnvio.error #loadingBar { display: none; }

#modalStatusEnvio.success #statusIcon::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}
#modalStatusEnvio.error #statusIcon::before {
    content: '\f057';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}
#modalStatusEnvio:not(.success):not(.error) #statusIcon::before {
    content: '\f110';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    animation: spin 1.5s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================================================= */
/* TOAST (Notificação estilo Windows)                                          */
/* ========================================================================= */
.toast {
    visibility: hidden;
    min-width: 280px;
    max-width: 90vw;
    background: var(--bg-surface);
    color: var(--text-primary);
    text-align: center;
    border-radius: var(--r-sm);
    padding: 8px 16px;
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    transition: all 0.3s ease-out;
    z-index: 9999;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary);
    font-size: 0.82rem;
}

.toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 30px;
    transform: translateX(-50%) translateY(0);
}

.toast.success { 
    border-left-color: var(--success);
    color: var(--success-hover);
}
.toast.danger { 
    border-left-color: var(--danger);
    color: var(--danger-hover);
}
.toast.info { 
    border-left-color: var(--info);
    color: var(--info-hover);
}

/* ========================================================================= */
/* FOOTER                                                                      */
/* ========================================================================= */
.app-footer {
    margin-top: 4px;
    padding: 6px;
    text-align: center;
    font-size: 0.72rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
}

.app-footer strong { color: var(--text-secondary); font-weight: 600; }

/* ========================================================================= */
/* RESPONSIVIDADE                                                              */
/* ========================================================================= */
@media (max-width: 1200px) {
    .app-container { padding: 6px; }
}

@media (max-width: 992px) {
    .app-header { padding: 6px 10px; }
    .brand-info h1 { font-size: 0.9rem; }
    .app-container { padding: 6px; }
    .card { padding: 10px; }
}

@media (max-width: 768px) {
    html { font-size: 12px; }
    .app-header { padding: 6px 8px; }
    .brand-logo { width: 28px; height: 28px; font-size: 0.75rem; }
    .app-container { padding: 4px; gap: 6px; }
    
    .input-group { flex-direction: column; align-items: stretch; }
    .input-group input,
    .input-group select,
    .input-group button { 
        width: 100%; 
        min-width: unset; 
    }
    #pessoasNaLinha, #numeroLote, #btnCarregarOp, #btnRetrabalho { 
        max-width: 100%; 
        flex: 1; 
    }
    
    .status-bar { flex-direction: column; gap: 4px; padding: 6px; }
    .status-bar > span { width: 100%; justify-content: space-between; }
    
    .list { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 4px; }
    .row { font-size: 0.72rem; padding: 6px 4px; }
    .row .prod-count { font-size: 1.5em; }
    .row .defect-count { font-size: 0.68em; }
    
    .controls { grid-template-columns: 1fr; }
    .control-group { flex-direction: column; }
    .bigbtn { padding: 8px; font-size: 0.82rem; height: 36px; }
    
    .modal-content { max-width: 95%; }
    .modal-content h2, .modal-content h3 { font-size: 0.85rem !important; padding: 7px 12px !important; }
    
    #resumoAdmin th, #resumoAdmin td { padding: 4px 6px; font-size: 0.75rem; }
    .totalBox { font-size: 0.85rem; padding: 6px; }
    #btnSalvarBanco { padding: 7px 14px; font-size: 0.85rem; }
    
    .toast { min-width: 90%; width: 90%; font-size: 0.78rem; }
}

@media (max-width: 480px) {
    .user-pill { display: none; }
    .brand-info small { display: none; }
    .row .prod-count { font-size: 1.3em; }
}

/* ===== V7.2 FIX: X compacto nos modais de ação ===== */
#modalEditar .modal-close,
#modalParada .modal-close {
    top: 9px !important;
    right: 10px !important;
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 8px !important;
    font-size: 18px !important;
    line-height: 1 !important;
    display: grid !important;
    place-items: center !important;
    z-index: 50 !important;
}
#modalEditar .modal-content h3,
#modalParada .modal-content h3 {
    padding-right: 52px !important;
}
