@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ===== PWA: To'liq ekran & Notch qo'llab-quvvatlash ===== */
@media all and (display-mode: fullscreen) {
  body { padding-top: env(safe-area-inset-top); }
  .admin-header { padding-top: max(0px, env(safe-area-inset-top)); }
}
@media all and (display-mode: standalone) {
  body { padding-top: env(safe-area-inset-top); }
  .admin-header { padding-top: max(0px, env(safe-area-inset-top)); }
}

/* Prevent text selection on kiosk (tablet UX) */
.kiosk-shell { -webkit-user-select: none; user-select: none; }
.key, .btn { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

/* ===== DESIGN TOKENS ===== */
:root {
  --bg:         #f0f4f8;
  --bg2:        #ffffff;
  --panel:      rgba(255, 255, 255, 0.85);
  --panel-hov:  rgba(255, 255, 255, 1);
  --border:     rgba(0, 0, 0, 0.08);
  --border-hov: rgba(0, 0, 0, 0.15);
  --text:       #0f172a;
  --muted:      #64748b;
  --accent:     #0ea5e9;
  --accent2:    #6366f1;
  --green:      #10b981;
  --red:        #ef4444;
  --yellow:     #f59e0b;
  --shadow:     0 16px 50px rgba(0, 0, 0, 0.06);
  --radius:     16px;
  --radius-sm:  10px;
  color-scheme: light;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Outfit', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Animated background gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(14, 165, 233, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 90%, rgba(99, 102, 241, 0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ===== KIOSK LAYOUT ===== */
body:not(.admin-page) {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.kiosk-main-layout {
  display: flex;
  flex-direction: row;
  gap: 40px;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 1200px;
  position: relative;
  z-index: 1;
}

.kiosk-left-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 550px;
  width: 100%;
}

.kiosk-right-panel {
  flex: 1;
  display: flex;
  justify-content: center;
  max-width: 700px;
  width: 100%;
}

.kiosk-shell {
  width: 100%;
}

@media (max-width: 850px) {
  .kiosk-main-layout {
    flex-direction: column;
    align-items: center;
  }
  .kiosk-left-panel {
    order: 2; /* Move leaderboards below PIN on small screens */
  }
  .kiosk-right-panel {
    order: 1;
  }
}

/* ===== GLASS PANEL ===== */
.panel {
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(14,165,233,0.12);
  border-radius: 24px;
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.9);
  animation: fadeSlideUp 0.5s cubic-bezier(0.16,1,0.3,1) both;
}

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

.main-panel { display: flex; flex-direction: column; gap: 18px; }

/* ===== CLOCK ===== */
.clock-wrap { text-align: center; padding: 8px 0 4px; }

.clock-display {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.clock-date {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 4px;
  font-weight: 500;
}

/* ===== MESSAGE CARDS ===== */
.message-card {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--panel);
  animation: fadeSlideUp 0.4s both;
}
.message-card p { margin: 0; font-size: 0.95rem; }
.message-card.success { border-color: rgba(52,211,153,0.35); background: rgba(52,211,153,0.06); }
.message-card.error   { border-color: rgba(251,113,133,0.35); background: rgba(251,113,133,0.06); }
.message-card.neutral { border-color: rgba(56,189,248,0.2);  background: rgba(56,189,248,0.04); }

/* ===== ATTENDANCE FORM ===== */
.attendance-form { display: flex; flex-direction: column; gap: 14px; }

.attendance-form input {
  width: 100%;
  padding: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.03);
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
  outline: none;
  font-family: 'Outfit', monospace;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.attendance-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}

/* ===== KEYPAD ===== */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.key {
  padding: 16px 10px;
  border: 1.5px solid rgba(14,165,233,0.15);
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.9);
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.key:hover  {
  background: #fff;
  border-color: rgba(14,165,233,0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(14,165,233,0.15);
}
.key:active { transform: scale(0.93); background: rgba(14,165,233,0.08); }

.clear-key, .back-key {
  background: rgba(99,102,241,0.08);
  border-color: rgba(99,102,241,0.2);
  color: var(--accent2);
  font-weight: 700;
}

/* ===== PROFILE CARD ===== */
.profile-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fadeSlideUp 0.45s both;
}

.profile-secondary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.profile-header h2 { font-size: 1.4rem; font-weight: 700; }
.profile-header p  { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }

.salary-pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(56,189,248,0.1);
  border: 1px solid rgba(56,189,248,0.25);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== ACTION BUTTONS ===== */
.profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.btn {
  padding: 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  overflow: hidden;
}
.btn:hover  { transform: translateY(-3px); filter: brightness(1.1); }
.btn:active { transform: scale(0.96); }

.btn-green {
  background: linear-gradient(135deg, #059669, var(--green));
  color: #022c22;
  box-shadow: 0 4px 20px rgba(52,211,153,0.3);
}
.btn-red {
  background: linear-gradient(135deg, #be123c, var(--red));
  color: #fff;
  box-shadow: 0 4px 20px rgba(251,113,133,0.3);
}
.btn-exit {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text);
  width: 100%;
  font-size: 0.9rem;
}
.btn-exit:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.exit-section { margin-top: 4px; }

/* ===== HISTORY CARD ===== */
.history-card {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
}
.history-card h3 { font-size: 0.9rem; color: var(--muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.08em; }
.history-card ul { list-style: none; display: flex; flex-direction: column; gap: 6px; }
.history-card li { font-size: 0.88rem; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--border); }
.history-card li:last-child { border-bottom: none; }

/* ===== JADIDON FOOTER ===== */
.jadidon-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 18px;
  margin-bottom: 18px;
  font-size: 0.72rem;
  color: rgba(124, 141, 181, 0.45);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  z-index: 10;
}
.jadidon-brand {
  font-weight: 700;
  color: rgba(56, 189, 248, 0.6);
  letter-spacing: 0.08em;
}

/* ===== QUICKVIEW MODAL ===== */
.quickview-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 8, 15, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fadeIn 0.3s ease-out both;
}

@keyframes fadeIn {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(12px); }
}

.quickview-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 24px;
  width: 90%;
  max-width: 450px;
  text-align: center;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.4);
  animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
  display: flex;
  flex-direction: column;
  align-items: center;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.qv-success { border-top: 3px solid var(--green); }
.qv-error   { border-top: 3px solid var(--red); }

.qv-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
}

.quickview-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.qv-message {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

.qv-stats {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.qv-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.qv-late { background: rgba(251,113,133,0.1); border: 1px solid rgba(251,113,133,0.2); }
.qv-late span { color: var(--red); }
.qv-worked { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.2); }
.qv-worked span { color: var(--green); }

.qv-loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin { 100% { transform: rotate(360deg); } }

.qv-redirect-text {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===== ADMIN LAYOUT ===== */
body.admin-page { display: block; padding: 0; }
body.admin-page::before { display: none; }

.admin-wrapper {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
.admin-wrapper::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 10% 5%, rgba(56,189,248,0.05) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 95%, rgba(129,140,248,0.05) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

/* ===== ADMIN HEADER ===== */
.admin-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 0 30px;
  height: 64px;
  display: flex;
  align-items: center;
}

.admin-header-content {
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.admin-title h1 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.admin-subtitle { color: var(--muted); font-size: 0.78rem; margin-top: 1px; }

.admin-actions { display: flex; align-items: center; gap: 12px; }
.user-info {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 12px;
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.2);
  border-radius: 999px;
}

/* ===== ADMIN MAIN ===== */
.admin-main {
  flex: 1;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  padding: 24px 28px 40px;
  position: relative;
  z-index: 1;
}

/* ===== ADMIN NAV ===== */
.admin-nav {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: var(--radius);
  margin-bottom: 28px;
  backdrop-filter: blur(10px);
  flex-wrap: wrap;
}
.admin-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-nav a:hover { background: var(--panel-hov); color: var(--text); }
.admin-nav a.active {
  background: linear-gradient(135deg, rgba(14,165,233,0.15), rgba(99,102,241,0.15));
  color: var(--accent);
  border: 1px solid rgba(14,165,233,0.3);
}

/* ===== SECTIONS ===== */
.admin-section { margin-bottom: 36px; animation: fadeSlideUp 0.4s both; }

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== STATS GRID ===== */
.stats-grid-admin {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}


/* ===== STAT BUTTONS (styled as cards) ===== */
.stat-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56,189,248,0.35);
}
.stat-button:active {
  transform: scale(0.97);
}
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
  animation: fadeSlideUp 0.4s both;
  cursor: default;
}
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.1); border-color: var(--border-hov); }

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-icon { font-size: 1.8rem; line-height: 1; }
.stat-content { flex: 1; }
.stat-number  { font-size: 2rem; font-weight: 800; margin: 0; line-height: 1; }
.stat-label   { font-size: 0.82rem; color: var(--muted); margin-top: 5px; font-weight: 500; }

.stat-total   { border-left: 3px solid var(--accent); }
.stat-total .stat-number { color: var(--accent); }
.stat-working { border-left: 3px solid var(--green); }
.stat-working .stat-number { color: var(--green); }
.stat-absent  { border-left: 3px solid var(--red); }
.stat-absent .stat-number  { color: var(--red); }
.stat-late    { border-left: 3px solid var(--yellow); }
.stat-late .stat-number    { color: var(--yellow); }

/* ===== FORM CARDS ===== */
.form-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
}
.two-columns { grid-template-columns: 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group-full { grid-column: 1 / -1; }

.form-group label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.form-group small { color: var(--muted); font-size: 0.78rem; }

.form-group input,
.form-group select,
.form-group textarea {
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  color: var(--text);
  font-size: 0.93rem;
  font-family: 'Outfit', sans-serif;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
  background: rgba(255, 255, 255, 1);
}
.form-group select option { background: #ffffff; color: var(--text); }

/* ===== BUTTONS ===== */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #07080f;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.9rem;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(56,189,248,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(56,189,248,0.35); filter: brightness(1.05); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  background: var(--panel-hov);
  border: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--border-hov); color: var(--text); background: rgba(255,255,255,0.09); }

.full-width { width: 100%; justify-content: center; }
.form-submit { width: 100%; padding: 12px; font-size: 0.95rem; }

/* ===== TABLES ===== */
.table-responsive { 
  overflow-x: auto; 
  border-radius: var(--radius); 
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.03);
  background: var(--panel);
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}
.admin-table thead {
  background: rgba(14, 165, 233, 0.04);
  position: relative;
}
.admin-table thead::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--border);
}
.admin-table thead th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 700;
  color: var(--text);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
}
.admin-table tbody tr {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.admin-table tbody tr::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 1px;
  background: var(--border);
  transition: all 0.3s;
}
.admin-table tbody tr:last-child::after { display: none; }
.admin-table tbody tr:hover { 
  background: rgba(14, 165, 233, 0.02); 
  transform: scale(1.002);
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  z-index: 10;
}
.admin-table tbody tr:hover::after {
  opacity: 0;
}
.admin-table tbody td {
  padding: 18px 20px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 500;
  vertical-align: middle;
}

/* Table cell helpers */
.cell-id    { font-weight: 700; color: var(--accent); font-size: 0.8rem; }
.cell-name  { font-weight: 600; }
.cell-time  { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.table-header-right { text-align: right !important; }
.currency { text-align: right; font-variant-numeric: tabular-nums; font-size: 0.88rem; }
.bonus  { color: var(--green); }
.penalty{ color: var(--red); }

/* Role badge */
.role-badge {
  display: inline-flex;
  align-items: center;
  background: rgba(129,140,248,0.12);
  color: var(--accent2);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid rgba(129,140,248,0.2);
}

/* Action badge */
.action-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  gap: 4px;
}
.action-in  { background: rgba(52,211,153,0.12); color: var(--green); }
.action-out { background: rgba(251,113,133,0.12); color: var(--red); }
.log-badge-shift   { background: rgba(56,189,248,0.12);  color: var(--accent); }
.log-badge-payment { background: rgba(52,211,153,0.12);  color: var(--green); }
.log-badge-penalty { background: rgba(251,113,133,0.12); color: var(--red); }
.log-badge-dayoff  { background: rgba(251,191,36,0.12);  color: var(--yellow); }

/* ===== CELL ACTIONS ===== */
.cell-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.btn-action {
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}
.btn-edit   { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.25); }
.btn-edit:hover   { background: rgba(59,130,246,0.25); transform: translateY(-1px); }
.btn-delete { background: rgba(251,113,133,0.12); color: var(--red); border-color: rgba(251,113,133,0.25); }
.btn-delete:hover { background: rgba(251,113,133,0.22); transform: translateY(-1px); }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.details-summary {
  cursor: pointer;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-block;
  user-select: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  background-image: linear-gradient(to right, rgba(255,255,255,0.1), rgba(255,255,255,0));
  background-blend-mode: overlay;
}
.details-summary::-webkit-details-marker { display: none; }
.details-summary:hover { 
  filter: brightness(1.15); 
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

.cell-actions details {
  position: relative;
}

.payment-form-popup {
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.12);
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 100;
  width: max-content;
  backdrop-filter: blur(10px);
  animation: fadeSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}
.payment-form { display: flex; gap: 10px; align-items: center; }
.payment-form input {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.03);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}
.payment-form input:focus { 
  border-color: var(--accent); 
  background: #fff; 
  box-shadow: 0 0 0 3px rgba(14,165,233,0.15); 
}

/* ===== BALANCE COLORS ===== */
.balance-positive { color: var(--green); font-weight: 700; }
.balance-negative { color: var(--red);   font-weight: 700; }

/* ===== EMPTY MESSAGE ===== */
.empty-message {
  text-align: center;
  color: var(--muted);
  font-style: italic;
  padding: 40px 20px !important;
  font-size: 0.9rem;
}

/* ===== STATUS TEXT ===== */
.status-text { font-size: 0.82rem; color: var(--muted); }

/* ===== INLINE INPUT ===== */
.inline-text-input {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
  color: var(--text);
  font-size: 0.82rem;
  font-family: 'Outfit', sans-serif;
  outline: none;
  width: 140px;
  transition: border-color 0.2s;
}
.inline-text-input:focus { border-color: var(--accent); }

/* ===== LOGS PAGE ===== */
.log-row-shift   td:first-child { border-left: 3px solid rgba(56,189,248,0.5); }
.log-row-payment td:first-child { border-left: 3px solid rgba(52,211,153,0.5); }
.log-row-penalty td:first-child { border-left: 3px solid rgba(251,113,133,0.5); }
.log-row-day_off td:first-child { border-left: 3px solid rgba(251,191,36,0.5); }

.shift-detail { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.shift-in  { color: var(--green); font-weight: 600; font-size: 0.88rem; }
.shift-out { color: var(--muted); font-weight: 500; font-size: 0.88rem; }
.shift-arrow { color: var(--muted); }
.shift-duration { color: var(--accent); font-size: 0.82rem; background: rgba(56,189,248,0.08); padding: 2px 8px; border-radius: 999px; }
.shift-active { color: var(--yellow); font-size: 0.82rem; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.log-amount         { color: var(--green); font-weight: 700; }
.log-penalty-amount { color: var(--red); font-weight: 700; }
.log-notes { color: var(--muted); font-size: 0.84rem; }

/* ===== PAYROLLS ===== */
.currency { font-variant-numeric: tabular-nums; }
.currency small { display: block; color: var(--muted); font-size: 0.75rem; font-weight: 400; margin-top: 2px; }

/* ===== SETTINGS ===== */
.form-group-full { grid-column: 1 / -1; }

/* ===== ADMIN LOGIN ===== */
.password-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== RATE BADGES ===== */
.rate-penalty { color: var(--red); }
.rate-bonus   { color: var(--green); }
.cell-code code {
  background: rgba(0,0,0,0.4);
  padding: 3px 8px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  color: var(--accent2);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .admin-main { padding: 16px 14px 30px; }
  .admin-header { height: auto; min-height: 64px; padding: 12px 16px; }
  .admin-header-content { flex-direction: column; align-items: stretch; gap: 12px; }
  .admin-title { text-align: center; }
  .admin-title h1 { font-size: 1.1rem; }
  .admin-subtitle { font-size: 0.75rem; }
  .admin-actions { justify-content: center; width: 100%; gap: 16px; }
  
  .admin-nav { flex-wrap: wrap; gap: 4px; justify-content: center; padding: 6px; }
  .admin-nav a { padding: 8px 12px; font-size: 0.82rem; flex: 1; text-align: center; min-width: calc(33% - 8px); }
  
  .stats-grid-admin { grid-template-columns: repeat(2, 1fr); }
  .two-columns { grid-template-columns: 1fr; }
  
  /* Make tables horizontally scrollable */
  .table-responsive-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -14px; padding: 0 14px; }
  .admin-table { min-width: 600px; }
  
  .admin-table thead th,
  .admin-table tbody td { padding: 10px 12px; font-size: 0.82rem; }
  .clock-display { font-size: 2.4rem; }

  .att-list { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 10px; }
  .att-list-header, .att-entry-wrap { min-width: 500px; }
}

@media (max-width: 480px) {
  .panel { padding: 16px; }
  .stats-grid-admin { grid-template-columns: 1fr; }
  .stat-buttons-grid { grid-template-columns: 1fr; }
  .profile-actions { grid-template-columns: 1fr; }
  .admin-nav a { min-width: calc(50% - 8px); }
  
  .dash-charts-row { flex-direction: column; }
  .dash-chart-card { width: 100%; }
}

/* ===== STAGGER ANIMATIONS FOR TABLE ROWS ===== */
.admin-table tbody tr {
  animation: fadeSlideUp 0.3s both;
}
.admin-table tbody tr:nth-child(1)  { animation-delay: 0.03s; }
.admin-table tbody tr:nth-child(2)  { animation-delay: 0.06s; }
.admin-table tbody tr:nth-child(3)  { animation-delay: 0.09s; }
.admin-table tbody tr:nth-child(4)  { animation-delay: 0.12s; }
.admin-table tbody tr:nth-child(5)  { animation-delay: 0.15s; }
.admin-table tbody tr:nth-child(6)  { animation-delay: 0.18s; }
.admin-table tbody tr:nth-child(7)  { animation-delay: 0.21s; }
.admin-table tbody tr:nth-child(8)  { animation-delay: 0.24s; }
.admin-table tbody tr:nth-child(9)  { animation-delay: 0.27s; }
.admin-table tbody tr:nth-child(10) { animation-delay: 0.30s; }


/* ===== KIOSK PREMIUM LIGHT STYLES ===== */

/* Animated ambient blobs */
.kiosk-bg-blobs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: floatBlob 14s ease-in-out infinite;
}
.blob-1 { width: 500px; height: 500px; background: rgba(14,165,233,0.18); top: -150px; left: -150px; animation-delay: 0s; }
.blob-2 { width: 400px; height: 400px; background: rgba(99,102,241,0.14); bottom: -100px; right: -100px; animation-delay: -5s; }
.blob-3 { width: 300px; height: 300px; background: rgba(16,185,129,0.1); top: 50%; left: 40%; animation-delay: -9s; }

@keyframes floatBlob {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(40px,-30px) scale(1.06); }
  66%      { transform: translate(-25px,35px) scale(0.95); }
}

/* Brand header */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.brand-logo-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 16px rgba(14,165,233,0.35);
}
.brand-text { display: flex; flex-direction: column; align-items: center; }
.brand-name {
  font-size: 1.2rem;
  font-weight: 800;
  background: linear-gradient(90deg, #0f172a 0%, var(--accent) 50%, var(--accent2) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmerName 4s linear infinite;
}
.brand-subtitle {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
@keyframes shimmerName {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* Profile Card Grid Layout */
.profile-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: 
    "header stats"
    "actions history"
    "secondary history";
  gap: 20px;
  animation: fadeSlideUp 0.45s both;
}
.prof-header { grid-area: header; display: flex; align-items: center; gap: 14px; }
.stats-row { grid-area: stats; display: flex; gap: 10px; align-self: center; }
.attendance-form { grid-area: actions; }
.profile-secondary { grid-area: secondary; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.history-card { grid-area: history; }

@media (max-width: 850px) {
  .profile-card {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "header"
      "stats"
      "actions"
      "secondary"
      "history";
  }
}

/* Profile header components */
.prof-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.25), 0 4px 16px rgba(14,165,233,0.2);
}
.prof-info h2 { font-size: 1.25rem; font-weight: 800; margin: 0; color: var(--text); }
.prof-role { color: var(--muted); font-size: 0.85rem; font-weight: 500; margin-top: 2px; }

/* Stats row */
.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: linear-gradient(135deg, rgba(14,165,233,0.06), rgba(99,102,241,0.06));
  border: 1px solid rgba(14,165,233,0.15);
  border-radius: 12px;
  gap: 4px;
}
.stat .lbl { font-size: 0.72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stat .val { font-size: 1.2rem; font-weight: 800; color: var(--text); }

/* PIN dots */
.pin-dots-wrap {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 14px 0 6px;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(14,165,233,0.3);
  background: transparent;
  transition: all 0.2s cubic-bezier(0.4,0,0.2,1);
}
.pin-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(14,165,233,0.5);
  transform: scale(1.15);
}
.pin-dot.shake { animation: shake 0.4s both; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(6px); }
  60%      { transform: translateX(-4px); }
  80%      { transform: translateX(4px); }
}

/* Message card */
.message-card {
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
}
.message-card.neutral {
  background: rgba(14,165,233,0.07);
  border: 1px solid rgba(14,165,233,0.2);
  color: var(--accent);
}
.message-card.error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  color: var(--red);
}

/* Action buttons with icons */
.btn-green, .btn-red {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.btn-green .btn-icon, .btn-red .btn-icon { font-size: 1.3rem; display: block; }
.btn-green .btn-label, .btn-red .btn-label { font-size: 0.82rem; display: block; letter-spacing: 0.08em; margin-top: 4px; font-weight: 700; }
.btn-green {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 4px 20px rgba(16,185,129,0.35);
}
.btn-red {
  background: linear-gradient(135deg, #dc2626, #ef4444);
  color: #fff;
  box-shadow: 0 4px 20px rgba(239,68,68,0.3);
}

/* History list */
.history-card h3 { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; font-weight: 700; }
.history-card ul { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.history-card li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
}
.history-card li:last-child { border-bottom: none; }
.hist-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.hist-in  { background: var(--green); box-shadow: 0 0 6px rgba(16,185,129,0.5); }
.hist-out { background: var(--red);   box-shadow: 0 0 6px rgba(239,68,68,0.4); }
.hist-label { flex: 1; font-weight: 600; color: var(--text); }
.hist-time { color: var(--muted); font-size: 0.75rem; }

/* Avans button */
.btn-avans {
  background: linear-gradient(135deg, rgba(139,92,246,0.12), rgba(99,102,241,0.12));
  border: 1px solid rgba(99,102,241,0.3);
  color: var(--accent2);
  cursor: pointer;
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  transition: all 0.25s;
}
.btn-avans:hover {
  background: linear-gradient(135deg, rgba(139,92,246,0.25), rgba(99,102,241,0.25));
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.2);
}

/* ===== LEADERBOARD CAROUSEL ===== */
.leaderboard-carousel { display: grid; width: 100%; }
.carousel-slide {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.7s ease, transform 0.7s ease;
  transform: translateY(12px);
}
.carousel-slide.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.leaderboard-card {
  background: rgba(255,255,255,0.7);
  border: 1px solid rgba(14,165,233,0.15);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}
.leaderboard-title {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.01em;
}
.leaderboard-list { display: flex; flex-direction: column; gap: 8px; }
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,0.8);
  border: 1px solid rgba(0,0,0,0.06);
  transition: transform 0.25s;
}
.leaderboard-item:hover { transform: translateX(4px); }
.leader-gold   { border-left: 3px solid #f59e0b; background: rgba(245,158,11,0.06); }
.leader-silver { border-left: 3px solid #94a3b8; background: rgba(148,163,184,0.06); }
.leader-bronze { border-left: 3px solid #cd7f32; background: rgba(205,127,50,0.06); }
.leader-rank   { font-size: 1.4rem; }
.leader-info   { flex: 1; }
.leader-name   { font-weight: 700; font-size: 0.9rem; color: var(--text); }
.leader-stats  { color: var(--muted); font-size: 0.78rem; margin-top: 1px; }

/* Jadidon footer */
.jadidon-footer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 6px;
  letter-spacing: 0.06em;
}
.jadidon-brand { font-weight: 800; color: var(--accent); }

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== KIOSK MODALS ===== */
.kiosk-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15,23,42,0.5);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.kiosk-modal-overlay.active { opacity: 1; pointer-events: auto; }
.kiosk-modal {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  width: 92%; max-width: 400px;
  padding: 0;
  overflow: hidden;
  transform: scale(0.9) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275);
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
}
.kiosk-modal-overlay.active .kiosk-modal { transform: scale(1) translateY(0); }
.kiosk-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(14,165,233,0.05), rgba(99,102,241,0.05));
}
.kiosk-modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--text); }
.kiosk-modal-close {
  background: rgba(0,0,0,0.05); border: none; color: var(--muted);
  font-size: 1.2rem; cursor: pointer; line-height: 1;
  border-radius: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.kiosk-modal-close:hover { background: rgba(0,0,0,0.1); }
.kiosk-modal-body { padding: 20px; }
.kiosk-modal-body label {
  display: block; margin-bottom: 6px;
  font-weight: 700; font-size: 0.85rem; color: var(--muted);
}
.kiosk-modal-body input, .kiosk-modal-body textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: rgba(0,0,0,0.03);
  color: var(--text);
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  transition: border-color 0.2s;
  outline: none;
}
.kiosk-modal-body input:focus, .kiosk-modal-body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}

/* ===== QV STATS GRID (quickview) ===== */
.qv-stats-grid {
  display: flex; gap: 10px; margin-top: 16px; width: 100%;
}
.stat-box {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  background: rgba(14,165,233,0.07);
  border: 1px solid rgba(14,165,233,0.15);
  text-align: center;
}
.stat-lbl { font-size: 0.72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-val  { font-size: 1rem; font-weight: 800; color: var(--text); margin-top: 4px; }

.qv-worker { font-size: 1.3rem; font-weight: 800; margin-top: 6px; }
.qv-role   { color: var(--muted); font-size: 0.88rem; margin-bottom: 4px; }

/* ===== ANNOUNCEMENT OVERLAY ===== */
.announcement-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(14px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.4s ease;
}
.announcement-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px 28px;
  width: 92%; max-width: 420px;
  text-align: center;
  animation: slideUp 0.5s ease;
  box-shadow: 0 24px 60px rgba(0,0,0,0.15);
}
.announcement-box h2 { font-size: 1.2rem; margin-bottom: 14px; font-weight: 800; color: var(--text); }
.announcement-box .ann-message {
  font-size: 0.95rem; color: var(--muted);
  line-height: 1.6; margin-bottom: 24px;
}
.announcement-box .btn-understand {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none; border-radius: 12px;
  font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: all 0.3s;
  font-family: 'Outfit', sans-serif;
  box-shadow: 0 4px 20px rgba(14,165,233,0.3);
}
.announcement-box .btn-understand:hover { filter: brightness(1.1); transform: translateY(-2px); }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }

.hist-break { background: #f59e0b; box-shadow: 0 0 6px rgba(245, 158, 11, 0.5); }

