:root {
  --bg: #080808;
  --surface: #111111;
  --surface-2: #1b1b1b;
  --text: #ffffff;
  --muted: #a8a8a8;
  --line: #2b2b2b;
  --green: #00d66f;
  --green-2: rgba(0, 214, 111, 0.2);
  --blue: #4a8cff;
  --amber: #ff8a1d;
  --red: #ff3b30;
  --orange: #ff6b00;
  --orange-dark: #e85f00;
  --ink: #f3f3f3;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.13), transparent 34vw),
    var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.client-login-body {
  min-height: 100vh;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

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

.client-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(460px, 100%);
  display: grid;
  gap: 22px;
}

.login-brand {
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.login-error {
  margin: 0;
  color: #ffb4b4;
  font-size: 13px;
  font-weight: 800;
}

.login-hint {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.login-hint strong {
  color: var(--orange);
}

.client-tab {
  display: none;
}

.client-tab.active {
  display: block;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
  background: #050505;
  color: #f7fbf8;
  border-right: 1px solid var(--line);
}

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

.brand-logo {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center;
  background: #000;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.brand strong,
h1,
h2,
h3,
.nav-item,
.primary-button,
.secondary-button,
.chip {
  font-family: Montserrat, Inter, sans-serif;
}

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

.nav-item {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  padding: 0 14px;
  background: transparent;
  color: #d9d9d9;
  text-align: left;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: rgba(249, 115, 22, 0.14);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--orange);
}

.main {
  min-width: 0;
  width: min(100%, 1240px);
  padding: 18px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.notification-button {
  position: relative;
}

.notification-button span {
  position: absolute;
  top: -7px;
  right: -7px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.lead-toast {
  display: grid;
  gap: 4px;
  margin-bottom: 14px;
  padding: 13px 15px;
  border: 1px solid rgba(0, 214, 111, 0.48);
  border-left: 5px solid var(--green);
  border-radius: 8px;
  background: rgba(0, 214, 111, 0.14);
  box-shadow: var(--shadow);
}

.lead-toast strong {
  font-family: Montserrat, Inter, sans-serif;
}

.lead-toast span {
  color: var(--muted);
  font-size: 13px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
}

.top-actions,
.filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: min(360px, 100%);
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.primary-button,
.secondary-button,
.icon-button,
.chip,
.call-button,
.whatsapp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 0 14px;
  font-weight: 800;
  text-decoration: none;
}

.primary-button {
  border-color: var(--orange);
  background: var(--orange);
  color: white;
}

.secondary-button,
.icon-button,
.chip,
.call-button {
  background: var(--surface);
  color: var(--ink);
}

.whatsapp-button {
  border-color: #1f9d62;
  background: #1f9d62;
  color: white;
}

.icon-button {
  width: 42px;
  padding: 0;
  font-size: 20px;
}

.chip.active {
  border-color: var(--orange);
  background: rgba(249, 115, 22, 0.14);
  color: var(--orange);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

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

.metric,
.panel,
.client-card,
.deal-card,
.task-card,
.lead-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric {
  display: grid;
  gap: 6px;
  min-height: 134px;
  padding: 18px;
}

.metric-link,
.clickable-item {
  cursor: pointer;
}

.metric-link:hover,
.clickable-item:hover {
  border-color: rgba(255, 107, 0, 0.72);
}

.metric span,
.metric small,
td,
.task-card p,
.client-card p,
.deal-card p,
.lead-card p {
  color: var(--muted);
}

.metric strong {
  font-size: 34px;
  line-height: 1;
}

.dashboard-grid,
.report-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 14px;
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-head,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-head span {
  color: var(--muted);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 14px;
}

th {
  color: #526159;
  font-size: 12px;
  text-transform: uppercase;
}

.status,
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status.ok {
  background: var(--green-2);
  color: var(--green);
}

.status.warn {
  background: rgba(249, 115, 22, 0.14);
  color: var(--amber);
}

.status.danger {
  background: #fdeaea;
  color: var(--red);
}

.task-list,
.portal-preview {
  display: grid;
  gap: 10px;
}

.task-row,
.portal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.task-row strong,
.portal-row strong {
  display: block;
  font-size: 14px;
}

.task-row span,
.portal-row span {
  color: var(--muted);
  font-size: 12px;
}

.section-head {
  align-items: end;
  margin-bottom: 18px;
}

.pipeline,
.kanban {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.column {
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.64);
  background: #101010;
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  margin-bottom: 10px;
}

.column-head strong {
  font-size: 13px;
}

.column-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.deal-card,
.task-card,
.lead-card {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  padding: 12px;
  box-shadow: none;
}

.deal-card p,
.task-card p,
.client-card p,
.lead-card p {
  margin-bottom: 0;
  font-size: 13px;
  line-height: 1.45;
}

.deal-meta,
.task-meta,
.client-meta,
.lead-actions,
.lead-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  background: #242424;
  color: #d5d5d5;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.compact-metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.compact-metric-grid .metric {
  min-height: 104px;
  padding: 14px;
}

.compact-metric-grid .metric strong {
  font-size: 28px;
}

.employee-portal-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.employee-portal-metrics .metric {
  min-height: 92px;
  padding: 12px;
  gap: 4px;
}

.employee-portal-metrics .metric strong {
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.05;
}

.employee-portal-metrics #portalPosition {
  font-size: clamp(20px, 1.8vw, 26px);
}

.employee-portal-metrics .metric span,
.employee-portal-metrics .metric small {
  font-size: 12px;
}

.filter-panel {
  margin-bottom: 14px;
}

[hidden] {
  display: none !important;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.employee-filter-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d0d;
  color: var(--ink);
  font-weight: 800;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--orange);
}

.span-2 {
  grid-column: span 2;
}

.wide-input {
  grid-column: span 2;
}

.document-form {
  grid-template-columns: minmax(170px, 1fr) 140px minmax(160px, 0.9fr) minmax(190px, 1.2fr) minmax(170px, 1fr) auto;
}

.inline-link {
  width: 100%;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 150px 100px minmax(150px, 0.9fr) minmax(190px, 1.2fr) auto;
  align-items: end;
  gap: 12px;
}

.employee-admin-layout {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.employee-work-panel {
  margin-bottom: 14px;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-submit {
  display: flex;
  justify-content: flex-end;
}

.setup-list {
  display: grid;
  gap: 10px;
}

.setup-list.compact {
  gap: 8px;
}

.setup-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.setup-item strong {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(249, 115, 22, 0.14);
  color: var(--orange);
  font-family: Montserrat, Inter, sans-serif;
  font-size: 12px;
}

.setup-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.alert-item {
  border-left: 4px solid var(--line);
}

.alert-item.ok {
  border-left-color: var(--green);
  background: rgba(0, 214, 111, 0.12);
}

.alert-item.warn {
  border-left-color: var(--orange);
  background: rgba(255, 107, 0, 0.14);
}

.alert-item.danger {
  border-left-color: var(--red);
  background: rgba(255, 59, 48, 0.14);
}

.document-link {
  color: var(--green);
  font-weight: 900;
  text-decoration: none;
}

.document-link:hover {
  text-decoration: underline;
}

.danger-pill {
  background: rgba(255, 59, 48, 0.18);
  color: #ffb4b4;
}

.employee-alert {
  border-color: rgba(255, 107, 0, 0.54);
  border-left-color: var(--orange);
  background: rgba(255, 107, 0, 0.14);
}

.admin-client-panel {
  margin-top: 14px;
}

.admin-client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.admin-client-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
}

.admin-client-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.admin-client-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-client-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.client-add-panel {
  margin-bottom: 14px;
}

.invoice-table {
  min-width: 760px;
}

.employee-table {
  min-width: 920px;
}

.table-select {
  min-width: 136px;
  min-height: 36px;
  padding: 0 9px;
  font-size: 13px;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.edit-button {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0d0d0d;
  color: var(--orange);
  font-weight: 900;
}

.compact-panel {
  margin-bottom: 14px;
}

.status-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.client-list-panel {
  margin-top: 14px;
}

.client-table {
  min-width: 1040px;
}

.client-lead-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.client-lead-detail-list {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  padding-top: 4px;
}

.client-lead-detail-list h3 {
  margin-bottom: 0;
  font-size: 15px;
}

.leader-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.leader-grid h3 {
  margin-bottom: 10px;
  font-size: 14px;
}

.leader-grid section {
  min-width: 0;
}

.leader-grid .span-2 {
  grid-column: span 2;
}

.lead-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.lead-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.lead-card {
  gap: 12px;
  margin-bottom: 0;
  padding: 16px;
}

.lead-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.lead-details span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.lead-actions {
  padding-top: 4px;
}

.lead-actions .secondary-button,
.lead-actions .call-button,
.lead-actions .whatsapp-button {
  min-height: 38px;
}

.portal-shell {
  display: grid;
  gap: 14px;
}

.portal-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  align-items: end;
  gap: 16px;
}

.portal-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.portal-tab {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font-family: Montserrat, Inter, sans-serif;
  font-weight: 800;
}

.portal-tab.active {
  border-color: var(--orange);
  background: rgba(249, 115, 22, 0.14);
  color: var(--orange);
}

.portal-view {
  display: none;
}

.portal-view.active {
  display: block;
}

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

.portal-lead-card {
  margin-bottom: 0;
}

.lead-list {
  display: grid;
  gap: 10px;
}

.lead-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.compact-select {
  display: grid;
  gap: 6px;
  min-width: 180px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.compact-select select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.lead-list-header {
  display: grid;
  grid-template-columns: minmax(154px, 1fr) minmax(160px, 0.95fr) minmax(170px, 1fr) minmax(124px, 0.72fr) auto;
  gap: 8px;
  padding: 0 10px 2px 14px;
  color: #6f7b73;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.lead-list-row {
  display: grid;
  grid-template-columns: minmax(154px, 1fr) minmax(160px, 0.95fr) minmax(170px, 1fr) minmax(124px, 0.72fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid transparent;
  border-left-width: 5px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lead-list-row.danger {
  border-left-color: var(--red);
  border-color: rgba(255, 59, 48, 0.62);
  background: linear-gradient(90deg, rgba(255, 59, 48, 0.58), rgba(255, 59, 48, 0.3));
}

.lead-list-row.warn {
  border-left-color: var(--orange);
  border-color: rgba(255, 107, 0, 0.66);
  background: linear-gradient(90deg, rgba(255, 107, 0, 0.6), rgba(255, 107, 0, 0.32));
}

.lead-list-row.ok {
  border-left-color: var(--green);
  border-color: rgba(0, 214, 111, 0.64);
  background: linear-gradient(90deg, rgba(0, 214, 111, 0.5), rgba(0, 214, 111, 0.26));
}

.lead-list-main {
  display: grid;
  gap: 5px;
}

.lead-list-main strong {
  font-family: Montserrat, Inter, sans-serif;
  font-size: 15px;
}

.lead-list-main span,
.lead-list-meta span,
.lead-note,
.lead-loss {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  line-height: 1.35;
}

.lead-list-meta {
  display: grid;
  gap: 5px;
}

.lead-note,
.lead-loss {
  display: block;
  margin-top: 6px;
  font-weight: 800;
}

.lead-note {
  color: #ffffff;
}

.lead-loss {
  color: #ffe0e0;
}

.lead-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.empty-state {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.client-card {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.client-card header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #272727;
}

.progress span {
  display: block;
  height: 100%;
  max-width: 100%;
  border-radius: inherit;
  background: var(--orange);
}

.employee-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 14px;
  margin-bottom: 14px;
}

.employee-directory-table {
  min-width: 680px;
}

.employee-directory-panel,
.employee-detail-panel {
  min-width: 0;
}

.employee-directory-table tr {
  cursor: pointer;
}

.employee-directory-table tr.selected-row td {
  background: rgba(255, 107, 0, 0.13);
}

.employee-detail-panel,
.employee-form-panel,
.leader-assignment-panel {
  display: grid;
  gap: 14px;
}

.employee-form-panel,
.leader-assignment-panel {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.compact-head {
  margin-bottom: 0;
}

.employee-detail-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 10px;
}

.employee-detail-stats div {
  display: grid;
  gap: 5px;
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.employee-detail-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.employee-detail-stats strong {
  font-family: Montserrat, Inter, sans-serif;
  overflow-wrap: anywhere;
  font-size: clamp(14px, 1.4vw, 16px);
  line-height: 1.15;
}

.employee-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

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

.danger-action {
  border-color: rgba(255, 59, 48, 0.52);
  color: #ffb4b4;
}

.leader-assignment-row {
  align-items: center;
  justify-content: space-between;
}

.row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.team-member-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.bars {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-row label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #272727;
}

.bar-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
}

.employee-calendar {
  display: grid;
  gap: 10px;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 116px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101010;
}

.calendar-day.empty {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.calendar-day strong {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #242424;
  color: #fff;
  font-family: Montserrat, Inter, sans-serif;
  font-size: 13px;
}

.calendar-day.weekend {
  opacity: 0.7;
  background: #0b0b0b;
}

.calendar-day.holiday {
  border-color: rgba(255, 59, 48, 0.62);
  background: rgba(255, 59, 48, 0.14);
}

.calendar-day.has-absence {
  border-color: rgba(255, 107, 0, 0.62);
}

.calendar-day.has-hours {
  box-shadow: inset 0 -3px 0 rgba(0, 214, 111, 0.58);
}

.calendar-note {
  display: block;
  overflow: hidden;
  border-radius: 7px;
  padding: 5px 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.holiday-note {
  background: var(--red);
}

.company-note {
  background: #3b3b3b;
  color: #f4f4f4;
}

.plan-note {
  background: #1d4ed8;
}

.vacation-note {
  background: var(--orange);
}

.sick-note {
  background: #b91c1c;
}

.hours-note {
  background: #087a45;
}

dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(18, 28, 23, 0.58);
}

.modal-card {
  padding: 20px;
  border-radius: 8px;
  background: var(--surface);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #0d0d0d;
  color: var(--text);
}

textarea {
  min-height: 152px;
  padding: 12px;
  resize: vertical;
  line-height: 1.45;
}

select option {
  background: #0d0d0d;
  color: var(--text);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.settings-static {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 152px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

.settings-static strong {
  font-family: Montserrat, Inter, sans-serif;
}

.settings-static > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

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

@media (max-width: 1120px) {
  .metric-grid,
  .admin-kpi-grid,
  .filter-grid,
  .client-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid,
  .report-grid,
  .admin-layout,
  .employee-admin-layout,
  .employee-workspace,
  .employee-action-grid,
  .portal-login {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 820px) {
  .app-shell,
  .client-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    overflow-x: auto;
  }

  .main {
    padding: 18px 14px 28px;
  }

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

  .search {
    min-width: 100%;
  }

  .metric-grid,
  .admin-kpi-grid,
  .filter-grid,
  .client-grid,
    .admin-client-grid,
    .lead-summary,
    .lead-grid,
    .portal-lead-grid,
    .lead-list-header,
    .lead-list-row,
    .settings-grid,
    .form-grid,
    .employee-detail-stats,
    .employee-filter-grid,
    .client-lead-summary,
    .leader-grid,
    .inline-form,
    .compact-action-form,
    .calendar-weekdays,
    .calendar-grid {
    grid-template-columns: 1fr;
  }

  .leader-grid .span-2 {
    grid-column: span 1;
  }

  .employee-portal-metrics {
    grid-template-columns: 1fr;
  }

  .calendar-weekdays {
    display: none;
  }

  .span-2 {
    grid-column: auto;
  }

  .wide-input {
    grid-column: auto;
  }

  .lead-list-header {
    display: none;
  }

  .lead-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .lead-list-actions {
    justify-content: flex-start;
  }
}
