:root {
  --primary: #C0392B;
  --primary-dark: #922B21;
  --primary-light: #E74C3C;
  --secondary: #1a1a1a;
  --text: #333333;
  --text-light: #666666;
  --bg: #ffffff;
  --bg-secondary: #f8f8f8;
  --bg-sidebar: #1a1a1a;
  --border: #e0e0e0;
  --success: #27AE60;
  --warning: #E67E22;
  --danger: #C0392B;
  --info: #2980B9;
  --radius: 6px;
  --shadow: 0 2px 8px rgba(0,0,0,0.1);
  --sidebar-width: 240px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

*:focus                          { outline: none; }
*:focus-visible                  { outline: 2px solid var(--primary); outline-offset: 2px; }
button:focus-visible             { outline: 2px solid var(--primary); outline-offset: 2px; }
input:focus-visible,
select:focus-visible,
textarea:focus-visible           { outline: none; }
label:focus,
label:focus-visible,
label:focus-within               { outline: none !important; }
a:focus-visible                  { outline: 2px solid var(--primary); outline-offset: 2px; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.screen { display: none; }
.screen.active { display: flex; }

#login-screen {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: url('/imagem.webp') center center / cover no-repeat;
  position: relative;
}

#login-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  pointer-events: none;
}

.login-box {
  position: relative;
  z-index: 1;
  background: #f4f6f9;
  border-radius: 14px;
  padding: 44px 40px;
  width: 400px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.08);
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.login-logo-img {
  max-width: 90px;
  max-height: 46px;
  object-fit: contain;
  margin: 0 auto;
  display: block;
}

.header-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
}

.login-logo .logo-icon {
  width: 80px;
  height: 80px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 32px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
}

.login-logo h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 1px;
}

.login-logo p {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.login-box h2 {
  font-size: 18px;
  margin-bottom: 24px;
  color: var(--secondary);
  text-align: center;
}

.login-box .form-group { margin-bottom: 16px; }

.login-box input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  transition: border-color .2s;
}

.login-box input:focus { outline: none; border-color: var(--primary); }

.btn-login {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  transition: background .2s;
}

.btn-login:hover { background: var(--primary-dark); }

/* ===== PASSWORD WRAPPER (olhinho) ===== */
.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrapper .form-control {
  padding-right: 44px;
  width: 100%;
}
.btn-eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color .2s;
  flex-shrink: 0;
}
.btn-eye:hover { color: var(--primary); }

/* ===== ESQUECI A SENHA ===== */
.forgot-link {
  text-align: right;
  margin-top: 2px;
  margin-bottom: 0;
}
.forgot-link a {
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  text-decoration: none;
  transition: color .2s;
}
.forgot-link a:hover { color: var(--primary); text-decoration: underline; }

/* ===== USER MENU DROPDOWN ===== */
.user-menu-wrap { position: relative; display: inline-flex; align-items: center; }
.user-menu-trigger {
  cursor: pointer;
  user-select: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s;
}
.user-menu-trigger:hover { background: rgba(255,255,255,.12); }
.user-menu-trigger::after { content: ' ▾'; font-size: 10px; opacity: .7; }
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
  min-width: 160px;
  z-index: 1000;
  overflow: hidden;
}
.user-menu-item {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.user-menu-item:hover { background: var(--bg-secondary); }
.user-menu-item-danger { color: var(--danger); }
.user-menu-item-danger:hover { background: #fff0f0; }

.login-panel-title h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}
.login-panel-title p {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.5;
}

#app-screen {
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: var(--secondary);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 24px;
  height: 60px;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}

.header-logo .logo-badge {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 14px;
  color: #fff;
  letter-spacing: -0.5px;
}

.header-logo span {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.header-logo small {
  font-size: 10px;
  opacity: .6;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
  line-height: 1;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-user .user-name { font-size: 13px; opacity: .85; }

.header-user .user-role {
  font-size: 11px;
  background: var(--primary);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.btn-logout {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  transition: all .2s;
}

.btn-logout:hover { background: rgba(255,255,255,0.1); }

.app-body {
  display: flex;
  min-height: 100vh;
}

/* ===== SIDEBAR — estilo ListJur ===== */
.sidebar {
  width: 64px;
  background: var(--bg-sidebar);
  color: #fff;
  position: fixed;
  top: 12px; bottom: 12px; left: 12px;
  overflow: hidden;
  z-index: 95;
  transition: width .28s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 8px 32px rgba(0,0,0,.45), 0 2px 8px rgba(0,0,0,.25);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
}
.sidebar:hover { width: 240px; }

/* === BRAND === */
.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px 0;
  flex-shrink: 0;
}
.sidebar-brand-logo-row {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 12px;
  width: 100%;
}
.sidebar-brand-img {
  height: 28px;
  width: auto;
  max-width: 120px;
  object-fit: contain;
}
.sidebar-brand-fallback {
  width: 32px; height: 32px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff; font-weight: 800; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-brand-divider {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,.08);
}
.sidebar-brand-text {
  max-height: 0; overflow: hidden; opacity: 0;
  transition: max-height .28s ease, opacity .2s ease, padding .28s ease;
  text-align: center; width: 100%;
  padding: 0 8px;
  white-space: nowrap;
}
.sidebar:hover .sidebar-brand-text {
  max-height: 80px; opacity: 1;
  padding: 12px 8px 16px;
}
.sidebar-brand-title {
  display: block;
  font-size: 15px; font-weight: 800;
  color: #fff;
  text-transform: uppercase; letter-spacing: .4px;
}
.sidebar-brand-desc {
  display: block;
  font-size: 9px;
  color: rgba(255,190,50,.85);
  text-transform: uppercase; letter-spacing: .5px;
  margin-top: 3px;
}

/* === NAV === */
.sidebar-nav { padding: 8px 0; flex: 1; overflow-y: auto; overflow-x: hidden; }

.nav-section {
  padding: 10px 22px 4px;
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 1.5px;
  color: rgba(255,255,255,.3);
  max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width .28s ease, opacity .2s ease;
  white-space: nowrap;
}
.sidebar:hover .nav-section {
  max-width: 200px; opacity: 1;
  transition: max-width .28s ease, opacity .22s ease .06s;
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 22px;
  color: rgba(255,255,255,.65);
  cursor: pointer; font-size: 13.5px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav-item .nav-icon { font-size: 17px; min-width: 20px; text-align: center; }
.nav-item span:not(.nav-icon) {
  max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width .28s ease, opacity .2s ease;
}
.sidebar:hover .nav-item span:not(.nav-icon) {
  max-width: 180px; opacity: 1;
  transition: max-width .28s ease, opacity .22s ease .06s;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: rgba(192,57,43,.2); color: #fff; border-left-color: var(--primary); }

/* === RODAPÉ: ações + perfil === */
.sidebar-actions { border-top: 1px solid rgba(255,255,255,.08); padding: 4px 0; flex-shrink: 0; }
.sidebar-action {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px;
  color: rgba(255,255,255,.55);
  cursor: pointer; font-size: 13px;
  border-left: 3px solid transparent;
  transition: background .15s, color .15s;
}
.sidebar-action .nav-icon { font-size: 15px; min-width: 20px; text-align: center; }
.sidebar-action span:not(.nav-icon) {
  max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width .28s ease, opacity .2s ease;
  white-space: nowrap;
}
.sidebar:hover .sidebar-action span:not(.nav-icon) {
  max-width: 180px; opacity: 1;
  transition: max-width .28s ease, opacity .22s ease .06s;
}
.sidebar-action:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar-action-exit { color: rgba(255,110,110,.65); }
.sidebar-action-exit:hover { background: rgba(192,57,43,.15); color: #ff6f6f; }

.sidebar-profile {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}
.sidebar-user-avatar {
  width: 34px; height: 34px; min-width: 34px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.sidebar-profile-info {
  max-width: 0; overflow: hidden; opacity: 0;
  transition: max-width .28s ease, opacity .2s ease;
  white-space: nowrap;
}
.sidebar:hover .sidebar-profile-info {
  max-width: 160px; opacity: 1;
  transition: max-width .28s ease, opacity .22s ease .06s;
}
.sidebar-profile-name { display: block; font-size: 12px; font-weight: 600; color: #fff; }
.sidebar-profile-role { display: block; font-size: 9px; color: rgba(255,255,255,.4); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

.main-content {
  margin-left: 88px; /* 12px gap + 64px sidebar + 12px gap */
  flex: 1; padding: 24px; min-height: 100vh;
}

.page { display: none; }
.page.active { display: block; }

.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-header h2, .card-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--secondary);
}

.card-body { padding: 20px; }

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--secondary);
}

.page-header p { color: var(--text-light); font-size: 13px; margin-top: 2px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { background: #333; }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1e8449; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--primary-dark); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #d35400; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #1a6fa0; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid.cols-1 { grid-template-columns: 1fr; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-group label.required::after {
  content: ' *';
  color: var(--primary);
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color .2s;
  font-family: inherit;
}

.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(192,57,43,0.1); }
.form-control[readonly] { background: var(--bg-secondary); color: var(--text-light); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-section { margin-bottom: 24px; }

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.radio-group { display: flex; gap: 12px; }

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all .2s;
}

.radio-option:hover { border-color: var(--primary); }
.radio-option input { cursor: pointer; accent-color: var(--primary); }
.radio-option.selected { border-color: var(--primary); background: rgba(192,57,43,0.05); color: var(--primary); font-weight: 600; }

.file-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}

.file-upload-area:hover  { border-color: #bbb; background: #fafafa; }
.file-upload-area.dragover { border-color: var(--primary); background: rgba(192,57,43,0.04); border-style: solid; }
.file-upload-area .upload-icon { font-size: 32px; margin-bottom: 8px; }
.file-upload-area p { color: var(--text-light); font-size: 13px; }
.file-upload-area input[type=file] { display: none; }

.file-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }

.file-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
}

.file-chip button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-light);
  font-size: 14px;
  line-height: 1;
  padding: 0;
}

.file-chip button:hover { color: var(--primary); }

.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--bg-secondary);
  padding: 10px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-light);
  border-bottom: 2px solid var(--border);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}

tbody tr:hover { background: var(--bg-secondary); }
tbody tr:last-child td { border-bottom: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.badge-phase1    { background: #EBF5FB; color: #2980B9; }
.badge-phase2    { background: #FEF9E7; color: #D68910; }
.badge-phase3    { background: #FDFEFE; color: #7D3C98; }
.badge-phase4    { background: #EAF4FB; color: #1A5276; }
.badge-completed { background: #EAFAF1; color: #1E8449; }
.badge-rejected  { background: #FDEDEC; color: #C0392B; }
.badge-success   { background: #EAFAF1; color: #1E8449; }
.badge-warning   { background: #FEF9E7; color: #D68910; }
.badge-danger    { background: #FDEDEC; color: #C0392B; }
.badge-info      { background: #EBF5FB; color: #2980B9; }
.badge-secondary { background: #F2F3F4; color: #566573; }

.phase-stepper {
  display: flex;
  align-items: center;
  margin-bottom: 28px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}

.phase-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.step-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all .3s;
}

.phase-step.done .step-number     { background: var(--success); color: #fff; }
.phase-step.active .step-number   { background: var(--primary); color: #fff; }
.phase-step.pending .step-number  { background: var(--border); color: var(--text-light); }
.phase-step.rejected .step-number { background: var(--danger); color: #fff; }

.step-info { flex: 1; }
.step-info .step-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); }
.step-info .step-name  { font-size: 13px; font-weight: 600; }
.phase-step.active .step-info .step-name  { color: var(--primary); }
.phase-step.done .step-info .step-name    { color: var(--success); }

.step-connector { flex: none; width: 40px; height: 2px; background: var(--border); margin: 0 8px; }
.step-connector.done { background: var(--success); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.info-item        { background: var(--bg-secondary); border-radius: var(--radius); padding: 12px; }
.info-item.full   { grid-column: 1 / -1; }
.info-item.half   { grid-column: span 2; }
.info-label       { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-light); margin-bottom: 4px; }
.info-value       { font-size: 14px; color: var(--text); font-weight: 500; word-break: break-word; }
.info-value.empty { color: var(--text-light); font-style: italic; }

.timeline { padding: 8px 0; }

.timeline-item {
  display: flex;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.timeline-item:last-child { border-bottom: none; }

.timeline-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.timeline-dot.submitted { background: #EBF5FB; color: var(--info); }
.timeline-dot.approved  { background: #EAFAF1; color: var(--success); }
.timeline-dot.rejected  { background: #FDEDEC; color: var(--danger); }
.timeline-dot.completed { background: #EAFAF1; color: var(--success); }

.timeline-content { flex: 1; }
.timeline-action  { font-size: 13.5px; font-weight: 600; color: var(--text); }
.timeline-meta    { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.timeline-note    { font-size: 12.5px; color: var(--danger); margin-top: 4px; font-style: italic; }

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active { display: flex; }

.modal {
  background: #fff;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--text-light); line-height: 1; }
.modal-close:hover { color: var(--primary); }
.modal-body   { padding: 20px; }
.modal-footer { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-danger  { background: #FDEDEC; border: 1px solid #F1948A; color: #922B21; }
.alert-success { background: #EAFAF1; border: 1px solid #82E0AA; color: #1E8449; }
.alert-warning { background: #FEF9E7; border: 1px solid #F9E79F; color: #D68910; }
.alert-info    { background: #EBF5FB; border: 1px solid #7FB3D3; color: #1A5276; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 14px;
}
.stat-card-btn {
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  user-select: none;
}
.stat-card-btn:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(192,57,43,.15); transform: translateY(-1px); }
.stat-card-active { border-color: var(--primary) !important; box-shadow: 0 0 0 2px rgba(192,57,43,.2) !important; }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.red    { background: rgba(192,57,43,0.1); }
.stat-icon.blue   { background: rgba(41,128,185,0.1); }
.stat-icon.green  { background: rgba(39,174,96,0.1); }
.stat-icon.orange { background: rgba(230,126,34,0.1); }

.stat-num   { font-size: 26px; font-weight: 700; line-height: 1; color: var(--secondary); }
.stat-label { font-size: 12px; color: var(--text-light); margin-top: 2px; }

.action-panel {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.action-panel.phase-active { border-color: var(--primary); }
.action-panel h3 { font-size: 15px; font-weight: 700; color: var(--secondary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.action-panel h3 .phase-tag { background: var(--primary); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }

.admin-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}

.admin-tab {
  padding: 10px 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all .2s;
}

.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.color-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
}

.color-option input[type=color] {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}

.color-option label { font-size: 13px; font-weight: 600; }

.divider { height: 1px; background: var(--border); margin: 20px 0; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

.text-muted   { color: var(--text-light); }
.text-danger  { color: var(--danger); }
.text-success { color: var(--success); }
.text-right   { text-align: right; }

.actions-col { white-space: nowrap; vertical-align: middle; }
.actions-col .btn { margin-right: 4px; }
.actions-col .btn:last-child { margin-right: 0; }

.rejection-banner {
  background: #FDEDEC;
  border: 1.5px solid #F1948A;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.rejection-banner .rej-icon  { font-size: 20px; flex-shrink: 0; }
.rejection-banner .rej-title { font-weight: 700; color: #922B21; font-size: 14px; }
.rejection-banner .rej-text  { color: #C0392B; font-size: 13px; margin-top: 2px; }

.search-bar { position: relative; max-width: 300px; }

.search-bar input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13.5px;
}

.search-bar input:focus { outline: none; border-color: var(--primary); }
.search-bar .search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-light); font-size: 14px; }

.btn-confirm-todos {
  background: var(--success);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  letter-spacing: .5px;
  transition: background .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-confirm-todos:hover { background: #1e8449; }
.btn-confirm-todos .todos-text { font-size: 18px; font-weight: 900; letter-spacing: 1px; }

.modal-overlay[style*="align-items:flex-start"] { overflow-y: auto; }

#db-table-content tbody tr:nth-child(even) { background: #fafafa; }
#db-table-content table th { font-size: 11px; white-space: nowrap; }
#db-table-content table td { white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid  { grid-template-columns: 1fr; }
  .info-grid  { grid-template-columns: repeat(2, 1fr); }
  .header-logo small { display: none; }
}

@media (max-width: 600px) {
  .stats-grid   { grid-template-columns: 1fr; }
  .info-grid    { grid-template-columns: 1fr; }
  .main-content { padding: 16px; }
}

/* ===== HOME SCREEN ===== */
#home-screen {
  flex-direction: column;
  background: #f4f5f7;
  min-height: 100vh;
}

.home-header {
  background: var(--secondary);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.home-logo-img {
  height: 42px;
  width: auto;
  object-fit: contain;
}

.home-header-user {
  display: flex;
  align-items: center;
  gap: 16px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
}

.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
}

.home-welcome {
  text-align: center;
  margin-bottom: 48px;
}

.home-welcome h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}

.home-welcome p {
  color: var(--text-light);
  font-size: 15px;
}

.home-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 380px));
  justify-content: center;
  gap: 24px;
  width: 100%;
  max-width: 900px;
}

.module-card {
  background: #d0d1d3;
  border-radius: 12px;
  padding: 32px 28px;
  cursor: pointer;
  border: 2px solid transparent;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all .2s;
  position: relative;
}

.module-card:hover {
  border-color: var(--primary);
  box-shadow: 0 6px 24px rgba(0,0,0,0.13);
  transform: translateY(-3px);
}

.module-icon {
  font-size: 40px;
  margin-bottom: 16px;
}

.module-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 8px;
}

.module-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.module-arrow {
  position: absolute;
  bottom: 20px;
  right: 24px;
  font-size: 20px;
  color: var(--primary);
  font-weight: bold;
  opacity: 0;
  transition: opacity .2s;
}

.module-card:hover .module-arrow {
  opacity: 1;
}

/* ===== SC: STATUS BUTTONS ===== */
.btn-sc-status {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity .15s, transform .1s;
  white-space: nowrap;
  display: inline-block;
}
.btn-sc-status:hover { opacity: .8; transform: scale(.97); }
.btn-sc-status.sc-todo { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.btn-sc-status.sc-done { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }

/* SC: Status select (substituiu os botões) */
.btn-sc-status-sel {
  padding: 5px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  white-space: nowrap;
  outline: none;
  transition: opacity .15s;
  font-family: inherit;
  appearance: auto;
}
.btn-sc-status-sel:hover { opacity: .8; }
.btn-sc-status-sel.sc-todo     { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.btn-sc-status-sel.sc-done     { background: #e8f5e9; color: #2e7d32; border-color: #a5d6a7; }
.btn-sc-status-sel.sc-returned { background: #fce4ec; color: #c62828; border-color: #ef9a9a; }

/* Cabeçalhos ordenáveis */
th[onclick] { transition: background .15s; }
th[onclick]:hover { background: var(--border) !important; }

/* Tooltip de quem concluiu */
.sc-tip-wrap { position: relative; display: inline-block; }
.sc-tip-wrap[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: rgba(30,30,30,.88);
  color: #fff;
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

/* ============================================================
   HOME: CARD "ADMINISTRAÇÃO DO SISTEMA" (somente dev)
   ============================================================ */
.module-card-admin {
  order: -1; /* sempre primeiro */
  background: linear-gradient(140deg, #1e2530 0%, #2c3645 100%);
  border-color: rgba(192,57,43,.45);
}
.module-card-admin .module-name { color: #ffffff; }
.module-card-admin .module-desc { color: #aeb8c4; }
.module-card-admin .module-arrow { color: var(--primary-light); }
.module-card-admin:hover { border-color: var(--primary-light); }
.module-card-admin::after {
  content: 'RESTRITO · DEV';
  position: absolute;
  top: 16px;
  right: 18px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .8px;
  color: #fff;
  background: var(--primary);
  padding: 3px 8px;
  border-radius: 20px;
}

/* ============================================================
   ADMINISTRAÇÃO DO SISTEMA — layout interno
   ============================================================ */
.sys-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.sys-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 15px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: box-shadow .2s, transform .2s;
}
.sys-stat:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.sys-stat-ico {
  width: 44px; height: 44px;
  flex-shrink: 0;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: rgba(192,57,43,.10);
}
.sys-stat-val { font-size: 25px; font-weight: 800; line-height: 1; color: var(--secondary); }
.sys-stat-lbl { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* Sub-navegação em pills (e-mail) */
.sys-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.sys-pill {
  padding: 8px 16px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  transition: all .15s;
}
.sys-pill:hover { color: var(--text); border-color: #c4c4c4; }
.sys-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 3px 10px rgba(192,57,43,.25);
}

/* Aviso/nota informativa */
.sys-note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff8e6;
  border: 1px solid #ffe3a3;
  border-radius: 11px;
  padding: 13px 16px;
  margin-bottom: 20px;
  font-size: 13px;
  line-height: 1.5;
  color: #8a6400;
}
.sys-note-ico { font-size: 18px; line-height: 1.3; }

/* Tabela de usuários — avatar + chips */
.sys-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
  flex-shrink: 0;
}
.sys-userbox { display: flex; align-items: center; gap: 12px; }
.sys-username { font-weight: 600; color: var(--secondary); font-size: 14px; }
.sys-useremail { font-size: 12px; color: var(--text-light); }
.sys-chip {
  display: inline-block;
  background: #eef1f4;
  color: #3a4654;
  border-radius: 6px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  margin: 1px 2px 1px 0;
}
.sys-role {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
}
.sys-role-dev    { background: #2c3645; color: #fff; }
.sys-role-admin  { background: #e8eefc; color: #2540b8; }
.sys-role-padrao { background: #eef1f4; color: #4a5562; }
.sys-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600;
}
.sys-status-on  { color: var(--success); }
.sys-status-off { color: var(--text-light); }
.sys-status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* Toolbar genérica das seções */
.sys-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.sys-section-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 18px;
}
.sys-section-head h2 { font-size: 19px; color: var(--secondary); margin: 0; }
.sys-section-head p  { font-size: 13px; color: var(--text-light); margin: 2px 0 0; }

/* ===== Fiscalização — dashboard ===== */
.fisc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
}
.fisc-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
}
.fisc-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.fisc-card-head h3 { font-size: 14px; font-weight: 700; color: var(--secondary); margin: 0; }

/* Barras horizontais (rankings) */
.fisc-bars { display: flex; flex-direction: column; gap: 9px; }
.fisc-bar-row { display: flex; align-items: center; gap: 10px; border-radius: 7px; padding: 2px 4px; transition: background .12s; }
.fisc-bar-row:hover { background: var(--bg-secondary, #f6f6f6); }
.fisc-bar-label {
  flex: 0 0 38%; max-width: 38%;
  font-size: 12.5px; color: var(--text); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fisc-bar-track { flex: 1; height: 10px; background: var(--bg-secondary, #eef1f4); border-radius: 6px; overflow: hidden; }
.fisc-bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); min-width: 2px; transition: width .4s ease; }
.fisc-bar-val { flex: 0 0 auto; font-size: 12.5px; font-weight: 700; color: var(--secondary); min-width: 26px; text-align: right; }
.fisc-bar-val span { display: block; font-size: 10px; font-weight: 500; color: var(--text-light); }

/* Timeline de colunas */
.fisc-timeline { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-top: 8px; }
.fisc-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; min-width: 0; }
.fisc-col-bar { width: 72%; max-width: 24px; background: linear-gradient(180deg, var(--primary), var(--primary-dark)); border-radius: 3px 3px 0 0; min-height: 2px; transition: height .3s ease; }
.fisc-col-bar:hover { filter: brightness(1.15); }
.fisc-col-lbl { font-size: 9px; color: var(--text-light); margin-top: 5px; height: 12px; white-space: nowrap; }

/* Feed de atividade recente */
.fisc-feed { display: flex; flex-direction: column; gap: 4px; max-height: 280px; overflow-y: auto; }
.fisc-feed-item { display: flex; align-items: center; gap: 11px; padding: 7px 4px; border-bottom: 1px solid var(--border); }
.fisc-feed-item:last-child { border-bottom: none; }
.fisc-feed-main { font-size: 13px; line-height: 1.35; min-width: 0; }
.fisc-feed-sub { font-size: 11px; color: var(--text-light); margin-top: 1px; }

/* Rodapé de paginação */
.fisc-more { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 16px; color: var(--text-light); font-size: 13px; }

/* ===================== DASHBOARD: AGUARDANDO VOCÊ ===================== */
.pending-panel:empty { display: none; }
.pending-panel {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 18px;
}
.pending-empty { color: var(--text-light); font-size: 14px; padding: 4px 2px; }
.pending-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pending-title { font-size: 15px; font-weight: 700; color: var(--secondary); }
.pending-count {
  background: var(--primary); color: #fff; font-size: 12px; font-weight: 700;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
}
.pending-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}
.pending-card {
  text-align: left; cursor: pointer; background: var(--bg-secondary, #f8f8f8);
  border: 1px solid var(--border); border-left: 4px solid var(--border);
  border-radius: 8px; padding: 11px 13px; transition: transform .12s, box-shadow .12s;
  display: flex; flex-direction: column; gap: 6px; font: inherit;
}
.pending-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.pending-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pending-seq { font-size: 12px; font-weight: 700; color: var(--text-light); }
.pending-card-title {
  font-size: 13.5px; font-weight: 600; color: var(--secondary); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pending-card-meta { font-size: 11.5px; color: var(--text-light); }
.pending-more { color: var(--text-light); font-size: 12.5px; margin-top: 10px; text-align: center; }

/* Bordas coloridas por nível de SLA */
.aging-border-fresh { border-left-color: var(--success); }
.aging-border-warn  { border-left-color: var(--warning); }
.aging-border-late  { border-left-color: var(--danger); }

/* Badge "há X dias" */
.aging {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px;
  border-radius: 10px; white-space: nowrap;
}
.aging-fresh { background: #E8F8F0; color: #1E8449; }
.aging-warn  { background: #FDF2E3; color: #B9770E; }
.aging-late  { background: #FDEDEC; color: #943126; }
.aging-none  { background: var(--bg-secondary, #eee); color: var(--text-light); }

/* ===================== DASHBOARD: RESUMO FINANCEIRO ===================== */
.value-summary:empty { display: none; }
.value-summary {
  display: grid; gap: 12px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.value-card {
  background: #fff; border: 1px solid var(--border); border-top: 3px solid var(--border);
  border-radius: 10px; padding: 16px 18px;
}
.value-card-label { font-size: 12.5px; color: var(--text-light); font-weight: 600; margin-bottom: 6px; }
.value-card-num { font-size: 22px; font-weight: 800; color: var(--secondary); letter-spacing: -.5px; }
.value-card-sub { font-size: 11.5px; color: var(--text-light); margin-top: 4px; }
.value-card.vs-progress { border-top-color: var(--warning); }
.value-card.vs-done     { border-top-color: var(--success); }
.value-card.vs-total    { border-top-color: var(--primary); }
