/* ==========================================================================
   BIZFLOW / KARIGARBOOK — MODERN DESIGN SYSTEM (VANILLA CSS)
   Tailored for Small Business Labor, Attendance, Invoicing & P&L Tracking
   ========================================================================== */

:root {
  /* Color Palette */
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-card-hover: rgba(31, 41, 55, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-glass-strong: rgba(255, 255, 255, 0.08);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-focus: #6366f1;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Accent Colors */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-glow: rgba(79, 70, 229, 0.25);

  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --success-text: #34d399;

  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.2);
  --warning-text: #fbbf24;

  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.2);
  --danger-text: #f87171;

  --info: #0ea5e9;
  --info-glow: rgba(14, 165, 233, 0.2);
  --info-text: #38bdf8;

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

  /* Shadows & Radii */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --sidebar-width: 250px;
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--info-text);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: #60a5fa;
}

/* Background Atmospheric Gradient */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(10, 14, 23, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: 0;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(10, 14, 23, 0) 70%);
  pointer-events: none;
  z-index: 0;
}

/* Layout Hierarchy */
.app-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* Sidebar (Desktop) */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  padding: 1.5rem 1rem;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.brand-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  font-size: 1.25rem;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-info h1 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.brand-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  overflow-y: auto;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.75rem 0.75rem 0.25rem;
  letter-spacing: 0.05em;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition);
}

.nav-link:hover {
  background: var(--bg-glass-strong);
  color: #fff;
  transform: translateX(3px);
}

.nav-link.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(59, 130, 246, 0.15));
  color: #fff;
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.15rem;
  width: 22px;
  text-align: center;
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-glass);
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* Header */
.top-navbar {
  height: 64px;
  background: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: sticky;
  top: 0;
  z-index: 90;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.content-container {
  padding: 2rem;
  flex: 1;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.mobile-nav-item.active {
  color: #818cf8;
}

.mobile-nav-item .icon {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

/* Cards & Containers */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Stat Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: transparent;
}

.stat-card.primary::before { background: var(--primary); }
.stat-card.success::before { background: var(--success); }
.stat-card.warning::before { background: var(--warning); }
.stat-card.danger::before { background: var(--danger); }
.stat-card.info::before { background: var(--info); }

.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.stat-icon.primary { background: var(--primary-glow); color: #818cf8; }
.stat-icon.success { background: var(--success-glow); color: var(--success-text); }
.stat-icon.warning { background: var(--warning-glow); color: var(--warning-text); }
.stat-icon.danger { background: var(--danger-glow); color: var(--danger-text); }
.stat-icon.info { background: var(--info-glow); color: var(--info-text); }

.stat-meta {
  flex: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  font-family: var(--font-sans);
}

.stat-subtext {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-success {
  background: rgba(16, 185, 129, 0.15);
  color: var(--success-text);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning-text);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger-text);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
  background: rgba(14, 165, 233, 0.15);
  color: var(--info-text);
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.badge-neutral {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  line-height: 1.25;
}

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

.btn-primary {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5b54ea, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-success:hover {
  background: linear-gradient(135deg, #1ea377, #10b981);
  color: #fff;
}

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

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
  color: #fff;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger-text);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
}

.btn-lg {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

/* Form Controls */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition);
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(0, 0, 0, 0.4);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Attendance Quick Button Group */
.attendance-pill-group {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.att-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-dim);
  transition: var(--transition);
}

.att-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.att-btn.active-present {
  background: #10b981;
  color: #fff;
}

.att-btn.active-half {
  background: #f59e0b;
  color: #fff;
}

.att-btn.active-absent {
  background: #ef4444;
  color: #fff;
}

.att-btn.active-leave {
  background: #3b82f6;
  color: #fff;
}

/* Category Quick Badges */
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.cat-pill {
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cat-pill:hover, .cat-pill.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #6366f1;
  color: #fff;
}

/* Alerts / Flash Notices */
.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--success-text);
}

.alert-danger, .alert-alert {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--danger-text);
}

/* Auth / Public Container */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow-lg);
}

/* Invoice Printable Template */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .sidebar, .top-navbar, .mobile-bottom-nav, .no-print {
    display: none !important;
  }
  .main-wrapper {
    margin-left: 0 !important;
  }
  .content-container {
    padding: 0 !important;
  }
  .printable-invoice {
    box-shadow: none !important;
    border: none !important;
    color: #000 !important;
  }
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .main-wrapper {
    margin-left: 0;
    padding-bottom: 74px; /* for mobile nav */
  }
  .mobile-bottom-nav {
    display: flex;
  }
  .content-container {
    padding: 1.25rem;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   ATTENDANCE 1-TOUCH TILE VIEW & CALENDAR VIEW (MOBILE-FIRST)
   ========================================================================== */

.att-view-tabs {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 3px;
}

button.att-view-tab,
a.att-view-tab,
.att-view-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: transparent;
  border: none;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  transition: var(--transition);
  -webkit-appearance: none;
  appearance: none;
}

.att-view-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.att-view-tab.active {
  background: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

/* Table Mode Attendance Status Button */
.tbl-status-group {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}

.tbl-status-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  -webkit-appearance: none;
  appearance: none;
}

.tbl-status-btn:hover {
  color: #fff;
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
}

.tbl-status-btn.active-present {
  background: rgba(16, 185, 129, 0.2) !important;
  border-color: var(--success) !important;
  color: var(--success-text) !important;
  font-weight: 700;
}

.tbl-status-btn.active-half_day {
  background: rgba(245, 158, 11, 0.2) !important;
  border-color: var(--warning) !important;
  color: var(--warning-text) !important;
  font-weight: 700;
}

.tbl-status-btn.active-absent {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: var(--danger) !important;
  color: var(--danger-text) !important;
  font-weight: 700;
}

.tbl-status-btn.active-paid_leave {
  background: rgba(59, 130, 246, 0.2) !important;
  border-color: var(--info) !important;
  color: var(--info-text) !important;
  font-weight: 700;
}

/* Worker Attendance Tile Card */
.att-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .att-tiles-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.worker-tile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--danger); /* default absent */
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.worker-tile:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.worker-tile.status-present {
  border-left-color: var(--success);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.05) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.worker-tile.status-half_day {
  border-left-color: var(--warning);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.05) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.worker-tile.status-absent {
  border-left-color: var(--danger);
  background: linear-gradient(145deg, rgba(239, 68, 68, 0.05) 0%, rgba(17, 24, 39, 0.9) 100%);
}

.worker-tile.status-paid_leave {
  border-left-color: var(--info);
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.05) 0%, rgba(17, 24, 39, 0.9) 100%);
}

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

.worker-info-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.worker-avatar-tile {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease;
}

.worker-avatar-tile:active {
  transform: scale(0.92);
}

.worker-name-role {
  min-width: 0;
}

.worker-name-role h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.worker-rate-badge {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* 1-Touch Segmented Touch Tabs */
.touch-tabs-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 3px;
}

.touch-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px; /* touch target standard */
  padding: 0.4rem 0.2rem;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.touch-tab-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.touch-tab-btn:active {
  transform: scale(0.95);
}

.touch-tab-btn .tab-icon {
  font-size: 1.05rem;
  margin-bottom: 2px;
}

/* Tab active states */
.touch-tab-btn.active-present {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}

.touch-tab-btn.active-half_day {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.touch-tab-btn.active-absent {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.touch-tab-btn.active-paid_leave {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Overtime Stepper & Project Controls */
.tile-extra-controls {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.75rem;
  align-items: center;
}

@media (max-width: 480px) {
  .tile-extra-controls {
    grid-template-columns: 1fr;
  }
}

.ot-touch-stepper {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.ot-step-btn {
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.ot-step-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.ot-step-btn:active {
  transform: scale(0.92);
}

.ot-val-display {
  flex: 1;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fbbf24;
}

/* ==========================================================================
   CALENDAR VIEW STYLES
   ========================================================================== */

.calendar-header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.calendar-month-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.calendar-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 6px;
}

.calendar-weekday-header {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.5rem 0;
}

.calendar-day-cell {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  height: 96px;
  padding: 0.5rem;
  vertical-align: top;
  position: relative;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: table-cell;
}

.calendar-day-cell:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.calendar-day-cell.other-month {
  opacity: 0.35;
  background: rgba(0, 0, 0, 0.2);
}

.calendar-day-cell.is-today {
  border-color: #6366f1;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.15) 0%, rgba(17, 24, 39, 0.95) 100%);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.25);
}

.calendar-day-cell.is-sunday {
  background: rgba(255, 255, 255, 0.015);
}

.calendar-day-num {
  font-size: 0.9rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.calendar-day-cell.is-today .calendar-day-num span:first-child {
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
}

.day-badge-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.cal-pill.present {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success-text);
}

.cal-pill.half {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning-text);
}

.cal-pill.absent {
  background: rgba(239, 68, 68, 0.18);
  color: var(--danger-text);
}

.cal-wage-summary {
  font-size: 0.7rem;
  font-weight: 700;
  color: #fbbf24;
  margin-top: 4px;
  text-align: right;
}

@media (max-width: 768px) {
  .calendar-table {
    border-spacing: 2px;
  }
  .calendar-day-cell {
    height: 72px;
    padding: 0.25rem;
  }
  .calendar-day-num {
    font-size: 0.75rem;
  }
  .cal-pill {
    font-size: 0.6rem;
    padding: 1px 3px;
  }
  .cal-wage-summary {
    display: none;
  }
}

/* ==========================================================================
   PROGRESSIVE WEB APP (PWA) INSTALL BANNER & PROMPTS
   ========================================================================== */

.pwa-install-banner {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 20px rgba(79, 70, 229, 0.25);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
}

.pwa-install-banner.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 769px) {
  .pwa-install-banner {
    bottom: 24px;
    right: 24px;
    left: auto;
    transform: translateY(150%);
  }
  .pwa-install-banner.show {
    transform: translateY(0);
  }
}

.pwa-app-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.pwa-app-icon img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.pwa-meta {
  flex: 1;
  min-width: 0;
}

.pwa-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.pwa-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 2px 0 0 0;
  line-height: 1.3;
}

.pwa-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-pwa-install {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-pwa-install:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

.btn-pwa-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-pwa-close:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* iOS instructions sheet */
.pwa-ios-sheet {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  width: calc(100% - 32px);
  max-width: 440px;
  background: rgba(17, 24, 39, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-lg);
  padding: 1.1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  opacity: 0;
  pointer-events: none;
}

.pwa-ios-sheet.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   FEATURE #6: EXECUTIVE CASH FLOW & NET PROFIT DASHBOARD
   ========================================================================== */

/* Month Navigation Bar */
.month-nav-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.3rem 0.6rem;
  backdrop-filter: blur(8px);
}

.month-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  transition: var(--transition);
}

.month-nav-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: #fff;
  transform: scale(1.05);
}

.month-nav-current {
  font-weight: 700;
  font-size: 0.88rem;
  color: #fff;
  padding: 0 0.5rem;
  letter-spacing: 0.02em;
}

/* Executive Cash Flow Pulse Hero Card */
.cashflow-pulse-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.95) 0%, rgba(30, 27, 75, 0.45) 100%);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.cashflow-pulse-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #10b981 0%, #6366f1 50%, #f59e0b 100%);
}

.cashflow-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.cashflow-title-area h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.cashflow-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cashflow-health-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.cashflow-health-badge.surplus {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.15);
}

.cashflow-health-badge.deficit {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.15);
}

.cashflow-health-badge.neutral {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Inflow vs Outflow Visual Ratio Meter */
.cashflow-meter-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.meter-labels-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.meter-track {
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.meter-segment-in {
  background: linear-gradient(90deg, #059669, #10b981);
  height: 100%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.meter-segment-out {
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  height: 100%;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.meter-legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.65rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Pillars Grid inside Pulse Card */
.cashflow-pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.cashflow-pillar {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 1.1rem;
  transition: var(--transition);
}

.cashflow-pillar:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.cashflow-pillar.primary {
  border-left: 4px solid #10b981;
}

.cashflow-pillar.warning {
  border-left: 4px solid #f59e0b;
}

.cashflow-pillar.accent {
  border-left: 4px solid #6366f1;
}

.pillar-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pillar-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.pillar-details {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.pillar-breakdown-tags {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
}

/* WhatsApp Instant Action Button */
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #25D366;
  color: #0b141a !important;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  text-decoration: none;
  border: none;
  white-space: nowrap;
}

.btn-whatsapp:hover {
  background: #20bd5a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.45);
  color: #000 !important;
}

/* Receivables Aging Badges */
.aging-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
}

.aging-badge.overdue {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.aging-badge.today {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.aging-badge.upcoming {
  background: rgba(14, 165, 233, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

/* Profitability Margin Bar */
.margin-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.margin-fill {
  height: 100%;
  border-radius: 3px;
}

.margin-fill.high {
  background: #10b981;
}

.margin-fill.medium {
  background: #f59e0b;
}

.margin-fill.negative {
  background: #ef4444;
}


