/* Client Tracker Page Styles */

.clients-main {
  padding: 48px 48px 80px;
  min-height: calc(100vh - 61px);
}

.clients-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* ─── Topbar ─────────────────────────────── */
.clients-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
}

.clients-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.clients-subtitle {
  font-size: 14px;
  color: var(--fg-muted);
}

.btn-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-add span {
  font-size: 18px;
  line-height: 1;
  font-weight: 300;
}

.btn-add:hover {
  background: #B45309;
}

.btn-add:active {
  transform: scale(0.97);
}

/* ─── Stats ──────────────────────────────── */
.clients-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 24px;
  min-width: 80px;
}

.stat-num {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--fg);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-lbl {
  font-size: 12px;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ─── Table ──────────────────────────────── */
.table-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(26, 37, 53, 0.04);
}

.clients-table {
  width: 100%;
  border-collapse: collapse;
}

.clients-table thead tr {
  background: #F8F7F4;
  border-bottom: 1px solid var(--border);
}

.clients-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.clients-table tbody tr {
  border-bottom: 1px solid var(--surface);
  transition: background 0.1s;
}

.clients-table tbody tr:last-child {
  border-bottom: none;
}

.clients-table tbody tr:hover {
  background: #FAFAF7;
}

.clients-table td {
  padding: 14px 16px;
  vertical-align: middle;
}

/* Cell types */
.cell-name { min-width: 200px; }

.client-name {
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 2px;
}

.client-address {
  font-size: 12px;
  color: var(--fg-muted);
}

.cell-contact {
  min-width: 180px;
}

.contact-line {
  font-size: 13px;
  color: var(--fg);
  margin-bottom: 2px;
}

.contact-phone {
  color: var(--fg-muted);
}

.no-contact {
  color: var(--fg-muted);
  font-size: 13px;
}

/* Schedule badge */
.schedule-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
}

.schedule-daily {
  background: #DBEAFE;
  color: #1D4ED8;
}

.schedule-weekly {
  background: var(--accent-light);
  color: #92400E;
}

.schedule-monthly {
  background: #F3E8FF;
  color: #7C3AED;
}

/* Status badge */
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 20px;
}

.status-active {
  background: #DCFCE7;
  color: #15803D;
}

.status-inactive {
  background: var(--surface);
  color: var(--fg-muted);
}

.status-archived {
  background: #FEE2E2;
  color: #991B1B;
}

/* Actions */
.cell-actions {
  display: flex;
  gap: 8px;
  white-space: nowrap;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  color: var(--fg-muted);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-action:hover {
  background: var(--surface);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-archive:hover {
  border-color: #991B1B;
  color: #991B1B;
}

/* ─── Empty State ────────────────────────── */
.clients-empty {
  text-align: center;
  padding: 80px 40px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.empty-icon {
  font-size: 40px;
  color: var(--accent);
  opacity: 0.4;
  margin-bottom: 16px;
}

.clients-empty h3 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.clients-empty p {
  font-size: 14px;
  color: var(--fg-muted);
  margin-bottom: 24px;
}

/* ─── Modal ──────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 37, 53, 0.45);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(26, 37, 53, 0.25);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--surface);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  transition: background 0.15s;
}

.modal-close:hover {
  background: var(--border);
}

.modal-body {
  padding: 24px;
}

.form-row {
  margin-bottom: 16px;
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.form-error {
  background: #FEE2E2;
  color: #991B1B;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: #F8F7F4;
}

.btn-cancel {
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-cancel:hover {
  background: var(--surface);
}

.btn-save {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-save:hover {
  background: #B45309;
}

.btn-save:active {
  transform: scale(0.97);
}

/* ─── Responsive ─────────────────────────── */
@media (max-width: 768px) {
  .clients-main { padding: 24px 20px 60px; }
  .clients-topbar { flex-direction: column; gap: 16px; }
  .clients-title { font-size: 28px; }
  .clients-stats { gap: 10px; }
  .stat-card { padding: 12px 16px; min-width: 60px; }
  .stat-num { font-size: 22px; }
  .table-wrap { overflow-x: auto; }
  .clients-table { min-width: 600px; }
  .form-row.two-col { grid-template-columns: 1fr; }
}