/* =====================================================
   CLIENTES PAGE STYLES
   ===================================================== */

/* Reset and Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-hover: #e2e8f0;
  --secondary-foreground: #475569;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --accent: #e0e7ff;
  --accent-foreground: #3730a3;
  --border: #e2e8f0;
  --input: #e2e8f0;
  --ring: #4f46e5;
  --radius: 12px;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.dark {
  --background: #0f172a;
  --foreground: #f1f5f9;
  --card: #1e293b;
  --card-foreground: #f1f5f9;
  --primary: #818cf8;
  --primary-hover: #a5b4fc;
  --primary-foreground: #0f172a;
  --secondary: #334155;
  --secondary-hover: #475569;
  --secondary-foreground: #e2e8f0;
  --muted: #334155;
  --muted-foreground: #94a3b8;
  --accent: #312e81;
  --accent-foreground: #c7d2fe;
  --border: #334155;
  --input: #334155;
  --ring: #818cf8;
}

html {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--background);
  color: var(--foreground);
  min-height: 100vh;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 32px;
  border-bottom: 1px solid var(--border);
  background-color: var(--card);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--foreground);
}

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

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme Toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--card);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background-color: var(--secondary);
  border-color: var(--muted-foreground);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  color: var(--foreground);
  transition: color 0.2s ease;
}

.theme-toggle .sun-icon {
  display: none;
}

.dark .theme-toggle .sun-icon {
  display: block;
}

.dark .theme-toggle .moon-icon {
  display: none;
}

/* Back Button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid var(--border);
  background-color: var(--card);
  color: var(--foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-back:hover {
  background-color: var(--secondary);
  border-color: var(--muted-foreground);
}

.btn-back svg {
  width: 16px;
  height: 16px;
}

/* Main Container */
.main-container {
  max-width: 1920px;
  margin: 0 auto;
  padding: 32px;
}

/* Card Base */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Decorative Elements */
.card-decoration {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), transparent);
  opacity: 0.05;
  top: -40px;
  right: -40px;
  pointer-events: none;
}

.card-decoration-2 {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-foreground), transparent);
  opacity: 0.03;
  bottom: -20px;
  left: -20px;
  pointer-events: none;
}

/* Search Section */
.search-section {
  margin-bottom: 24px;
}

.search-wrapper {
  position: relative;
  max-width: 400px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--input);
  border-radius: 10px;
  background-color: var(--card);
  color: var(--foreground);
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.dark .search-input:focus {
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

/* Table Card */
.table-card {
  padding: 0;
  overflow: hidden;
}

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

.table-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--foreground);
}

.table-count {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 9999px;
  background-color: var(--secondary);
  color: var(--muted-foreground);
}

/* Table */
.table-container {
  overflow-x: auto;
}

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

thead {
  background-color: var(--secondary);
}

th {
  padding: 14px 24px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

th:last-child {
  text-align: right;
}

td {
  padding: 16px 24px;
  font-size: 14px;
  color: var(--foreground);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td:last-child {
  text-align: right;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background-color 0.15s ease;
}

tbody tr:hover {
  background-color: var(--secondary);
}

/* Client Info */
.client-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.client-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent-foreground));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.client-name {
  font-weight: 500;
  color: var(--foreground);
}

.client-email {
  font-size: 13px;
  color: var(--muted-foreground);
}

/* Status Badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
}

.status-badge.active {
  background-color: #dcfce7;
  color: #166534;
}

.dark .status-badge.active {
  background-color: #14532d;
  color: #86efac;
}

.status-badge.inactive {
  background-color: #fef2f2;
  color: #dc2626;
}

.dark .status-badge.inactive {
  background-color: #450a0a;
  color: #fca5a5;
}

.status-badge.pending {
  background-color: #fef3c7;
  color: #d97706;
}

.dark .status-badge.pending {
  background-color: #451a03;
  color: #fcd34d;
}

/* Table Actions */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Icon Button */
.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background-color: var(--card);
  color: var(--foreground);
  border-color: var(--muted-foreground);
}

.btn-icon.delete:hover {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.dark .btn-icon.delete:hover {
  background-color: #450a0a;
  color: #fca5a5;
  border-color: #7f1d1d;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 64px 24px;
  color: var(--muted-foreground);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  opacity: 0.4;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--foreground);
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  max-width: 300px;
  margin: 0 auto;
}

/* Responsive */
@media (max-width: 768px) {
  .header {
    padding: 16px;
  }

  .main-container {
    padding: 16px;
  }

  th, td {
    padding: 12px 16px;
  }

  .client-avatar {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .header-actions {
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 8px;
  }

  .btn-back span {
    display: none;
  }
}
