/* Akmey Lab — identidade visual baseada no logotipo Akmey Biotecnologia Têxtil */
:root {
  /* Marca */
  --brand-900: #0f2a19; --brand-800: #143520; --brand-700: #194226; --brand-600: #1f5a32; --brand-500: #2b7442;
  --lime-500: #b8dd16; --lime-400: #c9e84a; --lime-100: #f3f9d8;
  /* Interface */
  --bg: #f4f6f2; --surface: #ffffff; --surface-2: #f8faf6; --surface-3: #eef2ea; --border: #dfe5da; --border-strong: #c9d2c2;
  --text: #17261c; --muted: #5f6f63; --primary: var(--brand-600); --primary-h: var(--brand-700);
  --danger: #c0392b; --danger-bg: #fdecea; --warn: #b26a00; --ok: #2b7442;
  --todo: #e7ebe4; --progress: #dcefe2; --done: #eaf6c4; --holdbg: #fff1d6;
  --radius: 10px; --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 42, 25, .08);
  --shadow: 0 1px 3px rgba(15, 42, 25, .08), 0 4px 12px rgba(15, 42, 25, .05);
  --shadow-lg: 0 12px 40px rgba(15, 42, 25, .22);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Montserrat", var(--font);
  font-family: var(--font); font-size: 14px; color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); }
a { color: var(--brand-600); text-decoration: none; cursor: pointer; }
a:hover { color: var(--heading); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px; background: var(--surface); width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(184, 221, 22, .35); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-2); color: var(--muted); }
textarea { resize: vertical; min-height: 70px; }
input[type=checkbox], input[type=radio] { width: auto; flex: none; accent-color: var(--brand-600); }
label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin: 12px 0 5px; }
:focus-visible { outline: 2px solid var(--lime-500); outline-offset: 2px; }

.btn { border: 0; border-radius: var(--radius-sm); padding: 8px 14px; background: var(--surface-3); cursor: pointer; font-weight: 600; white-space: nowrap; transition: background .15s, transform .05s; }
.btn:hover { background: #e2e8dc; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn.primary:hover { background: var(--primary-h); }
.btn.accent { background: var(--lime-500); color: var(--brand-900); }
.btn.accent:hover { background: var(--lime-400); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #a93226; }
.btn.danger-ghost { background: transparent; color: var(--danger); }
.btn.danger-ghost:hover { background: var(--danger-bg); }
.btn.link { background: none; color: var(--brand-600); padding: 4px 6px; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: default; }
.muted { color: var(--muted); } .small { font-size: 12px; } .right { text-align: right; } .nowrap { white-space: nowrap; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .grow { flex: 1; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--border); }
h1, h2, h3 { font-family: var(--font-display); color: var(--heading); letter-spacing: -.01em; }
h1 { font-size: 24px; font-weight: 700; margin: 0 0 18px; } h2 { font-size: 16px; font-weight: 700; margin: 0 0 12px; } h3 { font-size: 14px; font-weight: 700; margin: 18px 0 8px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; flex: 1; }
.page-sub { color: var(--muted); font-size: 13px; margin: -12px 0 18px; }

/* Layout */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--brand-700) 0%, var(--brand-900) 100%); color: #fff; padding: 16px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.sidebar-brand { padding: 6px 10px 16px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 8px; }
.sidebar-brand img { width: 150px; display: block; }
.sidebar-brand .tag { font-size: 11px; color: var(--lime-400); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-top: 6px; }
.nav-section { font-size: 10.5px; font-weight: 700; color: rgba(255,255,255,.45); text-transform: uppercase; padding: 16px 12px 6px; letter-spacing: .09em; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: rgba(255,255,255,.82); font-weight: 500; position: relative; margin: 1px 0; }
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.active { background: rgba(184, 221, 22, .16); color: #fff; font-weight: 600; }
.nav a.active::before { content: ''; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 4px; border-radius: 0 4px 4px 0; background: var(--lime-500); }
.nav .ico { width: 18px; text-align: center; opacity: .9; }
.sidebar-foot { margin-top: auto; padding: 14px 12px 4px; font-size: 11px; color: rgba(255,255,255,.4); }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; min-height: 58px; }
.topbar .crumb { font-family: var(--font-display); font-weight: 600; color: var(--brand-700); }
.content { padding: 24px; min-width: 0; }
.menu-toggle { display: none; }
.mobile-brand { display: none; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: -270px; width: 256px; z-index: 50; transition: left .2s; box-shadow: var(--shadow-lg); }
  .sidebar.open { left: 0; }
  .menu-toggle { display: inline-block; }
  .mobile-brand { display: block; height: 28px; }
  .topbar .crumb { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .content { padding: 14px; }
  .topbar { padding: 8px 12px; }
}

/* Avatar, badges */
.avatar { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 10px; font-weight: 700; color: #fff; flex: none; box-shadow: 0 0 0 2px #fff; }
.avatar.lg { width: 34px; height: 34px; font-size: 12px; }
.avatar.none { background: var(--surface-3) !important; color: var(--muted); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: var(--todo); color: #4a5a4e; white-space: nowrap; letter-spacing: .01em; }
.badge.progress { background: var(--progress); color: var(--brand-600); } .badge.done { background: var(--done); color: #4d6b00; } .badge.hold { background: var(--holdbg); color: #9a5b00; }
.badge.admin { background: var(--brand-700); color: var(--lime-400); }
.badge.off { background: #f1e3e1; color: var(--danger); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--lime-100); color: var(--brand-600); font-weight: 600; }
.bell { position: relative; } .bell .count { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; border-radius: 9px; font-size: 10px; padding: 0 5px; min-width: 16px; text-align: center; font-weight: 700; }
.type-icon { width: 18px; height: 18px; border-radius: 5px; display: inline-grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; flex: none; }
.prio { font-weight: 800; font-size: 13px; }
.prio-highest { color: #c0392b; } .prio-high { color: #d9730d; } .prio-medium { color: #a88a00; } .prio-low { color: #2b7a8c; } .prio-lowest { color: #7f9a8a; }
.overdue { color: var(--danger); font-weight: 600; }

/* Board */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; background: var(--surface); padding: 10px; border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.filters input, .filters select { width: auto; min-width: 150px; }
.filters input[type=checkbox] { min-width: 0; }
@media (max-width: 860px) { .filters input:not([type=checkbox]), .filters select { flex: 1 1 140px; min-width: 0; } }
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.column { background: var(--surface-3); border-radius: 12px; width: 282px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 210px); border: 1px solid var(--border); }
.column-head { padding: 12px 14px 8px; font-size: 12px; font-weight: 700; color: var(--heading); text-transform: uppercase; letter-spacing: .04em; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.column-head .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; }
.column-head .count { background: #fff; color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.column-head .wip-over { background: var(--danger-bg); color: var(--danger); }
.column.over { background: #fbeceA; border-color: #f2c7c1; }
.column-body { padding: 4px 8px 10px; overflow-y: auto; min-height: 70px; flex: 1; border-radius: 0 0 12px 12px; transition: background .15s; }
.column-body.drop { background: var(--lime-100); }
.icard { background: var(--surface); border-radius: 8px; box-shadow: var(--shadow-sm); padding: 11px 12px; margin-bottom: 8px; cursor: pointer; border: 1px solid var(--border); border-left: 3px solid transparent; transition: box-shadow .15s, transform .1s; }
.icard:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.icard.prio-bar-highest { border-left-color: #c0392b; } .icard.prio-bar-high { border-left-color: #d9730d; }
.icard.dragging { opacity: .4; }
.icard .title { margin-bottom: 8px; line-height: 1.4; word-break: break-word; font-weight: 500; }
.icard .meta { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.icard .labels { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 7px; }
.icard .hold-reason { font-size: 12px; background: var(--holdbg); color: #8a5200; border-radius: 6px; padding: 5px 8px; margin-bottom: 8px; }
.cat-bar { display: none; }

/* Tables */
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11.5px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; user-select: none; background: var(--surface-2); }
th.sortable { cursor: pointer; } th.sortable:hover { color: var(--brand-700); }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--border); background: var(--surface); }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .n { font-weight: 600; } .user-cell .u { font-size: 12px; color: var(--muted); }

/* Backlog */
.sprint-box { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; border: 1px solid var(--border); overflow: hidden; }
.sprint-head { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; background: var(--surface-2); }
.sprint-head b { font-family: var(--font-display); color: var(--heading); }
.blrow { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid #f0f3ed; cursor: pointer; }
.blrow:hover { background: var(--surface-2); } .blrow .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blrow select { width: auto; padding: 3px 6px; font-size: 12px; }

/* Modal */
.overlay { position: fixed; inset: 0; background: rgba(15, 42, 25, .55); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 580px; box-shadow: var(--shadow-lg); }
.modal.xl { max-width: 1100px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 0; gap: 10px; }
.modal-body { padding: 8px 22px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 14px 14px; }
.issue-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; }
.issue-grid > div:last-child { background: var(--surface-2); border-radius: var(--radius); padding: 14px; border: 1px solid var(--border); align-self: start; }
@media (max-width: 860px) { .issue-grid { grid-template-columns: 1fr; } .overlay { padding: 0; } .modal { border-radius: 0; min-height: 100vh; } }
.issue-title { font-size: 21px; font-weight: 700; font-family: var(--font-display); color: var(--heading); border: 1.5px solid transparent; padding: 4px 6px; margin-left: -8px; }
.issue-title:hover { border-color: var(--border); }
.side-field { display: grid; grid-template-columns: 110px 1fr; align-items: center; gap: 8px; padding: 4px 0; }
.side-field > span { font-size: 12px; color: var(--muted); font-weight: 600; }
.side-field select, .side-field input { padding: 5px 8px; }
.desc { white-space: pre-wrap; padding: 8px; border-radius: var(--radius-sm); min-height: 40px; cursor: text; line-height: 1.55; }
.desc:hover { background: var(--surface-2); }
.checklist-item { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-radius: var(--radius-sm); }
.checklist-item:hover { background: var(--surface-2); } .checklist-item.done .txt { text-decoration: line-through; color: var(--muted); }
.checklist-item .del { visibility: hidden; } .checklist-item:hover .del { visibility: visible; }
div.progress:not(.badge) { height: 7px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin: 4px 0 8px; }
div.progress:not(.badge) > div { height: 100%; background: linear-gradient(90deg, var(--brand-500), var(--lime-500)); transition: width .2s; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin: 20px 0 12px; overflow-x: auto; }
.tabs a { padding: 7px 12px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap; }
.tabs a.active { color: var(--brand-700); border-color: var(--lime-500); }
.comment { display: flex; gap: 10px; margin-bottom: 14px; } .comment .body { white-space: pre-wrap; margin-top: 4px; line-height: 1.5; }
.mention { color: var(--brand-600); font-weight: 600; background: var(--lime-100); border-radius: 4px; padding: 0 3px; }
.tl { border-left: 2px solid var(--border); padding-left: 14px; margin-left: 6px; }
.tl > div { margin-bottom: 12px; position: relative; } .tl > div::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--lime-500); box-shadow: 0 0 0 2px #fff; }

/* Indicadores e gráficos */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.kpi { position: relative; overflow: hidden; }
.kpi::after { content: ''; position: absolute; right: -18px; top: -18px; width: 64px; height: 64px; border-radius: 50%; background: var(--lime-100); }
.kpi .v { font-size: 27px; font-weight: 700; margin-top: 6px; font-family: var(--font-display); color: var(--heading); position: relative; z-index: 1; }
.kpi .v.overdue { color: var(--danger); }
.kpi .l { font-size: 12px; color: var(--muted); font-weight: 600; position: relative; z-index: 1; }
.hbar { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 10px; margin: 7px 0; font-size: 13px; }
.hbar .track { background: var(--surface-3); border-radius: 4px; height: 18px; overflow: hidden; }
.hbar .fill { height: 100%; border-radius: 4px; }
.vbars { display: flex; gap: 10px; align-items: flex-end; height: 170px; padding-top: 10px; }
.vbars .g { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.vbars .pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.vbars .b { width: 40%; max-width: 18px; border-radius: 4px 4px 0 0; min-height: 2px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 1000px) { .report-grid { grid-template-columns: 1fr; } }
.tis-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; font-size: 12px; margin: 7px 0; }
.tis-row .track { grid-column: 1 / -1; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }

/* Notificações, toasts */
.dropdown { position: absolute; right: 0; top: 44px; width: 390px; max-width: calc(100vw - 24px); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 60; max-height: 70vh; overflow-y: auto; border: 1px solid var(--border); }
.notif { padding: 11px 16px; border-bottom: 1px solid #f0f3ed; cursor: pointer; font-size: 13px; color: var(--text); } .notif:hover { background: var(--surface-2); }
.notif.unread { background: var(--lime-100); } .notif .when { font-size: 11px; color: var(--muted); margin-top: 3px; }
#toasts { position: fixed; bottom: 20px; left: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--brand-800); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: var(--shadow-lg); max-width: 400px; border-left: 4px solid var(--lime-500); animation: tin .2s ease-out; }
.toast.error { background: var(--danger); border-left-color: #ffb3a8; }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } }
.empty { text-align: center; color: var(--muted); padding: 30px; }

/* Login */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-brand { background: radial-gradient(circle at 20% 15%, rgba(184,221,22,.18), transparent 45%), linear-gradient(160deg, var(--brand-700), var(--brand-900)); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-brand img { width: min(360px, 80%); }
.auth-brand h2 { color: #fff; font-size: 30px; line-height: 1.2; margin: 0 0 12px; max-width: 460px; }
.auth-brand p { color: rgba(255,255,255,.75); max-width: 440px; line-height: 1.6; margin: 0; }
.auth-brand ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; color: rgba(255,255,255,.85); }
.auth-brand li::before { content: '▲'; color: var(--lime-500); font-size: 10px; margin-right: 10px; vertical-align: 1px; }
.auth-brand .foot { font-size: 12px; color: rgba(255,255,255,.45); }
.auth-brand .orbit { position: absolute; right: -120px; bottom: -160px; width: 520px; height: 300px; border: 6px solid rgba(184,221,22,.25); border-radius: 50%; transform: rotate(-12deg); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.auth-form form { width: 100%; max-width: 380px; }
.auth-form h1 { margin-bottom: 6px; }
.auth-form .btn.primary { width: 100%; padding: 11px; font-size: 15px; margin-top: 18px; }
.auth-mobile-logo { display: none; width: 180px; margin-bottom: 20px; }
@media (max-width: 860px) { .auth { grid-template-columns: 1fr; } .auth-brand { display: none; } .auth-mobile-logo { display: block; } }

/* Usuários */
.role-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 8px; margin-bottom: 6px; cursor: pointer; font-weight: 400; color: var(--text); font-size: 13px; }
.role-opt:hover { border-color: var(--border-strong); background: var(--surface-2); }
.role-opt input { margin-top: 3px; }
.role-opt b { display: block; color: var(--heading); }
.role-opt:has(input:checked) { border-color: var(--brand-500); background: var(--lime-100); }
.callout { border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.5; }
.callout.warn { background: #fff4e0; color: #7a4a00; border: 1px solid #f3d9a8; }
.callout.danger { background: var(--danger-bg); color: #8a2a1f; border: 1px solid #f2c7c1; }
.callout.info { background: var(--lime-100); color: var(--brand-700); border: 1px solid #dfeea0; }

/* Seleção em chips (fibras, etiquetas, pessoas) */
.chips, .people { border: 1.5px solid var(--border); border-radius: 8px; padding: 6px 10px 10px; background: var(--surface-2); max-height: 260px; overflow-y: auto; }
.chip-group { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin: 8px 0 5px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; margin: 0; cursor: pointer; font-weight: 500; color: var(--text); font-size: 12.5px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--border-strong); background: #fff; transition: all .12s; }
.chip:hover span { border-color: var(--brand-500); }
.chip input:checked + span { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.chip input:focus-visible + span { outline: 2px solid var(--lime-500); outline-offset: 2px; }
.modal.lg { max-width: 780px; }

/* Quadro: colunas editáveis */
.column-head.movable { cursor: grab; }
.column-head .colname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-menu { border: 0; background: transparent; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
.col-menu:hover { background: #fff; color: var(--brand-700); }
.column.dragging-col { opacity: .45; }
.column.col-target { outline: 2px dashed var(--lime-500); outline-offset: 2px; }
.add-col { flex: none; width: 200px; min-height: 64px; border: 2px dashed var(--border-strong); border-radius: 12px; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer; }
.add-col:hover { border-color: var(--brand-500); color: var(--brand-700); background: var(--lime-100); }
.icard .card-sub { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: var(--muted); margin: -2px 0 8px; }
.warn-txt { color: var(--warn); font-weight: 600; }

/* Detalhe: blocos laterais, pessoas e anexos */
.side-block { padding: 8px 0; border-top: 1px solid var(--border); margin-top: 6px; }
.side-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.side-block .pill { margin: 4px 4px 0 0; }
.people-list { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.person { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.attachments { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.att { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--surface-2); min-width: 0; }
.att img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; display: block; }
.att-icon { width: 48px; height: 48px; border-radius: 6px; background: var(--surface-3); display: grid; place-items: center; font-weight: 700; color: var(--brand-700); flex: none; }
.att-meta { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.att-meta a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }

/* Menu lateral em acordeão: laboratórios com submenu */
.nav .lab { margin: 2px 0; border-radius: 10px; }
.nav .lab.open { background: rgba(255,255,255,.06); padding-bottom: 6px; }
.nav .lab-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 9px 12px; }
.nav .lab-key { background: rgba(184,221,22,.18); color: var(--lime-400); font-weight: 700; font-size: 11px; letter-spacing: .04em; padding: 3px 7px; border-radius: 6px; }
.nav .lab.current .lab-key { background: var(--lime-500); color: var(--brand-900); }
.nav .lab-name { font-size: 13px; line-height: 1.25; }
.nav .lab.current .lab-name { color: #fff; font-weight: 600; }
.nav .chev { opacity: .6; font-size: 12px; }
.nav .lab-sub { margin-left: 22px; border-left: 1px solid rgba(255,255,255,.14); padding-left: 6px; }
.nav .lab-sub a { padding: 6px 10px; font-size: 13px; }
.nav .lab-sub a.active::before { left: -13px; }
.nav a.sm-link { font-size: 12.5px; color: rgba(255,255,255,.6); margin-top: 4px; }

/* Documentos */
.dropzone { border: 2px dashed var(--border-strong); border-radius: 12px; padding: 22px; text-align: center; background: var(--surface); color: var(--muted); margin-bottom: 18px; transition: all .15s; cursor: pointer; }
.dropzone:hover, .dropzone.over { border-color: var(--brand-500); background: var(--lime-100); color: var(--brand-700); }
.dropzone b { color: var(--brand-700); }
.docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.doc { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-sm); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.doc-top { display: flex; gap: 12px; align-items: flex-start; }
.doc-ico { width: 44px; height: 52px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.doc-ico.pdf { background: #c0392b; } .doc-ico.word { background: #2b579a; } .doc-ico.other { background: #7f8c80; }
.doc-title { font-weight: 700; color: var(--heading); line-height: 1.3; word-break: break-word; }
.doc-preview { font-size: 12.5px; color: var(--muted); line-height: 1.45; max-height: 74px; overflow: hidden; white-space: pre-wrap; background: var(--surface-2); border-radius: 6px; padding: 8px; }
.doc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.doc-issues { display: flex; gap: 4px; flex-wrap: wrap; font-size: 12px; }
.source-doc { font-size: 13px; background: var(--lime-100); border: 1px solid #dfeea0; color: var(--brand-700); border-radius: 8px; padding: 7px 10px; margin-top: 8px; }

/* ---------------------------------------------------------------- Componentes v5 */
.progress-toast { min-width: 280px; }
.progress-toast .bar { height: 5px; background: rgba(255,255,255,.2); border-radius: 3px; margin-top: 8px; overflow: hidden; }
.progress-toast .bar > div { height: 100%; width: 0; background: var(--lime-500); transition: width .2s; }
.avatar.emoji { background: var(--lime-100) !important; color: inherit; font-size: 15px; }
.avatar.lg.emoji { font-size: 18px; }
img.avatar { object-fit: cover; }
.avatar.xl { width: 84px; height: 84px; font-size: 30px; }
.avatar.xl.emoji { font-size: 44px; }
.profile-pic { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.icon-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.icon-pick { border: 1px solid var(--border); background: var(--surface-2); border-radius: 8px; font-size: 18px; width: 34px; height: 34px; cursor: pointer; }
.icon-pick:hover { border-color: var(--brand-500); background: var(--lime-100); }
.hold-box { font-size: 13px; background: var(--holdbg); color: #8a5200; padding: 8px 10px; border-radius: 8px; margin-top: 8px; }
/* Painel lateral da solicitação com abas */
.issue-grid > .side { padding-top: 6px; }
.side-tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin: -4px 0 10px; }
.side-tabs a { flex: 1; text-align: center; padding: 7px 4px; font-weight: 600; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -2px; }
.side-tabs a.active { color: var(--brand-700); border-color: var(--lime-500); }
.dropzone.small-dz { padding: 12px; margin-bottom: 10px; font-size: 13px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 10px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); display: block; }
.att-list { display: flex; flex-direction: column; gap: 6px; }
.att-list .att-icon { width: 34px; height: 34px; font-size: 11px; }
/* Registro de alterações */
.changes { display: flex; flex-direction: column; gap: 10px; }
.change { border-left: 3px solid var(--lime-500); padding: 4px 0 4px 10px; }
.diff { margin-top: 3px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.diff .old { background: #fdecea; color: #8a2a1f; text-decoration: line-through; border-radius: 3px; padding: 0 3px; }
.diff .new { background: #e6f4d9; color: #2b5e14; border-radius: 3px; padding: 0 3px; }
.diff details summary { cursor: pointer; }
.pre { white-space: pre-wrap; }
/* Relatório */
.report-form textarea { font-size: 13.5px; line-height: 1.5; }
table.shortcuts td { padding: 6px 8px; } kbd { background: var(--surface-3); border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 1px 6px; font-size: 12px; font-family: inherit; }
.sug-list { display: flex; flex-direction: column; gap: 12px; }
pre.code { background: var(--surface-3); padding: 10px 12px; border-radius: 8px; overflow-x: auto; font-size: 12.5px; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }

/* ---------------------------------------------------------------- Modo noturno */
:root { --heading: var(--brand-800); }
h1, h2, h3, .sprint-head b, .issue-title, .doc-title, .kpi .v, .role-opt b { color: var(--heading); }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1511; --surface: #16211a; --surface-2: #1b2820; --surface-3: #223127; --border: #2b3d31; --border-strong: #3b5243;
  --text: #e3ebe5; --muted: #9aae9f; --heading: #d4ecbf;
  --brand-500: #4fae6c; --brand-600: #3e9a5b; --brand-700: #6cc287; --primary: #2f8a4c; --primary-h: #3a9c59;
  --lime-100: #243418; --todo: #26342b; --progress: #1d3a27; --done: #2f3d14; --holdbg: #3a2d10; --danger-bg: #3a1c19;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4); --shadow: 0 1px 3px rgba(0,0,0,.45), 0 4px 12px rgba(0,0,0,.25);
}
:root[data-theme="dark"] body { background: var(--bg); }
:root[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #13301d 0%, #08150d 100%); }
:root[data-theme="dark"] .topbar { background: rgba(22, 33, 26, .95); }
:root[data-theme="dark"] .btn:hover { background: #2c3f32; }
:root[data-theme="dark"] .btn.primary:hover { background: var(--primary-h); }
:root[data-theme="dark"] .toast { background: #22362a; }
:root[data-theme="dark"] .chip span { background: var(--surface); }
:root[data-theme="dark"] .column-head .count { background: var(--surface); }
:root[data-theme="dark"] .col-menu:hover { background: var(--surface); }
:root[data-theme="dark"] .column.over { background: #2c1c1a; border-color: #5a2b26; }
:root[data-theme="dark"] .badge { color: #c7d6cb; }
:root[data-theme="dark"] .badge.progress { color: #8fd6a3; } :root[data-theme="dark"] .badge.done { color: #c9e86b; } :root[data-theme="dark"] .badge.hold { color: #f0c46b; }
:root[data-theme="dark"] .badge.off { background: #3a1c19; color: #f19a8f; }
:root[data-theme="dark"] .pill { color: #c9e86b; }
:root[data-theme="dark"] .hold-box, :root[data-theme="dark"] .icard .hold-reason { color: #f0c46b; }
:root[data-theme="dark"] .callout.info { color: #c9e86b; border-color: #3b4f1f; } :root[data-theme="dark"] .callout.warn { background: #3a2d10; color: #f0c46b; border-color: #5a4515; }
:root[data-theme="dark"] .callout.danger { color: #f19a8f; border-color: #5a2b26; }
:root[data-theme="dark"] .source-doc { color: #c9e86b; border-color: #3b4f1f; }
:root[data-theme="dark"] .mention { color: #c9e86b; }
:root[data-theme="dark"] .diff .old { background: #3a1c19; color: #f19a8f; } :root[data-theme="dark"] .diff .new { background: #1f3a18; color: #b9e58f; }
:root[data-theme="dark"] tr.clickable:hover td, :root[data-theme="dark"] .blrow:hover { background: var(--surface-3); }
:root[data-theme="dark"] .avatar { box-shadow: 0 0 0 2px var(--surface); }
:root[data-theme="dark"] .auth-form { background: var(--surface); }
:root[data-theme="dark"] .overlay { background: rgba(0, 0, 0, .65); }
:root[data-theme="dark"] a { color: #7fd197; }
:root[data-theme="dark"] .nav a, :root[data-theme="dark"] .notif { color: inherit; }
:root[data-theme="dark"] .nav a { color: rgba(255,255,255,.82); }
:root[data-theme="dark"] .btn.link, :root[data-theme="dark"] .tabs a.active, :root[data-theme="dark"] .side-tabs a.active { color: #8fd6a3; }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .btn.danger { color: #fff; }
:root[data-theme="dark"] .btn.accent { color: #0f2a19; }

/* Tela da solicitação em coluna única com abas no topo */
.modal.issue-modal { max-width: 980px; }
.issue-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 8px 0 6px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 600; }
.status-chip span { font-size: 12px; color: var(--muted); }
.status-chip select { width: auto; min-width: 170px; padding: 5px 8px; font-weight: 600; }
.head-info { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); padding: 0 4px; }
.top-tabs { margin: 14px 0 10px; }
.top-tabs a { flex: 0 0 auto; padding: 8px 14px; font-size: 13.5px; }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 24px; }
.details-grid .side-field { grid-template-columns: 130px 1fr; }
.details-blocks { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 20px; margin-top: 6px; }
@media (max-width: 860px) { .details-grid, .details-blocks { grid-template-columns: 1fr; } }
.gallery { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.col-rename { width: 100%; padding: 3px 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; }
.column-head .colname { cursor: text; border-radius: 4px; padding: 1px 3px; margin-left: -3px; }
.column-head .colname:hover { background: var(--surface); outline: 1px dashed var(--border-strong); }

/* ================================================================ Acabamento visual v7 */
.i { flex: none; vertical-align: -3px; }
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; }
.btn.icon-btn { padding: 6px 8px; }
.btn-group { display: inline-flex; gap: 2px; background: var(--surface-3); border-radius: 8px; padding: 2px; }
.btn-group .btn { background: transparent; }
.btn-group .btn:hover { background: var(--surface); }
.nav .ico { display: inline-flex; width: 18px; justify-content: center; opacity: .85; }
.nav a.active .ico { opacity: 1; color: var(--lime-400); }
#content { animation: fadein .18s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

/* Topo: busca global */
.gsearch { position: relative; display: flex; align-items: center; width: min(420px, 38vw); }
.gsearch input { padding: 8px 64px 8px 34px; border-radius: 10px; background: var(--surface-2); border-color: var(--border); }
.gsearch input:focus { background: var(--surface); }
.gs-ico { position: absolute; left: 11px; color: var(--muted); display: flex; pointer-events: none; }
.gs-kbd { position: absolute; right: 9px; font-size: 10.5px; color: var(--muted); pointer-events: none; }
.gs-results { left: 0; right: auto; width: 100%; min-width: 420px; top: 44px; padding: 4px; }
.gs-item { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; color: var(--text); cursor: pointer; }
.gs-item.sel, .gs-item:hover { background: var(--lime-100); }
.gs-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-empty { padding: 14px; color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .gsearch { display: none; } }
.lab-pill { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; background: var(--brand-700); color: var(--lime-400); border-radius: 5px; padding: 2px 6px; flex: none; }
.key { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--heading); }

/* Painel inicial */
.hero { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; }
.hero h1 { margin: 2px 0 4px; font-size: 26px; }
.hero-date { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.kpi::after { display: none; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.kpi .v { margin-top: 2px; }
.kpi-ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tone-green .kpi-ico { background: #e3f1e6; color: var(--brand-600); }
.tone-red .kpi-ico { background: var(--danger-bg); color: var(--danger); } .tone-red .v { color: var(--danger); }
.tone-amber .kpi-ico { background: var(--holdbg); color: #b26a00; }
.tone-blue .kpi-ico { background: #e3eef8; color: #2b5f8a; }
.tone-gray .kpi-ico { background: var(--surface-3); color: var(--muted); }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; }
@media (max-width: 1000px) { .home-grid { grid-template-columns: 1fr; } }
.section-title { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; color: var(--heading); margin: 0 0 10px; font-size: 15px; }
.work-list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.work-row { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.work-row:last-child { border-bottom: 0; }
.work-row:hover { background: var(--surface-2); }
.work-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-row .due { font-size: 12px; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; min-width: 86px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; color: var(--muted); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: var(--radius); text-align: center; }
.empty-state p { margin: 0; font-size: 13px; }
.lab-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; color: var(--text); box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s, border-color .12s; }
.lab-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--brand-500); color: var(--text); }
.lab-card .row { gap: 10px; }
.lab-key-lg { background: var(--brand-700); color: var(--lime-400); font-weight: 800; font-size: 12px; padding: 4px 8px; border-radius: 7px; letter-spacing: .04em; }
.lab-stats { display: flex; gap: 16px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.lab-stats b { color: var(--heading); font-size: 15px; }
.lab-card.ghost { display: flex; gap: 12px; align-items: center; border-style: dashed; box-shadow: none; background: transparent; color: var(--brand-700); }

/* Quadro */
.column { border-top: 3px solid var(--border-strong); }
.column.cat-todo { border-top-color: #9aa89d; } .column.cat-progress { border-top-color: var(--brand-500); }
.column.cat-hold { border-top-color: #e0a020; } .column.cat-done { border-top-color: var(--lime-500); }
.col-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 8px; margin: 2px 0 6px; border: 1.5px dashed var(--border-strong); border-radius: 8px; color: var(--muted); font-size: 12px; text-align: center; }
.icard { border-radius: 10px; }
.icard .meta { gap: 9px; }
.icard .meta > span:not(.type-icon):not(.avatar):not(.grow), .icard .card-sub > span { display: inline-flex; align-items: center; gap: 3px; }
.icard .meta b { color: var(--heading); font-size: 12px; }
.ok-txt { color: var(--ok); font-weight: 600; }
.filters { padding: 8px; gap: 6px; }
.filters input, .filters select { padding: 6px 9px; font-size: 13px; min-width: 140px; }

/* Tabelas */
th { white-space: nowrap; }
.list-table td:nth-child(2) { min-width: 240px; }
.list-table td:nth-child(3) { min-width: 120px; }
tr.clickable td:first-child { font-weight: 600; }

/* Abas */
.tabs a, .side-tabs a { display: inline-flex; align-items: center; gap: 6px; }
.cnt { background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; line-height: 18px; }
.tabs a.active .cnt, .side-tabs a.active .cnt { background: var(--lime-100); color: var(--brand-700); }
.top-tabs { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 3px; border-bottom-width: 1px; }
.top-tabs a { border: 0; border-radius: 8px; margin: 0; justify-content: center; }
.top-tabs a.active { background: var(--surface); box-shadow: var(--shadow-sm); color: var(--brand-700); }
.issue-title { font-size: 22px; }
.issue-head { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.modal-head h2:empty { display: none; }

/* Modo noturno para os novos elementos */
:root[data-theme="dark"] .tone-green .kpi-ico { background: #1d3a27; color: #8fd6a3; }
:root[data-theme="dark"] .tone-blue .kpi-ico { background: #1c2c3a; color: #8fb8dc; }
:root[data-theme="dark"] .tone-amber .kpi-ico { color: #f0c46b; }
:root[data-theme="dark"] .lab-pill, :root[data-theme="dark"] .lab-key-lg { background: #23402c; }
:root[data-theme="dark"] .gs-item.sel, :root[data-theme="dark"] .gs-item:hover { background: var(--surface-3); }
:root[data-theme="dark"] .lab-card.ghost { color: #8fd6a3; }

.btn.menu-toggle { display: none; }
@media (max-width: 860px) { .btn.menu-toggle { display: inline-flex; } }

/* ================================================================ v8: seletores fechados, pessoas, dashboard */
:root { --series-1: #2b7442; --series-2: #3d6fb6; }
:root[data-theme="dark"] { --series-1: #3f9a5c; --series-2: #5b8fd6; }
/* Menu fechado (fibras/etiquetas) */
.ms { border: 1.5px solid var(--border-strong); border-radius: 8px; background: var(--surface); position: relative; }
.ms[open] { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(184, 221, 22, .25); }
.ms > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 7px 10px; min-height: 36px; }
.ms > summary::-webkit-details-marker { display: none; }
.ms-sum { flex: 1; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13.5px; }
.ms-arrow { color: var(--muted); transform: rotate(90deg); transition: transform .15s; display: flex; }
.ms[open] .ms-arrow { transform: rotate(-90deg); }
.ms-panel { border-top: 1px solid var(--border); padding: 4px 10px 10px; max-height: 360px; overflow-y: auto; background: var(--surface-2); border-radius: 0 0 8px 8px; }
.ms-group { border-bottom: 1px solid var(--border); padding: 4px 0; }
.ms-group:last-child { border-bottom: 0; }
.ms-group > summary { cursor: pointer; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 6px 0; display: flex; align-items: center; gap: 6px; }
.ms-group[open] > summary { color: var(--brand-700); }
.ms-group .chip-row { padding: 2px 0 6px; }
.comp-box { margin-top: 8px; border-top: 1px dashed var(--border-strong); padding-top: 4px; }
.comp-row { display: grid; grid-template-columns: 1fr 90px auto; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; }
.comp-row input { padding: 4px 8px; text-align: right; }
.comp-total { text-align: right; font-size: 13px; margin-top: 4px; }
.comp-hint { margin-top: 4px; }
.details-grid .span2 { grid-column: 1 / -1; grid-template-columns: 130px 1fr; }
/* Pessoas marcadas (autocompletar) */
.people-input { position: relative; }
.pi-box { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1.5px solid var(--border-strong); border-radius: 8px; padding: 5px 7px; background: var(--surface); min-height: 38px; }
.pi-box:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(184, 221, 22, .3); }
.pi-text { border: 0 !important; box-shadow: none !important; padding: 3px 4px; flex: 1; min-width: 180px; background: transparent; }
.pi-chips { display: contents; }
.pi-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--lime-100); border-radius: 999px; padding: 2px 4px 2px 3px; font-size: 13px; font-weight: 500; }
.pi-chip .avatar { width: 22px; height: 22px; font-size: 9px; box-shadow: none; }
.pi-chip button { border: 0; background: transparent; cursor: pointer; color: var(--muted); font-size: 16px; line-height: 1; padding: 0 4px; border-radius: 50%; }
.pi-chip button:hover { color: var(--danger); }
.pi-list { left: 0; right: auto; top: calc(100% + 4px); width: 100%; max-width: 460px; padding: 4px; }
.pi-opt { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border-radius: 8px; color: var(--text); cursor: pointer; }
.pi-opt.sel, .pi-opt:hover { background: var(--lime-100); }
/* Usuários: ações em lote */
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.user-cell input[type=checkbox] { margin-right: 2px; }
/* Dashboard */
.dash-filters input[type=date] { min-width: 0; }
.dtiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 10px; margin-bottom: 16px; }
.dtile { padding: 14px 16px; }
.dtile .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.dtile .v { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--heading); margin: 2px 0; font-variant-numeric: tabular-nums; }
.dtile.bad .v { color: var(--danger); } .dtile.warn .v { color: #b26a00; }
.dgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.dcard { min-width: 0; } .dcard.wide { grid-column: span 2; }
@media (max-width: 1200px) { .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .dgrid { grid-template-columns: 1fr; } .dcard.wide { grid-column: auto; } }
.dcard h2 { display: flex; align-items: center; gap: 6px; font-size: 15px; }
.dhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.legend .sw, .viz-tip .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.sw.s1 { background: var(--series-1); } .sw.s2 { background: var(--series-2); }
.viz-line { width: 100%; height: auto; display: block; margin-top: 6px; }
.viz-line .grid { stroke: var(--border); stroke-width: 1; }
.viz-line .ax { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.viz-line .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line .ln.s1 { stroke: var(--series-1); } .viz-line .ln.s2 { stroke: var(--series-2); }
.viz-line .pt { stroke: var(--surface); stroke-width: 2; } .viz-line .pt.s1 { fill: var(--series-1); } .viz-line .pt.s2 { fill: var(--series-2); }
.viz-line .dl { font-size: 12px; font-weight: 600; fill: var(--text); font-family: var(--font); }
.viz-line .hit { fill: transparent; cursor: crosshair; }
.viz-line .hit:hover { fill: var(--surface-3); fill-opacity: .55; }
.hb { display: flex; flex-direction: column; gap: 6px; }
.hb-row { display: grid; grid-template-columns: minmax(80px, 40%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; padding: 2px 4px; border-radius: 6px; cursor: default; }
.hb-row:hover { background: var(--surface-2); }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.hb-track { height: 14px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.hb-fill { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0; }
.hb-val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); min-width: 36px; text-align: right; }
.lab-status { margin-bottom: 12px; } .lab-status .row { margin-bottom: 6px; gap: 8px; }
.viz-empty { color: var(--muted); font-size: 13px; padding: 14px 0; }
.viz-tip { position: fixed; z-index: 300; pointer-events: none; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; line-height: 1.5; max-width: 280px; }
.drow { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 13px; }
.drow:last-child { border-bottom: 0; } .drow:hover { background: var(--surface-2); }
.drow .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap.flat { box-shadow: none; }
.cellbar { display: inline-block; width: 60px; height: 8px; background: var(--surface-3); border-radius: 4px; margin-right: 8px; overflow: hidden; vertical-align: 0; }
.cellbar span { display: block; height: 100%; background: var(--series-1); }

.dtile .v { font-size: 24px; }

/* Usuários: seção de acesso e segurança dentro da edição */
.sec-box { margin-top: 16px; border: 1px solid var(--border); border-radius: 10px; padding: 12px; background: var(--surface-2); }
.sec-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.sec-status { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.sec-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ================================================================ Portal Akmey */
.logo-on-dark { display: none; }
:root[data-theme="dark"] .logo-on-light { display: none; }
:root[data-theme="dark"] .logo-on-dark { display: block; }
a.sidebar-brand { display: block; }

/* Login limpo: logo + usuário e senha, anéis de "átomo" ao fundo */
.login { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 18px; padding: 24px 16px; background: var(--bg); position: relative; overflow: hidden; }
.login-bg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.login-bg span { position: absolute; width: min(1100px, 170vw); height: min(380px, 60vw); border: 2px solid var(--lime-500); border-radius: 50%; opacity: .22; }
.login-bg span:nth-child(1) { transform: rotate(-14deg); }
.login-bg span:nth-child(2) { transform: rotate(46deg); border-color: var(--brand-500); opacity: .14; }
.login-bg span:nth-child(3) { transform: rotate(106deg); opacity: .12; }
.login-card { position: relative; width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 34px 30px 26px; box-shadow: var(--shadow-lg); animation: fadein .3s ease; }
.login-logo { display: flex; justify-content: center; margin-bottom: 18px; }
.login-logo img { width: 210px; }
.login-card form .btn.primary { width: 100%; padding: 11px; font-size: 15px; margin-top: 20px; }
.login-help { text-align: center; margin: 16px 0 0; font-size: 12px; color: var(--muted); }
.login-foot { position: relative; font-size: 12px; color: var(--muted); }

/* Estrutura do portal */
.portal { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.portal-top { display: flex; align-items: center; gap: 14px; padding: 12px 28px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 20; }
.portal-logo img { height: 40px; width: auto; }
.portal-nav { display: flex; gap: 4px; }
.portal-nav a { display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; }
.portal-nav a:hover { background: var(--surface-3); color: var(--text); }
.portal-nav a.active { background: var(--lime-100); color: var(--heading); }
.portal-user { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 3px 12px 3px 3px; cursor: pointer; font-weight: 600; }
.portal-user:hover { background: var(--surface-2); }
.portal-main { flex: 1; width: 100%; max-width: 1160px; margin: 0 auto; padding: 8px 28px 40px; }
.portal-foot { text-align: center; font-size: 12px; color: var(--muted); padding: 18px; }
.portal-page { padding-top: 24px; }
.portal-page .page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.sec-h { font-size: 15px; margin: 26px 0 10px; color: var(--heading); }

/* Destaque com átomo */
.portal-hero { text-align: center; padding: 34px 0 26px; }
.portal-hero h1 { font-family: var(--font-display); font-size: 30px; margin: 14px 0 6px; color: var(--heading); }
.portal-hero p { margin: 0; color: var(--muted); font-size: 15px; }
.atom { position: relative; width: 150px; height: 150px; margin: 0 auto; }
.atom span { position: absolute; inset: 48px -6px; border: 2px solid var(--lime-500); border-radius: 50%; opacity: .7; animation: atom-spin 16s linear infinite; }
.atom span:nth-child(2) { border-color: var(--brand-500); --r: 60deg; animation-duration: 18s; }
.atom span:nth-child(3) { --r: 120deg; opacity: .75; animation-duration: 22s; }
.atom i { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #2b7442, #143520 75%); box-shadow: 0 0 0 6px rgba(184, 221, 22, .18), 0 8px 24px rgba(15, 42, 25, .35); display: grid; place-items: center; z-index: 1; }
.atom i img { width: 38px; height: 38px; margin-left: 2px; }
@keyframes atom-spin { from { transform: rotate(var(--r, 0deg)); } to { transform: rotate(calc(var(--r, 0deg) + 360deg)); } }
@media (prefers-reduced-motion: reduce) { .atom span { animation: none; transform: rotate(var(--r, 0deg)); } }

/* Cartões dos programas */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 300px)); justify-content: center; gap: 18px; }
.app-tile { --c: var(--brand-600); --cb: var(--lime-100); position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left; padding: 22px 22px 18px; min-height: 196px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; color: var(--text); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.app-tile::after { content: ''; position: absolute; right: -40px; top: -40px; width: 130px; height: 130px; border-radius: 50%; border: 2px solid var(--c); opacity: .12; }
.app-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--c); color: var(--text); }
.app-tile:focus-visible { outline: 3px solid var(--lime-500); }
.app-ico { width: 58px; height: 58px; border-radius: 14px; display: grid; place-items: center; background: var(--cb); color: var(--c); }
.app-ico.sm { width: 42px; height: 42px; border-radius: 10px; flex: none; }
.app-name { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1.25; color: var(--heading); margin-top: 4px; }
.app-desc { font-size: 13px; color: var(--muted); line-height: 1.45; flex: 1; }
.app-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.app-ext { font-size: 11.5px; color: var(--muted); }
.app-tile.add { border-style: dashed; box-shadow: none; background: transparent; --c: var(--muted); --cb: var(--surface-3); }
.c-green { --c: #1f5a32; --cb: #e3f1e6; } .c-lime { --c: #5c7a00; --cb: #f0f8d0; } .c-blue { --c: #2c5c9e; --cb: #e3ecf8; }
.c-teal { --c: #12706e; --cb: #dcf1ef; } .c-amber { --c: #9a5b00; --cb: #fbefd8; } .c-gray { --c: #44514a; --cb: #e9edea; }
:root[data-theme="dark"] .c-green { --c: #7fd29a; --cb: #1d3a27; } :root[data-theme="dark"] .c-lime { --c: #c9e86b; --cb: #2f3d14; }
:root[data-theme="dark"] .c-blue { --c: #8fb6ec; --cb: #1c2c44; } :root[data-theme="dark"] .c-teal { --c: #74d3cf; --cb: #143533; }
:root[data-theme="dark"] .c-amber { --c: #f0c46b; --cb: #3a2d10; } :root[data-theme="dark"] .c-gray { --c: #c3cec7; --cb: #2a332e; }
.app-ico.c-green, .app-ico.c-lime, .app-ico.c-blue, .app-ico.c-teal, .app-ico.c-amber, .app-ico.c-gray { background: var(--cb); color: var(--c); }

/* Administração do portal */
.app-admin { display: grid; gap: 10px; }
.app-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; }
.sec-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.check-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: 13px; }
.check-list li::before { content: '✓'; color: var(--ok); font-weight: 700; margin-right: 8px; }
code { background: var(--surface-3); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.app-icon-pick, .color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.app-icon-pick label, .color-pick label { margin: 0; cursor: pointer; }
.app-icon-pick input, .color-pick input { position: absolute; opacity: 0; pointer-events: none; }
.app-icon-pick span { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1.5px solid var(--border-strong); color: var(--text); background: var(--surface); }
.app-icon-pick input:checked + span { border-color: var(--brand-500); background: var(--lime-100); box-shadow: 0 0 0 3px rgba(184, 221, 22, .35); }
.color-pick span { display: block; width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--border-strong); }
.color-pick input:checked + span { box-shadow: 0 0 0 3px var(--lime-500); }
.app-icon-pick input:focus-visible + span, .color-pick input:focus-visible + span { outline: 2px solid var(--lime-500); outline-offset: 2px; }
.who-list { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; background: var(--surface-2); }
.who-item { margin: 0; padding: 5px 0; color: var(--text); font-weight: 500; font-size: 13px; gap: 8px; }
.who-item[hidden] { display: none; }

/* Mensagens */
.rcpt { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; border: 1.5px solid var(--border-strong); border-radius: var(--radius-sm); padding: 4px 6px; background: var(--surface); cursor: text; }
.rcpt:focus-within { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(184, 221, 22, .35); }
.rcpt input { border: 0; box-shadow: none !important; flex: 1; min-width: 160px; padding: 4px; width: auto; }
.rcpt-chips { display: contents; }
.chip-x { display: inline-flex; align-items: center; gap: 4px; background: var(--lime-100); color: var(--heading); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: 12.5px; font-weight: 600; }
.chip-x button { border: 0; background: transparent; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); padding: 0 4px; }
.rcpt-list { position: relative; top: auto; right: auto; width: 100%; max-height: 280px; overflow-y: auto; margin-top: 4px; }
.rcpt-list .hl { background: var(--surface-2); }
.msg-body { white-space: pre-wrap; line-height: 1.6; }

@media (max-width: 760px) {
  .portal-top { padding: 10px 16px; gap: 8px; }
  .portal-logo img { height: 32px; }
  .portal-nav span, .portal-user > span:not(.avatar) { display: none; }
  .portal-user { padding: 3px; }
  .portal-main { padding: 4px 16px 32px; }
  .portal-hero h1 { font-size: 24px; }
  .sec-grid { grid-template-columns: 1fr; }
  .app-row { flex-wrap: wrap; }
}
