/* ==========================================================================
   04-admin-panel.css  (4 de 18)
   Painel interno (#adminView): barra lateral, topo, cartões, tabelas e definições.
   Não reordenar: a ordem de carga (ver README.md) faz parte da cascata,
   por isso os ficheiros seguintes podem substituir regras dos anteriores.
   ========================================================================== */

#adminView {
  display: none;
  background: var(--paper);
  min-height: 100vh;
}

#adminView .app {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

@media(min-width:900px) {
  #adminView .app {
    flex-direction: row;
  }
}

#adminView .sidebar {
  background: #0e232b;
  color: #eaf6f8;
  flex-shrink: 0;
  padding: 16px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

@media(min-width:900px) {
  #adminView .sidebar {
    width: 220px;
    flex-direction: column;
    align-items: stretch;
    padding: 22px 16px;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,.12);
  }
}

#adminView .sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}

#adminView .sb-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: IBM Plex Mono,monospace;
  font-size: 11px;
  font-weight: 700;
  color: #0b2630;
  flex-shrink: 0;
}

#adminView .sb-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: IBM Plex Mono,monospace;
  font-size: 11.5px;
  color: #f1efe999;
  cursor: pointer;
  margin-left: auto;
}

@media(min-width:900px) {
  #adminView .sb-back {
    margin: 22px 0 0;
  }
}

#adminView .sb-back svg {
  width: 13px;
  height: 13px;
}

#adminView .sb-back:hover {
  color: #eaf6f8;
}

#adminView .sb-nav {
  display: none;
}

@media(min-width:900px) {
  #adminView .sb-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 22px;
  }
}

#adminView .sb-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: #f1efe9b3;
  cursor: pointer;
  transition: background .15s,color .15s;
}

#adminView .sb-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#adminView .sb-item:hover {
  background: #ffffff0f;
  color: #eaf6f8;
}

#adminView .sb-item.active {
  background: var(--amber-10);
  color: var(--amber);
}

#adminView .sb-foot {
  display: none;
}

@media(min-width:900px) {
  #adminView .sb-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.12);
  }
}

#adminView .avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--amber-10);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: IBM Plex Mono,monospace;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

#adminView .sb-foot-text {
  font-size: 12px;
  line-height: 1.3;
}

#adminView .sb-foot-text .name {
  color: #eaf6f8;
  font-weight: 600;
}

#adminView .sb-foot-text .role {
  color: #f1efe98c;
}

#adminView main {
  flex: 1;
  min-width: 0;
}

#adminView .topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 18px 20px;
  border-bottom: 1px solid var(--ink-10);
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  z-index: 10;
}

@media(min-width:640px) {
  #adminView .topbar {
    padding: 22px 32px;
  }
}

#adminView .topbar h1 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.01em;
}

#adminView .topbar .sub {
  font-family: IBM Plex Mono,monospace;
  font-size: 11.5px;
  color: var(--graphite);
  margin-top: 2px;
}

#adminView .search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: 100px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  font-size: 13px;
  color: var(--graphite);
  min-width: 0;
  flex: 1;
  max-width: 260px;
}

#adminView .search svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

#adminView .search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  color: var(--ink);
}

#adminView .new-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: IBM Plex Mono,monospace;
  font-size: 12.5px;
  font-weight: 500;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px #0b263033;
  flex-shrink: 0;
}

#adminView .new-btn svg {
  width: 14px;
  height: 14px;
}

#adminView .content {
  padding: 20px;
}

@media(min-width:640px) {
  #adminView .content {
    padding: 28px 32px;
  }
}

#adminView .board {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 36px;
}

@media(min-width:760px) {
  #adminView .board {
    grid-template-columns: repeat(3,1fr);
    gap: 18px;
  }
}

#adminView .col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}

#adminView .col-head .title {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

#adminView .col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

#adminView .col-dot.pend {
  background: var(--amber);
}

#adminView .col-dot.prog {
  background: #3e5c8a;
}

#adminView .col-dot.done {
  background: #4c6e5a;
}

#adminView .col-count {
  font-family: IBM Plex Mono,monospace;
  font-size: 11px;
  color: var(--graphite);
  background: var(--ink-10);
  padding: 2px 8px;
  border-radius: 100px;
}

#adminView .col-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 40px;
}

#adminView .card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 14px 14px 12px;
  box-shadow: 0 8px 20px #0b26300f;
  cursor: pointer;
  transition: transform .2s,box-shadow .2s,border-color .2s;
}

#adminView .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px #0b26301f;
  border-color: #0ba5c74d;
}

#adminView .card .client {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 3px;
}

#adminView .card .cargo {
  font-size: 12px;
  color: var(--graphite);
  margin-bottom: 10px;
}

#adminView .card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#adminView .card .pid {
  font-family: IBM Plex Mono,monospace;
  font-size: 10.5px;
  color: var(--graphite);
}

#adminView .card .progress-tag {
  font-family: IBM Plex Mono,monospace;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
}

#adminView .progress-tag.pend {
  background: var(--amber-10);
  color: var(--amber);
}

#adminView .progress-tag.prog {
  background: #3e5c8a1a;
  color: #3e5c8a;
}

#adminView .progress-tag.done {
  background: #4c6e5a1f;
  color: #4c6e5a;
}

#adminView .stage-tracker {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 8px 0 10px;
}

#adminView .stage-tracker .stage {
  flex: 1;
  text-align: center;
  font-family: IBM Plex Mono,monospace;
  font-size: 9px;
  padding: 4px 2px;
  border-radius: 6px;
  background: var(--ink-10);
  color: var(--graphite);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#adminView .stage-tracker .stage.done {
  background: #4c6e5a24;
  color: #4c6e5a;
}

#adminView .stage-tracker .stage.active {
  background: var(--amber-10);
  color: var(--amber);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--amber-glow);
}

#adminView .card .foot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--ink-10);
}

#adminView .client-row,
#adminView .doc-row {
  display: grid;
  grid-template-columns: 1.6fr 1fr .8fr .9fr;
  gap: 10px;
  align-items: center;
  padding: 12px 4px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--ink-10);
}

#adminView .client-row-head {
  color: var(--graphite);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .04em;
  font-weight: 600;
}

#adminView .client-row .cn {
  display: flex;
  align-items: center;
  gap: 10px;
}

#adminView .doc-row .doc-name {
  display: flex;
  align-items: center;
  gap: 8px;
}

#adminView .doc-row .doc-name svg {
  width: 16px;
  height: 16px;
  color: var(--amber);
  flex-shrink: 0;
}

#adminView .stat-grid {
  display: grid;
  grid-template-columns: repeat(2,1fr);
  gap: 14px;
}

@media(min-width:700px) {
  #adminView .stat-grid {
    grid-template-columns: repeat(4,1fr);
  }
}

#adminView .stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 20px 18px;
}

#adminView .stat-num {
  font-family: IBM Plex Mono,monospace;
  font-size: 28px;
  font-weight: 700;
  color: var(--ink);
}

#adminView .stat-label {
  font-size: 12.5px;
  color: var(--graphite);
  margin-top: 4px;
}

#adminView .bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 4px;
  font-size: 13px;
}

#adminView .bar-label {
  width: 170px;
  flex-shrink: 0;
  color: var(--ink);
}

#adminView .bar-track {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--ink-10);
  overflow: hidden;
}

#adminView .bar-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 4px;
}

#adminView .bar-val {
  width: 22px;
  text-align: right;
  font-family: IBM Plex Mono,monospace;
  color: var(--graphite);
  flex-shrink: 0;
}

#adminView .settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--ink-10);
}

#adminView .settings-row:last-child {
  border-bottom: none;
}

#adminView .switch {
  width: 38px;
  height: 22px;
  border-radius: 11px;
  background: var(--ink-10);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s;
}

#adminView .switch:after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #00000040;
  transition: left .15s;
}

#adminView .switch.on {
  background: var(--amber);
}

#adminView .switch.on:after {
  left: 18px;
}

@media(max-width:700px) {
  #adminView .client-row,
  #adminView .doc-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 4px;
  }
  #adminView .client-row-head {
    display: none;
  }
  #adminView .bar-label {
    width: 110px;
    font-size: 12px;
  }
}

#adminView .mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink-10);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: IBM Plex Mono,monospace;
  font-size: 9px;
  font-weight: 600;
}

#adminView .checklist-mini {
  font-family: IBM Plex Mono,monospace;
  font-size: 10.5px;
  color: var(--graphite);
  display: flex;
  align-items: center;
  gap: 4px;
}

#adminView .checklist-mini svg {
  width: 12px;
  height: 12px;
}

#adminView .panel-head {
  margin-bottom: 16px;
}

#adminView .panel-head h2 {
  font-size: 17px;
  font-weight: 700;
}

#adminView .panel-head .sub {
  font-family: IBM Plex Mono,monospace;
  font-size: 11.5px;
  color: var(--graphite);
  margin-top: 3px;
}

#adminView .notes-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 22px;
  box-shadow: 0 12px 30px #0b26300f;
}

#adminView .note-block {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 4px;
  border-radius: 6px;
  transition: background .15s;
}

#adminView .note-block:hover {
  background: var(--ink-10);
}

#adminView .chk {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--ink-20);
  flex-shrink: 0;
  margin-top: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#adminView .chk.done {
  background: var(--amber);
  border-color: var(--amber);
}

#adminView .chk.done svg {
  width: 10px;
  height: 10px;
  color: #fff;
}

#adminView .note-text {
  font-size: 13.5px;
}

#adminView .note-text.done {
  color: var(--graphite);
  text-decoration: line-through;
}

#adminView .divider-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 10px;
}

#adminView .divider-note .label {
  font-family: IBM Plex Mono,monospace;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--graphite);
}

#adminView .divider-note .line {
  flex: 1;
  height: 1px;
  background: var(--ink-10);
}

#adminView .timeline-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 4px;
  font-size: 13px;
}

#adminView .timeline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

#adminView .timeline-date {
  font-family: IBM Plex Mono,monospace;
  font-size: 11px;
  color: var(--graphite);
  width: 74px;
  flex-shrink: 0;
}

#adminView .grid-two {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

@media(min-width:900px) {
  #adminView .grid-two {
    grid-template-columns: 1.3fr 1fr;
  }
}

#adminView footer.note {
  padding: 16px 20px;
  text-align: center;
  font-family: IBM Plex Mono,monospace;
  font-size: 11px;
  color: var(--graphite);
  border-top: 1px solid var(--ink-10);
}
