/* =========================================
   SISTEMA EXPRESSO NORDESTE - ESTILOS PRO
   ========================================= */
:root {
    --brand: #006B3F; 
    --brand-hover: #005230;
    --accent: #FBAF17; 
    --bg: #F4F7F6;
    --white: #ffffff;
    --border: #E2E8F0;
    --text: #1E293B;
    --text-muted: #64748B;
    
    --btn-reprove: #EF4444; 
    --btn-undo: #94A3B8; 
    --manage-btn: #3B82F6; 
    --excel-day: #10B981; 
    --excel-period: #059669;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body { font-family: 'Inter', sans-serif; background: var(--bg); margin: 0; padding: 0; color: var(--text); }

/* Login */
.login-wrapper { display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(135deg, var(--brand) 0%, #003d24 100%); }
.login-card { background: var(--white); padding: 40px; border-radius: 16px; box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; text-align: center; border-top: 6px solid var(--accent); }
.login-logo i { font-size: 50px; color: var(--brand); margin-bottom: 10px; }
.login-logo h2 { margin: 0; color: var(--text); font-weight: 800; font-size: 26px;}
.login-logo p { color: var(--text-muted); font-size: 14px; margin-top: 5px; margin-bottom: 30px; }
.login-card .input-group { text-align: left; margin-bottom: 20px; }
.login-card .input-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.login-card .input-group input { width: 100%; padding: 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; box-sizing: border-box; transition: 0.3s; background: #F8FAFC;}
.login-card .input-group input:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(0, 107, 63, 0.1); background: var(--white);}
.btn-login { width: 100%; background: var(--brand); color: var(--white); padding: 14px; font-size: 16px; justify-content: center; margin-top: 10px; border-radius: 8px;}
.btn-login:hover { background: var(--brand-hover); }
.login-error { color: var(--btn-reprove); font-size: 13px; margin-bottom: 15px; display: none; font-weight: 600; }

/* Main App */
#mainApp { padding: 30px; max-width: 1400px; margin: 0 auto; }
.top-panel { background: var(--white); padding: 25px 30px; border-radius: 16px; box-shadow: var(--shadow-sm); border-top: 5px solid var(--brand); display: flex; flex-wrap: wrap; gap: 30px; align-items: flex-end; margin-bottom: 25px; }
.title-box h1 { margin: 0; color: var(--brand); font-size: 26px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.title-box p { margin: 5px 0 0; color: var(--text-muted); font-size: 14px; }

.status-connection { font-size: 12px; margin-top: 10px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px;}
.status-online { background: #D1FAE5; color: #065F46; border: 1px solid #A7F3D0;}
.status-offline { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA;}

.control-group { display: flex; flex-direction: column; }
.control-group label { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

input[type="date"], input[type="text"], select { padding: 12px 15px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; transition: 0.2s; font-family: 'Inter', sans-serif; background: #F8FAFC;}
input[type="date"] { border-color: var(--brand); background: #F0FDF4; font-weight: 600; color: var(--brand); }
input#approverName { width: 220px; border-left: 4px solid var(--accent); font-weight: 600;}
input:focus, select:focus { border-color: var(--brand); background: var(--white);}

/* Buttons */
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.btn { padding: 12px 18px; border: none; border-radius: 8px; cursor: pointer; color: white; font-weight: 600; display: flex; align-items: center; gap: 8px; font-size: 13px; transition: all 0.2s; box-shadow: var(--shadow-sm); font-family: 'Inter', sans-serif;}
.btn:hover { opacity: 0.9; transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-save { background: var(--brand); }
.btn-reprove { background: var(--btn-reprove); }
.btn-undo { background: var(--btn-undo); color: #fff;}
.btn-manage { background: var(--manage-btn); }
.btn-excel-day { background: var(--excel-day); }
.btn-excel-period { background: var(--excel-period); }

/* Navigation & Tabs */
.main-tabs { display: flex; gap: 15px; margin-bottom: 25px; border-bottom: 2px solid var(--border); padding-bottom: 15px;}
.main-tab { background: transparent; border: none; font-size: 16px; font-weight: 700; color: var(--text-muted); padding: 12px 25px; cursor: pointer; transition: 0.3s; border-radius: 8px; display:flex; align-items:center; gap:8px;}
.main-tab.active { background: var(--brand); color: white; box-shadow: var(--shadow-md);}
.main-tab:hover:not(.active) { background: #E2E8F0; color: var(--text);}

.view-section { display: none; }
.view-section.active { display: block; animation: fadeIn 0.4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Sector Tabs */
.sector-tabs { display: flex; gap: 10px; margin-bottom: 20px;}
.sector-tab { background: var(--white); border: 1px solid var(--border); padding: 12px 25px; border-radius: 8px; font-weight: 700; color: var(--text); cursor: pointer; transition: 0.2s; box-shadow: var(--shadow-sm); display:flex; align-items:center; gap:8px;}
.sector-tab.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* Action Bar Day */
.action-bar-day { display: flex; justify-content: space-between; align-items: flex-end; background: var(--white); padding: 25px; border-radius: 16px; margin-bottom: 25px; box-shadow: var(--shadow-sm); border: 1px solid var(--border);}
.action-buttons-group { display: flex; gap: 10px; }

/* Cards Resumo */
.summary-bar { display: flex; gap: 20px; margin-bottom: 25px; }
.card { background: var(--white); padding: 25px; border-radius: 16px; flex: 1; box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 20px; border-left: 6px solid; border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);}
.card-ok { border-left-color: var(--brand); }
.card-ok .card-icon { color: var(--brand); background: #F0FDF4;}
.card-pending { border-left-color: var(--accent); }
.card-pending .card-icon { color: #D97706; background: #FEF3C7;}
.card-total { border-left-color: var(--manage-btn); }
.card-total .card-icon { color: var(--manage-btn); background: #EFF6FF;}
.card-icon { font-size: 28px; width: 65px; height: 65px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }
.card-info h3 { margin: 0; font-size: 32px; font-weight: 800; color: var(--text); line-height: 1; }
.card-info span { font-size: 13px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; margin-top:5px; display:block;}

/* Tabela e Filiais */
.branch-block { background: var(--white); margin-bottom: 25px; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.branch-head { background: #F8FAFC; padding: 18px 25px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
.branch-name { font-weight: 800; color: var(--text); font-size: 17px; display: flex; align-items: center; gap: 10px;}
.branch-name i { color: var(--brand); font-size: 18px;}
.btn-branch-approve { background: var(--white); color: var(--brand); border: 1px solid var(--brand); padding: 8px 15px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 700; transition: 0.2s; box-shadow: var(--shadow-sm);}
.btn-branch-approve:hover { background: var(--brand); color: var(--white); }

table.modern-table { width: 100%; border-collapse: collapse; }
table.modern-table th { text-align: left; padding: 15px 25px; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); background: var(--white);}
table.modern-table td { padding: 15px 25px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; color: var(--text); font-weight: 500;}
table.modern-table tr:hover { background: #F8FAFC; }

.obs-input { width: 100%; border: 1px solid transparent; background: transparent; padding: 10px; font-size: 13px; border-radius: 6px; transition: 0.2s; font-family: 'Inter', sans-serif;}
.obs-input:focus, .obs-input:hover { border: 1px solid var(--border); background: var(--white); outline: none; box-shadow: var(--shadow-sm);}

.status-badge { padding: 8px 14px; border-radius: 20px; font-size: 12px; font-weight: 800; cursor: pointer; display: inline-block; width: 100px; text-align: center; transition: 0.2s; user-select: none; border: 1px solid transparent;}
.status-badge:hover { filter: brightness(0.95); transform: scale(1.05); }
.st-pendente { background: #FEF3C7; color: #D97706; border-color: #FDE68A;}
.st-ok { background: #D1FAE5; color: #065F46; border-color: #A7F3D0;}
.st-erro { background: #FEE2E2; color: #991B1B; border-color: #FECACA;}

/* Individual Panel */
.individual-panel { background: var(--white); padding: 30px; border-radius: 16px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 30px;}
.indiv-top-section { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
.indiv-search-area input { flex: 1; padding: 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px;}
.date-range-row { display: flex; gap: 15px; margin-top: 5px; }
.indiv-bulk-actions { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--border);}
.individual-actions { display: flex; gap: 10px; margin-top: 8px; }
.individual-actions button { flex: 1; padding: 12px; font-size: 13px; justify-content: center; }

.search-result-box { padding: 20px; background: #F8FAFC; border-radius: 8px; display: none; border: 1px solid var(--border); font-size: 15px; margin-top: 15px; line-height: 1.6; }

/* Tabela Periodo Individual */
.indiv-period-container { border-top: 2px solid var(--border); padding-top: 20px; }
.indiv-period-container h3 { color: var(--brand); margin-top: 0; margin-bottom: 15px; font-size: 18px; display: flex; align-items: center; gap: 8px;}
.btn-small { padding: 8px 12px; font-size: 11px; border-radius: 6px; font-weight: 700; box-shadow: none;}

/* Modais */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(15, 23, 42, 0.7); backdrop-filter: blur(4px); z-index: 1000; justify-content: center; align-items: center; }
.modal-content { background: var(--white); padding: 30px; border-radius: 16px; width: 650px; max-width: 95%; box-shadow: var(--shadow-lg); animation: modalFadeIn 0.3s ease-out; }
@keyframes modalFadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; border-bottom: 1px solid var(--border); padding-bottom: 15px;}
.modal-header h2 { margin: 0; font-size: 20px; color: var(--text); display: flex; align-items: center; gap: 10px; font-weight: 800;}
.close-btn { cursor: pointer; font-size: 24px; color: var(--text-muted); transition: 0.2s; line-height: 1;}
.close-btn:hover { color: var(--btn-reprove); }
.add-form { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.input-wrap { display: flex; flex-direction: column; gap: 5px;}
.input-wrap label { font-size: 12px; font-weight: 700; color: var(--text-muted);}
.add-form input, .add-form select { width: 100%; box-sizing: border-box; }
.full-width { grid-column: span 2; }
.manage-list { max-height: 400px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: #F8FAFC;}
.manage-item { display: flex; justify-content: space-between; padding: 12px 15px; border-bottom: 1px solid var(--border); font-size: 13px; align-items: center; }
.manage-item:hover { background: var(--white); }
.btn-del { background: var(--btn-reprove); color: white; border: none; border-radius: 6px; padding: 8px 12px; cursor: pointer; transition: 0.2s;}
.btn-del:hover { background: #B91C1C; }
