/* Pastel Clay POS Design System - Stitch Adaptation */
@import url('https://fonts.googleapis.com/css2?family=Quicksand:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #f7f9fb;
  --bg-card: #ffffff;
  --text-main: #191c1e;
  --text-muted: #73787b;
  
  /* Acentos de colores desaturados y pasteles en Claymorfismo */
  --accent-cyan: #526069;
  --accent-cyan-light: #e3f2fd;
  --accent-cyan-text: #606f78;
  
  --accent-orange: #6b5a60;
  --accent-orange-light: #f4dce4;
  --accent-orange-text: #716066;
  
  --accent-green: #516161;
  --accent-green-light: #e2f4f3;
  --accent-green-text: #5f706f;

  --accent-purple: #7b6f7a;
  --accent-purple-light: #f0e6f2;
  --accent-purple-text: #776678;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Quicksand', sans-serif;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Estilo Claymorphic para Tarjetas (Light Pastel) */
.clay-card {
  background: var(--bg-card);
  border-radius: 28px;
  padding: 2rem;
  box-shadow: 
    10px 10px 25px rgba(160, 175, 190, 0.15), 
    inset 4px 4px 8px rgba(255, 255, 255, 0.9), 
    inset -5px -5px 10px rgba(160, 175, 190, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.clay-card:hover {
  transform: translateY(-2px);
  box-shadow: 
    12px 12px 30px rgba(160, 175, 190, 0.2), 
    inset 4px 4px 8px rgba(255, 255, 255, 0.95), 
    inset -5px -5px 10px rgba(160, 175, 190, 0.15);
}

/* Estilos Claymorphic para Inputs */
.clay-input {
  width: 100%;
  padding: 1rem 1.25rem;
  background: #f2f4f6;
  border: none;
  border-radius: 20px;
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  box-shadow: 
    inset 3px 3px 6px rgba(160, 175, 190, 0.25), 
    inset -2px -2px 4px rgba(255, 255, 255, 0.8);
  transition: box-shadow 0.2s ease;
}

.clay-input:focus {
  box-shadow: 
    inset 3px 3px 6px rgba(160, 175, 190, 0.35), 
    inset -2px -2px 4px rgba(255, 255, 255, 0.95),
    0 0 0 2px rgba(82, 96, 105, 0.25);
}

/* Botones Claymorphic Generales */
.clay-btn {
  padding: 0.8rem 1.8rem;
  border: none;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  text-decoration: none;
}

.clay-btn:hover {
  transform: translateY(-2px);
}

.clay-btn:active {
  transform: translateY(1px);
}

/* Variaciones de colores de Botones Pasteles */
.clay-btn-orange {
  background: var(--accent-orange-light);
  color: var(--accent-orange-text);
  box-shadow: 
    inset 3px 3px 6px rgba(255, 255, 255, 0.8),
    inset -4px -4px 8px rgba(113, 96, 102, 0.18),
    6px 6px 12px rgba(160, 175, 190, 0.15);
}
.clay-btn-orange:hover {
  background: #fcdce6;
  box-shadow: 
    inset 4px 4px 8px rgba(255, 255, 255, 0.9),
    inset -4px -4px 8px rgba(113, 96, 102, 0.12),
    8px 8px 16px rgba(160, 175, 190, 0.2);
}
.clay-btn-orange:active {
  box-shadow: 
    inset 1px 1px 3px rgba(255, 255, 255, 0.5),
    inset -1px -1px 3px rgba(0, 0, 0, 0.1),
    2px 2px 4px rgba(160, 175, 190, 0.1);
}

.clay-btn-green {
  background: var(--accent-green-light);
  color: var(--accent-green-text);
  box-shadow: 
    inset 3px 3px 6px rgba(255, 255, 255, 0.8),
    inset -4px -4px 8px rgba(95, 112, 111, 0.18),
    6px 6px 12px rgba(160, 175, 190, 0.15);
}
.clay-btn-green:hover {
  background: #eaf8f7;
  box-shadow: 
    inset 4px 4px 8px rgba(255, 255, 255, 0.9),
    inset -4px -4px 8px rgba(95, 112, 111, 0.12),
    8px 8px 16px rgba(160, 175, 190, 0.2);
}

.clay-btn-cyan {
  background: var(--accent-cyan-light);
  color: var(--accent-cyan-text);
  box-shadow: 
    inset 3px 3px 6px rgba(255, 255, 255, 0.8),
    inset -4px -4px 8px rgba(96, 111, 120, 0.18),
    6px 6px 12px rgba(160, 175, 190, 0.15);
}
.clay-btn-cyan:hover {
  background: #ecf6ff;
  box-shadow: 
    inset 4px 4px 8px rgba(255, 255, 255, 0.9),
    inset -4px -4px 8px rgba(96, 111, 120, 0.12),
    8px 8px 16px rgba(160, 175, 190, 0.2);
}

.clay-btn-purple {
  background: var(--accent-purple-light);
  color: var(--accent-purple-text);
  box-shadow: 
    inset 3px 3px 6px rgba(255, 255, 255, 0.8),
    inset -4px -4px 8px rgba(119, 102, 120, 0.18),
    6px 6px 12px rgba(160, 175, 190, 0.15);
}
.clay-btn-purple:hover {
  background: #f7eff9;
}

.clay-btn-secondary {
  background: #eceef0;
  color: #43474a;
  box-shadow: 
    inset 2px 2px 4px rgba(255, 255, 255, 0.8),
    inset -3px -3px 6px rgba(160, 175, 190, 0.15),
    4px 4px 8px rgba(160, 175, 190, 0.1);
}

/* Navbar */
.navbar {
  background: var(--bg-card);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 
    0 4px 20px rgba(160, 175, 190, 0.08),
    inset 0 2px 4px rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--text-main);
  text-decoration: none;
}

.navbar-brand svg {
  color: var(--accent-cyan);
}

.navbar-menu {
  display: flex;
  gap: 1rem;
  align-items: center;
}

/* Layout */
.container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.page {
  display: none;
  flex-direction: column;
  animation: fadeIn 0.4s ease;
}

.page.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Form Group */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Grid y Tablas */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.table-container {
  overflow-x: auto;
  border-radius: 20px;
  box-shadow: inset 2px 2px 5px rgba(160, 175, 190, 0.15);
  background: #f2f4f6;
  margin-top: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th, td {
  padding: 1rem 1.5rem;
}

th {
  background-color: #eceef0;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
}

td {
  border-bottom: 1px solid rgba(160, 175, 190, 0.05);
}

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

/* Terminal POS Vista */
.pos-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
  flex: 1;
}

@media (max-width: 900px) {
  .pos-layout {
    grid-template-columns: 1fr;
  }
}

.pos-cart {
  display: flex;
  flex-direction: column;
  height: 550px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdfdfd;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  margin-bottom: 0.75rem;
  box-shadow: 
    inset 2px 2px 4px rgba(255, 255, 255, 0.9),
    2px 2px 6px rgba(160, 175, 190, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* Notificaciones Clay */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 1rem 2rem;
  border-radius: 16px;
  font-weight: 700;
  color: #fff;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  box-shadow: 
    inset 2px 2px 4px rgba(255, 255, 255, 0.4),
    8px 8px 16px rgba(160,175,190,0.2);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast-success { background: #3cd070; color: #fff; }
.toast-error { background: #ff763b; color: #fff; }

/* Badges */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-block;
}

.badge-pendiente {
  background: #f4dce4;
  color: var(--accent-orange);
}

.badge-aprobada {
  background: #e2f4f3;
  color: var(--accent-green);
}

/* Mobile-First Adaptability & Responsiveness */
@media (max-width: 768px) {
  body {
    padding: 0;
  }
  .container {
    padding: 1rem 0.75rem !important;
  }
  .navbar {
    flex-direction: column !important;
    padding: 1rem !important;
    gap: 0.75rem !important;
  }
  .navbar-menu {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 0.5rem !important;
  }
  .navbar-menu span {
    display: block;
    width: 100%;
    text-align: center;
    margin: 0.25rem 0 !important;
  }
  .page {
    padding: 0.5rem 0 !important;
  }
  .grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .clay-card {
    grid-column: span 1 !important;
    padding: 1.25rem !important;
    border-radius: 20px !important;
  }
  .pos-cart {
    height: auto !important;
    min-height: 380px;
  }
  .pos-layout {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.5rem;
  }
  table {
    min-width: 550px;
  }
  h1 {
    font-size: 1.6rem !important;
    line-height: 1.2;
  }
  h2 {
    font-size: 1.3rem !important;
  }
  /* Espaciado para modales fijos en celulares */
  #modal-create-user, #modal-create-product, #modal-open-caja, #modal-close-caja, #modal-edit-user {
    padding: 1rem !important;
  }
  /* Márgenes superiores en vistas de autenticación en móvil */
  #page-login > div, #page-register > div {
    margin-top: 1.5rem !important;
  }
}
