/* Orbit · component library. Colors inherit from the selected theme. */

.hidden { display: none !important; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 6px; }
.grow { flex: 1; min-width: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 11px 17px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--accent-soft-ink); outline-offset: 3px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); filter: none; box-shadow: 0 5px 14px color-mix(in srgb, var(--accent) 20%, transparent); }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger-ink); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger-soft) 85%, var(--danger)); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.btn-sm { min-height: 34px; padding: 8px 11px; border-radius: 9px; font-size: 12px; gap: 6px; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn-sm svg { width: 14px; height: 14px; }
.btn .spinner { width: 15px; height: 15px; }

.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field label { color: var(--ink-2); font-family: var(--font-sans); font-size: 12px; font-weight: 650; letter-spacing: -.01em; }
.input, .select {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background-color: var(--surface-2);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
.input:hover, .select:hover { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--ink-3)); }
.input:focus, .select:focus { outline: none; border-color: var(--accent-soft-ink); background-color: var(--surface); box-shadow: 0 0 0 3px var(--accent-soft); }
.input:focus-visible, .select:focus-visible { outline: 2px solid var(--accent-soft-ink); outline-offset: 2px; }
.input::placeholder { color: var(--ink-3); opacity: 1; }
.input:disabled, .select:disabled { opacity: .5; cursor: not-allowed; }
.input[readonly] { background-color: var(--surface-3); color: var(--ink-2); }
textarea.input { min-height: 112px; resize: vertical; }
.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23748178' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
:root[data-theme="light"] .select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23748178' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); }
.select option { background: var(--surface); color: var(--ink); }
input[type="date"] { color-scheme: light; }
:root[data-theme="dark"] input[type="date"] { color-scheme: dark; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .65; cursor: pointer; filter: none; }
.hint { color: var(--ink-3); font-size: 11.5px; line-height: 1.6; }
.hint b { color: var(--ink-2); font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 9px; color: var(--ink-2); font-size: 12.5px; cursor: pointer; }
.check input, .rj-check { width: 17px; height: 17px; accent-color: var(--success); cursor: pointer; }
.check input:focus-visible, .rj-check:focus-visible { outline: 2px solid var(--accent-soft-ink); outline-offset: 3px; }

.segmented { display: inline-flex; gap: 3px; padding: 5px; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-2); }
.segmented button { min-height: 35px; padding: 9px 15px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font-family: var(--font-sans); font-size: 12px; font-weight: 650; cursor: pointer; transition: color .2s ease, background .2s ease, box-shadow .2s ease; }
.segmented button:hover { color: var(--ink); background: var(--surface-3); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.segmented button:focus-visible { outline: 2px solid var(--accent-soft-ink); outline-offset: 2px; }

.filter-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.filter-top .input { flex: 0 1 185px; min-width: 135px; width: auto; }
.filter-top .grow { flex: 2 1 270px; }
.filter-top .btn { flex: 0 0 auto; min-height: 46px; }
.filter-adv { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 18px; margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
.filter-adv > * { min-width: 0; }
.filter-adv .check { align-self: end; padding-bottom: 14px; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px solid transparent; border-radius: 7px; background: var(--surface-3); color: var(--ink-2); font-family: var(--font-sans); font-size: 10.5px; font-weight: 650; line-height: 1.2; white-space: nowrap; }
.badge.owner { background: var(--gold-soft); color: var(--gold-ink); border-color: transparent; }
.badge.admin { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: transparent; }
.badge.parceiro { background: var(--surface-3); color: var(--ink-2); }
.badge.aberto { background: var(--warn-soft); color: var(--warn-ink); border-color: transparent; }
.badge.voltado { background: var(--success-soft); color: var(--success-ink); border-color: transparent; }
.badge.off { background: var(--danger-soft); color: var(--danger-ink); border-color: transparent; }
.badge.dot::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.voltado.dot::before { animation: none; }

.card { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: none; animation: orbit-reveal .45s cubic-bezier(.2,.8,.2,1) both; }
.card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; min-height: 70px; padding: 22px 24px; border-bottom: 1px solid var(--border); }
.card-head h3 { color: var(--ink); font-family: var(--font-sans); font-size: 15px; font-weight: 650; letter-spacing: -.025em; }
.card-body { padding: 24px; }
.card-body > .table-wrap { box-shadow: none; }
.card .card { border-radius: 12px; }
.two-col { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; gap: 22px; }
.section-title { margin: 30px 0 13px; color: var(--ink-3); font-family: var(--font-sans); font-size: 10.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .1em; }
.pagehead { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.pagehead h3, .pagehead h2 { font-family: var(--font-sans); letter-spacing: -.04em; }

.stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(168px,1fr)); gap: 16px; margin-bottom: 26px; }
.stat { position: relative; overflow: hidden; min-width: 0; padding: 22px 24px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: none; }
.stat .k { display: flex; align-items: center; gap: 7px; color: var(--ink-2); font-family: var(--font-sans); font-size: 12px; font-weight: 550; }
.stat .k svg { width: 15px; height: 15px; }
.stat .v { margin-top: 17px; color: var(--ink); font-family: var(--font-sans); font-size: 33px; font-weight: 600; line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.stat .v small { color: var(--ink-3); font-family: var(--font-sans); font-size: 13px; font-weight: 500; letter-spacing: -.01em; }
.stat.accent { background: var(--accent-soft); border-color: transparent; }
.stat.accent .v { color: var(--accent-soft-ink); }
.meter { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; color: var(--ink-2); font-size: 12px; }
.pips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pip { width: 10px; height: 18px; border: 0; border-radius: 3px; background: var(--surface-3); }
.pip.used { background: var(--warn); border-color: transparent; }
.pip.free { background: var(--success); border-color: transparent; }

.table-wrap { overflow-x: auto; width: 100%; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: none; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; animation: orbit-reveal .45s cubic-bezier(.2,.8,.2,1) both; }
table { width: 100%; border-collapse: collapse; color: var(--ink); font-family: var(--font-sans); font-size: 12.5px; line-height: 1.5; }
thead th { padding: 15px 20px; border-bottom: 1px solid var(--border); background: var(--surface-2); color: var(--ink-3); font-size: 10.5px; font-weight: 650; letter-spacing: .035em; text-align: left; text-transform: none; white-space: nowrap; }
tbody td { padding: 18px 20px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .18s ease; }
tbody tr:hover { background: color-mix(in srgb,var(--surface-2) 70%,transparent); }
td .actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; }
td.right, th.right { text-align: right; }
td .row { gap: 12px; }
td .col { gap: 3px; }
td .col .faint { font-size: 11px; }
.table-wrap .avatar, .card .avatar { width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-soft-ink); font-family: var(--font-sans); font-size: 12px; font-weight: 650; }

.person { display: flex; align-items: flex-start; gap: 19px; margin-bottom: 24px; padding: 25px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); box-shadow: none; animation: orbit-reveal .4s ease both; }
.person .pa { display: grid; place-items: center; flex-shrink: 0; width: 54px; height: 54px; border-radius: 15px; background: var(--accent-soft); color: var(--accent-soft-ink); font-family: var(--font-sans); font-size: 19px; font-weight: 650; }
.person .pa svg { width: 25px; height: 25px; }
.person .pn { color: var(--ink); font-family: var(--font-sans); font-size: 20px; font-weight: 600; line-height: 1.25; letter-spacing: -.045em; }
.person .meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 11px; color: var(--ink-2); font-size: 11.5px; }
.person .meta b { color: var(--ink); font-weight: 550; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(245px,1fr)); gap: 18px; }
.person-grid .person { margin-bottom: 0; padding: 21px; }
.person-grid .person .pn { font-size: 17px; }
.item, .mandado { padding: 17px 18px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); transition: border-color .2s ease, background-color .2s ease; }
.item:hover, .mandado:hover { border-color: var(--border-strong); }
.item:last-child, .mandado:last-child { margin-bottom: 0; }
.item .t, .mandado .t { color: var(--ink); font-family: var(--font-sans); font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.item .s, .mandado .s { margin-top: 5px; color: var(--ink-2); font-size: 11.5px; line-height: 1.6; }
.item .actions, .mandado .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.item .actions .btn, .mandado .actions .btn { min-height: 31px; padding: 7px 10px; border-radius: 8px; font-size: 11px; gap: 6px; }
.item .actions .btn svg, .mandado .actions .btn svg { width: 13px; height: 13px; }
.item.spread { flex-wrap: wrap; }
.cm-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--border); }
.cm-row:first-child { padding-top: 0; }
.cm-row:last-of-type { border-bottom: 0; padding-bottom: 0; }
.cm-info { min-width: 0; }
.cm-info .t { color: var(--ink); font-size: 13px; font-weight: 600; }
.cm-info .s { margin-top: 5px; color: var(--ink-2); font-size: 11.5px; overflow-wrap: anywhere; }
.cm-actions { display: flex; align-items: center; flex-shrink: 0; gap: 8px; }

.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 46px 24px; color: var(--ink-3); font-size: 12px; line-height: 1.6; text-align: center; }
.empty > svg { width: 35px; height: 35px; margin-bottom: 15px; color: var(--ink-3); opacity: .6; stroke-width: 1.2; }
.empty .big { margin-bottom: 6px; color: var(--ink-2); font-family: var(--font-sans); font-size: 15px; font-weight: 550; letter-spacing: -.025em; }
.center-load { display: grid; place-items: center; min-height: 200px; padding: 55px; color: var(--ink-3); }
.spinner { display: inline-block; flex-shrink: 0; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: orbit-spin .8s linear infinite; }

.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow-y: auto; padding: 24px; background: color-mix(in srgb,var(--ink) 35%,transparent); backdrop-filter: blur(9px); animation: orbit-fade .2s ease; }
.modal { width: 100%; max-width: 470px; max-height: calc(100dvh - 48px); overflow-y: auto; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); animation: orbit-dialog .28s cubic-bezier(.2,.8,.2,1) both; scrollbar-width: thin; }
.modal-head { padding: 28px 28px 0; }
.modal-head h3 { color: var(--ink); font-family: var(--font-sans); font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -.045em; }
.modal-head p { margin: 9px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.modal-body { display: flex; flex-direction: column; gap: 19px; padding: 25px 28px; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 18px 28px 25px; border-top: 1px solid var(--border); background: var(--surface-2); }
.modal-error { padding: 13px 15px; border: 1px solid color-mix(in srgb,var(--danger) 18%,transparent); border-radius: 11px; background: var(--danger-soft); color: var(--danger-ink); font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.toasts { position: fixed; right: 25px; bottom: 25px; z-index: 80; display: flex; flex-direction: column; gap: 12px; }
.toast { display: flex; align-items: flex-start; gap: 11px; max-width: 365px; padding: 15px 18px; border: 1px solid var(--border-strong); border-radius: 13px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); font-size: 12px; line-height: 1.6; animation: orbit-toast .3s cubic-bezier(.2,.8,.2,1) both; }
.toast.ok { border-color: color-mix(in srgb,var(--success) 30%,var(--border)); }
.toast.ok svg { color: var(--success); }
.toast.err { border-color: color-mix(in srgb,var(--danger) 40%,var(--border)); }
.toast.err svg { color: var(--danger); }
.toast svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.rj-ok { display: flex; align-items: flex-start; gap: 15px; }
.rj-ok-ic { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 12px; background: var(--success-soft); color: var(--success); }
.rj-ok-ic.err { background: var(--danger-soft); color: var(--danger); }
.rj-ok-ic svg { width: 22px; height: 22px; }

@keyframes orbit-reveal { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes orbit-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes orbit-dialog { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes orbit-toast { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

@media (max-width: 1100px) {
  .card-head, .card-body { padding: 21px; }
  thead th { padding: 14px 16px; }
  tbody td { padding: 16px; }
}
@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; gap: 18px; }
  .stats { gap: 12px; }
  .stat { padding: 20px; }
}
@media (max-width: 560px) {
  .btn { min-height: 43px; }
  .btn-sm { min-height: 35px; }
  .card-head, .card-body { padding: 18px; }
  .card-head { min-height: 62px; gap: 10px; }
  .card-head h3 { font-size: 14px; }
  .filter-top { gap: 10px; }
  .filter-top .input { flex: 1 1 100%; width: 100%; }
  .filter-top .btn { flex: 1 1 auto; }
  .filter-adv { grid-template-columns: 1fr; gap: 16px; }
  .filter-adv .check { padding-bottom: 0; }
  .stats { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat { padding: 17px; }
  .stat .k { font-size: 10.5px; }
  .stat .v { font-size: 29px; }
  .person { gap: 13px; padding: 18px; }
  .person .pa { width: 42px; height: 42px; border-radius: 12px; font-size: 15px; }
  .person .pn { font-size: 17px; }
  .person .meta { gap: 6px 13px; font-size: 11px; }
  .person-grid { grid-template-columns: 1fr; }
  .item, .mandado { padding: 15px; }
  .item.spread { align-items: flex-start; }
  .item.spread > .row { flex-wrap: wrap; }
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; padding-inline: 10px; }
  .overlay { padding: 12px; }
  .modal { max-height: calc(100dvh - 24px); border-radius: 17px; }
  .modal-head { padding: 23px 21px 0; }
  .modal-body { padding: 22px 21px; }
  .modal-foot { padding: 17px 21px 21px; }
  .modal-foot .btn { flex: 1; }
  .toasts { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: 100%; }
  .pagehead { margin-bottom: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .input, .select, .segmented button, tbody tr, .item, .mandado { transition: none; }
  .card, .stat, .table-wrap, .person, .overlay, .modal, .toast { animation: none; }
}

/* Comfortable reading in the existing operational views. */
.hint, .empty { font-size: 12px; }
.check, .modal-error, .toast { font-size: 13px; }
.badge { font-size: 11px; }
.section-title { font-size: 11px; }
table { font-size: 13px; }
thead th { font-size: 11.5px; }
td .col .faint { font-size: 12px; }
.person .meta, .item .s, .mandado .s, .cm-info .s { font-size: 12px; }
@media (max-width: 560px) {
  .person .meta { font-size: 12px; }
  .stat .k { font-size: 11.5px; }
}
