/* ==========================================================================
   CLINICCAPS HM2 - SISTEMA DE DISEÑO LIGHT MODE PREMIUM: COQUETTE & CHIC
   ========================================================================== */

/* --- Importación de Fuentes (Outfit & Inter) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&family=Parisienne&family=Alex+Brush&display=swap');

/* --- Variables de Diseño y Paleta de Colores --- */
:root {
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Paleta Coquette Pastel & Chic Light */
  --bg-light: #fffcfd;
  --bg-light-gradient: linear-gradient(135deg, #fff2f5 0%, #fffbfd 50%, #f4f6ff 100%);
  
  /* Colores de Acento Coquette */
  --color-primary: #ff5c8a;      /* Rose Coquette Chic */
  --color-primary-glow: rgba(255, 92, 138, 0.15);
  --color-secondary: #ffb5a7;    /* Peach Pastel */
  --color-secondary-glow: rgba(255, 181, 167, 0.25);
  --color-accent: #a3bffa;       /* Lavender Pastel */
  
  /* Colores de Alerta y Estado */
  --color-success: #2ec4b6;      /* Teal Quirúrgico Pastel */
  --color-warning: #ffbf69;      /* Gold Pastel */
  --color-danger: #ff6b6b;       /* Coral Pastel */
  --color-text-main: #3a2d42;    /* Texto Principal Elegante Berenjena */
  --color-text-muted: #7d6e85;   /* Violeta Muted */
  
  /* Efecto Glassmorphism Premium Light */
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 92, 138, 0.1);
  --glass-bg-hover: rgba(255, 255, 255, 0.85);
  --glass-border-hover: rgba(255, 92, 138, 0.25);
  --glass-shadow: 0 10px 40px rgba(255, 182, 193, 0.18);
  --glass-blur: blur(16px);
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.4);
}
::-webkit-scrollbar-thumb {
  background: var(--color-primary-glow);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* --- Reseteo Base --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: var(--bg-light);
  background-image: var(--bg-light-gradient);
  color: var(--color-text-main);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* --- Contenedor Principal --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* --- Títulos --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  color: var(--color-text-main);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, #a3bffa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* --- Tarjetas Glassmorphism --- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(255, 92, 138, 0.12);
}

/* --- Botones Premium --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 12px;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: none;
  text-decoration: none;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, #e04573 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(255, 92, 138, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 92, 138, 0.45);
  opacity: 0.98;
}

.btn-secondary {
  background: linear-gradient(135deg, #fff 0%, #ffece9 100%);
  color: var(--color-primary);
  border: 1px solid rgba(255, 92, 138, 0.2);
  box-shadow: 0 4px 15px rgba(255, 182, 193, 0.2);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #fff 0%, #ffdcd5 100%);
  box-shadow: 0 8px 20px rgba(255, 92, 138, 0.15);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger) 0%, #d9383a 100%);
  color: #fff;
}

.btn-danger:hover {
  opacity: 0.9;
}

/* --- Formularios --- */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 92, 138, 0.15);
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(255, 92, 138, 0.2);
  background: #ffffff;
}

/* --- Estilo de Tablas para el ERP --- */
.table-container {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  margin-top: 15px;
}

.custom-table {
  width: 100%;
  min-width: 850px;
  border-collapse: collapse;
  text-align: left;
}

.custom-table th {
  padding: 14px 16px;
  background: rgba(255, 92, 138, 0.03);
  color: var(--color-text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255, 92, 138, 0.1);
}

.custom-table td {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 92, 138, 0.05);
  font-size: 0.95rem;
  color: var(--color-text-main);
}

.custom-table tr:hover {
  background: rgba(255, 92, 138, 0.02);
}

/* --- Badges de Stock --- */
.badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(46, 196, 182, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(46, 196, 182, 0.25);
}

.badge-warning {
  background: rgba(255, 191, 105, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(255, 191, 105, 0.3);
}

.badge-danger {
  background: rgba(255, 107, 107, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(255, 107, 107, 0.25);
}

/* --- Grid de Productos (Catálogo) --- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-image-container {
  width: 100%;
  height: 220px;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid rgba(255, 92, 138, 0.08);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.product-card:hover .product-image {
  transform: scale(1.06);
}

.product-title {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: var(--color-text-main);
}

.product-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 15px;
  flex-grow: 1;
}

.product-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.product-price {
  font-size: 1.45rem;
  font-weight: 800;
  font-family: var(--font-title);
  color: var(--color-primary);
}

.product-price-ves {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* --- Panel ERP Layout (Sidebar + Contenido) --- */
.erp-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: rgba(255, 253, 254, 0.7);
  border-right: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  gap: 35px;
}

.main-content {
  flex-grow: 1;
  padding: 40px;
}

.sidebar-logo {
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.03em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  gap: 12px;
}

.nav-link:hover, .nav-link.active {
  background: rgba(255, 92, 138, 0.08);
  color: var(--color-primary);
  transform: translateX(4px);
}

/* --- Modales --- */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(58, 45, 66, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
  align-items: flex-start;
  justify-content: center;
}

.modal-content {
  max-width: 520px;
  width: 100%;
  margin: 40px auto;
  background: #ffffff !important;
  border: 1px solid rgba(255, 92, 138, 0.15) !important;
  box-shadow: 0 20px 60px rgba(58, 45, 66, 0.15) !important;
}

/* --- Micro-Animación de Latido Cardiaco --- */
@keyframes heartPulse {
  0% { transform: scale(1); }
  15% { transform: scale(1.12); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
  60% { transform: scale(1); }
  100% { transform: scale(1); }
}

.pulse-icon {
  display: inline-block;
  animation: heartPulse 2.5s infinite ease-in-out;
  color: var(--color-primary);
}

/* --- Responsividad --- */
@media (max-width: 992px) {
  .erp-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
    padding: 20px;
  }
  .main-content {
    padding: 20px;
  }
}

/* --- Brand Logo Component (Cursive & Chic) --- */
.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}

.brand-logo-icon {
  color: var(--color-primary);
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-logo-text {
  font-family: 'Parisienne', cursive;
  font-size: 2.4rem;
  color: var(--color-primary);
  font-weight: 500;
  line-height: 1;
  position: relative;
  user-select: none;
  letter-spacing: 0.02em;
}

.brand-logo-sub {
  font-family: 'Alex Brush', cursive;
  font-size: 1.1rem;
  color: #c94a73;
  position: absolute;
  bottom: -8px;
  right: -10px;
  font-weight: bold;
}

/* --- Image Logo Styling and Hover Effects --- */
.brand-logo img {
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.brand-logo:hover img {
  transform: scale(1.04);
}

/* --- Header Watermark Background & Search Bar --- */
header.glass-card {
  position: relative;
  overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='100' viewBox='0 0 160 100'%3E%3Cpath d='M 20 35 h 8 v -8 h 6 v 8 h 8 v 6 h -8 v 8 h -6 v -8 h -8 z' fill='rgba%28255, 45, 117, 0.05%29'/%3E%3Cpath d='M 120 20 c -2.5 -2.5 -6.5 -2.5 -9 0 l -1 1 l -1 -1 c -2.5 -2.5 -6.5 -2.5 -9 0 c -2.5 2.5 -2.5 6.5 0 9 l 10 10 l 10 -10 c 2.5 -2.5 2.5 -6.5 0 -9 z' fill='rgba%280, 240, 255, 0.05%29'/%3E%3Cpath d='M 15 75 h 15 l 4 -12 l 4 24 l 4 -16 h 15' fill='none' stroke='rgba%28255, 255, 255, 0.06%29' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Ccircle cx='105' cy='70' r='10' fill='none' stroke='rgba%280, 240, 255, 0.05%29' stroke-width='2'/%3E%3Cpath d='M 95 70 c 0 12 20 12 20 0' fill='none' stroke='rgba%280, 240, 255, 0.05%29' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.header-search-container {
  flex: 1;
  max-width: 500px;
  margin: 0 40px;
  position: relative;
  z-index: 2;
}

.header-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.header-search-input {
  width: 100%;
  padding: 12px 20px 12px 45px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  color: var(--color-text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 1px 2px rgba(255, 92, 138, 0.05);
}

.header-search-input::placeholder {
  color: var(--color-text-muted);
  opacity: 0.65;
}

.header-search-input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow), inset 0 1px 2px rgba(255, 92, 138, 0.05);
}

.header-search-icon {
  position: absolute;
  left: 18px;
  color: var(--color-text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: color 0.3s ease;
}

.header-search-input:focus + .header-search-icon {
  color: var(--color-primary);
}

/* Responsive headers */
@media (max-width: 768px) {
  header.glass-card {
    flex-direction: column;
    gap: 15px;
    padding: 20px;
  }
  .header-search-container {
    max-width: 100%;
    width: 100%;
    margin: 10px 0;
  }
}

/* --- Header Watermark Illustrations --- */
.header-watermark-left {
  position: absolute;
  left: 230px;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg);
  height: 85px;
  width: auto;
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
  transition: all 0.3s ease;
  filter: drop-shadow(0 4px 6px rgba(255, 92, 138, 0.1));
}

.header-watermark-right {
  position: absolute;
  right: 210px;
  top: 50%;
  transform: translateY(-50%) rotate(15deg);
  height: 90px;
  width: auto;
  opacity: 0.85;
  pointer-events: none;
  z-index: 1;
  transition: all 0.3s ease;
  filter: drop-shadow(0 4px 6px rgba(0, 240, 255, 0.1));
}

@media (max-width: 1200px) {
  .header-watermark-left {
    left: 200px;
    height: 75px;
  }
  .header-watermark-right {
    right: 180px;
    height: 80px;
  }
}

@media (max-width: 1050px) {
  .header-watermark-left,
  .header-watermark-right {
    opacity: 0.6;
  }
}

@media (max-width: 920px) {
  .header-watermark-left,
  .header-watermark-right {
    display: none;
  }
}
