:root {
  /* Color Palette - Premium & Modern */
  --primary: #4f46e5; /* Indigo */
  --primary-light: #818cf8;
  --primary-dark: #3730a3;

  --secondary: #10b981; /* Emerald */
  --secondary-light: #34d399;

  --accent: #f59e0b; /* Amber/Gold */
  --danger: #ef4444; /* Red */

  --bg-dark: #0f172a; /* Slate 900 */
  --bg-card: #1e293b; /* Slate 800 */
  --bg-input: #334155; /* Slate 700 */

  --text-main: #f8fafc; /* Slate 50 */
  --text-muted: #94a3b8; /* Slate 400 */

  --border-color: #334155;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 15px rgba(79, 70, 229, 0.4);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 80px; /* Space for bottom nav */
  padding-top: 60px; /* Space for header */
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  color: var(--text-main);
}

.text-primary {
  color: var(--primary);
}
.text-secondary {
  color: var(--secondary);
}
.text-accent {
  color: var(--accent);
}
.text-muted {
  color: var(--text-muted);
}

/* Header */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: rgba(30, 41, 59, 0.85); /* Glassmorphism */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.header-content {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, var(--primary-light), var(--text-main));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Main Container */
.app-main {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  min-height: calc(100vh - 140px);
}

/* Sections */
.section-title {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.85rem;
  font-weight: 600;
}

.mt-4 {
  margin-top: 1.5rem;
}
.mb-4 {
  margin-bottom: 1.5rem;
}

/* Grid & Cards */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.stat-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.ventas-icon {
  background-color: rgba(16, 185, 129, 0.15);
  color: var(--secondary);
}
.pendientes-icon {
  background-color: rgba(245, 158, 11, 0.15);
  color: var(--accent);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}

/* Action Grid */
.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.action-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 15px;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-main);
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: var(--transition);
}

.action-card:hover {
  background-color: var(--bg-input);
  transform: scale(1.02);
}

.action-card .material-icons-round {
  color: var(--primary-light);
  font-size: 24px;
}

/* Menú Principal Dashboard Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 10px;
}

@media (min-width: 600px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

.menu-card {
  background-color: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-main);
  text-align: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s, background-color 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.menu-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  background-color: var(--bg-input);
  border-color: rgba(255, 255, 255, 0.15);
}

.menu-card:active {
  transform: scale(0.97);
}

.menu-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  transition: transform 0.2s ease;
}

.menu-card:hover .menu-icon-wrap {
  transform: scale(1.1);
}

.menu-icon-wrap .material-icons-round {
  font-size: 28px;
}

.menu-card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-main);
  line-height: 1.2;
}

.menu-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 65px;
  background-color: var(--bg-card);
  display: flex;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom); /* For iOS */
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  width: 100%;
  height: 100%;
  transition: var(--transition);
  position: relative;
  padding: 5px 0;
}

.nav-item .material-icons-round {
  font-size: 24px;
  margin-bottom: 4px;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--primary-light);
}

.nav-item.active .material-icons-round {
  transform: translateY(-2px);
  filter: drop-shadow(0 2px 4px rgba(129, 140, 248, 0.4));
}

.nav-item::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 3px;
  background-color: var(--primary-light);
  border-radius: 0 0 4px 4px;
  transition: var(--transition);
}

.nav-item.active::after {
  width: 30px;
}

.nav-item:hover,
.nav-item:active {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.btn-primary:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover,
.icon-btn:active {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Inputs & Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.2);
}

.form-control::placeholder {
  color: rgba(148, 163, 184, 0.5);
}

/* Toasts */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--text-main);
  color: var(--bg-dark);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transition: var(--transition);
  z-index: 2000;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error {
  background-color: var(--danger);
  color: white;
}

.toast.success {
  background-color: var(--secondary);
  color: white;
}

.toast.danger {
  background-color: var(--danger);
  color: white;
}

.toast.warning {
  background-color: var(--accent);
  color: white;
}

/* Modals System */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

@media (min-width: 640px) {
  .modal-overlay {
    align-items: center;
  }
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-card);
  width: 100%;
  max-width: 500px;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}

@media (min-width: 640px) {
  .modal-content {
    border-radius: 20px;
    transform: translateY(20px);
  }
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Fullscreen Slide Modal */
.modal-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--bg-dark);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-fullscreen.active {
  display: flex !important;
}
