:root {
  color-scheme: dark;
  --bg: #0f1724;
  --sidebar: #202b39;
  --panel: #1d2735;
  --panel-soft: #222e3e;
  --line: #364456;
  --active: #3a4557;
  --text: #f7f9fc;
  --muted: #a9b4c4;
  --blue: #3b82f6;
  --green: #4ade80;
  --amber: #fbbf24;
  --red: #fb4d4d;
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.hidden {
  display: none !important;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: 100vh;
}

.access-screen {
  min-height: 100vh;
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 34px;
}

.access-intro {
  max-width: 760px;
}

.access-intro h1 {
  margin-bottom: 12px;
}

.access-intro p:not(.eyebrow),
.access-card p {
  color: var(--muted);
  line-height: 1.5;
}

.access-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  max-width: 980px;
}

.access-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 22px;
  display: grid;
  gap: 14px;
}

.access-card span {
  width: fit-content;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 7px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.access-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.access-card select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #172132;
  color: white;
  padding: 0 12px;
}

.access-card input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #172132;
  color: white;
  padding: 0 12px;
}

.login-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.login-error {
  min-height: 18px;
  margin: 0;
  color: #ffc3c3 !important;
  font-size: 13px;
  font-weight: 800;
}

.access-card button:not(.primary) {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #172132;
  color: white;
  font-weight: 850;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
  padding: 28px 14px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

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

.brand {
  padding: 0 10px 20px;
  border-bottom: 1px solid var(--line);
}

.brand-mark,
.user span {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--blue), #22d3ee);
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.brand strong,
.user strong {
  display: block;
  font-size: 17px;
}

.brand small,
.user small {
  color: var(--muted);
  font-size: 12px;
}

.menu {
  display: grid;
  gap: 8px;
}

.menu button {
  min-height: 44px;
  border: 0;
  border-radius: 7px;
  padding: 0 14px;
  background: transparent;
  color: #dbe3ee;
  text-align: left;
  font-weight: 750;
}

.menu button:hover,
.menu button.active {
  background: var(--active);
  color: white;
}

.client-mode .menu button:not([data-section="visao-geral"]),
.employee-mode .menu button:not([data-section="visao-geral"]) {
  display: none;
}

.client-mode .menu button[data-section="visao-geral"],
.employee-mode .menu button[data-section="visao-geral"] {
  pointer-events: none;
}

.client-mode #newTaskButton,
.employee-mode #newTaskButton {
  display: none;
}

.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 24px 10px 0;
  display: grid;
  gap: 18px;
}

.logout {
  border: 0;
  background: transparent;
  color: #ff6b6b;
  padding: 0;
  text-align: left;
  font-weight: 800;
}

.main {
  padding: 30px 30px 42px;
  overflow: hidden;
}

.topbar {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #243246;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.12;
}

h2 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.2;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  min-width: 230px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #172132;
}

.view-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
}

.view-switch button.active {
  background: var(--blue);
  color: white;
}

.search {
  min-width: 300px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #172132;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
}

.primary {
  min-height: 42px;
  border: 0;
  border-radius: 7px;
  background: var(--blue);
  color: white;
  padding: 0 16px;
  font-weight: 850;
}

.secondary {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #172132;
  color: #dbe3ee;
  padding: 0 14px;
  font-weight: 850;
}

.session-pill {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.section {
  display: none;
}

.section.active {
  display: block;
}

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

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric {
  min-height: 102px;
  padding: 20px;
  display: grid;
  align-content: center;
}

.metric span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 13px;
  font-weight: 850;
}

.metric strong {
  margin: 8px 0 4px;
  font-size: 33px;
  line-height: 1;
}

.metric small,
.panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.blue {
  color: var(--blue) !important;
}

.green {
  color: var(--green) !important;
}

.amber {
  color: var(--amber) !important;
}

.red {
  color: var(--red) !important;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  overflow: hidden;
}

.panel.large {
  min-height: 330px;
}

.panel-head {
  min-height: 58px;
  padding: 0 20px;
  border-bottom: 1px solid #2d3a4d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.task-list,
.task-board,
.table,
.document-list,
.routine,
.settings-grid {
  display: grid;
  gap: 10px;
  padding: 18px 20px 20px;
}

.plan-admin {
  margin-bottom: 16px;
}

.plan-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, .45fr) auto;
  gap: 12px;
  padding: 18px 20px 20px;
  align-items: end;
}

.client-access-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px 10px;
  align-items: end;
}

.plan-form label,
.client-access-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.plan-form select,
.client-access-form select,
.client-access-form input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #172132;
  color: white;
  padding: 0 12px;
}

.access-result {
  min-height: 22px;
  margin: 0;
  padding: 0 20px 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.access-result.success {
  color: #b7f7cc;
}

.access-result.error {
  color: #ffc3c3;
}

.task-card,
.table-row,
.document-row,
.routine article,
.settings-grid article {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  padding: 14px;
}

.task-card,
.table-row,
.document-row,
.routine article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.task-card strong,
.table-row strong,
.document-row strong,
.routine strong {
  display: block;
  margin-bottom: 5px;
}

.task-card p,
.table-row p,
.document-row p,
.routine span,
.settings p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.status {
  min-width: 104px;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  text-align: center;
  border: 1px solid transparent;
}

.status.ok {
  color: #b7f7cc;
  background: rgba(74, 222, 128, .11);
  border-color: rgba(74, 222, 128, .28);
}

.status.warning {
  color: #ffe2a8;
  background: rgba(251, 191, 36, .11);
  border-color: rgba(251, 191, 36, .30);
}

.status.danger {
  color: #ffc3c3;
  background: rgba(251, 77, 77, .12);
  border-color: rgba(251, 77, 77, .30);
}

.status.info {
  color: #cfe2ff;
  background: rgba(59, 130, 246, .13);
  border-color: rgba(59, 130, 246, .30);
}

.sign-button {
  min-height: 36px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  background: rgba(59, 130, 246, .13);
  color: #cfe2ff;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 850;
}

.sign-button:disabled {
  border-color: rgba(74, 222, 128, .28);
  background: rgba(74, 222, 128, .11);
  color: #b7f7cc;
  cursor: default;
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 18px 20px 20px;
}

.quick-grid button {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: white;
  font-weight: 850;
}

.quick-grid button:hover {
  border-color: var(--blue);
}

.toolbar {
  margin-bottom: 16px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tabs button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #172132;
  color: #dbe3ee;
  padding: 0 14px;
  font-weight: 800;
}

.tabs button.active {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}

.settings {
  padding-bottom: 20px;
}

.pricing-panel {
  min-height: calc(100vh - 150px);
}

.pricing-frame {
  width: 100%;
  min-height: calc(100vh - 210px);
  border: 0;
  display: block;
  background: #0f1724;
}

.client-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.company-card {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  display: grid;
  gap: 5px;
}

.company-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
  text-transform: uppercase;
}

.company-card strong {
  font-size: 24px;
}

.company-card small {
  color: var(--muted);
}

.settings h2,
.settings p {
  padding: 0 20px;
}

.settings h2 {
  padding-top: 20px;
}

dialog {
  width: min(460px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--text);
  padding: 0;
}

dialog::backdrop {
  background: rgba(0, 0, 0, .55);
}

.modal {
  display: grid;
  gap: 14px;
  padding-bottom: 18px;
}

.modal label {
  display: grid;
  gap: 6px;
  padding: 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.modal input,
.modal select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #172132;
  color: white;
  padding: 0 12px;
}

.modal menu {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin: 0;
  padding: 0 20px;
}

.modal menu button,
.modal .panel-head button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #172132;
  color: white;
  padding: 0 14px;
}

.modal menu .primary {
  background: var(--blue);
  border-color: var(--blue);
}

@media (max-width: 1080px) {
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .access-screen {
    padding: 22px 16px;
  }

  .access-grid {
    grid-template-columns: 1fr;
  }

  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px;
  }

  .brand {
    padding-bottom: 14px;
  }

  .menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-footer {
    display: none;
  }

  .main {
    padding: 20px 16px 30px;
  }

  .topbar,
  .topbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .view-switch {
    min-width: 0;
  }

  .search {
    min-width: 0;
  }

  .metrics,
  .quick-grid,
  .client-summary,
  .plan-form,
  .client-access-form {
    grid-template-columns: 1fr;
  }

  .task-card,
  .table-row,
  .document-row,
  .routine article {
    grid-template-columns: 1fr;
  }

  .status {
    width: fit-content;
  }
}
