/* ==========================================================================
   1. VARIABLES GLOBALES Y RESET
   ========================================================================== */
:root {
  /* Paleta base y fondos */
  --amanda-pastel: #f1d6f6;
  --bg-app: #f7ccff;        /* Fondo rosa principal de la pantalla */
  --bg-surface: #fffdec;    /* Tono crema para la cápsula del menú y tarjetas */
  --bg-card: #ffffff;
  --bg-hover: #f9eefa;
  --border-color: #e8d0ec;

  /* Textos */
  --text-main: #2b1830;
  --text-muted: #7d6484;

  /* Primario y acentos */
  --primary: #9446a8;
  --primary-hover: #7b328d; 
  --primary-focus: rgba(148, 70, 168, 0.2);

  /* Estados y alertas */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;

  /* Estructura y sombras */
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  padding: 0;
  margin: 0;
  /*min-height: 100vh;*/
}

/* ==========================================================================
   2. CONTENEDORES Y ESTRUCTURA GENERAL
   ========================================================================== */
.page-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 16px;
}

.panel-container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(148, 70, 168, 0.06);
  overflow: hidden;
}

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

.panel-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   3. BOTONES Y ACCIONES
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid var(--border-color);
  background: var(--amanda-pastel);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.btn-edit {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.btn-edit:hover {
  background-color: var(--amanda-pastel);
}

.btn-edit img {
  width: 30px;
  height: 30px;
}

/* Botones de Turno */
.btn-shift {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-open {
  background-color: var(--success);
  color: white;
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-open:hover {
  background-color: #059669;
  transform: translateY(-1px);
}

.btn-close {
  background-color: var(--danger);
  color: white;
  box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.btn-close:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
}

/* ==========================================================================
   4. FORMULARIOS, BUSCADORES Y EXPORTACIÓN
   ========================================================================== */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  gap: 8px;
  flex: 1;
  max-width: 450px;
}

.input-text,
.input-control {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text-main);
  background-color: #faf7fb;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-text:focus,
.input-control:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-focus);
}

.export-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.export-btn img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.export-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
}

form.form-amanda {
  padding: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   5. TABLAS DE REGISTROS
   ========================================================================== */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

thead tr {
  background-color: #f7eaf9;
  border-bottom: 1px solid var(--border-color);
}

th {
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}

tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.15s ease;
}

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

td {
  padding: 8px 16px;
  color: var(--text-main);
  vertical-align: middle;
}

.col-action {
  width: 60px;
  text-align: center;
}

.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ==========================================================================
   6. PANEL DE CONTROL (INDEXEMP)
   ========================================================================== */
.dashboard-container {
  max-width: 900px;
  margin: 30px auto;
  padding: 0 1.25rem;
}

.welcome-header {
  margin-bottom: 1.5rem;
  text-align: center;
}

.welcome-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.welcome-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Tarjeta del turno en tono crema */
.shift-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 14px rgba(148, 70, 168, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.shift-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.shift-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.shift-icon-wrapper.open {
  background: var(--success-bg);
  color: var(--success);
}

.shift-icon-wrapper.closed {
  background: var(--danger-bg);
  color: var(--danger);
}

.shift-text h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.shift-text span {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ==========================================================================
   7. NAVBAR BASE COMÚN
   ========================================================================== */
.navbar-amanda {
  background: transparent !important;
  border-bottom: none !important;
  box-shadow: none !important;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 14px 0;
}

@media (min-width: 992px) {
  .nav-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    position: relative;
  }
}

@media (min-width: 1400px) {
  .nav-container {
    max-width: 95%;
    width: 100%;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 56px;
    position: relative;
  }
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.brand-wrapper img {
  width: 100px;
  height: 100px;
  object-fit: contain;
}

.brand-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-badge {
  font-size: 1.25rem;
  color: var(--text-main);
  padding: 4px 14px;
  border-radius: 20px;
  font-weight: 600;
}

.dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 6px 0;
}

/* ==========================================================================
   8. COMPORTAMIENTO ESCRITORIO (>= 992px)
   ========================================================================== */
@media (min-width: 992px) {
  .nav-button img {
    width: 30px !important;
    height: 30px !important;
    object-fit: contain;
  }

}

@media (min-width: 1400px) {
  .nav-button img {
    width: 40px !important;
    height: 40px !important;
    object-fit: contain;
  }

}

@media (min-width: 992px) {
  .navbar-toggler {
    display: none !important;
  }

  .navbar-collapse {
    display: flex !important;
    align-items: center;
    position: static;
    justify-content: flex-end;
  }

  /* Cápsula flotante crema */
  ul.nav-menu {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    list-style: none !important;
    margin: 0 !important;
    gap: 8px !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 22px !important;
    padding: 6px 16px !important;
    box-shadow: 0 4px 16px rgba(148, 70, 168, 0.06) !important;
  }

  .nav-item {
    position: relative;
    list-style: none;
    margin: 0;
  }

  .nav-button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 6px 12px !important;
    background: transparent !important;
    border: none !important;
    border-radius: 12px !important;
    color: var(--text-main) !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    transition: all 0.15s ease;
  }

  .nav-button:hover,
  .nav-item:hover > .nav-button {
    background-color: rgba(148, 70, 168, 0.08) !important;
    color: var(--primary) !important;
  }

  /* Submenús desplegables */
  .dropdown-content {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 200px;
    background: #ffffff;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    padding: 6px;
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all 0.15s ease;
    z-index: 1050;
  }

  .nav-item:hover .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .dropdown-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: background 0.15s;
  }

  .dropdown-link:hover {
    background-color: var(--bg-hover);
    color: var(--primary);
  }
}

/* ==========================================================================
   9. COMPORTAMIENTO MÓVIL (<= 991px)
   ========================================================================== */
@media (max-width: 991px) {
  .navbar-toggler {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    margin-left: auto;
  }

  .navbar-toggler:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
  }

  .navbar-collapse {
    position: absolute;
    top: 64px;
    left: 0;
    width: 100%;
    background: #ffffff;
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
    display: none !important;
    flex-direction: column !important;
    z-index: 999;
    justify-content: flex-end;
  }

  .navbar-collapse.open {
    display: flex !important;
  }

  ul.nav-menu {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 100% !important;
    padding: 20px 0 !important;
    margin: 0 !important;
    list-style: none !important;
    gap: 16px !important;
  }

  .nav-item {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .nav-button {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    color: var(--text-main) !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    padding: 8px 16px !important;
    cursor: pointer !important;
    width: 100%;
  }

  .nav-button img {
    width: 40px !important;
    height: 40px !important;
    margin-bottom: 6px !important;
    object-fit: contain;
  }

  .nav-button:hover {
    color: var(--primary) !important;
  }

  .dropdown-content {
    display: none;
    list-style: none;
    padding: 6px 0;
    margin: 6px 0 0 0;
    background: var(--bg-hover);
    width: 85%;
    max-width: 280px;
    border-radius: 8px;
    text-align: center;
  }

  .nav-item.mobile-open .dropdown-content {
    display: block;
  }

  .dropdown-link {
    display: block;
    padding: 8px 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.875rem;
  }

  .shift-card {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    text-align: center;
  }

  .shift-info {
    flex-direction: column;
  }
}