/* ===== M7 ATTENDANCE — DESIGN SYSTEM ===== */
/* Flat Design | Indigo Primary | Fira Code Headings */

:root {
  --c-primary: #6366F1;
  --c-primary-l: #818CF8;
  --c-primary-d: #4F46E5;
  --c-success: #10B981;
  --c-danger: #EF4444;
  --c-warning: #F59E0B;
  --c-bg: #F5F3FF;
  --c-text: #1E1B4B;
  --c-muted: #6B7280;
  --c-border: #E5E7EB;
}

* { box-sizing: border-box; }

body {
  font-family: 'Fira Sans', sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
}

/* TYPOGRAPHY */
h1, h2, h3, h4,
.font-code { font-family: 'Fira Code', monospace; }

/* NAVIGATION */
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--c-muted);
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.nav-item:hover { background: #EEF2FF; color: var(--c-primary); }
.nav-item.active { background: #EEF2FF; color: var(--c-primary); font-weight: 600; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.bnav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 12px; border-radius: 12px;
  font-size: 11px; font-weight: 500; color: var(--c-muted);
  background: transparent; border: none; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.bnav-item:hover, .bnav-item.active {
  background: #EEF2FF; color: var(--c-primary);
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 8px;
  font-weight: 600; font-size: 13px;
  cursor: pointer; border: none;
  transition: all 0.15s ease; text-decoration: none;
}
.btn-primary { background: var(--c-primary); color: white; }
.btn-primary:hover { background: var(--c-primary-d); }
.btn-success { background: var(--c-success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--c-danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-warning { background: var(--c-warning); color: white; }
.btn-warning:hover { background: #D97706; }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--c-primary);
  color: var(--c-primary);
}
.btn-outline:hover { background: #EEF2FF; }
.btn-ghost { background: transparent; color: var(--c-muted); }
.btn-ghost:hover { background: #F3F4F6; color: var(--c-text); }
.btn-xl { padding: 18px 36px; font-size: 18px; border-radius: 14px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 10px; }

/* AVATAR */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; font-family: 'Fira Code', monospace;
  font-weight: 700; color: white; flex-shrink: 0;
  width: 36px; height: 36px; font-size: 12px;
}
.avatar-sm { width: 28px; height: 28px; font-size: 10px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }
.avatar-xl { width: 64px; height: 64px; font-size: 20px; }

/* TEAM COLORS */
.team-SEO1 { background: #6366F1; }
.team-SEO2 { background: #EC4899; }
.team-RAK-Dev { background: #10B981; }
.team-Admin { background: #F59E0B; }
.team-Management { background: #8B5CF6; }
.team-Design { background: #06B6D4; }
.team-Content { background: #EF4444; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
}
.badge-work  { background: #D1FAE5; color: #065F46; }
.badge-off   { background: #FEE2E2; color: #991B1B; }
.badge-remote { background: #DBEAFE; color: #1E40AF; }
.badge-ot    { background: #FEF3C7; color: #92400E; }
.badge-pending { background: #F3F4F6; color: #374151; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-miss  { background: #FEE2E2; color: #991B1B; }
.badge-present { background: #D1FAE5; color: #065F46; }

/* STATUS DOT */
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0;
}
.dot-work    { background: #10B981; }
.dot-off     { background: #EF4444; }
.dot-remote  { background: #3B82F6; }
.dot-pending { background: #F59E0B; }
.dot-none    { background: #D1D5DB; }

/* CARDS */
.card { background: white; border: 1px solid var(--c-border); border-radius: 12px; }

/* STAT CARD */
.stat-card {
  background: white; border: 1px solid var(--c-border);
  border-radius: 12px; padding: 18px 20px;
}
.stat-num {
  font-family: 'Fira Code', monospace;
  font-size: 32px; font-weight: 700; line-height: 1;
}
.stat-label { font-size: 12px; color: var(--c-muted); font-weight: 500; margin-top: 4px; }

/* TABLES */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 14px;
  font-weight: 600; font-size: 11px; color: var(--c-muted);
  text-transform: uppercase; letter-spacing: 0.06em;
  border-bottom: 1px solid var(--c-border); white-space: nowrap;
}
.data-table td { padding: 11px 14px; border-bottom: 1px solid #F9FAFB; }
.data-table tbody tr:hover td { background: #FAFAFA; }
.data-table tbody tr:last-child td { border-bottom: none; }

/* SCHEDULE GRID */
.schedule-wrapper {
  overflow-x: auto; border: 1px solid var(--c-border);
  border-radius: 12px; background: white;
}
.schedule-table { border-collapse: collapse; min-width: 100%; font-size: 11px; }
.schedule-table th,
.schedule-table td { border: 1px solid #F3F4F6; }
.schedule-table th {
  background: #FAFAFA; font-family: 'Fira Code', monospace;
  font-weight: 600; padding: 8px 4px; text-align: center;
  white-space: nowrap; position: sticky; top: 0; z-index: 5;
  color: var(--c-muted);
}
.schedule-table td { padding: 3px; height: 38px; text-align: center; vertical-align: middle; }
.col-name {
  position: sticky; left: 0; background: white; z-index: 10;
  text-align: left !important; padding: 6px 12px !important;
  min-width: 170px; max-width: 170px;
  border-right: 2px solid var(--c-border) !important;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
th.col-name { z-index: 15; background: #FAFAFA; }

/* SCHEDULE CELL */
.s-cell {
  width: 40px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 5px; font-weight: 700; font-size: 10px;
  cursor: pointer; transition: all 0.12s ease;
  border: 1.5px solid transparent;
}
.s-cell:hover { transform: scale(1.08); opacity: 0.9; }
.s-cell.c-work   { background: #ECFDF5; color: #065F46; border-color: #A7F3D0; }
.s-cell.c-off    { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }
.s-cell.c-remote { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.s-cell.c-ot     { background: #FFFBEB; color: #B45309; border-color: #FDE68A; }
.s-cell.c-wknd   { background: #F9FAFB; color: #9CA3AF; border-color: transparent; cursor: default; }
.s-cell.c-today  { box-shadow: 0 0 0 2px var(--c-primary); }
.s-cell.c-mine   { box-shadow: inset 0 0 0 1.5px var(--c-primary); }
.s-cell.disabled { cursor: not-allowed; opacity: 0.5; }

/* TEAM ROW HEADER */
.team-row-header td {
  background: #FAFAFA; font-weight: 700; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--c-muted); padding: 5px 12px !important;
  border-top: 2px solid var(--c-border) !important;
}

/* CALENDAR */
.cal-header {
  display: grid; grid-template-columns: repeat(7, 1fr);
  background: #FAFAFA; border-bottom: 1px solid var(--c-border);
}
.cal-header div { padding: 10px 4px; text-align: center; font-size: 12px; font-weight: 700; color: var(--c-muted); }
.cal-grid-rows { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-day {
  min-height: 72px; border: 1px solid #F3F4F6; padding: 6px;
  cursor: pointer; transition: background 0.12s;
  position: relative;
}
.cal-day:hover { background: #F9FAFB; }
.cal-day.today { background: #EEF2FF; }
.cal-day.today .cal-day-num { color: var(--c-primary); font-weight: 700; }
.cal-day.other-month { opacity: 0.35; }
.cal-day-num { font-size: 13px; font-weight: 600; color: var(--c-text); margin-bottom: 4px; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 2px; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; }

/* RULE ERROR */
.rule-error {
  background: #FEF2F2; border: 1px solid #FECACA;
  border-radius: 8px; padding: 10px 12px;
  color: #991B1B; font-size: 12px; line-height: 1.5;
}
.rule-ok {
  background: #ECFDF5; border: 1px solid #A7F3D0;
  border-radius: 8px; padding: 10px 12px;
  color: #065F46; font-size: 12px;
}

/* ROLL CALL PROGRESS BAR */
.progress-bar { background: #F3F4F6; border-radius: 100px; overflow: hidden; height: 8px; }
.progress-fill { height: 100%; background: var(--c-primary); border-radius: 100px; transition: width 0.4s ease; }

/* TOAST */
.toast {
  background: white; border-radius: 10px;
  padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  pointer-events: all; min-width: 260px; max-width: 340px;
  animation: toastIn 0.3s ease;
}
@keyframes toastIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 1px; }
.toast-success .toast-icon { color: var(--c-success); }
.toast-error .toast-icon { color: var(--c-danger); }
.toast-info .toast-icon { color: var(--c-primary); }
.toast-title { font-weight: 700; font-size: 13px; }
.toast-msg { font-size: 12px; color: var(--c-muted); margin-top: 1px; }

/* CLOCK */
.clock-big {
  font-family: 'Fira Code', monospace;
  font-size: 56px; font-weight: 700;
  color: var(--c-primary); letter-spacing: -2px; line-height: 1;
}

/* ACTIVITY ITEM */
.activity-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.activity-item:hover { background: #FAFAFA; }

/* DIVIDER */
.divider { border: none; border-top: 1px solid var(--c-border); }

/* CHECKIN BIG BUTTON */
.checkin-btn {
  width: 150px; height: 150px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; cursor: pointer;
  border: none; font-family: 'Fira Sans', sans-serif;
  font-weight: 700; font-size: 18px;
  transition: all 0.2s ease; margin: 0 auto;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}
.checkin-btn.idle {
  background: var(--c-success); color: white;
  animation: ring-pulse 2s infinite;
}
.checkin-btn.active { background: var(--c-danger); color: white; }
.checkin-btn.done { background: #F3F4F6; color: var(--c-muted); cursor: not-allowed; }
@keyframes ring-pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #D1D5DB; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9CA3AF; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .clock-big { font-size: 40px; }
  .stat-num { font-size: 24px; }
}
