:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #0b1535;
  --muted: #65748b;
  --line: #dce4ef;
  --navy: #071f3f;
  --navy-2: #082a52;
  --teal: #078f93;
  --blue: #0b62ce;
  --green: #159447;
  --purple: #6d3ac6;
  --orange: #f17610;
  --red: #df1f32;
  --shadow: 0 16px 35px rgba(13, 30, 63, .08);
  --soft-shadow: 0 10px 25px rgba(13, 30, 63, .06);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.app-shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; background: linear-gradient(180deg, #062348, #051a33 58%, #031326); color: #fff; overflow: hidden;
}
.sidebar-bg {
  position: absolute; inset: auto 0 0; height: 46%; opacity: .32;
  background:
    linear-gradient(180deg, transparent, rgba(2, 10, 25, .95)),
    repeating-linear-gradient(72deg, transparent 0 23px, rgba(20, 145, 190, .55) 24px, transparent 26px),
    repeating-linear-gradient(108deg, transparent 0 28px, rgba(40, 110, 170, .45) 29px, transparent 31px),
    linear-gradient(90deg, transparent 48%, rgba(18, 170, 190, .32) 49%, transparent 52%);
}
.sidebar-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; padding: 78px 12px 20px; }
.side-nav { display: grid; gap: 10px; }
.side-link {
  display: flex; align-items: center; gap: 18px; color: rgba(255,255,255,.86); min-height: 58px; padding: 0 18px; border-radius: 10px;
  font-size: 18px; border: 1px solid transparent;
}
.side-link span { width: 30px; text-align: center; font-size: 22px; color: rgba(255,255,255,.84); }
.side-link strong { font-weight: 760; }
.side-link:hover, .side-link.active { background: linear-gradient(135deg, rgba(14, 91, 152, .95), rgba(10, 71, 126, .74)); text-decoration: none; border-color: rgba(255,255,255,.07); box-shadow: inset 0 1px rgba(255,255,255,.1); }
.collapse-hint { margin-top: auto; color: rgba(255,255,255,.82); display: flex; gap: 12px; align-items: center; font-size: 14px; padding: 12px 16px; }
.collapse-hint span { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: rgba(255,255,255,.12); }
.workspace { min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.app-topbar {
  height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 28px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(12px);
}
.brand-row { display: flex; align-items: center; gap: 18px; min-width: max-content; }
.hamburger { border: 0; background: transparent; color: #21324d; font-size: 26px; cursor: pointer; }
.brand { color: var(--text); font-size: 29px; font-weight: 850; letter-spacing: -.5px; }
.brand span, .screen-title h1 span, .login-hero h1 span { color: var(--teal); }
.top-actions { display: flex; align-items: center; gap: 18px; min-width: 0; }
.search-box { width: 360px; max-width: 30vw; height: 46px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 10px; padding: 0 15px; color: var(--muted); background: #fff; }
.search-box.light { max-width: 310px; width: 310px; }
.role-pill { border-radius: 999px; padding: 8px 15px; font-size: 13px; color: #fff; font-weight: 850; letter-spacing: .02em; }
.role-pill.admin { background: var(--teal); }
.role-pill.auditor { background: var(--purple); }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 12px; border-left: 1px solid var(--line); white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; background: var(--blue); font-weight: 850; font-size: 12px; flex: none; }
.avatar.sm { background: #eef2f7; color: var(--text); border: 1px solid var(--line); }
.avatar.tiny { width: 26px; height: 26px; font-size: 10px; }
.avatar.c1, .unit-icon.c1, .activity-dot.c1, .discipline-icon.c1 { background: var(--teal); }
.avatar.c2, .unit-icon.c2, .activity-dot.c2, .discipline-icon.c2 { background: var(--blue); }
.avatar.c3, .unit-icon.c3, .activity-dot.c3, .discipline-icon.c3 { background: var(--purple); }
.avatar.c4, .unit-icon.c4, .activity-dot.c4, .discipline-icon.c4 { background: var(--orange); }
.avatar.c5, .unit-icon.c5, .activity-dot.c5, .discipline-icon.c5 { background: var(--green); }
.avatar.c6, .unit-icon.c6, .activity-dot.c6, .discipline-icon.c6 { background: #334155; }
.logout-link { color: var(--muted); font-weight: 700; }
.content { padding: 26px 28px 70px; flex: 1; }
.footer { text-align: center; padding: 18px; color: #8b98ab; font-size: 13px; }

.messages { display: grid; gap: 8px; margin-bottom: 16px; }
.floating-messages { position: fixed; top: 18px; right: 18px; z-index: 10; width: min(440px, calc(100vw - 36px)); }
.alert { border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); background: #fff; box-shadow: var(--soft-shadow); }
.alert-success { color: #135d31; background: #f0fdf4; border-color: #c1f0cf; }
.alert-danger { color: #991b1b; background: #fff1f2; border-color: #fecdd3; }
.alert-warning { color: #92400e; background: #fffbeb; border-color: #fde68a; }

.screen-title { margin-bottom: 22px; }
.inline-title { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
h1 { margin: 0; font-size: 32px; line-height: 1.16; letter-spacing: -.6px; }
h2 { margin: 0 0 12px; font-size: 19px; }
h3 { margin: 0 0 10px; }
p { color: var(--muted); margin: 7px 0 0; line-height: 1.45; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.card-head span { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 26px; }
.small-empty { padding: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; padding: 9px 16px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; color: var(--text); font-weight: 850; cursor: pointer; text-decoration: none;
}
.btn:hover { text-decoration: none; filter: brightness(.98); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 8px 18px rgba(11, 98, 206, .2); }
.btn.success { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.danger-outline { border-color: #fecdd3; background: #fff1f2; color: #c0182b; }
.btn.cloud { border-color: var(--line); color: var(--text); background: #fff; }
.btn.small { min-height: 34px; font-size: 13px; padding: 7px 12px; }
.btn.full { width: 100%; }
.outline-teal { border-color: var(--teal); color: var(--teal); background: #fff; }
.outline-blue { border-color: var(--blue); color: var(--blue); background: #fff; }
.outline-purple { border-color: var(--purple); color: var(--purple); background: #fff; }

input, select, textarea {
  width: 100%; border: 1px solid #ccd6e4; border-radius: 10px; background: #fff; color: var(--text); padding: 11px 13px; outline: none;
}
select[multiple] { min-height: 115px; }
textarea { resize: vertical; min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(11, 98, 206, .1); }
label { display: grid; gap: 7px; color: #172342; font-weight: 760; font-size: 14px; }
label small { color: var(--muted); font-weight: 500; }
.form-stack { display: grid; gap: 15px; }

.login-screen { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; padding: 32px; background: #f7fafd; }
.login-hero { position: relative; overflow: hidden; border-radius: 18px 0 0 18px; background: linear-gradient(135deg, rgba(3,24,55,.98), rgba(7,56,100,.9)), radial-gradient(circle at 70% 52%, rgba(6, 149, 164, .4), transparent 34%); }
.rail-lines { position: absolute; inset: 0; opacity: .38; background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.08) 20.3%, transparent 20.8%), repeating-linear-gradient(78deg, transparent 0 38px, rgba(43,178,210,.24) 40px, transparent 42px), repeating-linear-gradient(105deg, transparent 0 46px, rgba(255,255,255,.12) 48px, transparent 50px), linear-gradient(90deg, transparent 49%, rgba(18,177,191,.4) 50%, transparent 51%); }
.login-hero-content { position: relative; z-index: 1; color: #fff; padding: 90px 76px; height: 100%; }
.login-hero h1 { font-size: 40px; margin: 0; }
.accent-line { width: 68px; height: 4px; border-radius: 4px; background: var(--teal); margin: 22px 0 28px; }
.login-hero p { color: rgba(255,255,255,.9); font-size: 22px; margin-bottom: 46px; }
.security-card { width: 360px; min-height: 94px; display: flex; align-items: center; gap: 20px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.08); border-radius: 12px; padding: 18px 22px; margin-bottom: 16px; backdrop-filter: blur(8px); }
.security-card strong, .security-card small { display: block; }
.security-card strong { font-size: 18px; }
.security-card small { color: rgba(255,255,255,.84); margin-top: 8px; }
.security-icon { width: 46px; height: 46px; display: grid; place-items: center; font-size: 28px; border-radius: 50%; }
.security-icon.shield { color: #16c4bd; }
.security-icon.lock { color: #2587ff; }
.login-note { position: absolute; bottom: 70px; left: 76px; color: rgba(255,255,255,.78); font-size: 14px; line-height: 1.55; }
.login-panel-wrap { display: grid; place-items: center; background: #fff; border-radius: 0 18px 18px 0; box-shadow: var(--shadow); }
.login-panel { width: min(670px, 80%); padding: 28px 34px; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--soft-shadow); }
.login-icon { width: 92px; height: 92px; border-radius: 50%; background: #eef3f8; display: grid; place-items: center; margin: 0 auto 22px; font-size: 42px; }
.login-panel h2 { font-size: 28px; text-align: center; margin-bottom: 4px; }
.login-panel p { text-align: center; margin-bottom: 34px; }
.input-icon { display: flex; align-items: center; gap: 12px; border: 1px solid #d5deea; border-radius: 10px; padding: 0 14px; }
.input-icon input { border: 0; box-shadow: none; padding-left: 0; }
.input-icon input:focus { box-shadow: none; }
.login-options { display: flex; justify-content: space-between; align-items: center; }
.checkline { display: inline-flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; font-weight: 500; color: var(--muted); }
.checkline input { width: auto; accent-color: var(--teal); }
.divider { display: flex; align-items: center; color: var(--muted); margin: 24px 0; }
.divider:before, .divider:after { content: ""; flex: 1; height: 1px; background: var(--line); }
.divider span { padding: 0 20px; }
.login-help { margin-top: 24px; text-align: center; color: var(--muted); line-height: 1.45; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 18px; }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-card { display: flex; align-items: center; gap: 24px; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--soft-shadow); padding: 22px 24px; min-height: 120px; }
.kpi-icon { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 28px; font-weight: 900; flex: none; }
.kpi-icon.teal { background: var(--teal); }
.kpi-icon.blue { background: var(--blue); }
.kpi-icon.green { background: var(--green); }
.kpi-icon.navy { background: #063a68; }
.kpi-icon.purple { background: var(--purple); }
.kpi-card span, .kpi-card small { display: block; color: var(--muted); }
.kpi-card span { color: var(--text); font-weight: 780; margin-bottom: 8px; }
.kpi-card strong { display: block; font-size: 32px; line-height: 1; margin-bottom: 8px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 18px; align-items: start; }
.stack-panels { display: grid; gap: 18px; }
.clean-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.clean-table th { color: #243553; font-size: 12px; text-align: left; padding: 14px 12px; border-bottom: 1px solid var(--line); font-weight: 850; }
.clean-table td { padding: 13px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.clean-table td small, .unit-row small, .access-item small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
.table-wrap { overflow-x: auto; }
.route-line { display: inline-block; width: 34px; height: 5px; border-radius: 99px; margin-right: 12px; vertical-align: middle; background: var(--teal); }
.route-line.c2, .mini-progress .c2 { background: var(--blue); }
.route-line.c3 { background: var(--purple); }
.route-line.c4 { background: var(--orange); }
.route-line.c5 { background: var(--green); }
.mini-progress { height: 8px; background: #dfe6ee; border-radius: 99px; width: 130px; display: inline-block; overflow: hidden; vertical-align: middle; margin-right: 8px; }
.mini-progress span { display: block; height: 100%; background: var(--teal); border-radius: inherit; }
.big-progress { height: 10px; background: #e0e5ec; border-radius: 99px; overflow: hidden; min-width: 220px; flex: 1; }
.big-progress b { display: block; height: 100%; background: var(--purple); border-radius: inherit; }
.ok { color: var(--green); font-weight: 800; }
.blue-text { color: var(--blue); font-weight: 800; }
.activity-list, .access-list { display: grid; gap: 12px; }
.activity-item { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; }
.activity-dot { width: 38px; height: 38px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-weight: 850; }
.activity-item em, .access-item em { color: var(--muted); font-size: 12px; font-style: normal; }
.access-item { display: grid; grid-template-columns: 32px 1fr 80px auto; align-items: center; gap: 10px; min-height: 40px; }
.disciplines-card { margin-top: 18px; }
.discipline-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.discipline-tile { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 10px; min-height: 152px; }
.discipline-icon { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 900; }
.tile-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tile-footer span { padding: 5px 9px; border-radius: 99px; background: #eaf4ff; color: var(--blue); font-size: 12px; font-weight: 700; }

.auditor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; }
.filter-row { display: grid; grid-template-columns: repeat(4, 1fr) auto; align-items: end; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.clear-link { padding-bottom: 12px; white-space: nowrap; }
.unit-list { margin-top: 8px; }
.unit-list-head, .unit-row { display: grid; grid-template-columns: 2.3fr 1.1fr 1.1fr 1.2fr 1.35fr 1fr 1fr; gap: 14px; align-items: center; }
.unit-list-head { color: #22324d; font-size: 13px; font-weight: 850; padding: 14px 12px; border-bottom: 1px solid var(--line); }
.unit-row { min-height: 94px; border-bottom: 1px solid var(--line); padding: 14px 12px; }
.unit-name { display: flex; align-items: center; gap: 16px; }
.unit-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 900; flex: none; }
.unit-discipline { display: grid; place-items: center; gap: 3px; color: var(--blue); }
.badge { display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 850; white-space: nowrap; }
.status-not_started { background: #eef2f7; color: #334155; }
.status-in_progress { background: #e7f0ff; color: #0959bc; }
.status-paused { background: #fff0cd; color: #94560a; }
.status-finalized { background: #dcfce7; color: #166534; }
.good { background: #e8faef; color: var(--green); border: 1px solid #bfe9ce; }
.danger-badge { background: #fff1f2; color: var(--red); border: 1px solid #fecdd3; }
.queue-panel { display: grid; gap: 18px; }
.queue-card { border: 1px solid var(--line); border-left: 4px solid #94a3b8; border-radius: 12px; padding: 16px; margin-top: 12px; }
.queue-card.blue { border-left-color: var(--blue); }
.queue-card.green { border-left-color: var(--green); }
.queue-card span, .queue-card small { color: var(--muted); display: block; }
.queue-card strong { display: block; font-size: 30px; margin: 8px 0; }
.tip-card { background: #f9fcff; }

.import-layout, .log-layout, .audit-exec-layout, .user-layout { display: grid; gap: 20px; align-items: start; }
.import-layout { grid-template-columns: minmax(0, 1fr) 430px; }
.import-main { display: grid; gap: 20px; }
.dropzone { display: grid; place-items: center; gap: 8px; min-height: 190px; border: 1px dashed #9db2cb; border-radius: 14px; background: #fbfdff; cursor: pointer; text-align: center; }
.dropzone input { display: none; }
.drop-icon { color: var(--blue); font-size: 44px; }
.dropzone em { color: var(--teal); border: 1px solid var(--teal); border-radius: 8px; padding: 10px 18px; font-style: normal; font-weight: 850; }
.file-feedback { color: var(--muted); font-size: 13px; }
.discipline-select-line { display: grid; grid-template-columns: 1fr 210px; gap: 14px; align-items: end; }
.check-list { list-style: none; display: grid; gap: 12px; padding: 0; margin: 20px 0 0; color: #334155; }
.check-list li:before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #20ad6b; color: #fff; margin-right: 10px; font-weight: 900; }
.import-side { display: grid; gap: 20px; }
.summary-line { display: flex; align-items: center; gap: 20px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-top: 12px; }
.summary-line strong { display: block; font-size: 28px; }
.summary-line small { color: var(--muted); }
.link-row { display: block; margin-top: 18px; font-weight: 850; }
.actions-panel { display: grid; gap: 14px; }
.side-note { font-size: 13px; }
.excel-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 4px; background: #19934e; color: #fff; font-weight: 900; margin-right: 10px; }
.discipline-inline { display: inline-grid; place-items: center; width: 28px; height: 28px; color: var(--blue); margin-right: 8px; }
.row-actions { display: flex; gap: 12px; align-items: center; }
.row-actions a, .row-actions span, .icon-btn { color: #183252; border: 0; background: transparent; font-size: 18px; cursor: pointer; }
.row-actions form { margin: 0; }

.user-layout { grid-template-columns: minmax(0, 1fr) 440px; }
.user-main { min-width: 0; }
.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.drawer-panel { background: #fff; border-left: 1px solid var(--line); box-shadow: -10px 0 35px rgba(13,30,63,.06); border-radius: 0; padding: 30px; min-height: calc(100vh - 150px); }
.drawer-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 24px; }
.drawer-head h2 { font-size: 24px; margin-bottom: 6px; }
.drawer-head a { color: var(--text); font-size: 28px; }
.info-box { padding: 14px; border: 1px solid #b8d4fb; background: #eef6ff; border-radius: 10px; color: #274469; font-size: 13px; }
.drawer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.pagination-lite { display: flex; justify-content: space-between; align-items: center; gap: 14px; color: var(--muted); padding-top: 14px; }
.pagination-lite button, .pagination-lite a { min-width: 34px; height: 34px; display: inline-grid; place-items: center; border: 1px solid var(--line); background: #fff; border-radius: 8px; margin-left: 5px; color: var(--text); }
.pagination-lite .active { background: var(--blue); color: #fff; border-color: var(--blue); }

.audit-header { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; gap: 16px; margin-bottom: 18px; }
.back-btn { width: 50px; height: 50px; border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; font-size: 32px; color: var(--text); background: #fff; }
.audit-title h1 { font-size: 26px; }
.audit-actions { display: flex; gap: 14px; }
.audit-exec-layout { grid-template-columns: minmax(0, 1fr) 430px; }
.audit-main-card { display: grid; gap: 16px; }
.summary-strip { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.summary-strip > div { border-right: 1px solid var(--line); padding-right: 12px; }
.summary-strip > div:last-child { border-right: 0; }
.summary-strip span, .selected-meta span, .selected-progress span { color: var(--muted); display: block; font-size: 13px; margin-bottom: 8px; }
.audit-progress-line { display: flex; align-items: center; gap: 14px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.checklist-card { padding: 0; overflow: hidden; }
.checklist-table th, .checklist-table td { padding: 12px 14px; }
.checklist-table td:nth-child(3), .checklist-table td:nth-child(4), .checklist-table td:nth-child(5) { text-align: center; }
.radio-cell input { accent-color: var(--teal); width: 18px; height: 18px; }
.danger-radio input { accent-color: var(--red); }
.checklist-table textarea { min-height: 48px; font-size: 13px; padding: 8px 10px; }
.mini-upload { margin-top: 6px; display: inline-flex; align-items: center; width: auto; color: var(--blue); font-size: 12px; cursor: pointer; }
.mini-upload input { display: none; }
.photo-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.photo-links a { font-size: 12px; background: #eef6ff; padding: 4px 7px; border-radius: 999px; }
.audit-side-panel { display: grid; gap: 16px; }
.audit-side-panel .card { padding: 20px; }
.side-dropzone { min-height: 100px; display: grid; place-items: center; text-align: center; border: 1px dashed #9db2cb; border-radius: 12px; color: var(--muted); padding: 14px; }
.photos-preview-head { display: flex; justify-content: space-between; margin: 16px 0 10px; }
.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.thumb { height: 80px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg,#d7e2ef,#f4f7fb); color: #334155; font-size: 26px; overflow: hidden; text-align: center; padding: 6px; }
.thumb span { font-size: 10px; display: block; }
.thumb.placeholder { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.sticky-actions { position: sticky; bottom: 0; z-index: 10; display: flex; justify-content: flex-end; gap: 12px; padding: 14px; background: rgba(244, 247, 251, .92); border-top: 1px solid var(--line); backdrop-filter: blur(10px); }

.log-layout { grid-template-columns: minmax(0, 1fr) 420px; }
.log-main { display: grid; gap: 18px; }
.selected-unit-card { display: grid; grid-template-columns: 110px minmax(0, 1.8fr) 1.1fr 1.1fr 1.2fr; align-items: center; gap: 24px; }
.signal-icon { width: 90px; height: 90px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; font-size: 42px; }
.selected-unit-title h2 { font-size: 25px; margin: 0 0 18px; }
.selected-progress { min-width: 220px; }
.admin-action-side { display: grid; gap: 18px; }
.danger-action-card h2 { color: #1e293b; }
.red-box { border: 1px solid #ffb4bc; background: #fff4f5; border-radius: 14px; padding: 18px; margin-top: 20px; }
.red-box h3 { color: #b41525; font-size: 20px; }
.log-table .action-badge { display: inline-flex; border-radius: 9px; padding: 9px 12px; background: #eef6ff; color: var(--blue); font-weight: 850; }
.log-table .action-badge.c2 { background: #fff4e6; color: var(--orange); }
.log-table .action-badge.c3, .log-table .action-badge.c4 { background: #e9fbf0; color: var(--green); }
.log-table .action-badge.c5 { background: #f5edff; color: var(--purple); }
.log-table .action-badge.c6 { background: #fff1f2; color: var(--red); }
code { white-space: pre-wrap; color: #40516b; font-size: 12px; }
.restart-layout { max-width: 900px; margin: 0 auto; }
.danger-zone { border-color: #fecdd3; }
.confirm-box { background: #fff1f2; border: 1px solid #fecdd3; border-radius: 14px; padding: 16px; margin: 18px 0; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 88px 1fr; }
  .side-link strong, .collapse-hint { display: none; }
  .side-link { justify-content: center; padding: 0; }
  .dashboard-grid, .import-layout, .user-layout, .audit-exec-layout, .log-layout, .auditor-grid { grid-template-columns: 1fr; }
  .discipline-grid { grid-template-columns: repeat(3, 1fr); }
  .drawer-panel { border-radius: var(--radius); border-left: 1px solid var(--line); }
  .top-actions .search-box { display: none; }
}
@media (max-width: 760px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .app-topbar, .inline-title, .audit-header, .summary-strip, .selected-unit-card, .filter-row, .discipline-select-line { grid-template-columns: 1fr; flex-direction: column; height: auto; align-items: stretch; }
  .app-topbar { gap: 12px; padding: 14px; }
  .top-actions { flex-wrap: wrap; }
  .content { padding: 16px; }
  .kpi-grid, .kpi-grid.three, .discipline-grid { grid-template-columns: 1fr; }
  .login-screen { grid-template-columns: 1fr; padding: 12px; }
  .login-hero, .login-panel-wrap { border-radius: 18px; }
  .login-hero-content { padding: 48px 28px; }
  .login-panel { width: 92%; }
  .unit-list-head { display: none; }
  .unit-row { grid-template-columns: 1fr; gap: 10px; }
  .audit-actions { flex-wrap: wrap; }
  .sticky-actions { flex-direction: column; }
}

/* V2.2 — Locks concorrentes e GPS */
.row-locked {
  background-color: #f5f5f5 !important;
  opacity: 0.7;
  pointer-events: none;
}
.row-locked input,
.row-locked textarea,
.row-locked button {
  cursor: not-allowed !important;
}
.row-locked .lock-info {
  color: #c00000;
  font-size: 0.85em;
  font-weight: 600;
}
.row-mine-lock {
  background-color: #f0fdf4 !important;
  border-left: 3px solid #16a34a;
}
.row-mine-lock .lock-info {
  color: #15803d;
  font-size: 0.85em;
  font-weight: 600;
}
.lock-icon {
  margin-right: 6px;
  font-size: 1.1em;
}
.admin-force-unlock {
  background-color: #c00000;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.8em;
  border: none;
  cursor: pointer;
  margin-left: 8px;
  pointer-events: auto !important;
}
.row-locked .admin-force-unlock {
  cursor: pointer !important;
}
.anchor-photo-card {
  margin-bottom: 18px;
}
.anchor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}
.anchor-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.gps-status {
  color: #15803d;
  font-size: 0.9rem;
  font-weight: 700;
}
#anchor-form {
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.anchor-upload {
  border: 1px dashed #9db2cb;
  border-radius: 10px;
  padding: 12px 16px;
  background: #f8fbff;
}
.anchor-list {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}
.anchor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #d8e1ef;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fbfdff;
}
.anchor-item small {
  color: var(--muted);
}

/* V2.2.1 - ação administrativa para remover importação incorreta e reimportar */
.inline-delete-form {
  display: inline-flex;
  margin: 0 0 0 6px;
  padding: 0;
}
.inline-delete-form button {
  border: 1px solid #fecaca;
  background: #fff5f5;
  color: #b91c1c;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}
.inline-delete-form button:hover {
  background: #fee2e2;
}

/* V2.4 — BP auditado/concluído */
tr.row-completed { background: #f0f7f0; opacity: 0.78; }
tr.row-completed td { color: #555; }
tr.row-completed input, tr.row-completed textarea { pointer-events: none; }
.done-icon { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: #2e7d32; color: white; text-align: center; line-height: 22px; font-weight: bold; margin-right: 6px; }
.done-info { font-size: 12px; color: #2e7d32; margin: 4px 0; padding: 6px 10px; background: #e8f5e9; border-left: 3px solid #2e7d32; border-radius: 4px; }
.done-info small { color: #888; margin-left: 6px; }
.complete-checkbox { display: inline-block; margin-top: 6px; padding: 4px 10px; background: #fff3cd; border: 1px solid #ffc107; border-radius: 4px; font-size: 13px; cursor: pointer; }
.complete-checkbox:hover { background: #ffe69c; }
.admin-reopen-btn { margin-left: 8px; padding: 3px 10px; background: #fff; border: 1px solid #d32f2f; color: #d32f2f; border-radius: 4px; font-size: 12px; cursor: pointer; }
.admin-reopen-btn:hover { background: #ffebee; }
.row-locked { background-color: #f5f5f5 !important; opacity: 0.7; }
.row-locked input, .row-locked textarea, .row-locked button { cursor: not-allowed !important; }
.row-locked .lock-info { color: #c00000; font-size: 0.85em; font-weight: 600; }
.row-mine-lock { background-color: #f0fdf4 !important; border-left: 3px solid #16a34a; }
.row-mine-lock .lock-info { color: #15803d; font-size: 0.85em; font-weight: 600; }
.lock-icon { margin-right: 6px; font-size: 1.1em; }
.admin-force-unlock { background-color: #c00000; color: white; padding: 4px 10px; border-radius: 4px; font-size: 0.8em; border: none; cursor: pointer; margin-left: 8px; }
.danger-link { color:#c00000; font-weight:700; }
.import-options-grid { display:grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap:12px; align-items:end; }
.export-buttons { display:flex; gap:10px; align-items:center; margin-bottom:14px; flex-wrap:wrap; }
.admin-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap:16px; }
.live-kpis { padding:10px 12px; background:#eef6ff; border:1px solid #bfdbfe; border-radius:8px; margin-bottom:10px; color:#0b376d; }
body.sidebar-collapsed .sidebar { width: 60px; }
@media (max-width: 900px) { .import-options-grid { grid-template-columns:1fr; } }

/* V2.5 — recolher/expandir menu funcional */
body.sidebar-collapsed .sidebar { width: 60px; }
body.sidebar-collapsed .sidebar .side-link strong { display: none; }
body.sidebar-collapsed .sidebar .collapse-hint span:first-child { transform: rotate(180deg); display:inline-block; }
body.sidebar-collapsed .sidebar .collapse-hint .label { display: none; }
body.sidebar-collapsed .workspace { margin-left: 60px; }
.collapse-hint { border: 0; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; width: 100%; text-align: left; padding: 10px 14px; border-radius: 10px; }

/* V2.5 — dropdown de ações */
.row-menu { position: relative; display: inline-block; }
.row-menu-list { display: none; position: absolute; right: 0; top: 100%; background: white; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.1); list-style: none; padding: 4px 0; margin: 4px 0 0; min-width: 180px; z-index: 10; }
.row-menu.open .row-menu-list { display: block; }
.row-menu-list li a, .row-menu-list li button { display: block; width: 100%; text-align: left; padding: 8px 14px; background: none; border: 0; cursor: pointer; font: inherit; color: #333; text-decoration: none; }
.row-menu-list li a:hover, .row-menu-list li button:hover { background: #f5f5f5; }
.row-menu-list .danger-link, .danger-link { color: #d32f2f; }
.icon-btn { border:0; background:transparent; cursor:pointer; padding:4px 8px; border-radius:6px; }
.icon-btn:hover { background:#eef2f7; }

/* V2.5 — layout estável com nomes longos */
.kpi-card, .discipline-tile, .summary-line, .activity-item, .access-item, .unit-row, .queue-card { min-width: 0; }
.kpi-card strong, .discipline-tile strong, .activity-item strong, .access-item strong, .unit-name strong, .summary-line strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.discipline-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.kpi-grid.mockup-kpis { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.stack-panels { min-width: 0; }
.panel-main { min-width: 0; overflow: hidden; }
.clean-table { table-layout: auto; }
.clean-table td { word-break: break-word; }
.clean-table td strong { max-width: 380px; display: inline-block; vertical-align: middle; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-result { margin-top: 14px; max-width: 100%; overflow:auto; }
.help-pre { white-space: pre-wrap; font-family: inherit; line-height: 1.5; }

/* V2.7.2 — bloqueio POST Iniciar, relatórios Word e visualização operacional */
.unit-row-locked { background: #fff7ed !important; border-left: 4px solid #f97316; }
.unit-row-locked .btn.disabled, .btn.disabled { opacity: .45; cursor: not-allowed; filter: grayscale(0.4); }
.lock-chip { display: inline-block; padding: 4px 8px; border-radius: 999px; background: #fff3cd; color: #92400e; font-size: 12px; font-weight: 700; margin-right: 6px; }
.unit-lock-banner { margin: 10px 0 14px; }
.ready-word { margin-top: 4px; color: #15803d; font-size: 12px; font-weight: 700; }
.ra-items { margin-top: 6px; padding: 8px 10px; background: #f8fafc; border-left: 3px solid #0b54b5; border-radius: 4px; font-size: 12px; line-height: 1.4; color: #334155; }
.ra-note { margin-top: 4px; color: #92400e; font-size: 12px; font-weight: 600; }
.btn.tiny { padding: 3px 7px; font-size: 11px; }
.success { background: #16a34a !important; color: #fff !important; border-color: #16a34a !important; }
.pagination-lite a { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 30px; border: 1px solid #dbe3ef; border-radius: 6px; text-decoration: none; }

/* ========================================================================
   V2.11.2 — Responsividade entre monitores diferentes
   Cobre: notebook 1366×768, FHD 1920×1080, QHD 2560×1440, 4K 3840×2160,
   ultrawide 21:9 / 32:9, e mudança de DPR ao mover entre telas.
   ======================================================================== */
:root {
  --side-width: clamp(220px, 18vw, 300px);
  --topbar-h: clamp(64px, 6vw, 84px);
  --content-pad: clamp(16px, 2.2vw, 36px);
  --base-font: clamp(14px, 0.95vw, 17px);
  --h1-font: clamp(22px, 2.2vw, 36px);
  --kpi-font: clamp(24px, 2.6vw, 38px);
}
html { font-size: var(--base-font); }
body { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.app-shell { grid-template-columns: var(--side-width) 1fr; }
.app-topbar { height: var(--topbar-h); padding: 0 var(--content-pad); }
.content { padding: var(--content-pad) var(--content-pad) calc(var(--content-pad) * 2); }
h1 { font-size: var(--h1-font); }
.kpi-card strong { font-size: var(--kpi-font); }
.search-box { max-width: min(360px, 28vw); }

/* Notebook / monitor secundário pequeno (até 1500px) */
@media (max-width: 1500px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 360px; }
  .user-layout    { grid-template-columns: minmax(0, 1fr) 380px; }
  .import-layout  { grid-template-columns: minmax(0, 1fr) 360px; }
  .auditor-grid   { grid-template-columns: minmax(0, 1fr) 280px; }
}
/* Monitor médio (1500-1919) */
@media (min-width: 1500px) and (max-width: 1919px) {
  .kpi-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .discipline-grid { grid-template-columns: repeat(6, minmax(160px, 1fr)); }
}
/* FHD (1920) e maior — centraliza para não ficar "perdido" no canto */
@media (min-width: 1920px) {
  .app-shell { grid-template-columns: 300px 1fr; max-width: 1880px; margin: 0 auto; }
  .content   { max-width: 1620px; margin: 0 auto; width: 100%; }
}
/* QHD/4K — eleva tipografia e largura útil */
@media (min-width: 2400px) {
  :root { --base-font: 18px; }
  .app-shell { max-width: 2200px; }
  .content   { max-width: 1980px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 520px; }
}
/* Aspect ratio extremo (ultrawide) — limita largura para não esticar tudo */
@media (min-aspect-ratio: 21/9) {
  .app-shell      { max-width: min(2400px, 92vw); margin: 0 auto; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 480px; }
}
/* DPI alto (Retina/HiDPI) */
@media (min-resolution: 1.5dppx) {
  .kpi-icon { box-shadow: 0 0 0 0.5px rgba(0,0,0,.04); }
}
/* Alturas baixas (laptops com 720p) */
@media (orientation: landscape) and (max-height: 720px) {
  .sidebar-inner { padding-top: 24px; }
  .side-link { min-height: 44px; font-size: 16px; }
  .app-topbar { height: 64px; }
  .kpi-card { min-height: 96px; padding: 16px 18px; }
}
/* Container queries onde houver suporte */
@supports (container-type: inline-size) {
  .workspace { container-type: inline-size; }
  @container (max-width: 980px) {
    .dashboard-grid, .user-layout, .import-layout { grid-template-columns: 1fr; }
  }
}

/* V2.11.2 — Painel ao vivo de auditores em campo */
.live-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.live-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: var(--soft-shadow); display: grid; gap: 8px; }
.live-card.is-active { border-left: 4px solid var(--green); }
.live-card.is-prelock { border-left: 4px solid var(--orange); }
.live-card .who { display: flex; align-items: center; gap: 10px; }
.live-card .who strong { font-size: 16px; }
.live-card .meta { color: var(--muted); font-size: 12px; }
.live-card .progress-mini { height: 6px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.live-card .progress-mini b { display: block; height: 100%; background: var(--blue); }
.gps-q { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 800; }
.gps-q.excellent { background: #dcfce7; color: #166534; }
.gps-q.good      { background: #e0f2fe; color: #075985; }
.gps-q.fair      { background: #fef3c7; color: #92400e; }
.gps-q.poor      { background: #fee2e2; color: #991b1b; }
.live-empty { text-align: center; color: var(--muted); padding: 36px; border: 1px dashed var(--line); border-radius: 14px; background: #fafbfd; }

/* ========================================================================
   V2.11.4 — refinamento responsivo validado por agentes multitela
   Objetivo: manter a operação confortável de 1024×768 até 3840×2160/32".
   Não altera a lógica do sistema; apenas evita estouro de grid, barras
   horizontais indevidas e perda de ações em telas menores.
   ======================================================================== */
:root {
  --v2114-card-gap: clamp(12px, 1.2vw, 20px);
  --v2114-list-min: 980px;
}

.app-page { overflow-x: hidden; }
.content { min-width: 0; }
.dashboard-grid,
.kpi-grid,
.stack-panels,
.card,
.table-wrap,
.unit-list,
.queue-panel,
.import-layout,
.user-layout,
.log-layout,
.audit-exec-layout,
.auditor-grid { min-width: 0; }

.table-wrap,
.unit-list {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.unit-list-head,
.unit-row {
  min-width: var(--v2114-list-min);
}

.unit-name strong,
.unit-name small,
.clean-table td,
.clean-table th {
  overflow-wrap: anywhere;
}

.btn,
.badge,
.role-pill,
.logout-link { white-space: nowrap; }

/* Telas pequenas de notebook e monitores antigos: a tabela vira área rolável,
   preservando as colunas críticas e sem quebrar os botões de ação. */
@media (max-width: 1366px) {
  :root {
    --side-width: 88px;
    --content-pad: 18px;
    --base-font: 14px;
    --v2114-list-min: 920px;
  }
  .side-link strong,
  .collapse-hint .label { display: none; }
  .side-link { justify-content: center; padding: 0; }
  .dashboard-grid,
  .import-layout,
  .user-layout,
  .audit-exec-layout,
  .log-layout,
  .auditor-grid { grid-template-columns: 1fr !important; }
  .queue-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .queue-panel .tip-card { grid-column: 1 / -1; }
  .top-actions { gap: 10px; }
  .user-chip strong { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 1180px) {
  .top-actions .search-box { display: none; }
  .kpi-grid,
  .kpi-grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discipline-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .queue-panel { grid-template-columns: 1fr; }
}

/* Tablets e janelas estreitas: a lista de trechos vira cards empilhados.
   Isso evita corte de 'Iniciar/Retomar', status e auditor em uso. */
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr !important; }
  .sidebar { display: none; }
  .app-topbar,
  .inline-title,
  .audit-header,
  .summary-strip,
  .selected-unit-card,
  .filter-row,
  .discipline-select-line,
  .table-toolbar {
    display: flex;
    flex-direction: column;
    height: auto;
    align-items: stretch;
  }
  .app-topbar { gap: 12px; padding: 12px 14px; position: static; }
  .brand { font-size: 22px; }
  .top-actions { flex-wrap: wrap; align-items: stretch; }
  .role-pill, .user-chip, .logout-link { align-self: flex-start; }
  .content { padding: 14px 14px 96px; }
  .unit-list { overflow-x: visible; }
  .unit-list-head { display: none; }
  .unit-row {
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin: 10px 0;
    background: #fff;
    box-shadow: var(--soft-shadow);
  }
  .unit-discipline { place-items: start; }
  .mini-progress { width: min(100%, 180px); }
}

@media (max-width: 640px) {
  h1 { font-size: 24px; }
  .kpi-grid,
  .kpi-grid.three,
  .discipline-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 92px; padding: 16px; gap: 14px; }
  .kpi-icon { width: 52px; height: 52px; font-size: 22px; }
  .login-screen { padding: 10px; }
  .login-hero { display: none; }
  .login-panel-wrap { min-height: calc(100vh - 20px); border-radius: 18px; }
  .login-panel { width: min(100%, 420px); padding: 26px 20px; }
  .card { padding: 16px; }
  .btn { width: 100%; }
}

/* Monitores grandes e 32": amplia área útil sem deformar. */
@media (min-width: 2560px) {
  :root { --base-font: 17px; --side-width: 310px; }
  .app-shell { max-width: min(2320px, 94vw); }
  .content { max-width: 2100px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) minmax(460px, 560px); }
}

@media (min-width: 3440px) {
  :root { --base-font: 18px; --side-width: 320px; }
  .app-shell { max-width: min(2680px, 88vw); }
  .content { max-width: 2380px; }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr) 600px; }
}
