/* ============================================
   VIPS TURNOS - Estilos
   Paleta: Rojo VIPS (#CC092F), Blanco, Grises
   Mobile-First
   ============================================ */

:root {
  --vips-red: #CC092F;
  --vips-red-dark: #A00625;
  --vips-red-light: #FDE8EC;
  --white: #FFFFFF;
  --bg: #F4F5F7;
  --bg-card: #FFFFFF;
  --text: #1A1A2E;
  --text-secondary: #6B7280;
  --border: #E5E7EB;
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { font-size: 16px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

.hidden { display: none !important; }

/* ========== LOGIN SCREEN ========== */
#loginScreen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  background: linear-gradient(135deg, var(--vips-red) 0%, #8B0020 100%);
  padding: 24px;
}

.login-container {
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-logo { margin-bottom: 32px; }

.logo-icon {
  width: 72px;
  height: 72px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 32px;
  font-weight: 800;
  color: var(--vips-red);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.login-logo h1 {
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-subtitle {
  color: rgba(255,255,255,0.8);
  font-size: 14px;
  margin-top: 4px;
}

.login-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  box-shadow: var(--shadow-lg);
}

.login-text {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 24px;
}

#googleButton {
  display: flex;
  justify-content: center;
}

/* ========== HEADER ========== */
.header {
  background: var(--vips-red);
  color: var(--white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-small {
  width: 32px;
  height: 32px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--vips-red);
}

.header-title {
  font-size: 18px;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-user {
  font-size: 13px;
  font-weight: 500;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.role-badge.manager {
  background: rgba(255,255,255,0.2);
  color: var(--white);
}

.role-badge.worker {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.9);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.btn-icon:hover { background: rgba(255,255,255,0.15); }

/* ========== TAB NAVIGATION ========== */
.tabs {
  display: flex;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 99;
}

.tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab.active {
  color: var(--vips-red);
  border-bottom-color: var(--vips-red);
  font-weight: 600;
}

.tab:hover { color: var(--vips-red); }

.badge {
  background: var(--vips-red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* ========== TAB CONTENT ========== */
.tab-content {
  display: none;
  padding: 16px;
  max-width: 768px;
  margin: 0 auto;
  padding-bottom: 80px;
}

.tab-content.active { display: block; }

/* ========== CALENDAR ========== */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.cal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.btn-nav {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s;
  line-height: 1;
}

.btn-nav:hover {
  background: var(--vips-red-light);
  border-color: var(--vips-red);
  color: var(--vips-red);
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}

.cal-weekdays span {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.cal-cell {
  aspect-ratio: 1;
  background: var(--white);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: all 0.15s;
  border: 2px solid transparent;
  min-height: 44px;
}

.cal-cell:hover {
  background: var(--vips-red-light);
}

.cal-cell.empty {
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.cal-cell.today .day-num {
  background: var(--vips-red);
  color: var(--white);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.cal-cell.has-shift {
  background: var(--vips-red-light);
  border-color: var(--vips-red);
}

.cal-cell.selected {
  background: var(--vips-red);
  color: var(--white);
  border-color: var(--vips-red-dark);
  box-shadow: 0 2px 8px rgba(204,9,47,0.3);
}

.cal-cell.selected .day-num { color: var(--white); }

.day-num {
  font-size: 14px;
  font-weight: 600;
  z-index: 1;
}

.shift-count {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--vips-red);
  color: var(--white);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  line-height: 1.3;
}

/* ========== SHIFT SUMMARY ========== */
.shift-summary {
  margin-top: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.summary-header {
  margin-bottom: 12px;
}

.summary-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.summary-empty {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

.shift-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  border-left: 3px solid var(--vips-red);
}

.shift-time {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.shift-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.shift-position {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.shift-worker {
  font-size: 12px;
  color: var(--text-secondary);
}

.shift-card .btn-icon {
  color: var(--danger);
  flex-shrink: 0;
}

.shift-card .btn-icon:hover {
  background: rgba(239,68,68,0.1);
}

.add-shift-btn {
  width: 100%;
  margin-top: 8px;
}

/* ========== REQUESTS ========== */
.requests-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.requests-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.requests-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.request-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-left: 3px solid var(--border);
  transition: all 0.2s;
}

.request-card.pendiente { border-left-color: var(--warning); }
.request-card.aprobada { border-left-color: var(--success); }
.request-card.denegada { border-left-color: var(--danger); opacity: 0.7; }

.request-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.request-type {
  font-size: 14px;
  font-weight: 600;
}

.request-status {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: capitalize;
}

.status-pendiente { background: #FEF3C7; color: #92400E; }
.status-aprobada { background: #D1FAE5; color: #065F46; }
.status-denegada { background: #FEE2E2; color: #991B1B; }

.request-date {
  font-size: 13px;
  color: var(--text);
  font-weight: 500;
}

.request-details {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.4;
}

.request-created {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.empty-state {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-secondary);
}

.empty-state p { font-size: 15px; }
.empty-hint { font-size: 13px; margin-top: 4px; opacity: 0.7; }

/* ========== INBOX ========== */
#tabInbox h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.inbox-card .request-user {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 6px;
}

.inbox-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-approve, .btn-deny {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-approve {
  background: var(--success);
  color: var(--white);
}

.btn-approve:hover { background: #059669; }

.btn-deny {
  background: var(--danger);
  color: var(--white);
}

.btn-deny:hover { background: #DC2626; }

/* ========== BUTTONS ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--vips-red);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  gap: 6px;
}

.btn-primary:hover { background: var(--vips-red-dark); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-danger { color: var(--danger) !important; }

/* ========== MODALS ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.2s;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--white);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-secondary);
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

.modal-close:hover { background: var(--bg); }

.modal-body {
  padding: 16px 20px 24px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
  flex: 1;
}

/* ========== FORM FIELDS ========== */
.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  margin-top: 16px;
}

.field-label:first-child { margin-top: 0; }

.field-input,
.field-select,
.field-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--vips-red);
  box-shadow: 0 0 0 3px rgba(204,9,47,0.1);
}

.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.field-textarea {
  resize: vertical;
  min-height: 80px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ========== RESPONSIVE: TABLET & DESKTOP ========== */
@media (min-width: 768px) {
  .modal-overlay {
    align-items: center;
  }

  .modal {
    border-radius: var(--radius);
    max-height: 80vh;
  }

  .cal-cell {
    aspect-ratio: auto;
    min-height: 72px;
    padding: 6px;
    align-items: flex-start;
    justify-content: flex-start;
  }

  .day-num {
    font-size: 15px;
    margin-bottom: 4px;
  }

  .cal-cell.today .day-num {
    width: 32px;
    height: 32px;
  }

  .header {
    padding: 16px 24px;
  }

  .header-title {
    font-size: 20px;
  }

  .tab {
    padding: 14px 16px;
    font-size: 14px;
  }

  .tab-content {
    padding: 24px;
  }

  .requests-header h3 {
    font-size: 20px;
  }
}

/* ========== DARK MODE SUPPORT ========== */
/* Keeping it light per VIPS brand guidelines */
