/* ============================================================
   HashTurn Attendance System — Design System
   Brand: Dark (#0b0b0b), Green (#2ecc71), White text
   Font: Inter (Google Fonts)
   ============================================================ */

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

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
  --bg-primary:      #0b0b0b;
  --bg-secondary:    #111111;
  --bg-card:         #161616;
  --bg-card-hover:   #1c1c1c;
  --bg-input:        #1a1a1a;
  --border:          #2a2a2a;
  --border-light:    #333333;

  --green:           #2ecc71;
  --green-dark:      #27ae60;
  --green-glow:      rgba(46, 204, 113, 0.15);
  --green-border:    rgba(46, 204, 113, 0.3);

  --blue:            #3b82f6;
  --blue-light:      #60a5fa;
  --pink:            #f472b6;
  --yellow:          #fbbf24;
  --red:             #ef4444;
  --orange:          #f97316;

  --text-primary:    #ffffff;
  --text-secondary:  #a0aec0;
  --text-muted:      #606060;

  --radius-sm:       6px;
  --radius-md:       10px;
  --radius-lg:       14px;
  --radius-xl:       20px;

  --shadow-card:     0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-green:    0 0 20px rgba(46, 204, 113, 0.2);

  --transition:      all 0.2s ease;
  --transition-slow: all 0.35s ease;
}

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: 'Inter', sans-serif; }
input, select, textarea { font-family: 'Inter', sans-serif; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ── Layout Helpers ────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-sm { gap: 8px; }
.flex-gap { gap: 16px; }
.flex-gap-lg { gap: 24px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── Typography ────────────────────────────────────────────── */
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.5px; }
h2 { font-size: 1.4rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 600; }
h4 { font-size: 0.95rem; font-weight: 600; }
.text-green { color: var(--green); }
.text-muted { color: var(--text-secondary); font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.font-mono { font-family: 'Courier New', monospace; }

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11, 11, 11, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.navbar-brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.1rem; font-weight: 800; letter-spacing: 1px;
  text-transform: uppercase;
}
.logo__mark {
  position: relative;
  width: 32px; height: 32px;
  display: inline-block;
  vertical-align: middle;
}
.logo__mark > span {
  position: absolute;
  border-radius: 4px;
  display: block;
}
.lm-g { width: 100%; height: 7px; top: 6px; left: 0; background: var(--green); z-index: 1; }
.lm-b { width: 100%; height: 7px; bottom: 6px; left: 0; background: var(--blue); z-index: 1; }
.lm-r { height: 100%; width: 7px; left: 6px; top: 0; background: var(--red); z-index: 2; }
.lm-y { height: 100%; width: 7px; right: 6px; top: 0; background: var(--yellow); z-index: 2; }

.brand-text {
  text-shadow: -1.5px 0 0px #ef4444, 1.5px 0 0px #0ea5e9;
  letter-spacing: 0.5px;
}

.navbar-right { display: flex; align-items: center; gap: 16px; }
.user-tag {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 6px 14px;
  font-size: 0.85rem; font-weight: 500;
}
.user-tag .role-badge {
  background: var(--green); color: #000;
  font-size: 0.7rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px; text-transform: uppercase;
}
.user-tag .role-badge.admin { background: #7c3aed; color: #fff; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-md);
  font-size: 0.875rem; font-weight: 600;
  border: none; transition: var(--transition);
  white-space: nowrap;
}
.btn-sm { padding: 6px 14px; font-size: 0.8rem; border-radius: var(--radius-sm); }
.btn-lg { padding: 13px 28px; font-size: 1rem; }
.btn-primary {
  background: var(--green); color: #000;
}
.btn-primary:hover { background: var(--green-dark); transform: translateY(-1px); box-shadow: var(--shadow-green); }
.btn-secondary {
  background: transparent; color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { border-color: var(--green); color: var(--green); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid transparent; }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); border-color: var(--border); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; }

/* Check-in/out big button */
.btn-checkin {
  width: 100%; padding: 18px; border-radius: var(--radius-lg);
  font-size: 1.05rem; font-weight: 700; letter-spacing: 0.3px;
  background: var(--green); color: #000; border: none;
  transition: var(--transition-slow);
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.3);
  position: relative; overflow: hidden;
}
.btn-checkin::before {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 0; height: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s, height 0.4s;
}
.btn-checkin:hover::before { width: 300px; height: 300px; }
.btn-checkin:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(46, 204, 113, 0.45); }
.btn-checkin.checked-in {
  background: var(--red);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3); color: #fff;
}
.btn-checkin.checked-in:hover { box-shadow: 0 8px 30px rgba(239, 68, 68, 0.45); }
.btn-checkin:disabled { background: var(--bg-card); color: var(--text-muted); box-shadow: none; cursor: not-allowed; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.card-title { font-size: 1rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title .icon { font-size: 1.1rem; }

/* Stat cards */
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px 24px;
  transition: var(--transition);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
}
.stat-card.green::before { background: linear-gradient(90deg, var(--green), transparent); }
.stat-card.blue::before { background: linear-gradient(90deg, var(--blue), transparent); }
.stat-card.pink::before { background: linear-gradient(90deg, var(--pink), transparent); }
.stat-card.yellow::before { background: linear-gradient(90deg, var(--yellow), transparent); }
.stat-card:hover { border-color: var(--border-light); transform: translateY(-2px); box-shadow: var(--shadow-card); }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.stat-value { font-size: 2rem; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.stat-value.green { color: var(--green); }
.stat-value.blue { color: var(--blue); }
.stat-value.pink { color: var(--pink); }
.stat-value.yellow { color: var(--yellow); }
.stat-sub { font-size: 0.78rem; color: var(--text-muted); }

/* ── Forms / Inputs ─────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.4px; }
.form-control {
  width: 100%; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); padding: 10px 14px;
  font-size: 0.9rem; transition: var(--transition);
  outline: none;
}
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow); }
.form-control::placeholder { color: var(--text-muted); }
select.form-control { cursor: pointer; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead tr { background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
thead th { padding: 12px 16px; font-size: 0.75rem; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; text-align: left; white-space: nowrap; }
tbody tr { border-bottom: 1px solid var(--border); transition: var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--bg-card-hover); }
tbody td { padding: 12px 16px; color: var(--text-primary); vertical-align: middle; }

/* ── Status Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
}
.badge-standard { background: rgba(59, 130, 246, 0.15); color: var(--blue-light); border: 1px solid rgba(59,130,246,0.3); }
.badge-overtime  { background: rgba(244, 114, 182, 0.15); color: var(--pink); border: 1px solid rgba(244,114,182,0.3); }
.badge-undertime { background: rgba(249, 115, 22, 0.15); color: var(--orange); border: 1px solid rgba(249,115,22,0.3); }
.badge-null      { background: rgba(150, 150, 150, 0.1); color: var(--text-muted); border: 1px solid var(--border); }
.badge-present   { background: rgba(46, 204, 113, 0.15); color: var(--green); border: 1px solid var(--green-border); }
.badge-leave     { background: rgba(251, 191, 36, 0.15); color: var(--yellow); border: 1px solid rgba(251,191,36,0.3); }
.badge-absent    { background: rgba(239, 68, 68, 0.15); color: var(--red); border: 1px solid rgba(239,68,68,0.3); }

/* ── Toggle ─────────────────────────────────────────────────── */
.view-toggle {
  display: inline-flex; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 4px;
}
.view-toggle button {
  padding: 7px 20px; border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 600;
  border: none; background: transparent; color: var(--text-secondary);
  transition: var(--transition);
}
.view-toggle button.active {
  background: var(--green); color: #000;
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px;
  width: 100%; max-width: 480px;
  transform: scale(0.9); transition: var(--transition);
  max-height: 90vh; overflow-y: auto;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.modal-title { font-size: 1.2rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; line-height: 1; transition: var(--transition); }
.modal-close:hover { color: var(--text-primary); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }

/* ── Live Timer ─────────────────────────────────────────────── */
.timer-display {
  font-size: 3rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: var(--green); letter-spacing: 2px; font-family: 'Courier New', monospace;
  text-align: center; line-height: 1;
  text-shadow: 0 0 30px rgba(46, 204, 113, 0.4);
}
.timer-display.inactive { color: var(--text-muted); text-shadow: none; }

.session-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 32px 24px;
  text-align: center; position: relative; overflow: hidden;
}
.session-card::after {
  content: ''; position: absolute; top: 0; left: 50%;
  transform: translateX(-50%);
  width: 60%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--green), transparent);
}

/* ── Toast ──────────────────────────────────────────────────── */
.toast-container {
  position: fixed; top: 80px; right: 24px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 18px;
  min-width: 280px; font-size: 0.875rem;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  display: flex; align-items: center; gap: 10px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }
.toast.info    { border-left: 3px solid var(--blue); }

@keyframes slideIn { from { opacity:0; transform: translateX(30px); } to { opacity:1; transform:translateX(0); } }
@keyframes fadeOut { from { opacity:1; } to { opacity:0; transform:translateY(-10px); } }

/* ── Page Layout ────────────────────────────────────────────── */
.page-content { padding: 32px; max-width: 1280px; margin: 0 auto; }
.section { margin-bottom: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.divider { height: 1px; background: var(--border); margin: 24px 0; }

/* ── Login Page ─────────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 20% 50%, rgba(46,204,113,0.06) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 20%, rgba(52,152,219,0.04) 0%, transparent 50%),
              var(--bg-primary);
}
.login-card {
  width: 100%; max-width: 420px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-xl); padding: 42px 36px;
  box-shadow: var(--shadow-card);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.login-logo .logo__mark {
  display: block; width: 48px; height: 48px; margin: 0 auto 16px;
}
.login-logo .logo__mark > span { border-radius: 6px; }
.login-logo .lm-g { height: 10px; width: 100%; top: 9px; left: 0; }
.login-logo .lm-b { height: 10px; width: 100%; bottom: 9px; left: 0; }
.login-logo .lm-r { width: 10px; height: 100%; left: 9px; top: 0; }
.login-logo .lm-y { width: 10px; height: 100%; right: 9px; top: 0; }
.login-logo h1 { font-size: 1.4rem; font-weight: 800; letter-spacing: 2px; }
.login-logo p { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.login-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.login-sub { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 28px; }

/* ── Chart Container ────────────────────────────────────────── */
.chart-container { position: relative; height: 280px; width: 100%; }

/* ── Sidebar for employee (optional panel) ──────────────────── */
.dashboard-grid {
  display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start;
}

/* ── Leaves indicator ───────────────────────────────────────── */
.leaves-row { display: flex; gap: 8px; margin-top: 8px; }
.leaf-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px rgba(46,204,113,0.5);
}
.leaf-dot.used { background: var(--border-light); box-shadow: none; }

/* ── Empty state ─────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.875rem; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .navbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .modal { padding: 24px 20px; margin: 16px; }
  .timer-display { font-size: 2.2rem; }
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(46, 204, 113, 0); }
}
.pulse { animation: pulse-green 2s infinite; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 0.4s ease both; }

/* ── Active session indicator ───────────────────────────────── */
.session-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); display: inline-block;
  margin-right: 6px;
  animation: pulse-green 2s infinite;
}

/* ── Earnings Component ─────────────────────────────────────── */
.earnings-card {
  position: relative;
  overflow: hidden;
}
.earnings-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, #f59e0b, var(--green), var(--pink));
}
.earnings-total-wrap {
  font-size: 2.6rem; font-weight: 800; font-variant-numeric: tabular-nums;
  color: #fff; line-height: 1.1; letter-spacing: -0.5px;
}
.pulse-glow {
  text-shadow: 0 0 15px rgba(244,114,182,0.15);
}

.progress-bar-bg {
  width: 100%; height: 6px; background: var(--bg-secondary); border-radius: 3px; overflow: hidden; border: 1px solid var(--border);
}
.progress-bar-fill {
  height: 100%; background: var(--green); border-radius: 3px; 
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.4s;
}

/* ── Filter bar ─────────────────────────────────────────────── */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px 20px;
  margin-bottom: 16px;
}
.filter-bar .form-control { flex: 1; min-width: 160px; }

/* ── Overflow helpers ───────────────────────────────────────── */
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
