/* KIKOS Pastes - Dedicated Employee Mobile Web App CSS */
:root {
  --bg-app: #080D1A;
  --bg-surface: #0F172A;
  --bg-card: #141F36;
  --bg-input: #1A2642;
  --bg-glass: rgba(15, 23, 42, 0.85);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(245, 158, 11, 0.35);

  --primary: #F59E0B;
  --primary-hover: #D97706;
  --primary-light: #FBBF24;
  --primary-glow: rgba(245, 158, 11, 0.2);

  --success: #10B981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #F59E0B;
  --danger: #EF4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --info: #38BDF8;

  --text-main: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  padding-bottom: 84px; /* Space for bottom nav */
  -webkit-font-smoothing: antialiased;
}

/* App Header */
.app-mobile-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11, 17, 32, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #FFF;
}

.brand-sub {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.branch-selector-wrapper {
  position: relative;
  min-width: 140px;
}

.branch-select-field {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  background: var(--bg-card);
  color: #FFF;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.45rem 1.8rem 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
}

.branch-select-field:focus {
  border-color: var(--primary);
}

.branch-selector-wrapper::after {
  content: '▾';
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  pointer-events: none;
  font-size: 0.75rem;
}

/* Header Live Bar */
.header-live-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
  padding-top: 0.35rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  color: var(--success);
}

.status-dot {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.live-clock {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-main);
}

/* Main Container */
.mobile-view-container {
  padding: 0.85rem 1rem 1.5rem;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

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

/* Subtabs Segmented Control */
.subtabs-segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  background: var(--bg-surface);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.15rem;
}

.subtab-item {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 0.55rem 0.25rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.subtab-item span.icon {
  font-size: 1.05rem;
}

.subtab-item.active {
  background: rgba(245, 158, 11, 0.18);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.subtab-panel {
  display: none;
}
.subtab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

/* Section Titles & Cards */
.card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.section-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #FFF;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.section-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 0.9rem;
}

/* Sticky Live Summary Bar for Pieces */
.pieces-summary-bar {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(30, 41, 59, 0.9));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  text-align: center;
}

.summary-metric {
  background: rgba(11, 17, 32, 0.6);
  padding: 0.5rem 0.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-metric .metric-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.summary-metric .metric-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.summary-metric .metric-sub {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Category Filter Pills */
.pill-filter-bar {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin-bottom: 0.85rem;
  scrollbar-width: none;
}
.pill-filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill.active {
  background: var(--primary);
  color: #0F172A;
  border-color: var(--primary);
}

/* Fast Piece Items Grid */
.piece-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-bottom: 1.25rem;
}

.piece-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: border-color 0.15s;
}

.piece-item-card.has-qty {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.05);
}

.piece-info {
  flex: 1;
}

.piece-name {
  font-size: 0.84rem;
  font-weight: 800;
  color: #FFF;
  line-height: 1.2;
}

.piece-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.15rem;
}

.piece-stepper {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: #FFF;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}

.stepper-btn:active {
  background: var(--primary);
  color: #0F172A;
}

.stepper-inp {
  width: 48px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: #FBBF24;
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
  text-align: center;
  outline: none;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 0.9rem;
}

.form-label {
  display: block;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  color: #FFF;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.form-input.big-number {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

/* Buttons */
.btn-app {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.btn-app:active {
  transform: scale(0.98);
}

.btn-primary-app {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #0F172A;
}

.btn-success-app {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #FFF;
}

.btn-secondary-app {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

/* ==================== CHECADOR DE ASISTENCIA STYLES ==================== */
.employee-card-select {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.7), rgba(15, 23, 42, 0.9));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.15rem;
}

.staff-status-box {
  background: rgba(11, 17, 32, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.staff-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-full);
}

.pill-working {
  background: rgba(16, 185, 129, 0.2);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.pill-eating {
  background: rgba(245, 158, 11, 0.2);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.pill-ended {
  background: rgba(239, 68, 68, 0.2);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.pill-unregistered {
  background: rgba(148, 163, 184, 0.15);
  color: #94A3B8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

/* Big Action Punch Buttons */
.attendance-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.punch-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.punch-btn:active {
  transform: scale(0.96);
}

.punch-btn .icon {
  font-size: 1.8rem;
  line-height: 1;
}

.punch-btn .title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.punch-btn .desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Punch Button Themes */
.punch-in {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(16, 185, 129, 0.5);
  color: #34D399;
}
.punch-in:hover {
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.3), rgba(15, 23, 42, 0.9));
}

.punch-lunch-out {
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.15), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(245, 158, 11, 0.4);
  color: #FBBF24;
}

.punch-lunch-in {
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.15), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  color: #38BDF8;
}

.punch-out {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.18), rgba(15, 23, 42, 0.9));
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  color: #F87171;
}
.punch-out:hover {
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.3), rgba(15, 23, 42, 0.9));
}

/* Timeline Feed of Today's Attendance */
.attendance-feed {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.feed-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feed-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.feed-icon {
  font-size: 1.2rem;
}

.feed-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFF;
}

.feed-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.feed-time {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

/* Bottom App Navigation Bar */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(11, 17, 32, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-subtle);
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.35rem 1rem 0.75rem;
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  gap: 0.2rem;
  transition: all 0.2s;
  border-radius: var(--radius-md);
}

.nav-item .nav-icon {
  font-size: 1.35rem;
}

.nav-item.active {
  color: var(--primary);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

/* Toast Alerts */
.app-toast {
  position: fixed;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  color: #FFF;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Receipt Preview Thumbnail */
.receipt-thumb-box {
  position: relative;
  width: 100%;
  max-height: 160px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px dashed var(--border-accent);
  margin-top: 0.5rem;
  display: none;
}

.receipt-thumb-box img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

.receipt-remove-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.7);
  color: #EF4444;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  cursor: pointer;
}
