﻿/* =========================================================
   Rasta Pets – Inicio / Dashboard
   Diseño Veterinario Minimalista / Soft UI
   ========================================================= */

:root {
  /* Fondos */
  --bg-body: #f6f9fc;
  --bg-card: #ffffff;
  --bg-soft: #f4fcfa;
  --bg-input: #f8fbfd;

  /* Textos */
  --text-main: #102a56;
  --text-secondary: #7b8ba8;
  --text-placeholder: #a6b3c9;

  /* Colores */
  --color-primary: #22c7a9;
  --color-primary-hover: #16a88e;
  --color-primary-soft: #e9fbf7;

  --color-blue: #2563eb;
  --color-blue-soft: #eff6ff;

  --color-green: #22c55e;
  --color-green-soft: #ecfdf5;

  --color-orange: #f59e0b;
  --color-orange-soft: #fffbeb;

  --color-purple: #8b5cf6;
  --color-purple-soft: #f3efff;

  --color-red: #ef4444;
  --color-red-soft: #fff1f2;

  --color-cyan: #06b6d4;
  --color-cyan-soft: #ecfeff;

  /* Icon backgrounds */
  --bg-icon-blue: var(--color-blue-soft);
  --bg-icon-green: var(--color-primary-soft);
  --bg-icon-orange: var(--color-orange-soft);
  --bg-icon-purple: var(--color-purple-soft);

  /* Bordes */
  --border-soft: #e3eaf3;
  --border-light: #eef3f8;

  /* Sombras */
  --shadow-soft: 0 14px 35px rgba(16, 42, 86, 0.06);
  --shadow-hover: 0 20px 48px rgba(16, 42, 86, 0.10);
  --shadow-primary: 0 12px 26px rgba(34, 199, 169, 0.22);

  /* Radius */
  --radius-xl: 28px;
  --radius-l: 20px;
  --radius-m: 16px;
  --radius-s: 12px;
  --radius-round: 999px;

  /* Typography */
  --font-family: "Inter", "DM Sans", system-ui, sans-serif;
  --font-size-base: 14px;
}

/* =========================================
   Base & Layout
   ========================================= */

.page.dashboard {
  min-height: 100vh;
  box-sizing: border-box;

  display: flex;
  flex-direction: column;
  gap: 26px;

  padding: 28px 36px;

  background:
    radial-gradient(circle at top right, rgba(34, 199, 169, 0.10), transparent 32%),
    var(--bg-body);

  color: var(--text-main);
  font-family: var(--font-family);
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

/* Scrollbar clean */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(123, 139, 168, 0.30);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(123, 139, 168, 0.50);
}

/* =========================================
   Header
   ========================================= */

.page__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;

  padding-bottom: 0;
  border-bottom: none;
}

.header-left .subtitle {
  margin-bottom: 7px;

  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.header-left h1 {
  color: var(--text-main);

  font-size: 34px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;

  padding: 10px 12px;

  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-round);

  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

/* Search Box */
.search-box {
  width: 220px;

  display: flex;
  align-items: center;
  gap: 10px;

  padding: 10px 16px;

  background: var(--bg-input);
  color: var(--text-main);

  border: 1px solid var(--border-light);
  border-radius: var(--radius-round);
}

.search-box svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.search-box input {
  width: 100%;

  border: none;
  outline: none;
  background: transparent;

  color: var(--text-main);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
}

.search-box input::placeholder {
  color: var(--text-placeholder);
}

/* Session Pill */
.session-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  width: 40px;
  height: 40px;

  display: flex;
  align-items: center;
  justify-content: center;

  background:
    linear-gradient(135deg, var(--color-primary) 0%, #42d6bd 100%);

  border-radius: 50%;

  box-shadow: 0 10px 20px rgba(34, 199, 169, 0.22);
}

.user-avatar svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
}

.user-info p {
  max-width: 150px;

  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 800;

  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =========================================
   KPI Cards
   ========================================= */

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.kpi-card {
  position: relative;

  display: flex;
  align-items: center;
  gap: 16px;

  padding: 22px 24px;

  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-soft);

  overflow: hidden;

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.kpi-card::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 20px;

  width: 46px;
  height: 46px;

  border-radius: 18px;

  background:
    radial-gradient(circle at center, rgba(34, 199, 169, 0.14), transparent 62%);

  pointer-events: none;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(34, 199, 169, 0.22);
}

/* Icon Styles */
.kpi-icon {
  width: 58px;
  height: 58px;
  flex-shrink: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 20px;
}

.kpi-icon svg {
  width: 27px;
  height: 27px;
}

/* Colors for specific KPIs */
.card-blue .kpi-icon {
  background-color: var(--bg-icon-blue);
  color: var(--color-blue);
}

.card-green .kpi-icon {
  background-color: var(--bg-icon-green);
  color: var(--color-primary-hover);
}

.card-orange .kpi-icon {
  background-color: var(--bg-icon-orange);
  color: var(--color-orange);
}

.card-purple .kpi-icon {
  background-color: var(--bg-icon-purple);
  color: var(--color-purple);
}

/* KPI Text */
.kpi-content {
  position: relative;
  z-index: 1;

  display: flex;
  flex-direction: column;
}

.kpi-label {
  margin-bottom: 3px;

  color: var(--text-secondary);
  font-size: 13.5px;
  font-weight: 600;
}

.kpi-value {
  margin-bottom: 4px;

  color: var(--text-main);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.kpi-value.small-text {
  font-size: 18px;
}

.kpi-hint {
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
}

.badge.positive {
  color: var(--color-primary-hover);
  font-weight: 900;
}

/* =========================================
   Dashboard Grid
   ========================================= */

.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

/* Common Dash Card */
.dash-card {
  display: flex;
  flex-direction: column;

  padding: 26px;

  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);

  box-shadow: var(--shadow-soft);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;

  margin-bottom: 22px;
}

.card-header h2 {
  color: var(--text-main);
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

/* Actions in Card Header */
.card-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 7px 13px;

  background: var(--color-primary-soft);
  color: var(--color-primary-hover);

  border: 1px solid rgba(34, 199, 169, 0.18);
  border-radius: var(--radius-s);

  font-size: 13px;
  font-weight: 800;
  text-decoration: none;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.action-link:hover {
  background: var(--color-primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-icon {
  width: 34px;
  height: 34px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: var(--bg-input);
  color: var(--text-main);

  border: 1px solid var(--border-soft);
  border-radius: var(--radius-s);

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.btn-icon:hover {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* =========================================
   Tables
   ========================================= */

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

.modern-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.modern-table thead th {
  padding: 14px 16px;

  background: var(--color-primary-soft);
  color: var(--color-primary-hover);

  text-align: left;

  font-size: 12.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;

  border-bottom: 1px solid rgba(34, 199, 169, 0.12);
}

.modern-table thead th:first-child {
  border-top-left-radius: var(--radius-m);
}

.modern-table thead th:last-child {
  border-top-right-radius: var(--radius-m);
}

.modern-table tbody td {
  padding: 15px 16px;

  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;
  vertical-align: middle;

  border-bottom: 1px solid var(--border-light);
}

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

.modern-table tbody tr:hover td {
  background: rgba(34, 199, 169, 0.045);
}

.modern-table tbody td:first-child {
  color: var(--text-main);
  font-weight: 800;
}

.modern-table tbody td:nth-child(4) {
  font-weight: 800;
}

/* Side Card List */
.list-container {
  margin-bottom: 24px;
}

.simple-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.simple-table th {
  padding-bottom: 10px;

  color: var(--text-secondary);
  text-align: left;

  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;

  border-bottom: 1px solid var(--border-light);
}

.simple-table td {
  padding: 12px 0;

  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 600;

  border-bottom: 1px solid var(--border-light);
}

/* =========================================
   Promo / Progress Box
   ========================================= */

.promo-box {
  margin-top: auto;
  padding: 20px;

  background:
    linear-gradient(135deg, #e9fbf7 0%, #f3efff 100%);

  color: var(--text-main);

  border: 1px solid rgba(34, 199, 169, 0.18);
  border-radius: var(--radius-l);

  text-align: center;

  box-shadow: 0 12px 28px rgba(16, 42, 86, 0.05);
}

.promo-box p {
  margin-bottom: 12px;

  color: var(--text-main);
  font-size: 13.5px;
  font-weight: 700;
}

.progress-fake {
  height: 8px;

  background: rgba(34, 199, 169, 0.16);
  border-radius: var(--radius-round);

  overflow: hidden;
}

.progress-fake .bar {
  height: 100%;

  background: var(--color-primary);
  border-radius: var(--radius-round);
}

/* =========================================
   Responsive
   ========================================= */

@media (max-width: 1000px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .header-right {
    width: 100%;
    justify-content: space-between;
  }

  .search-box {
    flex: 1;
    width: auto;
  }
}

@media (max-width: 640px) {
  .page.dashboard {
    padding: 22px 18px;
    gap: 22px;
  }

  .header-left h1 {
    font-size: 28px;
  }

  .header-right {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-l);
  }

  .session-pill {
    justify-content: flex-start;
  }

  .kpis {
    grid-template-columns: 1fr;
  }

  .dash-card {
    padding: 22px;
    border-radius: 22px;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
  }
}