/* ============================================================
   SILHOUETTE UK — Attendance & Production Control System
   Built by ZULFIQAR AI LAB
   Design system: AMOLED black / signature 208h duty ring
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Core surface */
  --bg: #000000;
  --bg-elevated: #060606;
  --bg-card: #080808;
  --bg-card-hover: #0c0c0c;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);

  /* Text */
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.80);
  --text-faint: rgba(255, 255, 255, 0.55);

  /* State colors */
  --green: #00e676;
  --green-dim: rgba(0, 230, 118, 0.14);
  --red: #ff3b3b;
  --red-dim: rgba(255, 59, 59, 0.14);
  --amber: #ffb300;
  --amber-dim: rgba(255, 179, 0, 0.14);
  --blue: #2196f3;
  --blue-dim: rgba(33, 150, 243, 0.14);
  --violet: #a06bff;
  --violet-dim: rgba(160, 107, 255, 0.14);

  /* Type */
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Layout */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar-w: 248px;
  --shadow-glow: 0 0 40px rgba(255, 255, 255, 0.03);
}

[data-theme="light"] {
  /* Core surface */
  --bg: #eceae3;
  --bg-elevated: #f6f5ef;
  --bg-card: #fdfcee;
  --bg-card-hover: #ffffff;
  --border: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.16);

  /* Text */
  --text: #000000;
  --text-dim: rgba(0, 0, 0, 0.90);
  --text-faint: rgba(0, 0, 0, 0.70);

  /* State colors (pure green for light bg) */
  --green: #00c853;
  --green-dim: rgba(0, 200, 83, 0.14);
  --red: #dc2626;
  --red-dim: rgba(220, 38, 38, 0.14);
  --amber: #d97706;
  --amber-dim: rgba(217, 119, 6, 0.14);
  --blue: #2563eb;
  --blue-dim: rgba(37, 99, 235, 0.14);
  --violet: #7c3aed;
  --violet-dim: rgba(124, 58, 237, 0.14);

  --shadow-glow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* Make role text blue in light mode */
[data-theme="light"] .brand-text .sub,
[data-theme="light"] .user-chip .who .role {
  color: var(--blue);
  font-weight: 600;
}

/* Light mode specific background */
[data-theme="light"] .grid-bg {
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 30%, transparent 90%);
}

/* Light mode green button specific styles & hover animation */
[data-theme="light"] .btn-primary {
  background: #00c853 !important;
  color: #ffffff !important;
  border-color: #00c853 !important;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
}

[data-theme="light"] .btn-primary::before {
  background: #ff6d00;
  transition: clip-path 0.35s ease-out;
}

[data-theme="light"] .btn-primary:hover::before {
  transition: clip-path 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="light"] .btn-primary:hover {
  background: #00c853 !important;
  color: #ffffff !important;
  border-color: #ff6d00 !important;
  box-shadow: 0 4px 18px rgba(255, 109, 0, 0.45);
  transition: border-color 1.2s ease, box-shadow 1.2s ease, color 1.2s ease;
}

/* Light mode red button (btn-danger) specific styles & dark black hover animation */
[data-theme="light"] .btn-danger {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
}

[data-theme="light"] .btn-danger::before {
  background: #000000;
  transition: clip-path 0.35s ease-out;
}

[data-theme="light"] .btn-danger:hover::before {
  transition: clip-path 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="light"] .btn-danger:hover {
  background: #dc2626 !important;
  color: #ffffff !important;
  border-color: #000000 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4);
  transition: border-color 1.2s ease, box-shadow 1.2s ease, color 1.2s ease;
}

/* Light mode ghost danger button (Delete/Reject) specific styles & red hover animation */
[data-theme="light"] .btn-ghost-danger {
  color: #dc2626 !important;
  border-color: rgba(220, 38, 38, 0.3) !important;
  background: transparent !important;
  transition: border-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
}

[data-theme="light"] .btn-ghost-danger::before {
  background: #dc2626;
  transition: clip-path 0.35s ease-out;
}

[data-theme="light"] .btn-ghost-danger:hover::before {
  transition: clip-path 1.2s cubic-bezier(0.25, 1, 0.5, 1);
}

[data-theme="light"] .btn-ghost-danger:hover {
  background: transparent !important;
  color: #ffffff !important;
  border-color: #dc2626 !important;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.35);
  transition: border-color 1.2s ease, box-shadow 1.2s ease, color 1.2s ease;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  /* Stop native body scroll/bounce */
  background: var(--bg);
  overscroll-behavior: none;
}

body {
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input,
select,
textarea {
  font-family: inherit;
}

::selection {
  background: var(--green);
  color: #000;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 10px;
}

/* Ambient grid background texture */
.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* ============ LAYOUT SHELL ============ */
.shell {
  display: flex;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  /* Smooth scrolling on iOS */
  position: relative;
  z-index: 1;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  padding: 24px 16px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Collapsed State */
.sidebar.collapsed {
  width: 76px;
  padding: 24px 10px;
}

.sidebar.collapsed .brand-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-chip .who,
.sidebar.collapsed .logout-text {
  display: none;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 0;
  width: 42px;
  height: 42px;
  margin: 0 auto 8px auto;
}

.sidebar.collapsed .user-chip {
  justify-content: center;
  padding: 8px 0;
  margin-bottom: 8px;
}

.sidebar.collapsed .logout-btn {
  justify-content: center;
  border: none;
  padding: 0;
  width: 42px;
  height: 42px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.03);
}

.sidebar.collapsed .logout-btn:hover {
  background: var(--red-dim);
}

.sidebar.collapsed .sidebar-brand {
  justify-content: center;
  padding: 12px 0 16px;
  flex-direction: column;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 15px;
  position: relative;
}

.sidebar.collapsed .brand-logo {
  transition: opacity 0.2s ease;
}

.sidebar.collapsed .sidebar-brand:hover .brand-logo {
  opacity: 0;
}

.sidebar.collapsed .sidebar-brand:hover .toggle-btn {
  opacity: 1;
  pointer-events: auto;
}

.sidebar.collapsed .brand-left {
  justify-content: center;
}

.sidebar.collapsed .toggle-btn {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  background: var(--bg-card);
  border-color: var(--border-strong);
  transition: opacity 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.sidebar.collapsed .toggle-btn svg {
  transform: rotate(180deg) translateX(-1px);
  stroke-width: 4px !important;
}

.sidebar.collapsed .toggle-btn:hover {
  color: #000 !important;
  border-color: #fff !important;
  background: #fff !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.4) !important;
  transform: translateX(-50%) scale(1.08) !important;
}

.sidebar.collapsed .footer-credit {
  display: none;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  position: relative;
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-logo {
  transition: opacity 0.2s;
}

.brand-text {
  line-height: 1.25;
  overflow: hidden;
}

.brand-text .name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.brand-text .sub {
  font-size: 9.5px;
  color: var(--text-faint);
  letter-spacing: 1.2px;
  text-transform: uppercase;
  font-weight: 600;
}

.toggle-btn {
  position: relative;
  right: auto;
  top: auto;
  transform: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  z-index: 10;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.toggle-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 4px !important;
  transform: translateX(-1px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-btn:hover {
  color: #000;
  border-color: #fff;
  background: #fff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: conic-gradient(from 180deg, var(--green), var(--blue), var(--green));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  color: #000;
  box-shadow: 0 0 18px rgba(0, 230, 118, 0.35);
}

.brand-text {
  line-height: 1.2;
}

.brand-text .name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13.5px;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.brand-text .sub {
  font-size: 10px;
  color: var(--text-faint);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--text-faint);
  padding: 6px 10px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  transition: .15s ease;
  margin-bottom: 2px;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  opacity: .8;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.nav-item.active {
  background: var(--green-dim);
  color: var(--green);
  box-shadow: inset 0 0 0 1px rgba(0, 230, 118, 0.25);
}

.nav-item.active svg {
  opacity: 1;
}

.sidebar-foot {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}

.user-chip:hover {
  background: rgba(255, 255, 255, 0.04);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-display);
  flex-shrink: 0;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.user-chip .who {
  font-size: 12.5px;
  line-height: 1.3;
}

.user-chip .who .role {
  color: var(--text-faint);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.logout-btn {
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  transition: .15s;
}

.logout-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.logout-btn:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-dim);
}

.main {
  flex: 1;
  min-width: 0;
  padding: 28px 32px 20px;
}

.main::after {
  content: "";
  display: block;
  height: 60px;
  /* Forces scrollable space at the bottom */
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  flex-wrap: wrap;
  gap: 14px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .2px;
}

.page-sub {
  color: var(--text-faint);
  font-size: 12.5px;
  margin-top: 3px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-clock {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-dim);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: .35;
  }
}

/* ============ GRID / CARDS ============ */
.grid {
  display: grid;
  gap: 18px;
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-main {
  grid-template-columns: 1.3fr 1fr;
}

.month-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 768px) {
  .month-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .month-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: .15s ease;
  min-width: 0;
  /* Fix flex/grid overflow issue */
}

.card:hover {
  border-color: var(--border-strong);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
}

.card-title-sm {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}

.stat-card .stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  margin: 6px 0 4px;
}

.stat-card .stat-delta {
  font-size: 11.5px;
  font-family: var(--font-mono);
}

.stat-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 17px;
  height: 17px;
}

.up {
  color: var(--green);
}

.down {
  color: var(--red);
}

.flat {
  color: var(--text-faint);
}

/* ============ 208H DUTY RING (signature element) ============ */
.duty-ring-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
}

.duty-ring {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 4px solid var(--border-strong);
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.duty-ring .water {
  position: absolute;
  top: 110%;
  /* Default empty */
  left: 50%;
  width: 250px;
  height: 250px;
  margin-left: -125px;
  transition: top 1.5s cubic-bezier(0.4, 0, 0.2, 1), background-color 1s;
  z-index: 1;
}

.duty-ring .wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
  background-color: inherit;
}

.duty-ring .wave1 {
  opacity: 0.4;
  border-radius: 43%;
  animation: spinWave 6s linear infinite;
}

.duty-ring .wave2 {
  opacity: 0.8;
  border-radius: 46%;
  animation: spinWave 9s linear infinite;
}

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

.duty-ring .center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.duty-ring .center .hrs {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.duty-ring .center .of {
  font-size: 9.5px;
  color: var(--text-faint);
  letter-spacing: .5px;
}

.duty-meta .row {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  color: var(--text-dim);
}

.duty-meta .row span:last-child {
  font-family: var(--font-mono);
  color: var(--text);
}

/* ============ TABLES ============ */
.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  transform: translateZ(0);
  will-change: transform;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

thead th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  font-weight: 600;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}

tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
  border-bottom: none;
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mono {
  font-family: var(--font-mono);
  color: var(--text-dim);
  white-space: nowrap;
}

/* ============ BADGES / PILLS ============ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.done {
  background: var(--green-dim);
  color: var(--green);
}

.badge.editing {
  background: var(--blue-dim);
  color: var(--blue);
}

.badge.pending {
  background: var(--amber-dim);
  color: var(--amber);
}

.badge.cancelled {
  background: var(--red-dim);
  color: var(--red);
}

.badge.assigned {
  background: var(--violet-dim);
  color: var(--violet);
}

.badge.present {
  background: var(--green-dim);
  color: var(--green);
}

.badge.absent {
  background: var(--red-dim);
  color: var(--red);
}

.badge.onbreak {
  background: var(--amber-dim);
  color: var(--amber);
}

.badge.approved {
  background: var(--green-dim);
  color: var(--green);
}

.badge.rejected {
  background: var(--red-dim);
  color: var(--red);
}

.task-chip {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text);
  transition: .15s ease;
}

.btn svg {
  width: 15px;
  height: 15px;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary {
  position: relative;
  overflow: hidden;
  z-index: 1;
  background: var(--green);
  color: #000;
  border-color: var(--green);
  transition: color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.btn-primary::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: #ff6d00;
  z-index: -1;
  clip-path: circle(0% at 50% 100%);
  transition: clip-path 0.35s ease-out;
  border-radius: inherit;
}

.btn-primary:hover::before {
  clip-path: circle(200% at 50% 100%);
  transition: clip-path 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background: var(--green) !important;
  color: #ffffff;
  border-color: #ff6d00;
  box-shadow: 0 0 20px rgba(255, 109, 0, 0.4);
  transition: color 0.1s ease, border-color 0.1s ease, box-shadow 0.7s ease;
}

.btn-danger {
  position: relative;
  overflow: hidden;
  z-index: 1;
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  transition: color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.btn-danger::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: #000000;
  z-index: -1;
  clip-path: circle(0% at 50% 100%);
  transition: clip-path 0.35s ease-out;
  border-radius: inherit;
}

.btn-danger:hover::before {
  clip-path: circle(200% at 50% 100%);
  transition: clip-path 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-danger:hover {
  background: var(--red) !important;
  color: #ffffff !important;
  border-color: #000000;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
  transition: color 0.1s ease, border-color 0.1s ease, box-shadow 0.7s ease;
}

.btn-ghost-danger {
  position: relative;
  overflow: hidden;
  z-index: 1;
  color: var(--red);
  border-color: rgba(255, 59, 59, 0.3);
  background: transparent;
  transition: color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.btn-ghost-danger::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--red);
  z-index: -1;
  clip-path: circle(0% at 50% 100%);
  transition: clip-path 0.35s ease-out;
  border-radius: inherit;
}

.btn-ghost-danger:hover::before {
  clip-path: circle(200% at 50% 100%);
  transition: clip-path 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ghost-danger:hover {
  background: transparent !important;
  color: #ffffff !important;
  border-color: var(--red);
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.35);
  transition: color 0.1s ease, border-color 0.1s ease, box-shadow 0.7s ease;
}

.btn-ghost-blue {
  position: relative;
  overflow: hidden;
  z-index: 1;
  color: var(--text);
  border-color: rgba(33, 150, 243, 0.3);
  background: transparent;
  transition: color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.btn-ghost-blue::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--blue);
  z-index: -1;
  clip-path: circle(0% at 50% 100%);
  transition: clip-path 0.35s ease-out;
  border-radius: inherit;
}

.btn-ghost-blue:hover::before {
  clip-path: circle(200% at 50% 100%);
  transition: clip-path 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-ghost-blue:hover {
  background: transparent !important;
  color: #ffffff !important;
  border-color: var(--blue);
  box-shadow: 0 4px 15px rgba(33, 150, 243, 0.35);
  transition: color 0.1s ease, border-color 0.1s ease, box-shadow 0.7s ease;
}

.btn-sm {
  padding: 7px 12px;
  font-size: 12px;
  border-radius: 8px;
}

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

/* ============ FORM ELEMENTS ============ */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 7px;
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  transition: .15s;
  box-sizing: border-box;
}

.field textarea {
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.12);
}

.field select,
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaaaaa' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
  background-color: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}

[data-theme="light"] select,
[data-theme="light"] .field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23222222' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-color: #ffffff !important;
  color: #000000 !important;
  border-color: rgba(0, 0, 0, 0.15);
}

option {
  background-color: var(--bg-elevated);
  color: var(--text);
  padding: 10px;
}

[data-theme="light"] option {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Color Scheme per Theme for Native Pickers (Date, Time, Select) */
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] option {
  color-scheme: light;
}

:root,
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] option {
  color-scheme: dark;
}

/* ============ CUSTOM ANIMATED DROPDOWN ============ */
.custom-select-wrapper {
  position: relative;
  user-select: none;
  width: 100%;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background-color 0.25s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .custom-select-trigger {
  background: #ffffff !important;
  color: #000000 !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
}

.custom-select-trigger:hover,
.custom-select-wrapper.open .custom-select-trigger {
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px var(--green-dim) !important;
}

.custom-select-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-dim);
}

.custom-select-wrapper.open .custom-select-arrow {
  transform: rotate(180deg);
  color: var(--green);
}

/* Floating Slide-Down Options Menu */
.custom-select-options {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  width: max-content;
  max-width: 280px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  z-index: 10000;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 240px;
  overflow-y: auto;

  /* Smooth Slide-Down Animation */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
    visibility 0.25s ease;
}

[data-theme="light"] .custom-select-options {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12) !important;
}

.custom-select-wrapper.open .custom-select-options {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.custom-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

[data-theme="light"] .custom-option {
  color: rgba(0, 0, 0, 0.85);
}

.custom-option:hover {
  background: var(--green-dim);
  color: var(--green);
}

.custom-option.selected {
  background: var(--green-dim);
  color: var(--green);
  font-weight: 600;
}

.custom-option .opt-check {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.custom-option.selected .opt-check {
  opacity: 1;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"] {
  cursor: pointer;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300e676'%3E%3Cpath d='M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19a2 2 0 0 0 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7v-5z'/%3E%3C/svg%3E");
}

input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300b8ff'%3E%3Cpath d='M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z'/%3E%3C/svg%3E");
}

.field-row {
  display: flex;
  gap: 12px;
}

.field-row .field {
  flex: 1;
}

.hint {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 6px;
}

/* Task-type dropdown pill options rendering (used in select + preview chip) */
.task-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--violet-dim);
  color: var(--violet);
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .15s;
  margin-left: 5px;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.icon-btn svg {
  width: 15px;
  height: 15px;
}

/* ============ MONTH CARD ============ */
.month-card {
  padding: 15px 5px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  user-select: none;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.month-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: #ffffff;
  z-index: -1;
  clip-path: circle(0% at 50% 100%);
  transition: clip-path 0.35s ease-out;
  border-radius: inherit;
}

[data-theme="light"] .month-card::before {
  background: #000000;
}

.month-card:hover::before {
  clip-path: circle(200% at 50% 100%);
  transition: clip-path 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.month-card:hover {
  background: transparent !important;
  color: #000000 !important;
  border-color: #ffffff;
  transform: translateY(-2px);
  transition: color 0.1s ease, border-color 0.1s ease, transform 0.3s ease;
}

[data-theme="light"] .month-card:hover {
  color: #ffffff !important;
  border-color: #000000;
}

.month-card.selected {
  background: var(--green);
  color: #000;
  border-color: var(--green);
  transform: translateY(-3px);
  box-shadow: 0 8px 15px rgba(0, 255, 136, 0.2);
}

.month-card.selected::before {
  background: #ff6d00;
}

.month-card.selected:hover {
  background: transparent !important;
  color: #ffffff !important;
  border-color: #ff6d00;
  box-shadow: 0 0 20px rgba(255, 109, 0, 0.4);
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.25s ease;
  pointer-events: none;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 26px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45);
  transform: translateY(15px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] .modal {
  background: #fdfcee !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

.modal-overlay.open .modal {
  transform: translateY(0) scale(1);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  border: none;
  background: transparent;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

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

.modal-actions .btn {
  flex: 1;
}

/* ============ TOAST ============ */
.toast-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--green);
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 13px;
  min-width: 240px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: slideIn .25s ease;
}

.toast.err {
  border-left-color: var(--red);
}

@keyframes slideIn {
  from {
    transform: translateX(30px);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ============ EMPTY STATE ============ */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-faint);
}

.empty svg {
  width: 36px;
  height: 36px;
  opacity: .4;
  margin-bottom: 10px;
}

.empty .msg {
  font-size: 13px;
}

/* ============ LOGIN PAGE ============ */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-glow);
}

.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 26px;
  text-align: center;
}

.login-brand .brand-mark {
  width: 52px;
  height: 52px;
  font-size: 20px;
  margin-bottom: 14px;
}

.login-brand .company {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .4px;
}

.login-brand .powered {
  font-size: 10.5px;
  color: var(--text-faint);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: 4px;
}

.role-tabs {
  display: flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 22px;
}

.role-tab {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}

.role-tab.active {
  background: var(--green);
  color: #000;
}

.login-err {
  background: var(--red-dim);
  color: var(--red);
  border: 1px solid rgba(255, 59, 59, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 16px;
  display: none;
}

.login-foot {
  text-align: center;
  margin-top: 18px;
  font-size: 11.5px;
  color: var(--text-faint);
}

/* ============ RESPONSIVE ============ */
.mobile-topbar,
.mobile-bottom-nav {
  display: none;
}

.sidebar-overlay {
  display: none;
}

@media (max-width: 980px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
  }

  .shell::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 60;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 55;
  }

  .sidebar-overlay.open {
    display: block;
  }

  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 40;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }

  .mobile-bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 40;
    padding: 16px 5px 20px 5px;
    /* Match header height, with extra bottom padding */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  }

  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.6) !important;
    /* White faded icons */
    text-decoration: none;
    flex: 1;
    transition: all 0.2s ease;
    padding: 0 !important;
    /* Override nav-item padding */
    margin: 0 !important;
    /* Override nav-item margin */
    background: transparent !important;
    /* Remove nav-item background */
    box-shadow: none !important;
    /* Remove nav-item shadow */
    border-radius: 0 !important;
    /* Remove nav-item border-radius */
  }

  .bottom-nav-item svg {
    width: 24px;
    height: 24px;
  }

  .bottom-nav-item.active {
    color: var(--green) !important;
    /* Bright green on click */
  }

  .bottom-nav-item.active svg {
    stroke-width: 2.5;
    transform: scale(1.15);
  }

  .main {
    padding: 18px 16px 85px;
    /* Increase bottom padding for nav bar */
  }

  .topbar {
    display: none;
  }

  .grid-3,
  .grid-4,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .duty-ring-wrap {
    flex-direction: column;
    text-align: center;
  }

  .field-row {
    flex-direction: column;
    gap: 0;
  }

  table {
    font-size: 12px;
  }

  .stat-card .stat-value {
    font-size: 24px;
  }

  .toggle-btn {
    display: none !important;
  }

  .nav-item {
    margin-bottom: 8px;
    padding: 12px 14px;
  }

  .logout-btn {
    margin-top: 10px;
  }

  .mobile-topbar .icon-btn {
    padding: 8px;
    color: #ffffff !important;
  }

  .mobile-topbar .icon-btn svg {
    width: 30px;
    height: 30px;
  }
}

/* SweetAlert Handwritten Styles */
.hw-popup {
  background: var(--bg-elevated) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
}

.hw-title {
  font-family: 'Caveat', cursive !important;
  font-size: 38px !important;
  color: var(--green) !important;
}

.hw-text {
  font-family: 'Caveat', cursive !important;
  font-size: 26px !important;
  color: var(--text) !important;
}

.swal2-html-container {
  font-family: 'Caveat', cursive !important;
  font-size: 26px !important;
  color: var(--text) !important;
}

/* Floating Break Timer (Pill Design) */
#floatingTimer.futuristic-pill {
  position: fixed;
  bottom: 30px;
  right: 30px;
  height: 60px;
  padding: 0 25px 0 10px;
  background: rgba(20, 20, 25, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 15px rgba(0, 255, 170, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 9999;
  cursor: grab;
  user-select: none;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s;
}

#floatingTimer.futuristic-pill:active {
  cursor: grabbing;
  transform: scale(0.95);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.6);
}

#floatingTimer.futuristic-pill.overtime {
  border-color: rgba(255, 77, 77, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(255, 77, 77, 0.3);
  animation: pulse-red 2s infinite;
}

#floatingTimer.futuristic-pill .pill-icon {
  font-size: 20px;
  background: var(--green);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  box-shadow: 0 0 10px rgba(0, 255, 170, 0.4);
}

#floatingTimer.futuristic-pill.overtime .pill-icon {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 77, 77, 0.4);
  color: #fff;
}

#floatingTimer.futuristic-pill .pill-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#floatingTimer.futuristic-pill #timerLabel {
  font-size: 9px;
  color: var(--text-faint);
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 2px;
}

#floatingTimer.futuristic-pill.overtime #timerLabel {
  color: var(--red);
}

#floatingTimer.futuristic-pill #timerText {
  font-size: 18px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}

/* Responsive Filter Row Style */
.filter-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.filter-row>div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-row label {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}

.filter-row select,
.filter-row input[type="month"] {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  outline: none;
  height: 32px;
  box-sizing: border-box;
}

.filter-row input[type="month"] {
  padding: 5px 10px;
}

.filter-row .btn-print-action {
  margin-left: auto;
  background: var(--blue);
  border: none;
  color: #fff;
  font-size: 12px;
  height: 32px;
  display: inline-flex;
  align-items: center;
}

@media (max-width: 600px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }

  .filter-row>div {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }

  .filter-row label {
    font-size: 13px;
    font-weight: 500;
  }

  .filter-row select,
  .filter-row input[type="month"] {
    flex: 1;
    max-width: 70%;
    height: 36px;
    font-size: 13px;
  }

  .filter-row #btnClearFilters {
    height: 36px;
    font-size: 13px;
    width: 100%;
    margin-top: 2px;
  }

  .filter-row .btn-print-action {
    margin-left: 0 !important;
    width: 100%;
    justify-content: center;
    height: 36px;
    font-size: 13px;
  }
}

@keyframes pulse-red {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }

  70% {
    box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* SPA View Section Logic */
.view-section {
  display: none;
  scroll-margin-top: 80px;
  /* Leave space for sticky header */
}

.view-section.active {
  display: block;
}

/* ============ CHAT CONTEXT MENU ============ */
.chat-context-menu {
  position: fixed;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  z-index: 9999;
  padding: 8px 0;
  min-width: 160px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.context-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.2s;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.context-menu-item.danger {
  color: var(--red);
}

.context-menu-item.danger:hover {
  background: var(--red-dim);
}

/* ============ FORCE PERFECT CIRCLES FOR AVATARS ============ */
img[style*="border-radius:50%"],
img[style*="border-radius: 50%"],
div[style*="border-radius:50%"]:not(.live-dot),
div[style*="border-radius: 50%"]:not(.live-dot),
.avatar,
.avatar img {
  aspect-ratio: 1 / 1 !important;
  flex-shrink: 0 !important;
  object-fit: cover !important;
  min-width: 28px;
  min-height: 28px;
}

.chat-context-menu-old {
  position: fixed;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  min-width: 150px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-context-item {
  padding: 10px 15px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-context-item:hover {
  background: var(--bg-hover);
}

.chat-context-item.danger {
  color: var(--red);
}

.chat-reaction-picker {
  display: flex;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  position: absolute;
  z-index: 10001;
}

.chat-reaction-btn {
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: transform 0.1s;
}

.chat-reaction-btn:hover {
  transform: scale(1.2);
}

.chat-reactions-display {
  display: flex;
  gap: 4px;
  margin-top: -5px;
  margin-bottom: 5px;
  z-index: 2;
  position: relative;
}

.chat-reaction-badge {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.chat-reaction-badge img {
  width: 14px;
  height: 14px;
}

/* ============================================================
   RESPONSIVE TABLES & INPUT FOCUS STATES
   ============================================================ */

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
}

/* Premium Focus States */
input:focus,
textarea:focus,
select:focus {
  outline: none !important;
  border-color: var(--green) !important;
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.2) !important;
  transition: all 0.2s ease-out;
}

/* ============================================================
   HIDE SCROLLBARS ON MOBILE
   ============================================================ */
@media (max-width: 900px) {
  *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  * {
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
  }
}

/* ============================================================
   MESSAGES VIEW — COMPLETE FULLSCREEN FIT & NO PAGE SCROLL
   ============================================================ */
body:has(#messages.active),
.shell:has(#messages.active),
body.messages-page-active,
.shell.messages-page-active {
  overflow: hidden !important;
}

body:has(#messages.active) .main::after,
.shell:has(#messages.active) .main::after,
body.messages-page-active .main::after,
.shell.messages-page-active .main::after {
  display: none !important;
  height: 0 !important;
}

.chat-card-fixed {
  height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  body:has(#messages.active),
  .shell:has(#messages.active),
  body.messages-page-active,
  .shell.messages-page-active {
    overflow: hidden !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  body:has(#messages.active) .main,
  .shell:has(#messages.active) .main,
  body.messages-page-active .main,
  .shell.messages-page-active .main {
    padding: 8px 10px 0 10px !important;
    overflow: hidden !important;
    height: calc(100dvh - 56px) !important;
  }

  body:has(#messages.active) .main::after,
  .shell:has(#messages.active) .main::after,
  body.messages-page-active .main::after,
  .shell.messages-page-active .main::after {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
  }

  #messages.active {
    height: 100% !important;
  }

  #messages.active .chat-card-fixed,
  .chat-card-fixed {
    /* Height fills the space between topbar (56px) down to right above bottom-nav (64px) */
    height: calc(100dvh - 134px) !important;
    margin: 0 !important;
  }

  #messages .card {
    padding: 12px !important;
  }

  #messages .card-head {
    margin-bottom: 8px !important;
  }
}

/* ============================================================
   PRINT STYLES FOR PAYROLL
   ============================================================ */
@media print {
  @page {
    margin: 0;
  }

  body * {
    visibility: hidden;
  }

  .print-hide {
    display: none !important;
  }

  #payroll,
  #payroll * {
    visibility: visible;
    color: #000 !important;
  }

  #payroll {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 15mm;
    padding-top: 5mm;
    box-sizing: border-box;
    background: #fff !important;
    min-height: 100vh;
  }

  #payroll .card {
    box-shadow: none !important;
    border: none !important;
    background: transparent !important;
  }

  #payroll .btn {
    display: none !important;
    /* Hide print and edit buttons */
  }

  /* Force table styles for print */
  .print-only {
    display: block !important;
  }

  #payroll table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    border: 1px solid #000 !important;
  }

  #payroll th,
  #payroll td {
    border: 1px solid #000 !important;
    padding: 10px;
    text-align: left;
    background: #fff !important;
    color: #000 !important;
  }

  #payroll th {
    font-weight: bold;
    background: #f0f0f0 !important;
    position: static !important;
  }

  .sidebar,
  .mobile-topbar,
  .mobile-bottom-nav,
  .theme-btn-container {
    display: none !important;
  }
}