/* ============================================================
   MASAconARTE — Estilos principales
   Paleta: Espresso #3D2314 | Marrón #8B5E3C | Ámbar #C4874F
            Trigo claro #E8C99A | Crema #FAF6EF
   ============================================================ */

:root {
  --color-dark:       #3D2314;
  --color-primary:    #8B5E3C;
  --color-amber:      #C4874F;
  --color-wheat:      #E8C99A;
  --color-cream:      #FAF6EF;
  --color-cream-2:    #F3EBE0;
  --color-border:     #E0D0BC;
  --color-green:      #6B8F4E;
  --color-text:       #2C1A0E;
  --color-text-muted: #8A7060;
  --sidebar-width:    260px;
  --sidebar-bg:       #2C1A0E;
  --sidebar-text:     #E8D5C0;
  --header-height:    0px;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--color-cream);
  color: var(--color-text);
  font-size: 0.9rem;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, .font-display {
  font-family: 'Playfair Display', serif;
}

.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }

/* ── Layout ───────────────────────────────────────────────── */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem;
  min-width: 0;
  transition: margin-left 0.3s;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.3s;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logo {
  width: 160px;
  opacity: 0.9;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sidebar-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--color-amber);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1rem; flex-shrink: 0;
}
.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  display: block;
  color: white;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav {
  list-style: none;
  padding: 0.75rem 0;
  margin: 0;
  flex: 1;
}
.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.35);
  padding: 1rem 1.25rem 0.4rem;
  font-weight: 600;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-link:hover {
  background: rgba(255,255,255,0.07);
  color: white;
  border-left-color: var(--color-amber);
}
.sidebar-link.active {
  background: rgba(196, 135, 79, 0.2);
  color: var(--color-wheat);
  border-left-color: var(--color-amber);
}
.sidebar-link i { font-size: 1rem; min-width: 1.2rem; }

.sidebar-footer {
  padding: 0.75rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.sidebar-logout { color: rgba(255,255,255,0.5); }
.sidebar-logout:hover { color: #ff8585; background: rgba(255,100,100,0.1); }

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 1rem; left: 1rem;
  z-index: 1100;
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 8px;
  width: 42px; height: 42px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

/* ── Page Header ──────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-dark);
  margin: 0;
  line-height: 1.2;
}
.page-subtitle {
  color: var(--color-text-muted);
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(61,35,20,0.06);
}
.card-header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.25rem;
  border-radius: 12px 12px 0 0 !important;
}
.card-header h5, .card-header h6 { font-weight: 600; color: var(--color-dark); }
.card-body { padding: 1.25rem; }

/* ── Stat Cards ───────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 1px 4px rgba(61,35,20,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(61,35,20,0.1); }
.stat-card__icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-card--primary .stat-card__icon { background: rgba(139,94,60,0.12); color: var(--color-primary); }
.stat-card--amber .stat-card__icon   { background: rgba(196,135,79,0.12); color: var(--color-amber); }
.stat-card--green .stat-card__icon   { background: rgba(107,143,78,0.12); color: var(--color-green); }
.stat-card--dark .stat-card__icon    { background: rgba(61,35,20,0.08);   color: var(--color-dark); }

.stat-card__value {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-dark);
  line-height: 1;
}
.stat-card__label { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 500; margin-top: 0.2rem; }

/* ── Tables ───────────────────────────────────────────────── */
.table { margin: 0; }
.table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  font-weight: 600;
  background: #faf6ef;
  border-bottom: 1px solid var(--color-border);
  padding: 0.75rem 1rem;
}
.table td { padding: 0.75rem 1rem; vertical-align: middle; }
.table-hover tbody tr:hover { background: #fdf9f5; }
.table-total { background: var(--color-cream-2); }
.table-total td { font-weight: 700; color: var(--color-dark); }
.table-section-header td { background: #fdf5ee; color: var(--color-primary); font-weight: 600; font-size: 0.8rem; padding: 0.5rem 1rem; }

/* ── Badges ───────────────────────────────────────────────── */
.badge-regular  { background: #e8f0e0; color: #4a7030; font-weight: 600; }
.badge-encargo  { background: #fde8d0; color: #944d10; font-weight: 600; }
.badge-rotacion { background: #e0eafa; color: #1a4080; font-weight: 600; }

.badge-quantity {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 28px; height: 28px;
  background: var(--color-primary);
  color: white; font-weight: 700;
  border-radius: 8px; font-size: 0.85rem;
  padding: 0 6px;
}
.badge-quantity-sm {
  display: inline-block;
  background: var(--color-wheat);
  color: var(--color-dark);
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.75rem;
}

.status-badge { font-weight: 600; font-size: 0.78rem; padding: 4px 10px; border-radius: 20px; }
.status-pendiente  { background: #fff3cd; color: #856404; }
.status-completado { background: #d1f0db; color: #1a6b3a; }
.status-cancelado  { background: #fde8e8; color: #9b2323; }

.badge-role-admin    { background: rgba(139,94,60,0.15); color: var(--color-primary); font-weight: 600; font-size: 0.75rem; padding: 2px 8px; border-radius: 20px; display: inline-block; }
.badge-role-employee { background: rgba(107,143,78,0.15); color: var(--color-green); font-weight: 600; font-size: 0.75rem; padding: 2px 8px; border-radius: 20px; display: inline-block; }

/* ── Buttons ──────────────────────────────────────────────── */
.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  font-weight: 600;
  border-radius: 8px;
}
.btn-primary:hover, .btn-primary:focus {
  background: #7a5132; border-color: #7a5132; color: white;
}
.btn-outline-primary {
  color: var(--color-primary); border-color: var(--color-primary);
}
.btn-outline-primary:hover { background: var(--color-primary); color: white; }

.btn-icon {
  width: 32px; height: 32px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid var(--color-border);
  background: #fff; color: var(--color-primary);
  transition: all 0.15s;
}
.btn-icon:hover { background: var(--color-cream-2); border-color: var(--color-primary); }
.btn-icon--danger { color: #c0392b; }
.btn-icon--danger:hover { background: #fde8e8; border-color: #c0392b; }

/* ── Alerts / Toasts ──────────────────────────────────────── */
.alert-success { background: #d1f0db; border-color: #a8ddb8; color: #1a5c30; }
.alert-danger  { background: #fde8e8; border-color: #f5b7b1; color: #922b21; }
.alert-info    { background: #dbeafe; border-color: #bfdbfe; color: #1e40af; }
.alert-toast {
  position: fixed;
  top: 1.5rem; right: 1.5rem;
  z-index: 9999;
  min-width: 280px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-radius: 10px;
  border: none;
  font-weight: 500;
}

/* ── Forms ────────────────────────────────────────────────── */
.form-control, .form-select {
  border-color: var(--color-border);
  border-radius: 8px;
  font-size: 0.875rem;
  color: var(--color-text);
}
.form-control:focus, .form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(139,94,60,0.12);
}
.form-label { font-weight: 500; font-size: 0.85rem; color: var(--color-text); margin-bottom: 0.35rem; }
.input-group-text { background: var(--color-cream-2); border-color: var(--color-border); color: var(--color-primary); }

/* ── Upcoming days ────────────────────────────────────────── */
.upcoming-days {
  display: flex; flex-wrap: wrap; gap: 0.75rem;
}
.upcoming-day-card {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: var(--color-cream-2);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--color-text);
  transition: all 0.2s;
  min-width: 170px;
}
.upcoming-day-card:hover { background: var(--color-wheat); color: var(--color-dark); border-color: var(--color-amber); }
.upcoming-day-date { text-align: center; }
.upcoming-day-num { display: block; font-size: 1.5rem; font-weight: 700; font-family: 'Playfair Display',serif; color: var(--color-primary); line-height: 1; }
.upcoming-day-month { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--color-text-muted); }
.upcoming-day-stats { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--color-text-muted); }

/* ── Empty state ──────────────────────────────────────────── */
.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem;
}
.empty-state i { font-size: 2.5rem; color: var(--color-wheat); display: block; margin-bottom: 0.5rem; }
.empty-state p { margin: 0; }

/* ── LOGIN ────────────────────────────────────────────────── */
.login-body { background: var(--color-cream); min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-bg-pattern {
  position: fixed; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(
    45deg,
    transparent, transparent 40px,
    rgba(196,135,79,0.04) 40px, rgba(196,135,79,0.04) 80px
  );
}
.login-container { position: relative; z-index: 1; width: 100%; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(61,35,20,0.12);
  padding: 2.5rem;
  width: 100%; max-width: 420px;
  border: 1px solid var(--color-border);
}
.login-logo-wrap { text-align: center; margin-bottom: 1.5rem; }
.login-logo { max-width: 200px; }
.login-title { font-size: 1.5rem; font-weight: 700; color: var(--color-dark); text-align: center; margin: 0; }
.login-subtitle { color: var(--color-text-muted); text-align: center; font-size: 0.875rem; margin: 0.25rem 0 1.5rem; }
.btn-login { background: var(--color-primary); border-color: var(--color-primary); padding: 0.7rem; font-size: 1rem; font-weight: 600; border-radius: 10px; }
.btn-login:hover { background: var(--color-dark); border-color: var(--color-dark); }
.login-footer-text { text-align: center; color: var(--color-text-muted); margin-top: 1.5rem; }

/* ── NEW ORDER ────────────────────────────────────────────── */
.day-block {
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
}
.day-block-header {
  background: var(--color-cream-2);
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
}
.day-block-body { padding: 1.25rem; }

/* Secciones de panes */
.breads-section { margin-bottom: 1.75rem; }
.breads-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-wheat);
  display: flex; align-items: center;
}
.breads-section-title--encargo { color: #944d10; border-bottom-color: #fde8d0; }
.breads-section-title--rotacion { color: #1a4080; border-bottom-color: #e0eafa; }

/* Grid de panes */
.breads-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
}

/* Botón de pan */
.bread-btn {
  background: #fff;
  border: 2px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  overflow: hidden;
  position: relative;
  user-select: none;
}
.bread-btn:hover {
  border-color: var(--color-amber);
  box-shadow: 0 3px 10px rgba(196,135,79,0.2);
  transform: translateY(-2px);
}
.bread-btn--selected {
  border-color: var(--color-primary);
  background: #faf0e6;
  box-shadow: 0 3px 10px rgba(139,94,60,0.2);
}
.bread-btn-img-wrap {
  position: relative;
  height: 120px;
  background: var(--color-cream-2);
  overflow: hidden;
}
.bread-btn-img { width: 100%; height: 100%; object-fit: cover; }
.bread-btn-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.bread-btn-placeholder::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(255,255,255,0.14) 0%,
    rgba(0,0,0,0) 45%,
    rgba(0,0,0,0.22) 100%);
}
.bread-btn-placeholder i {
  position: relative; z-index: 1;
  font-size: 1.8rem;
  color: rgba(255,255,255,0.45);
  text-shadow: 0 1px 4px rgba(0,0,0,0.45);
}

/* 6 estilos fotorrealistas de pan (asignados por bread.id % 6) */
.bread-pp-0 { background: radial-gradient(ellipse at 35% 38%, #f5e6a8 0%, #e8bf66 35%, #c4874f 66%, #8b5230 100%); }
.bread-pp-1 { background: radial-gradient(ellipse at 42% 36%, #daa870 0%, #be7444 42%, #8a5c3a 72%, #5a3620 100%); }
.bread-pp-2 { background: radial-gradient(ellipse at 32% 32%, #a07848 0%, #7a5830 44%, #5a3e22 76%, #3a2410 100%); }
.bread-pp-3 { background: radial-gradient(ellipse at 28% 32%, #6a4a30 0%, #4a3020 52%, #2e1c0e 85%, #1a0e06 100%); }
.bread-pp-4 { background: radial-gradient(ellipse at 45% 38%, #c8a562 0%, #9e7840 40%, #786030 74%, #584828 100%); }
.bread-pp-5 { background: radial-gradient(ellipse at 50% 44%, #f8ecca 0%, #ecd688 34%, #c8a858 68%, #a07840 100%); }
.bread-btn-qty {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--color-primary);
  color: white;
  font-weight: 700; font-size: 0.85rem;
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.bread-btn-name {
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-dark);
  text-align: center;
  line-height: 1.3;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
}

/* Sección seleccionados */
.selected-items-section {
  background: var(--color-cream-2);
  border-radius: 10px;
  padding: 1rem;
  border: 1px solid var(--color-border);
}
.selected-items-title {
  font-size: 0.85rem; font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}
.selected-items-list { display: flex; flex-direction: column; gap: 0.5rem; }
.selected-item {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  gap: 0.5rem;
}
.selected-item-name { font-weight: 500; flex: 1; font-size: 0.875rem; }
.selected-item-controls { display: flex; align-items: center; gap: 0.35rem; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-border);
  background: var(--color-cream-2);
  cursor: pointer; font-size: 0.8rem;
  color: var(--color-primary);
  transition: all 0.15s;
}
.qty-btn:hover { background: var(--color-wheat); border-color: var(--color-amber); }
.qty-btn--minus { color: #e07730; }
.qty-btn--remove { color: #c0392b; }
.qty-btn--remove:hover { background: #fde8e8; border-color: #c0392b; }
.qty-value { font-weight: 700; font-size: 1rem; min-width: 24px; text-align: center; color: var(--color-dark); }

/* Búsqueda de cliente */
.client-suggestions {
  position: absolute;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  z-index: 500;
  width: 100%;
  max-height: 200px;
  overflow-y: auto;
}
.client-suggestion-item {
  padding: 0.6rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s;
}
.client-suggestion-item:hover { background: var(--color-cream-2); }

/* ── ADMIN — Panes ────────────────────────────────────────── */
.bread-admin-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.2s;
}
.bread-admin-card:hover { box-shadow: 0 4px 16px rgba(139,94,60,0.12); transform: translateY(-2px); }
.bread-inactive { opacity: 0.6; }
.bread-admin-img-wrap { position: relative; height: 140px; background: var(--color-cream-2); }
.bread-admin-img { width: 100%; height: 100%; object-fit: cover; }
.bread-admin-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: var(--color-wheat);
  background: linear-gradient(135deg, #f3ebe0, #e8d5c0);
}
.bread-admin-category-badge { position: absolute; top: 8px; left: 8px; }
.bread-inactive-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.6);
  display: flex; align-items: center; justify-content: center;
}
.bread-inactive-overlay span { font-weight: 700; color: var(--color-text-muted); }
.bread-admin-info { padding: 0.75rem; }
.bread-admin-name { font-size: 0.85rem; font-weight: 600; margin: 0 0 0.5rem; color: var(--color-dark); line-height: 1.3; }
.bread-admin-actions { display: flex; gap: 0.35rem; }

.img-preview { max-height: 120px; border-radius: 8px; object-fit: cover; border: 1px solid var(--color-border); }

/* ── ADMIN — Rotación ─────────────────────────────────────── */
.rotation-table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--color-border); }
.rotation-table { margin: 0; }
.rotation-table th { white-space: nowrap; text-align: center; background: var(--color-cream-2); }
.rotation-bread-col { min-width: 240px; text-align: left !important; }
.rotation-day-col { min-width: 100px; }

.rotation-bread-thumb {
  width: 40px; height: 40px; border-radius: 8px; object-fit: cover;
}
.rotation-bread-thumb-placeholder {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--color-cream-2); display: flex; align-items: center; justify-content: center;
  color: var(--color-wheat); font-size: 1.2rem;
}

.rotation-toggle { position: relative; display: inline-block; width: 46px; height: 24px; cursor: pointer; }
.rotation-toggle input { opacity: 0; width: 0; height: 0; }
.rotation-toggle-slider {
  position: absolute; inset: 0;
  background: #d0c8c0; border-radius: 24px;
  transition: background 0.2s;
}
.rotation-toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px; width: 18px;
  left: 3px; bottom: 3px;
  background: white; border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.rotation-toggle input:checked + .rotation-toggle-slider { background: var(--color-primary); }
.rotation-toggle input:checked + .rotation-toggle-slider::before { transform: translateX(22px); }

.save-toast {
  position: fixed; bottom: 2rem; right: 2rem;
  background: var(--color-primary);
  color: white; padding: 0.6rem 1.25rem;
  border-radius: 30px;
  font-weight: 600; font-size: 0.875rem;
  box-shadow: 0 4px 16px rgba(139,94,60,0.3);
  z-index: 9999;
}

/* ── ADMIN — Días ─────────────────────────────────────────── */
.day-management-card .card-body { padding: 1rem; }
.bread-day-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--color-cream-2);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.78rem; font-weight: 500;
  color: var(--color-dark);
}
.bread-day-badge-name { max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btn-remove-bread {
  background: none; border: none; padding: 0;
  line-height: 1; cursor: pointer;
  color: #c0392b; font-weight: 700; font-size: 0.9rem;
  margin-left: 2px;
}
.btn-remove-bread:hover { color: #a93226; }

/* ── ADMIN — Panel principal ──────────────────────────────── */
.admin-module-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  position: relative; overflow: hidden;
  transition: all 0.2s; cursor: pointer;
  box-shadow: 0 1px 4px rgba(61,35,20,0.06);
}
.admin-module-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(61,35,20,0.1); }
.admin-module-icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: white; flex-shrink: 0;
}
.admin-module-count { font-size: 2rem; font-weight: 700; font-family: 'Playfair Display',serif; color: var(--color-dark); line-height: 1; }
.admin-module-label { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 500; }

.admin-nav-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  text-decoration: none; color: var(--color-dark);
  transition: all 0.2s;
  min-height: 120px;
}
.admin-nav-card:hover { border-color: var(--color-amber); background: #fdf8f3; color: var(--color-primary); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(139,94,60,0.1); }
.admin-nav-card i { font-size: 2rem; color: var(--color-amber); }
.admin-nav-card span { font-weight: 700; font-size: 0.95rem; }
.admin-nav-card small { color: var(--color-text-muted); font-size: 0.78rem; }

/* ── ADMIN — Usuarios ─────────────────────────────────────── */
.user-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  transition: all 0.2s;
}
.user-card:hover { box-shadow: 0 4px 16px rgba(139,94,60,0.08); }
.user-card--inactive { opacity: 0.6; }
.user-card__avatar {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 700; color: white; flex-shrink: 0;
}
.user-card__avatar--admin    { background: var(--color-primary); }
.user-card__avatar--employee { background: var(--color-green); }
.user-card__info { flex: 1; min-width: 0; }
.user-card__name { font-weight: 700; font-size: 0.95rem; margin: 0 0 2px; color: var(--color-dark); }
.user-card__username { font-size: 0.8rem; color: var(--color-text-muted); }
.user-card__actions { display: flex; gap: 0.35rem; flex-shrink: 0; }

/* ── INFORMES — Tabs ──────────────────────────────────────── */
.report-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.report-tab {
  padding: 0.6rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.2s;
}
.report-tab:hover { border-color: var(--color-amber); color: var(--color-primary); }
.report-tab.active { background: var(--color-primary); border-color: var(--color-primary); color: white; }

/* Rank badges */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  font-weight: 700; font-size: 0.75rem;
}
.rank-1 { background: #ffd700; color: #7a5000; }
.rank-2 { background: #c0c0c0; color: #444; }
.rank-3 { background: #cd7f32; color: white; }
.rank-other { background: var(--color-cream-2); color: var(--color-text-muted); }

/* ── Detail view ──────────────────────────────────────────── */
.detail-row {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-cream-2);
  gap: 1rem;
}
.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 0.78rem; color: var(--color-text-muted); font-weight: 500; flex-shrink: 0; }
.detail-value { font-size: 0.875rem; text-align: right; }
.bread-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; }
.bread-thumb-placeholder {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--color-cream-2); display: flex; align-items: center; justify-content: center;
  color: var(--color-wheat); font-size: 1.2rem;
}
.status-select { min-width: 130px; font-size: 0.8rem; border-radius: 20px; }

/* ── RESUMEN DEL DÍA ──────────────────────────────────────── */

/* Hero banner superior */
.summary-hero {
  background: linear-gradient(135deg, var(--color-dark) 0%, #6b3c22 100%);
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: 0 6px 24px rgba(61,35,20,0.25);
}
.summary-hero-left { flex: 1; min-width: 0; }
.summary-hero-day {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-transform: capitalize;
  line-height: 1.1;
}
.summary-hero-date {
  font-size: 0.875rem;
  color: var(--color-wheat);
  margin-top: 2px;
  text-transform: capitalize;
}
.summary-hero-orders {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  margin-top: 0.5rem;
}
.summary-hero-right {
  text-align: center;
  background: rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  min-width: 110px;
  flex-shrink: 0;
}
.summary-hero-total-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-amber);
  text-transform: uppercase;
}
.summary-hero-total-num {
  font-family: 'Playfair Display', serif;
  font-size: 3.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.summary-hero-total-sub {
  font-size: 0.75rem;
  color: var(--color-wheat);
  margin-top: 2px;
}

/* Cabeceras de categoría */
.summary-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  font-weight: 700;
  font-size: 0.82rem;
  border-radius: 8px 8px 0 0;
  border: 1px solid transparent;
  border-bottom: none;
}
.summary-cat-total {
  font-size: 0.82rem;
  font-weight: 700;
  background: rgba(255,255,255,0.55);
  padding: 2px 10px;
  border-radius: 20px;
}

.summary-cat--regular  .summary-cat-header { background: #dde9ff; color: #2d4a8a; border-color: #b8cef5; }
.summary-cat--encargo  .summary-cat-header { background: #ffefd4; color: #7a4e10; border-color: #f0d090; }
.summary-cat--rotacion .summary-cat-header { background: #d6f5e0; color: #1e6637; border-color: #a0deb8; }

/* Grid de filas */
.summary-rows {
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.summary-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--color-cream-2);
  transition: background 0.12s;
}
.summary-row:last-child { border-bottom: none; }
.summary-row:hover { background: #fdfaf5; }

.summary-row-info { flex: 1; min-width: 0; }

.summary-row-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Barra proporcional */
.summary-row-bar {
  height: 5px;
  background: var(--color-cream-2);
  border-radius: 3px;
  margin: 5px 0 4px;
  overflow: hidden;
}
.summary-row-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.summary-cat--regular  .summary-row-bar-fill { background: #4a7ae8; }
.summary-cat--encargo  .summary-row-bar-fill { background: var(--color-amber); }
.summary-cat--rotacion .summary-row-bar-fill { background: #3a9e5f; }

.summary-row-meta {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

/* Número de cantidad */
.summary-row-qty {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  min-width: 3.5rem;
  text-align: right;
  flex-shrink: 0;
}
.summary-cat--regular  .summary-row-qty { color: #2d4a8a; }
.summary-cat--encargo  .summary-row-qty { color: #7a4e10; }
.summary-cat--rotacion .summary-row-qty { color: #1e6637; }

/* Fila total */
.summary-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--color-dark);
  color: #fff;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 4px 16px rgba(61,35,20,0.2);
}
.summary-total-row span:last-child {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--color-amber);
  line-height: 1;
}

/* ── CALENDARIO ───────────────────────────────────────────── */
.cal {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  overflow: hidden;
  user-select: none;
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-primary);
  color: #fff;
  padding: 0.6rem 0.75rem;
}

.cal-month-label {
  font-family: 'Playfair Display', serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.cal-nav {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
  line-height: 1;
}
.cal-nav:hover { background: rgba(255,255,255,0.2); color: #fff; }

.cal-dow-headers {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--color-cream-2);
  border-bottom: 1px solid var(--color-border);
}
.cal-dow-headers > span {
  text-align: center;
  padding: 0.35rem 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cal-dh-work { color: var(--color-primary) !important; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
}

.cal-cell {
  text-align: center;
  padding: 0.45rem 0.2rem;
  font-size: 0.82rem;
  font-weight: 500;
  border-right: 1px solid var(--color-cream-2);
  border-bottom: 1px solid var(--color-cream-2);
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cal-cell:nth-child(7n) { border-right: none; }

.cal-empty { background: #fafafa; }

.cal-off {
  color: #ccc;
  background: #fafafa;
}

.cal-work {
  color: var(--color-dark);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.cal-work:hover {
  background: var(--color-wheat);
  color: var(--color-dark);
}

.cal-today {
  background: #fff5d9;
  font-weight: 800;
  color: var(--color-dark);
  outline: 2px solid var(--color-amber);
  outline-offset: -2px;
  position: relative;
  z-index: 1;
}

.cal-past {
  opacity: 0.32;
  cursor: not-allowed;
  background: #f8f8f8 !important;
}
.cal-past.cal-work { color: var(--color-text-muted); }
.cal-past:hover { background: #f8f8f8 !important; }

.cal-selected {
  background: var(--color-primary) !important;
  color: #fff !important;
  font-weight: 700;
  outline: none;
}
.cal-selected:hover { background: var(--color-dark) !important; }
.cal-selected.cal-today {
  outline: 2px solid var(--color-amber);
  outline-offset: -2px;
}

/* Botón de rotación opcional (Mar–Vie) */
.btn-rotation-optional {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.75rem 1.25rem;
  background: none;
  border: 2px dashed var(--color-border);
  border-radius: 10px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}
.btn-rotation-optional:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-cream-2);
}
.btn-rotation-optional i {
  font-size: 1.1rem;
  color: var(--color-amber);
  flex-shrink: 0;
}
.btn-rotation-optional__hint {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--color-amber);
  font-weight: 600;
  flex-shrink: 0;
}
.btn-rotation-optional:hover .btn-rotation-optional__hint {
  color: var(--color-primary);
}

/* Observaciones por día */
.day-notes-wrap {
  border-top: 1px solid var(--color-border);
  padding-top: 0.85rem;
}
.day-notes-wrap textarea {
  resize: vertical;
  background: #fffdf8;
  border-color: var(--color-border);
  font-size: 0.85rem;
}
.day-notes-wrap textarea:focus {
  border-color: var(--color-amber);
  box-shadow: 0 0 0 0.2rem rgba(196,135,79,0.15);
}

.cal-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2.5rem 1rem;
  color: var(--color-text-muted);
  background: var(--color-cream-2);
  border-radius: 12px;
  border: 2px dashed var(--color-border);
  text-align: center;
}
.cal-placeholder i { font-size: 2.5rem; color: var(--color-wheat); }
.cal-placeholder p  { margin: 0; font-size: 0.875rem; line-height: 1.4; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 992px) {
  .breads-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-toggle { display: flex; align-items: center; justify-content: center; }
  .sidebar-overlay { display: block; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
  .sidebar-overlay.active { opacity: 1; pointer-events: all; }

  .main-content {
    margin-left: 0;
    padding: 1rem;
    padding-top: 4rem;
  }
  .breads-grid { grid-template-columns: repeat(2, 1fr); }
  .page-title { font-size: 1.35rem; }
  .stat-card__value { font-size: 1.5rem; }
  .stat-card__icon { width: 42px; height: 42px; font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .breads-grid { grid-template-columns: repeat(2, 1fr); }
  .bread-btn-img-wrap { height: 90px; }
  .bread-btn-name { font-size: 0.72rem; padding: 0.4rem; }
  .cal-cell { font-size: 0.75rem; min-height: 30px; padding: 0.3rem 0.1rem; }
  .cal-month-label { font-size: 0.85rem; }
}
