/* EF Tecidos — operational dashboard */
:root {
  --bg: #f5f7fa;
  --surface: #fff;
  --text: #182739;
  --muted: #768395;
  --border: #e5eaf0;
  --primary: #245bd6;
  --primary-light: #f0f5ff;
  --green: #13876b;
  --green-bg: #eef9f4;
  --amber: #ad7614;
  --amber-bg: #fff8e9;
  --red: #c54b4b;
  --red-bg: #fff2f2;
  --radius: 12px;
  --shadow: 0 2px 4px #152d4d03;
  --shadow-md: 0 8px 24px #152d4d0a;
}
body { font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif; font-size: 13px; -webkit-font-smoothing: antialiased; }
button, input, select { font-family: inherit; }
button { touch-action: manipulation; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 3px solid #73a0f5; outline-offset: 3px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 230px; background: #111f32; color: #fff; z-index: 110; display: flex; flex-direction: column; padding: 30px 16px 20px; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; margin: 0 10px 48px; color: #fff; text-decoration: none; font-size: 17px; font-weight: 650; letter-spacing: -.4px; }
.brand-monogram { display: grid; place-content: center; position: relative; width: 42px; height: 42px; border-radius: 12px; background: #2c62dc; font-size: 19px; font-weight: 750; letter-spacing: -1px; }
.brand-monogram > span { position: absolute; right: 7px; bottom: 7px; color: #98bdff; }
.sidebar-brand small { display: block; margin-top: 5px; color: #92a2b8; font-size: 10px; letter-spacing: .2px; font-weight: 400; }
.sidebar-caption { color: #75869e; letter-spacing: 1.8px; font-size: 9px; font-weight: 650; margin: 0 14px 14px; }
#view-tabs { display: flex; flex-direction: column; gap: 5px; }
.view-tab { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; text-align: left; font-size: 12px; background: transparent; border: 0; border-radius: 8px; color: #a6b4c8; font-weight: 500; }
.view-tab svg { flex: 0 0 auto; width: 18px; height: 18px; opacity: .9; }
.view-tab:hover { color: white; background: #1d3049; border: 0; }
.view-tab.active { color: #fff; background: #2456c5; box-shadow: 0 4px 12px #00000014; }
.sidebar-footer { margin-top: auto; padding: 20px 8px 0; border-top: 1px solid #ffffff12; display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 600; }
.sidebar-footer small { display: block; color: #7f92ad; margin-top: 4px; font-size: 10px; font-weight: 400; }
.workspace-avatar { width: 32px; height: 32px; display: grid; place-items: center; background: #26354b; border-radius: 8px; font-size: 11px; color: #b9c8df; }
.workspace-dot { width: 6px; height: 6px; background: #4b91f1; border-radius: 50%; margin-left: auto; }
.header { margin-left: 230px; height: 72px; padding: 0 36px; background: #fff; box-shadow: none; gap: 16px; }
.header > .header-logo { display: none; }
.header-title { display: flex; gap: 14px; font-size: 12px; color: #8a96a7; }
.header-title strong { color: #35465e; font-weight: 500; }
.header-breadcrumb { color: #c4ccd6; }
.header-status { font-size: 11px; }
.status-dot { width: 6px; height: 6px; }
.btn-refresh, .btn-logout { padding: 9px 13px; border-radius: 7px; font-size: 11px; font-weight: 500; }
.btn-refresh { color: #344866; }
.btn-logout { border-color: transparent; }
.main { margin-left: 230px; max-width: none; padding: 32px 36px 48px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.eyebrow { display: block; font-size: 9px; font-weight: 700; letter-spacing: 2px; color: #7d8a9e; margin-bottom: 9px; }
.page-heading h1 { font-size: clamp(23px, 2.1vw, 30px); letter-spacing: -.85px; line-height: 1.25; font-weight: 650; color: #172a44; }
.page-heading p { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 8px; }
.heading-date { display: flex; gap: 8px; align-items: center; color: #65758a; background: white; padding: 10px 12px; border: 1px solid var(--border); border-radius: 7px; font-size: 11px; white-space: nowrap; }
.heading-date svg { width: 15px; height: 15px; }
.stats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { position: relative; padding: 20px 18px; min-height: 126px; align-items: flex-start; flex-direction: column; gap: 13px; border-color: var(--border); box-shadow: var(--shadow); }
.stat-card > div:last-child { width: 100%; }
.stat-card.active { background: white; border-color: #b7c9ed; }
.stat-card.active::after { content: ''; position: absolute; left: 18px; right: 18px; bottom: 0; height: 3px; background: var(--primary); border-radius: 2px 2px 0 0; }
.stat-icon { width: 32px; height: 32px; border-radius: 8px; position: absolute; right: 16px; top: 18px; color: var(--primary); background: #f0f5ff; }
.stat-icon svg { width: 17px; height: 17px; }
.stat-icon-truck { background: #f1f5fe; color: #5279bb; }
.stat-icon-alert { background: #fff4ed; color: #c68148; }
.stat-icon-clock { background: #f5f1fe; color: #9473c4; }
.stat-icon-check { background: #edf8f4; color: #239174; }
.stat-label { font-size: 11px; font-weight: 500; margin: 0 30px 13px 0; line-height: 1.4; color: #6e7d91; min-height: 16px; }
.stat-value { font-size: 29px; line-height: 1; color: #1d314d; font-weight: 650; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.stat-scope { font-size: 10px; color: #98a2b0; margin-top: 9px; }
.delivery-overview { background: white; border: 1px solid var(--border); border-radius: var(--radius); display: grid; grid-template-columns: 1.2fr repeat(3, 1fr); margin-bottom: 20px; min-height: 78px; }
.delivery-overview-title { padding: 18px 20px; display: flex; align-items: center; gap: 11px; color: #536d92; }
.delivery-overview-title svg { width: 20px; height: 20px; flex-shrink: 0; }
.delivery-overview-title strong { display: block; color: #354760; font-size: 12px; font-weight: 600; }
.delivery-overview-title small { display: block; color: #94a0b0; font-size: 10px; margin-top: 5px; }
.delivery-metric { display: flex; align-items: center; gap: 9px; border: 0; border-left: 1px solid var(--border); background: transparent; cursor: pointer; padding: 18px; font-size: 11px; color: #748298; text-align: left; }
.delivery-metric:hover, .delivery-metric.active { background: var(--primary-light); }
.delivery-metric:last-child { border-radius: 0 12px 12px 0; }
.delivery-metric strong { font-size: 22px; font-weight: 650; color: #2a3d58; margin-left: auto; font-variant-numeric: tabular-nums; }
.metric-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; background: #94a3b8; }
.metric-dot.today { background: #3b78df; }
.metric-dot.overdue { background: #d88b4d; }
.health-grid { background: transparent; margin: 0 0 5px; gap: 18px; }
.health-card { background: transparent; border: 0; padding: 2px 0; gap: 8px; align-items: center; }
.health-title { font-size: 10px; color: #7c8ba0; font-weight: 500; }
.health-value { font-size: 10px; color: #6c7b90; margin-top: 3px; }
.health-dot { width: 5px; height: 5px; margin-top: 0; }
.timezone-note { font-size: 9px; color: #96a2b3; margin: 0 0 16px; }
.maintenance { background: transparent; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; margin-bottom: 24px; }
.maintenance summary { padding: 11px 0 14px; font-size: 11px; color: #60718a; }
.maintenance summary span { font-size: 10px; font-weight: 400; color: #9aa5b5; margin-left: 10px; }
.maintenance-actions { padding: 2px 0 18px; }
.maintenance-actions button { font-size: 11px !important; }
.filters { display: grid; grid-template-columns: minmax(200px, 1fr) auto auto; gap: 14px; padding: 22px; margin-bottom: 20px; box-shadow: none; }
.filter-heading { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; margin-bottom: 2px; }
.filter-heading strong { color: #34465f; font-size: 12px; font-weight: 600; }
.filter-heading span { color: #8e9bae; font-size: 10px; }
.search-wrap { min-width: 0; }
.search-input, .date-input, .delivery-select { border-radius: 7px; height: 38px; background: #fafbfd; border-color: #e4e9f1; color: #41546e; font-size: 11px; }
.search-input { padding-left: 36px; }
.date-input { width: 126px; padding: 7px; }
.filter-label { font-size: 10px; color: #8794a7; }
.btn-clear-date { height: 36px; font-size: 10px; }
.delivery-select { padding: 0 10px; min-width: 158px; border: 1px solid #e4e9f1; }
.status-pills { grid-column: 1 / -1; border-top: 1px solid #f0f3f7; padding-top: 15px; gap: 7px; }
.pill { padding: 6px 12px; font-size: 10px; border-radius: 6px; border-color: transparent; color: #7e8da1; background: transparent; }
.pill:hover { background: #f6f8fc; border-color: transparent; }
.pill.active { background: #edf3ff; border-color: #dce7fe; color: #3463b9; }
.table-wrap { box-shadow: none; }
.table-header { padding: 20px 22px; }
.table-title { color: #2b3e5a; font-size: 13px; font-weight: 600; }
.table-subtitle { color: #98a4b4; font-size: 10px; margin-top: 5px; line-height: 1.5; }
.table-count { font-size: 10px; padding: 5px 9px; background: #f2f5fa; color: #6e8099; border-radius: 5px; white-space: nowrap; }
thead th { padding: 14px 18px; font-size: 9px; letter-spacing: .7px; color: #7d8ca0; background: #fafbfd; border-color: #edf1f6; font-weight: 600; }
td { padding: 22px 18px; }
tbody tr { border-color: #eef2f7; }
tbody tr:hover { background: #fafcff; }
.nf-num { color: #334f78; font-size: 12px; font-weight: 650; }
.nf-dest { color: #52627a; font-size: 11px; margin-top: 5px; line-height: 1.4; min-width: 130px; }
.nf-carrier { font-size: 9px; font-style: normal; color: #96a3b5; margin-top: 5px; }
.pipeline { min-width: 245px; }
.journey-label { font-size: 8px; }
.journey-marker { width: 13px; height: 13px; border-width: 1.5px; font-size: 8px; }
.journey::before { top: 32px; height: 1px; }
.journey-truck { width: 21px; height: 16px; top: -23px; }
.journey-meta { font-size: 8px; margin-top: 8px; }
.badge { font-size: 9px; font-weight: 550; padding: 5px 8px; border-radius: 5px; white-space: nowrap; }
.badge::before { content: ''; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.badge-rota { background: #eff5ff; color: #4879c3; }
.badge-transito { background: #f0f5fd; color: #617fac; }
.badge-entregue { color: #23886c; }
.badge-ocorrencia { color: #be6d3a; background: #fff5ed; }
.notif-chip { font-size: 9px; border: 0; border-radius: 5px; padding: 5px 7px; }
.time-cell { font-size: 10px; color: #8593a7; white-space: nowrap; }
.archive-row { display: grid; place-items: center; flex-shrink: 0; width: 27px; height: 27px; border: 1px solid transparent; border-radius: 5px; color: #a2aec0; background: transparent; cursor: pointer; }
.archive-row:hover { background: #fff2f2; color: var(--red); border-color: #f5dcdc; }
.nf-open { font: inherit; background: transparent; border: 0; padding: 0; color: inherit; cursor: pointer; text-align: left; }
.nf-open:hover { text-decoration: underline; }
.stat-card { text-align: left; font-family: inherit; }
.header .brand-monogram { width: 27px; height: 27px; font-size: 12px; border-radius: 7px; color: #fff; }
.header .brand-monogram > span { right: 4px; bottom: 4px; }
.delivery-cell { min-width: 132px; }
.delivery-date { color: #30476a; font-size: 12px; font-weight: 650; letter-spacing: -.2px; white-space: nowrap; }
.delivery-state { display: inline-flex; align-items: center; gap: 5px; font-size: 9px; color: #7790b2; margin-top: 6px; white-space: nowrap; }
.delivery-state > span { width: 4px; height: 4px; border-radius: 50%; background: currentColor; }
.delivery-cell.today .delivery-state { color: #356fd0; }
.delivery-cell.overdue .delivery-state, .delivery-cell.overdue .delivery-date { color: #be773d; }
.delivery-cell.delivered .delivery-state { color: #23886c; }
.delivery-cell.unknown .delivery-date { font-size: 11px; color: #94a1b3; font-weight: 500; }
.delivery-cell.unknown .delivery-state { color: #a2adbc; }
.delivery-cell.expanded { margin-bottom: 22px; padding: 22px; border: 1px solid #dfe8f6; background: #f6f9ff; border-radius: 10px; }
.delivery-cell.expanded.overdue { background: #fffaf4; border-color: #f2e3d0; }
.delivery-cell.expanded.delivered { background: #f3faf7; border-color: #d8ece3; }
.delivery-cell.expanded.unknown { background: #f8fafc; border-color: var(--border); }
.delivery-eyebrow { font-size: 9px; letter-spacing: 1.2px; color: #8293aa; font-weight: 650; margin-bottom: 10px; }
.expanded .delivery-date { font-size: 25px; }
.expanded .delivery-state { font-size: 11px; margin-top: 9px; }
.expanded p { font-size: 11px; line-height: 1.7; color: #8794a8; margin-top: 10px; }
.modal { border-radius: 0; box-shadow: -8px 0 48px #162a4b18; }
.modal-head { padding: 28px; }
.modal-body { padding: 26px 28px; }
.modal-title { color: #2a4164; font-size: 22px; }
.info-item { background: #f8fafc; padding: 13px 14px; }
.info-key { font-size: 9px; color: #8c9aae; }
.info-val { color: #4c607d; font-size: 12px; line-height: 1.5; word-break: break-word; }
.timeline-title { font-size: 10px; letter-spacing: .8px; color: #8292a8; }
.empty { padding: 60px 22px; color: #98a5b7; font-size: 12px; }
.demo-banner { font-size: 10px; margin-bottom: 22px; }
@media (min-width: 1700px) { .main { padding: 40px 48px; } .header { padding: 0 48px; } td { padding: 25px 22px; } .pipeline { min-width: 300px; } }
@media (max-width: 1350px) {
  .sidebar { width: 205px; padding-left: 12px; padding-right: 12px; }
  .header, .main { margin-left: 205px; }
  .main { padding: 28px 24px; }
  .header { padding: 0 24px; }
  .stats-grid { gap: 10px; }
  .stat-card { padding: 18px 14px; }
  .stat-icon { right: 12px; width: 27px; height: 27px; }
  .stat-label { font-size: 10px; min-height: 28px; }
  .delivery-overview { grid-template-columns: 1fr repeat(3, 1fr); }
  .delivery-metric { padding: 14px; font-size: 10px; }
  .filters { grid-template-columns: 1fr auto; }
  .delivery-select { grid-column: 2; }
  .search-wrap { grid-row: 2; }
  .date-wrap { grid-column: 1; grid-row: 3; }
}
@media (max-width: 1050px) {
  .heading-date { display: none; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-card { min-height: 115px; }
  .stat-label { min-height: 0; }
  .delivery-overview { grid-template-columns: repeat(3, 1fr); }
  .delivery-overview-title { grid-column: 1 / -1; border-bottom: 1px solid var(--border); padding: 13px 18px; }
  .delivery-overview-title small { display: inline; margin-left: 8px; }
  .delivery-overview-title strong { display: inline; }
  .delivery-metric:nth-child(2) { border-left: 0; }
  .health-grid { gap: 10px; }
}
@media (max-width: 768px) {
  .header { margin-left: 0; padding: 0 18px; height: 62px; gap: 10px; }
  .header > .header-logo { display: flex; font-size: 14px; color: #243c61; }
  .header-logo svg { width: 23px; height: 23px; }
  .header-title { display: none; }
  .sidebar { position: sticky; top: 62px; width: 100%; padding: 8px 12px; background: #111f32; z-index: 90; }
  .sidebar-brand, .sidebar-caption, .sidebar-footer { display: none; }
  #view-tabs { flex-direction: row; overflow-x: auto; gap: 4px; scrollbar-width: none; }
  .view-tab { flex: 0 0 auto; width: auto; padding: 10px; font-size: 10px; gap: 6px; }
  .view-tab svg { width: 15px; height: 15px; }
  .main { margin: 0; padding: 24px 18px 36px; }
  .page-heading { margin-bottom: 22px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 11px; max-width: 360px; }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .health-title { font-size: 9px; }
  .health-value { font-size: 9px; line-height: 1.5; }
  .filters { padding: 18px; }
  .filter-heading { display: block; }
  .filter-heading span { display: block; margin-top: 5px; }
  .modal { width: 100%; }
  .modal-body, .modal-head { padding: 22px; }
  .journey-label { display: none; }
  .pipeline { min-width: 245px; }
}
@media (max-width: 600px) {
  .main { padding: 22px 14px 32px; }
  .eyebrow { font-size: 8px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-card { min-height: 120px; padding: 17px 14px; }
  .stat-label { font-size: 10px; margin-right: 30px; min-height: 26px; }
  .stat-value { font-size: 27px; }
  .stat-scope { font-size: 9px; }
  .delivery-overview { grid-template-columns: 1fr; }
  .delivery-overview-title { grid-column: 1; }
  .delivery-metric { padding: 12px 18px; border-left: 0; border-bottom: 1px solid #f0f3f7; font-size: 11px; }
  .delivery-metric strong { font-size: 20px; }
  .delivery-metric:last-child { border-radius: 0 0 12px 12px; border-bottom: 0; }
  .health-grid { grid-template-columns: 1fr; gap: 9px; }
  .health-card > div { display: flex; flex-wrap: wrap; gap: 4px 8px; }
  .health-value { margin-top: 0; }
  .timezone-note { text-align: left; margin-top: 8px; }
  .maintenance summary span { display: none; }
  .filters { display: flex; flex-direction: column; align-items: stretch; gap: 12px; padding: 16px; overflow: visible; }
  .search-wrap { flex: auto; }
  .date-wrap { width: 100%; flex-wrap: wrap; }
  .date-input { flex: 1; min-width: 102px; width: 102px; }
  .date-wrap .filter-label { font-size: 9px; }
  .status-pills { gap: 5px; }
  .pill { font-size: 10px; padding: 6px 9px; }
  .table-header { padding: 18px 16px; }
  .table-subtitle { max-width: 230px; }
  #view-nfs tbody tr:not(.skeleton) { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; padding: 20px 16px; }
  #view-nfs td { padding: 0; min-width: 0; }
  #view-nfs td::before { font-size: 8px; color: #98a5b8; letter-spacing: .5px; margin-bottom: 7px; }
  #view-nfs td[data-label="NF / Cliente"] { grid-column: 1; }
  #view-nfs td[data-label="Data Emissão"] { grid-column: 2; }
  #view-nfs td[data-label="Etapas"] { grid-column: 1 / -1; margin: 0; padding: 4px 0 10px; border-bottom: 1px solid #edf1f7; }
  #view-nfs td[data-label="Etapas"]::before { display: none; }
  #view-nfs .pipeline { min-width: 0; }
  #view-nfs .journey-label { display: block; font-size: 8px; }
  #view-nfs .journey-meta { font-size: 9px; }
  #view-nfs td[colspan] { grid-column: 1 / -1; }
  #view-nfs td[colspan]::before { display: none; }
  .delivery-date { font-size: 13px; }
  .delivery-state { font-size: 9px; }
  .info-grid { grid-template-columns: 1fr; }
  .expanded .delivery-date { font-size: 23px; }
  .header-status { display: none; }
  .btn-refresh { font-size: 10px; }
  .view-tab { flex: 0 0 auto; }
}
