/* === Foxii dark theme === */
:root {
  --bg: #0a0f1a;
  --bg-elev: #0f1626;
  --surface: #131a2a;
  --surface-2: #1a2336;
  --border: #1f2a3d;
  --border-strong: #2a3a55;
  --text: #e6edf3;
  --text-muted: #8b95a8;
  --accent: #2ee5c9;
  --accent-hover: #5cf0d8;
  --accent-soft: rgba(46, 229, 201, 0.12);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.15);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.12);
  --warn: #fbbf24;
  --shadow-glow: 0 0 32px rgba(46, 229, 201, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --sidebar-w: 232px;
  --header-h: 64px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 600px at -10% -10%, rgba(46, 229, 201, 0.08), transparent 60%),
    radial-gradient(700px 500px at 110% 0%, rgba(167, 139, 250, 0.06), transparent 60%);
  pointer-events: none;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.15rem; }

p { margin: 0 0 0.5rem; }
.muted { color: var(--text-muted); }
.accent { color: var(--accent); }
code { font-family: var(--font-mono); background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.85em; }

/* === Layout === */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-w);
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg) 100%);
  border-right: 1px solid var(--border);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  z-index: 50;
  transition: transform 0.25s ease;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 6px;
}

.sidebar__logo {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 0 18px rgba(46, 229, 201, 0.45));
}

.sidebar__title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
.sidebar__title strong { font-size: 1.1rem; }
.sidebar__title span { color: var(--accent); font-size: 0.95rem; font-weight: 600; }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.is-active {
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar__logout button {
  width: 100%;
  justify-content: flex-start;
}

.menu-toggle {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 60;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.menu-toggle svg { width: 20px; height: 20px; }

.main {
  margin-left: var(--sidebar-w);
  padding: 36px 36px 64px;
  min-height: 100vh;
  max-width: 1400px;
}

.main--auth {
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
  width: 100%;
}

/* === Page header === */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.page-header__actions { display: flex; gap: 8px; }
.page-header__stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}
.page-header__stat strong { font-size: 1.4rem; }

/* === Card === */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(46, 229, 201, 0.3), transparent);
  opacity: 0.6;
}

.card__title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 18px;
  font-weight: 600;
}

/* === Grid layouts === */
.grid { display: grid; gap: 20px; }
.grid--entry { grid-template-columns: 1.4fr 1fr; }
.grid--clients { grid-template-columns: 1fr 1.5fr; }
.grid--charts { grid-template-columns: 1fr 1fr; }

/* === Forms === */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.field--full { grid-column: 1 / -1; }
.field small { font-size: 0.78rem; }

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

.field--error input,
.field--error select,
.field--error textarea {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.06);
}
.field--error input:focus,
.field--error select:focus,
.field--error textarea:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
.field--error label { color: var(--danger); }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238b95a8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

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

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  padding: 8px 0;
}
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); }

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

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }

.btn--primary {
  background: var(--accent);
  color: #062424;
  box-shadow: var(--shadow-glow);
}
.btn--primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  color: #062424;
}
.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn--ghost {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--accent);
  color: var(--accent);
}

.btn--block { width: 100%; }
.btn--sm { padding: 8px 14px; font-size: 0.85rem; }

/* === Auth screen === */
body.is-auth {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), var(--violet), transparent);
}

.auth-card__brand {
  text-align: center;
  margin-bottom: 28px;
}
.auth-card__brand img {
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 24px rgba(46, 229, 201, 0.5));
}
.auth-card__brand h1 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}

.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form__hint { text-align: center; font-size: 0.85rem; }
.auth-form__hint.error { color: var(--danger); }
.auth-card__footer {
  text-align: center;
  font-size: 0.78rem;
  margin-top: 22px;
  margin-bottom: 0;
}

/* === Flash (toast) === */
.flash-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  border: 1px solid transparent;
  background: var(--surface);
  backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  animation: flash-in 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.flash--success {
  background: linear-gradient(180deg, rgba(74, 222, 128, 0.18), rgba(74, 222, 128, 0.08)), var(--surface);
  border-color: rgba(74, 222, 128, 0.4);
  color: var(--success);
}
.flash--error {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.18), rgba(248, 113, 113, 0.08)), var(--surface);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
}
.flash__close {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0.7;
  line-height: 1;
  padding: 0 4px;
}
.flash__close:hover { opacity: 1; }
.flash.is-leaving { animation: flash-out 0.3s ease forwards; }

@keyframes flash-in {
  from { opacity: 0; transform: translateX(20px) scale(0.96); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes flash-out {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(20px); }
}

@media (max-width: 720px) {
  .flash-stack {
    top: auto;
    bottom: 16px;
    right: 16px;
    left: 16px;
    width: auto;
  }
  @keyframes flash-in {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

/* === Recent list === */
.recent-list {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 540px;
  overflow-y: auto;
}
.recent-item {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.recent-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.recent-item__client { font-size: 0.95rem; }
.recent-item__detail {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 4px 0 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent-item__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* === Badges === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.badge--ok { background: var(--success-soft); color: var(--success); }
.badge--muted { background: var(--surface-2); color: var(--text-muted); }

/* === Tables === */
.table-wrap { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(46, 229, 201, 0.03); }
.data-table__detail {
  max-width: 360px;
  color: var(--text-muted);
}
.data-table__actions {
  display: flex;
  gap: 6px;
  white-space: nowrap;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.icon-btn svg { width: 14px; height: 14px; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.icon-btn--danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-soft); }

.inline-form { display: inline-block; margin: 0; }

/* === Filters === */
.filters__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 14px;
  align-items: end;
}
.filters__actions { display: flex; gap: 8px; }

/* === Empty state === */
.empty-state {
  text-align: center;
  padding: 32px;
  color: var(--text-muted);
}

/* === Ranking bars === */
.ranking { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.ranking__item { display: flex; flex-direction: column; gap: 6px; }
.ranking__head { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.92rem; }
.ranking__bar {
  height: 8px;
  background: var(--bg-elev);
  border-radius: 999px;
  overflow: hidden;
}
.ranking__bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--violet));
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* === Client list === */
.client-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.client-list li {
  background: var(--bg-elev);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.95rem;
}

/* === KPI grid === */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  overflow: hidden;
}
.kpi__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.kpi__value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.kpi__hint { font-size: 0.78rem; color: var(--text-muted); }
.kpi--accent {
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border-color: rgba(46, 229, 201, 0.35);
}
.kpi--accent .kpi__value { color: var(--accent); }

/* === Charts === */
.chart-wrap { position: relative; height: 280px; }

/* === Heatmap === */
.heatmap-wrap {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.heatmap-axis {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 0;
  padding-right: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.heatmap-axis span {
  height: 14px;
  line-height: 14px;
  display: flex;
  align-items: center;
}
.heatmap {
  display: flex;
  gap: 3px;
  align-items: flex-start;
}
.heatmap__week { display: flex; flex-direction: column; gap: 3px; }
.heatmap-cell {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  display: inline-block;
  cursor: default;
  transition: transform 0.1s;
}
.heatmap-cell:hover { transform: scale(1.4); border-color: var(--accent); }
.heatmap-cell[data-level="0"] { background: var(--bg-elev); }
.heatmap-cell[data-level="1"] { background: rgba(46, 229, 201, 0.22); border-color: rgba(46, 229, 201, 0.3); }
.heatmap-cell[data-level="2"] { background: rgba(46, 229, 201, 0.45); border-color: rgba(46, 229, 201, 0.5); }
.heatmap-cell[data-level="3"] { background: rgba(46, 229, 201, 0.7); border-color: rgba(46, 229, 201, 0.7); }
.heatmap-cell[data-level="4"] { background: var(--accent); border-color: var(--accent); }
.heatmap-cell[data-out="1"] { opacity: 0.25; }
.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: 0.78rem;
}

/* === Modal === */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.is-open { display: flex; }
.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.7);
  backdrop-filter: blur(6px);
  animation: modal-fade 0.2s ease;
}
.modal__panel {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  animation: modal-pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2);
  overflow: hidden;
}
.modal__panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--danger), transparent);
}
.modal__title {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.modal__message {
  color: var(--text-muted);
  margin: 0 0 22px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.btn--danger {
  background: var(--danger);
  color: #2a0808;
  box-shadow: 0 0 24px rgba(248, 113, 113, 0.35);
}
.btn--danger:hover {
  background: #fca5a5;
  color: #2a0808;
  transform: translateY(-1px);
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.92) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* === Responsive === */
@media (max-width: 960px) {
  .grid--entry, .grid--clients, .grid--charts { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .filters__grid { grid-template-columns: 1fr 1fr; }
  .filters__actions { grid-column: 1 / -1; justify-content: flex-end; }
  .main { padding: 24px 20px 64px; }
}

@media (max-width: 720px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: 24px 0 48px rgba(0, 0, 0, 0.5);
  }
  .sidebar.is-open { transform: translateX(0); }
  .menu-toggle { display: flex; }
  .main { margin-left: 0; padding: 64px 16px 48px; }
  .form-grid { grid-template-columns: 1fr; }
  .filters__grid { grid-template-columns: 1fr; }
  h1 { font-size: 1.4rem; }
  .page-header__stat { width: 100%; align-items: flex-start; }
  .auth-card { padding: 28px 24px; }
}

@media (max-width: 460px) {
  .kpi__value { font-size: 1.3rem; }
  .data-table__detail { max-width: 200px; }
}

/* === Datepicker === */
.dp-field { position: relative; }

.dp-field > input { width: 100%; padding-right: 40px; }

.dp-trigger {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.dp-trigger svg { width: 17px; height: 17px; }
.dp-trigger:hover { color: var(--accent); background: var(--accent-soft); }
.dp-field.is-open .dp-trigger { color: var(--accent); }

.dp-pop {
  position: absolute;
  z-index: 60;
  top: calc(100% + 6px);
  left: 0;
  width: 268px;
  max-width: 92vw;
  padding: 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
}
.dp-pop--up { top: auto; bottom: calc(100% + 6px); }
.dp-pop[hidden] { display: none; }

.dp-head {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 10px;
}
.dp-label {
  flex: 1;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
}
.dp-nav {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.dp-nav:hover { color: var(--accent); background: var(--accent-soft); }

.dp-week,
.dp-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.dp-week {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dp-day {
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.dp-day:hover { background: var(--surface); border-color: var(--border-strong); }
.dp-day.is-out { color: var(--text-muted); opacity: 0.45; }
.dp-day.is-today { border-color: var(--accent); color: var(--accent); }
.dp-day.is-selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #06231f;
  font-weight: 700;
  opacity: 1;
}

.dp-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.dp-link {
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.dp-link:hover { background: var(--accent-soft); }
.dp-link[data-clear] { color: var(--text-muted); }
.dp-link[data-clear]:hover { color: var(--danger); background: var(--danger-soft); }

/* === Estado de cobro === */
.badge--warn { background: var(--danger-soft); color: var(--danger); }
.kpi__value.warn { color: var(--warn); }

.btn--success {
  background: var(--success);
  border-color: var(--success);
  color: #052e16;
}
.btn--success:hover {
  background: #6ee7a0;
  border-color: #6ee7a0;
  color: #052e16;
  transform: translateY(-1px);
}

.cobro-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.cobro-summary__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  background: var(--surface);
}
.cobro-summary__item span { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em; }
.cobro-summary__item strong { font-size: 1.5rem; line-height: 1.2; }
.cobro-summary__item small { font-size: 0.76rem; }
.cobro-summary__item--pending { border-left-color: var(--warn); }
.cobro-summary__item--pending strong { color: var(--warn); }
.cobro-summary__item--paid { border-left-color: var(--success); }
.cobro-summary__item--paid strong { color: var(--success); }

/* Chip clickeable de cobrado / pendiente */
.cobro-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.cobro-chip:hover { transform: translateY(-1px); }
.cobro-chip:active { transform: none; }
.cobro-chip__icon { width: 12px; height: 12px; flex: none; }
.cobro-chip__date { opacity: 0.75; font-weight: 500; }
.cobro-chip__date:empty { display: none; }

.cobro-chip.is-paid {
  background: var(--success-soft);
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--success);
}
.cobro-chip.is-paid:hover { background: rgba(74, 222, 128, 0.2); }

.cobro-chip.is-pending {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.35);
  color: var(--danger);
}
.cobro-chip.is-pending:hover { background: rgba(248, 113, 113, 0.2); }
.cobro-chip.is-pending .cobro-chip__icon { display: none; }

/* Seleccion multiple en la tabla */
.col-check { width: 34px; padding-right: 0 !important; }
.col-check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}
.data-table--selectable tr.is-selected td { background: var(--accent-soft); }

.bulk-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
}
.bulk-bar[hidden] { display: none; }
.bulk-bar__count { font-size: 0.86rem; }
.bulk-bar__count strong { color: var(--accent); }
.bulk-bar__actions { display: flex; flex-wrap: wrap; gap: 8px; }

@media (max-width: 640px) {
  .bulk-bar { flex-direction: column; align-items: stretch; }
  .bulk-bar__actions .btn { flex: 1; }
}

/* === Montos y valor hora === */
.amount {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.amount::before { content: "$"; opacity: 0.5; margin-right: 2px; }
.col-amount { text-align: right; }
.cobro-summary__item strong { font-family: var(--font-mono); }
.cobro-summary__item strong::before { content: "$"; opacity: 0.5; margin-right: 2px; }
.cobro-summary__item strong:empty::before { content: ""; }
.kpi__value#kpiPaidAmount::before,
.kpi__value#kpiPendingAmount::before { content: "$"; opacity: 0.5; margin-right: 2px; }
.bulk-bar__count .amount::before { opacity: 0.6; }
.mt-14 { margin-top: 14px; }

/* Lista de clientes con su valor hora */
.client-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.client-row__name { font-weight: 600; }
.client-row__rate {
  display: flex;
  align-items: center;
  gap: 6px;
}
.client-row__prefix { color: var(--text-muted); }
.client-row__rate input {
  width: 96px;
  padding: 7px 10px;
  font-family: var(--font-mono);
  text-align: right;
}
.client-row__rate .btn { flex: none; }
.client-note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .client-row { flex-direction: column; align-items: stretch; }
  .client-row__rate input { flex: 1; width: auto; }
}

/* === Monto centrado y mas legible === */
.col-amount { text-align: center; }
.data-table .amount { font-size: 0.98rem; font-weight: 700; }
.data-table .col-amount .muted { font-size: 0.98rem; }

/* === Color por cliente === */
/* Tinte muy suave en la fila; el hover y la seleccion siguen ganando */
.data-table tbody tr td { background: var(--row-tint, transparent); }
.data-table tbody tr:hover td { background: var(--row-tint-hover, rgba(46, 229, 201, 0.03)); }
.data-table--selectable tbody tr.is-selected td { background: var(--accent-soft); }

.client-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 8px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  vertical-align: baseline;
}

.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatches--inline { flex: 1; justify-content: center; }

.swatch { cursor: pointer; line-height: 0; }
.swatch input { position: absolute; opacity: 0; width: 0; height: 0; }
.swatch > span {
  display: block;
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.swatch:hover > span { transform: scale(1.12); }
.swatch input:checked + span {
  border-color: var(--text);
  transform: scale(1.12);
}
.swatch input:focus-visible + span { border-color: var(--accent); }
.swatch--none > span {
  background:
    linear-gradient(45deg, transparent 44%, var(--text-muted) 44%, var(--text-muted) 56%, transparent 56%),
    var(--surface-2);
}

/* Fila de cliente con su formulario */
.client-row__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
}
.client-row__name { flex: 1 1 120px; min-width: 0; }

@media (max-width: 640px) {
  .client-row__form { flex-direction: column; align-items: stretch; }
  .swatches--inline { justify-content: flex-start; }
}

/* === Agrupacion por mes en el historial === */
.group-row td {
  padding: 16px 12px 8px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--border-strong) !important;
}
.data-table tbody tr.group-row:hover td { background: transparent !important; }
.group-row__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent);
}
.group-row__meta { margin-left: 10px; font-size: 0.78rem; color: var(--text-muted); }
.group-row__pending {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--warn);
}
.amount--pending { color: var(--warn); }
.amount--paid { color: var(--success); }

/* === Ranking por cliente === */
.ranking__figures {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
}
.ranking__figures .muted { font-size: 0.76rem; }
.ranking__clear { font-size: 0.82rem; color: var(--success); font-weight: 600; }
.ranking__paid { display: block; margin-top: 4px; font-size: 0.74rem; }
.ranking__paid .amount { font-size: 0.74rem; font-weight: 600; color: var(--text-muted); }

/* === Cliente inactivo === */
.client-row.is-inactive { opacity: 0.55; }
.client-row.is-inactive .client-row__name { text-decoration: line-through; }
.client-row.is-inactive .badge { margin-left: 8px; text-decoration: none; }
.client-row__state { margin: 0; }

@media (max-width: 640px) {
  .client-row__state { display: flex; }
  .client-row__state .btn { flex: 1; }
}
