/* clients/clients.css — Client Management page-specific styles */

/* ── FILTER BAR ── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-500);
  cursor: pointer;
  transition: all 0.14s;
  font-family: 'Assistant', sans-serif;
}

.pill:hover { background: var(--gray-50); color: var(--navy); }
.pill.active { background: var(--navy); color: white; border-color: var(--navy); }
.pill.pill-green.active { background: var(--green); border-color: var(--green); }
.pill.pill-gray.active  { background: var(--gray-500); border-color: var(--gray-500); }
.pill.pill-amber.active { background: var(--amber); border-color: var(--amber); color: #1C1917; }
.pill.pill-blue.active   { background: var(--blue); border-color: var(--blue); }
.pill.pill-teal.active   { background: #0D9488; border-color: #0D9488; }
.pill.pill-purple.active { background: #8B5CF6; border-color: #8B5CF6; }

/* ── CLIENTS CARD GRID ── */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.client-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.12s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.client-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--blue);
  transform: translateY(-1px);
}

.client-card.skeleton-card { pointer-events: none; }

/* Card header: avatar + name + status */
.cc-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cc-name-block { flex: 1; min-width: 0; }

.cc-badges { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; flex-shrink: 0; }
.cat-chip {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 10px;
  white-space: nowrap; line-height: 1.6;
}
.cat-business { background: #DBEAFE; color: #2563EB; }
.cat-company_event { background: #CCFBF1; color: #0F766E; }
.cat-private  { background: #EDE9FE; color: #7C3AED; }
.cat-prospect { background: #FEF3C7; color: #B45309; }

/* Card stats row */
.cc-stats {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--gray-100);
  border-bottom: 1px solid var(--gray-100);
  padding: 10px 0;
}

.cc-stat {
  flex: 1;
  text-align: center;
  padding: 0 8px;
  border-right: 1px solid var(--gray-100);
}

.cc-stat:last-child { border-right: none; }

.cc-stat-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.cc-stat-val {
  font-size: 15px;
  font-weight: 800;
  color: var(--navy);
}

/* Card footer: phone + actions */
.cc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cc-phone {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--blue);
  text-decoration: none;
}

.cc-phone:hover { text-decoration: underline; }
.cc-phone-empty { font-size: 13px; color: var(--gray-300); }

.client-name-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.client-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.client-name-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.client-contact {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 1px;
}

.client-cell {
  font-size: 13px;
  color: var(--gray-500);
}

.client-cell a {
  color: var(--blue);
  text-decoration: none;
}

.client-cell a:hover { text-decoration: underline; }

.revenue-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}

.status-active   { background: var(--green-light);  color: #16A34A; }
.status-inactive { background: var(--gray-100);     color: var(--gray-500); }
.status-prospect { background: var(--amber-light);  color: #D97706; }

.action-btns {
  display: flex;
  gap: 4px;
}

.action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  transition: all 0.14s;
}

.action-btn:hover { background: var(--gray-100); color: var(--navy); }
.action-btn.danger:hover { background: var(--red-light); color: var(--red); }

.action-btn .material-symbols-outlined { font-size: 16px; }

/* ── EMPTY STATE ── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state .material-symbols-outlined {
  font-size: 48px;
  color: var(--gray-200);
  display: block;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── DETAIL VIEW (tabs) ── */
.detail-view { display: none; }
.detail-view.visible { display: block; }
.list-view.hidden { display: none; }

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 16px;
  font-family: 'Assistant', sans-serif;
  transition: gap 0.14s;
}

.back-btn:hover { gap: 9px; }

.detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 18px;
  align-items: start;
}

/* ── CLIENT SIDEBAR CARD ── */
.client-info-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  padding: 22px;
  position: sticky;
  top: 0;
}

.client-big-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 24px;
  margin: 0 auto 12px;
}

.client-big-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-bottom: 6px;
}

.client-big-status {
  text-align: center;
  margin-bottom: 16px;
}

.client-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.client-info-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-500);
}

.client-info-item .material-symbols-outlined {
  font-size: 16px;
  color: var(--gray-300);
  flex-shrink: 0;
}

.client-info-item a {
  color: var(--blue);
  text-decoration: none;
}

.client-info-item a:hover { text-decoration: underline; }

.menu-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.menu-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 5px;
  background: var(--blue-light);
  color: #2563EB;
  font-weight: 600;
}

/* ── TABS ── */
.tabs-bar {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 18px;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-400);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-family: 'Assistant', sans-serif;
  transition: all 0.14s;
  white-space: nowrap;
}

.tab-btn:hover { color: var(--navy); }
.tab-btn.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 700; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── RULES PANEL ── */
.rules-discounts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
  background: var(--gray-50);
  transition: opacity 0.14s;
}

.rule-item.inactive {
  opacity: 0.5;
}

.rule-item.inactive .rule-text {
  text-decoration: line-through;
}

.rule-type-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 1px;
}

.rt-discount    { background: var(--green-light);  color: #16A34A; }
.rt-preference  { background: var(--blue-light);   color: #2563EB; }
.rt-restriction { background: var(--red-light);    color: #DC2626; }
.rt-note        { background: var(--amber-light);  color: #D97706; }
.rt-instruction { background: var(--purple-light); color: #7C3AED; }

.rule-body {
  flex: 1;
  min-width: 0;
}

.rule-text {
  font-size: 13px;
  color: var(--navy);
  font-weight: 500;
  margin-bottom: 3px;
}

.rule-meta {
  font-size: 11px;
  color: var(--gray-400);
}

.rule-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* ── ADD RULE FORM ── */
.inline-form {
  background: var(--gray-50);
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 10px;
  display: none;
}

.inline-form.open { display: block; }

.inline-form-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* ── DISCOUNTS TABLE ── */
.disc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.disc-table th {
  padding: 8px 10px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.disc-table td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--gray-50);
  color: var(--gray-500);
}

.disc-table tr:last-child td { border-bottom: none; }
.disc-table tr:hover td { background: var(--gray-50); }

/* ── REVENUE CHART ── */
.chart-container {
  position: relative;
  height: 280px;
  margin-bottom: 16px;
}

.revenue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.revenue-table th {
  padding: 8px 12px;
  text-align: right;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
}

.revenue-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-50);
  color: var(--gray-500);
}

.revenue-table tr:hover td { background: var(--gray-50); }
.delta-up   { color: #16A34A; font-weight: 700; }
.delta-down { color: var(--red); font-weight: 700; }

/* ── LOADING SKELETON ── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── RESPONSIVE ── */
@media (max-width: 1100px) {
  .detail-grid { grid-template-columns: 1fr; }
  .client-info-card { position: static; }
}

@media (max-width: 820px) {
  .clients-grid { grid-template-columns: 1fr; }
  .rules-discounts-grid { grid-template-columns: 1fr; }
}
