:root {
  --pond: #214a63;
  --papaya: #f7a287;
  --bg: #f8f9fa;
  --ink: #233e4f;
  --muted: #758894;
  --line: #e1e8ec;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--bg);
  font: 13px/1.5 'Segoe UI', Arial, sans-serif;
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 7px 10px;
}

button:hover {
  background: #edf3f6;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
}

input,
select,
textarea {
  border: 1px solid #dce5e9;
  border-radius: 5px;
  background: white;
  padding: 7px 9px;
  min-width: 0;
}

input[type="checkbox"] {
  accent-color: var(--pond);
  width: 14px;
  height: 14px;
  cursor: pointer;
}

textarea {
  min-height: 70px;
  resize: vertical;
}

.primary {
  background: var(--pond);
  border-color: var(--pond);
  color: white;
  font-weight: 600;
}

.primary:hover {
  background: #173d54;
}

.quiet {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

main {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 24px;
  max-width: 2100px;
  margin: auto;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  flex-shrink: 0;
}

.app-header > div {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  font-size: 31px;
  line-height: 1;
  letter-spacing: -2px;
  font-weight: 750;
}

.logo span {
  color: var(--papaya);
}

h1 {
  font-size: 19px;
  font-weight: 650;
  margin: 0;
  letter-spacing: -0.5px;
}

.header-divider {
  height: 18px;
  width: 1px;
  background: #d8e2e7;
}

.header-caption {
  color: var(--muted);
  font-size: 12px;
}

.demo {
  color: #9b796a;
  font-size: 10px;
}

.app-header .primary {
  font-size: 12px;
}

.workspace-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.workspace-nav > div {
  display: flex;
  gap: 20px;
}

.workspace-nav button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
}

.workspace-nav button.selected {
  color: var(--pond);
  border-color: var(--pond);
  font-weight: 650;
}

.workspace-nav button span {
  font-size: 10px;
  padding: 2px 6px;
  background: #e8eef2;
  border-radius: 4px;
  margin-left: 5px;
}

.workspace-nav > span {
  font-size: 11px;
  color: #b2735b;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 0;
  flex-shrink: 0;
}

.toolbar > input {
  flex: 1;
  min-width: 150px;
  max-width: 470px;
}

.toolbar select {
  font-size: 11px;
  max-width: 150px;
}

.group-select {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  font-size: 10px;
  color: var(--muted);
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(470px, 1fr) minmax(390px, 440px);
  border: 1px solid var(--line);
  background: white;
  border-radius: 9px;
  overflow: hidden;
}

.work-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  background: #fff;
}

.list-header {
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  font-size: 10px;
  color: var(--muted);
}

.list-header label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-header > span {
  margin-left: auto;
}

.list-header select {
  font-size: 10px;
  padding: 3px;
}

.list-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 15px;
  font-size: 9px;
  color: #899aa4;
  border-top: 1px solid var(--line);
}

#list {
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.work-row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) 147px;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 1px solid #eaf0f3;
  border-left: 3px solid transparent;
  align-items: start;
}

.work-row.current {
  background: #f0f6f9;
  border-left-color: var(--pond);
}

.work-row:hover {
  background: #f7fafb;
}

.work-row.current:hover {
  background: #edf4f8;
}

.work-row > input {
  margin: 5px 0;
}

.row-main {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  min-width: 0;
}

.row-main:hover {
  background: transparent;
}

.row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.row-top strong {
  font-size: 11px;
  color: #557587;
}

.row-id {
  font-size: 9px;
  color: #9aabb5;
  margin-left: auto;
}

.badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 500;
}

.urgent {
  background: #ffebe4;
  color: #b36041;
}

.soon {
  background: #fff4da;
  color: #977120;
}

.low {
  background: #edf1f4;
  color: #80919b;
}

.row-main h3 {
  font-size: 13px;
  font-weight: 650;
  margin: 3px 0;
  line-height: 1.4;
  color: #274657;
}

.excerpt {
  margin: 0;
  font-size: 11px;
  color: #7e909b;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row-context {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: #66867b;
  margin-top: 5px;
}

.access {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.occupied {
  color: #a17c68;
}

.row-operations {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
}

.row-operations select {
  padding: 1px 4px;
  font-size: 9px;
  max-width: 100px;
  align-self: flex-end;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.meta-action {
  font-size: 10px;
  padding: 0 3px;
  text-align: right;
  background: transparent;
  border: 0;
  color: #617c8b;
}

.meta-action small {
  display: block;
  font-size: 10px;
  color: #8b9da7;
}

.next-action {
  font-size: 10px;
  border: 0;
  background: #eaf1f5;
  color: var(--pond);
  padding: 5px 7px;
  margin-top: 2px;
  text-align: right;
  font-weight: 600;
}

.list-group {
  position: sticky;
  top: 0;
  background: #f0f4f7;
  z-index: 1;
  padding: 6px 18px;
  font-size: 10px;
  font-weight: 600;
  color: #728997;
  border-bottom: 1px solid var(--line);
}

.list-group span {
  float: right;
}

#bulk {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  background: var(--pond);
  color: white;
  flex-wrap: wrap;
  font-size: 11px;
}

#bulk button {
  font-size: 10px;
  padding: 4px 8px;
}

#bulk .quiet {
  color: #d6e5ed;
}

#bulk strong {
  margin-right: auto;
}

#detail {
  border-left: 1px solid var(--line);
  min-height: 0;
  background: #fcfdfe;
  overflow: hidden;
}

#form {
  display: flex;
  height: 100%;
  flex-direction: column;
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.eyebrow {
  font-size: 9px;
  letter-spacing: 1px;
  color: #8499a6;
}

.drawer-head h2 {
  font-size: 16px;
  line-height: 1.4;
  margin: 5px 0 0;
  letter-spacing: -0.3px;
}

.panel-nav {
  display: flex;
  gap: 4px;
  align-items: flex-start;
}

.panel-nav button {
  font-size: 14px;
  padding: 3px 8px;
}

.drawer-body {
  overflow: auto;
  flex: 1;
  padding: 17px 20px;
}

.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-line strong {
  font-size: 12px;
}

.drawer-body h3 {
  font-size: 11px;
  font-weight: 650;
  margin: 12px 0 6px;
}

.section-line h3 {
  margin: 0;
}

.case-summary p {
  font-size: 12px;
  line-height: 1.6;
  margin: 10px 0;
  color: #657e8d;
  white-space: pre-wrap;
}

.case-summary .relevant {
  border-left: 2px solid var(--papaya);
  padding-left: 10px;
  font-size: 11px;
}

.access-box {
  background: #edf4f5;
  border-radius: 6px;
  padding: 9px 11px;
  font-size: 11px;
  color: #557c77;
}

.access-box small {
  font-size: 9px;
  display: block;
  margin-top: 3px;
  color: #91a2aa;
}

.note {
  font-size: 10px;
  line-height: 1.65;
  color: var(--muted);
  margin: 8px 0;
}

.media-section {
  margin: 13px 0;
}

.media-thumbnails {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 8px 0;
}

.media-thumb {
  width: 94px;
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
}

.media-thumb img,
.video-symbol {
  width: 100%;
  height: 54px;
  object-fit: cover;
  display: block;
  background: #eaf1f5;
}

.video-symbol {
  display: grid;
  place-items: center;
  font-size: 20px;
}

.media-thumb > span:last-child {
  display: block;
  font-size: 8px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 3px;
}

details {
  border-top: 1px solid var(--line);
  padding: 11px 0;
}

summary {
  font-size: 11px;
  cursor: pointer;
  color: #587585;
  font-weight: 600;
}

details .form-grid {
  margin-top: 12px;
}

.planning {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.planning > .section-line {
  margin-bottom: 12px;
}

.release {
  font-size: 10px;
  border: 0;
  background: #e4eef3;
  color: var(--pond);
  padding: 5px 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10px;
  color: #748b98;
}

.field input,
.field select,
.field textarea {
  font-size: 11px;
}

.field.full {
  grid-column: 1 / -1;
}

.checks {
  display: flex;
  gap: 14px;
  padding: 5px 0;
  flex-wrap: wrap;
}

.checks label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.related {
  background: #f7f5ee;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 9px;
}

.related strong {
  font-size: 10px;
  color: #8d7a49;
}

.related p {
  font-size: 9px;
  color: #a3936f;
  margin: 2px 0 6px;
}

.related button {
  display: block;
  font-size: 10px;
  background: none;
  border: 0;
  text-align: left;
  padding: 3px 0;
  color: #877b61;
}

.material-row {
  display: grid;
  grid-template-columns: 1fr 55px 55px 25px;
  gap: 5px;
  align-items: center;
  margin: 8px 0;
}

.material-row select,
.material-row input {
  padding: 6px 4px;
  font-size: 10px;
}

.material-row output {
  font-size: 10px;
}

.material-row button {
  padding: 3px;
}

.total {
  display: flex;
  justify-content: space-between;
  background: #edf3f6;
  padding: 10px;
  margin-top: 12px;
  font-size: 11px;
  border-radius: 6px;
}

.drawer-footer {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: white;
  flex-shrink: 0;
}

.drawer-footer span {
  margin-right: auto;
  font-size: 9px;
  color: #8b9da7;
}

.drawer-footer button {
  font-size: 11px;
}

footer {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  font-size: 9px;
  color: #93a3ac;
}

footer button {
  font-size: 9px !important;
}

.empty {
  padding: 40px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.empty strong {
  display: block;
  color: var(--pond);
}

dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  color: var(--ink);
  width: min(440px, 90vw);
  box-shadow: 0 15px 80px rgba(18, 52, 70, 0.2);
}

dialog::backdrop {
  background: rgba(23, 56, 76, 0.33);
}

dialog h2 {
  font-size: 18px;
  margin: 0 0 8px;
}

dialog p {
  font-size: 12px;
  color: var(--muted);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.modal-actions button {
  font-size: 12px;
}

#media-view {
  width: min(900px, 90vw);
  max-height: 90vh;
}

.media-view-head {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 12px;
}

#media-content img,
#media-content video {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  margin: auto;
}

#toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pond);
  color: white;
  padding: 11px 18px;
  border-radius: 8px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

#toast.visible {
  opacity: 1;
}

.suggestions-trigger {
  font-size: 11px;
  color: var(--pond);
  background: #edf3f6;
}

.suggestions-trigger span {
  background: var(--pond);
  color: white;
  border-radius: 12px;
  padding: 1px 6px;
  margin-left: 5px;
}

#suggestion-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff2df;
  border-bottom: 1px solid #f2dfc3;
  font-size: 11px;
  color: #987038;
  flex-shrink: 0;
}

#suggestion-banner > span {
  flex: 1;
}

#suggestion-banner button {
  font-size: 10px;
  padding: 4px 8px;
}

#suggestions-dialog {
  width: min(650px, 94vw);
  max-height: 85vh;
  padding: 22px;
}

#suggestion-review {
  width: min(650px, 94vw);
  max-height: 88vh;
  overflow: auto;
}

.suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
}

.suggestion-header h2 {
  font-size: 18px;
}

.suggestion-header p {
  margin: 4px 0 12px;
  font-size: 11px;
}

.suggestion-header > button {
  font-size: 20px;
  line-height: 1;
  padding: 4px 8px;
}

.suggestion-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 15px;
}

.suggestion-tabs button {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  font-size: 12px;
  padding: 9px 0;
}

.suggestion-tabs .selected {
  border-color: var(--pond);
  font-weight: 600;
}

.suggestion-demo {
  font-size: 10px !important;
  background: #edf3f6;
  padding: 9px;
  border-radius: 6px;
}

.suggestion-item {
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.suggestion-item h3 {
  margin: 5px 0;
  font-size: 13px;
}

.suggestion-item p {
  font-size: 11px;
  line-height: 1.6;
  margin: 5px 0;
  color: #758a97;
}

.suggestion-item small {
  font-size: 10px;
  color: #96a5ad;
}

.suggestion-priority {
  font-size: 9px;
  letter-spacing: 0.6px;
  color: #6a8c89;
}

.suggestion-priority.p0 {
  color: #b16c3c;
}

.suggestion-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.suggestion-actions button {
  font-size: 10px;
}

.window-line {
  font-size: 11px;
  color: #5d7f8d !important;
  font-weight: 600;
}

#context-suggestions {
  background: #f5f7f0;
  border: 1px solid #e6ecdf;
  border-radius: 7px;
  margin: 13px 0;
  padding: 10px 12px;
}

#context-suggestions .suggestion-item {
  padding: 9px 0;
}

#context-suggestions .suggestion-item:last-child {
  border: 0;
}

#context-suggestions h3 {
  font-size: 11px;
}

.review-caution {
  background: #fff4e4;
  color: #9a7746;
  border-radius: 6px;
  padding: 10px;
  font-size: 11px;
  margin: 10px 0;
}

.review-record {
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 12px;
  margin: 10px 0;
}

.review-select,
.release-check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11px;
}

.review-record p {
  margin: 6px 0;
}

.review-record small {
  display: block;
  font-size: 10px;
  color: #879ba7;
  margin-bottom: 9px;
}

.release-check {
  margin-top: 10px;
}

.review-record input[type="datetime-local"] {
  max-width: 240px;
}

#suggestion-review-fields h3 {
  font-size: 12px;
}

@media (max-width: 1100px) {
  main {
    padding: 0 14px;
  }
  .toolbar {
    flex-wrap: wrap;
  }
  .toolbar > input {
    max-width: none;
    flex: 1;
  }
  .workspace {
    grid-template-columns: minmax(380px, 1fr) 370px;
  }
  .work-row {
    grid-template-columns: 14px minmax(0, 1fr) 110px;
    gap: 8px;
    padding: 10px;
  }
  .header-caption {
    display: none;
  }
  .group-select {
    margin-left: 0;
  }
  .drawer-body {
    padding: 14px;
  }
}

@media (max-width: 800px) {
  main {
    height: auto;
    min-height: 100dvh;
  }
  .workspace {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .work-list {
    max-height: 55vh;
  }
  #detail {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  #form {
    height: auto;
  }
  .drawer-body {
    max-height: 65vh;
  }
  .app-header > div {
    gap: 8px;
  }
  .demo {
    display: none;
  }
  .workspace-nav > span {
    display: none;
  }
  .workspace-nav > div {
    gap: 16px;
  }
  .list-footer span {
    display: none;
  }
  .toolbar select {
    max-width: 135px;
  }
  .drawer-footer {
    position: sticky;
    bottom: 0;
  }
  .toolbar {
    gap: 6px;
  }
  .toolbar > input {
    min-width: 100%;
  }
  .app-header {
    flex-wrap: wrap;
    height: auto;
    min-height: 68px;
    padding: 10px 0;
    gap: 8px;
  }
  .header-divider {
    display: none;
  }
  #suggestion-banner {
    flex-wrap: wrap;
  }
}

/* ==========================================================================
   EXTENSÃO: CALENDÁRIO AO CLICAR NA DATA (.tp-date)
   ========================================================================== */
button.tp-date {
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 700;
  color: #214A63;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
button.tp-date:hover {
  background: var(--surface-alt, #f8fafc);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Grade de 7 colunas para o calendário */
.tp-grid.calendar {
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.tp-grid.calendar .tp-cell {
  height: 28px;
  font-size: 0.8rem;
  padding: 0;
}
.tp-grid.calendar .tp-cell.is-empty {
  pointer-events: none;
  opacity: 0;
}
.tp-grid.calendar .tp-cell.is-today:not(.is-sel) {
  border: 1px solid #214A63;
  font-weight: 800;
}

.tp-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted, #8a97a8);
  margin-bottom: 4px;
}

.tp-cal-back {
  background: none;
  border: none;
  font: inherit;
  font-size: 0.72rem;
  color: var(--text-muted, #8a97a8);
  cursor: pointer;
  text-decoration: underline;
}
.tp-cal-back:hover {
  color: #214A63;
}

