:root[data-theme="light"] {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f6f8;
  --bg-input: #f0f2f5;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-text: #ffffff;
  --accent-hover: #1d4ed8;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #d97706;
  --warning-bg: #fef3c7;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #0891b2;
  --info-bg: #cffafe;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
}

:root[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-input: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --border: #334155;
  --accent: #3b82f6;
  --accent-text: #ffffff;
  --accent-hover: #60a5fa;
  --success: #22c55e;
  --success-bg: #14532d;
  --warning: #f59e0b;
  --warning-bg: #78350f;
  --danger: #ef4444;
  --danger-bg: #7f1d1d;
  --info: #22d3ee;
  --info-bg: #164e63;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.30);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.40);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.50);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  font-size: 16px;
  overflow-x: hidden;
  height: 100vh;
  width: 100vw;
}

html[lang="ar"] body,
html[dir="rtl"] body {
  font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

/* RTL pages (including mixed content) prefer Cairo when Arabic is active */
html[lang="ar"] input,
html[lang="ar"] textarea,
html[lang="ar"] button,
html[lang="ar"] select {
  font-family: inherit;
}

.screen {
  display: none;
  height: 100vh;
  width: 100vw;
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  overflow-y: auto;
  background-color: var(--bg-primary);
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* Login Screen */
#login-screen {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.login-container {
  width: 100%;
  max-width: 400px;
  background-color: var(--bg-primary);
  border-radius: 1.5rem;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-logo {
  max-width: 180px;
  height: auto;
  max-height: 80px;
  margin-bottom: 1.5rem;
  object-fit: contain;
}

.login-header h1 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn-primary {
  width: 100%;
  padding: 0.875rem;
  border-radius: 0.75rem;
  border: none;
  background-color: var(--accent);
  color: var(--accent-text);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

.btn-secondary {
  width: 100%;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 1rem;
  cursor: pointer;
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.875rem;
  cursor: pointer;
  text-decoration: none;
}

/* Utilities */
.content-padding {
  padding: 1rem;
}

.pb-20 {
  padding-bottom: 5rem; /* Space for bottom nav */
}

.hidden {
  display: none !important;
}

/* Form Elements */
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}

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

.login-footer {
  margin-top: 2rem;
  text-align: center;
}

/* App Shell */
#app-shell {
  padding-top: 60px; /* top nav height */
  padding-bottom: 70px; /* bottom nav height */
}

.top-nav {
  position: fixed;
  top: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 60px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 100;
  padding: 0 1rem;
}

.nav-content {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  flex: 1;
}

.nav-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.125rem;
  flex-shrink: 0;
}

.header-logo {
  height: 32px;
  width: auto;
  max-width: 100px;
  object-fit: contain;
  border-radius: 4px;
}

.top-nav h2 {
  font-size: 1.125rem;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-lang {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  min-width: 2.5rem;
  height: 2.25rem;
  padding: 0 0.45rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1;
}

.btn-lang:active {
  opacity: 0.85;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 70px;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  gap: 4px;
}

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

.nav-item.active {
  color: var(--accent);
}

.nav-icon-wrapper {
  position: relative;
  display: flex;
}

.nav-icon-wrapper .badge {
  position: absolute;
  top: -4px;
  inset-inline-end: -8px;
  background-color: var(--danger);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Dashboard */
#dashboard-view {
  padding: 1rem;
}

.greeting-card {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  padding: 1.5rem;
  border-radius: 1.25rem;
  color: white;
  margin-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.greeting-card::after {
  content: '';
  position: absolute;
  top: -20%;
  inset-inline-end: -10%;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  pointer-events: none;
}

/* Dashboard greeting: color by today status */
.greeting-card--status-present {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.greeting-card--status-absent {
  background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 100%);
}

.greeting-card--status-day_off {
  background: linear-gradient(135deg, #475569 0%, #334155 100%);
}

.greeting-card--status-on_leave {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
}

.greeting-card--status-holiday {
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
}

.greeting-card--status-not_checked_in {
  background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
}

.greeting-content h1 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.notification-body {
  font-size: 0.875rem;
  opacity: 0.9;
  line-height: 1.4;
}

/* ─── Tasks Placeholder Section ─── */
.tasks-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: calc(100vh - 150px);
  padding: 2rem;
  text-align: center;
}

.tasks-empty-state .empty-icon-wrapper {
  background-color: var(--bg-secondary);
  width: 80px;
  height: 80px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.tasks-empty-state .empty-icon {
  width: 40px;
  height: 40px;
  color: var(--text-tertiary);
}

.tasks-empty-state h2 {
  font-size: 1.25rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.tasks-empty-state p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 280px;
}

.tasks-list-portal {
  padding: 1rem;
  padding-bottom: 5rem;
  max-width: 40rem;
  margin: 0 auto;
  text-align: start;
}

.task-attention-banner {
  margin: 0 0.75rem 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: color-mix(in srgb, var(--warning) 18%, var(--bg-secondary));
  border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
  text-align: start;
}

.tasks-board-portal {
  display: flex;
  gap: 0.65rem;
  padding: 0.5rem 0.5rem 5rem;
  overflow-x: auto;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
}

.tasks-filter-tabs {
  margin: 0 0.75rem 0.5rem;
  flex-wrap: wrap;
}

.task-board-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem 0.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.task-board-tabs::-webkit-scrollbar {
  display: none;
}

.task-board-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}

.task-board-tab--active {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-secondary));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
}

.task-board-tab__count {
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  line-height: 1.1rem;
  text-align: center;
}

.task-board-tab--active .task-board-tab__count {
  background: var(--accent);
}

.task-card-status--overdue {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 14%, var(--bg-primary));
  border-color: color-mix(in srgb, var(--danger) 35%, transparent);
}

.task-card-shift {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.task-sheet-incomplete-penalty {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--danger);
  margin: 0.35rem 0 0;
}

.tasks-list-portal {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0 0.75rem calc(5rem + env(safe-area-inset-bottom, 0));
  max-width: 32rem;
  margin: 0 auto;
}

.tasks-list-portal__empty {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.875rem;
  padding: 2rem 1rem;
  margin: 0;
}

.task-column-portal {
  flex: 1 1 0;
  min-width: 9.5rem;
  max-width: 12rem;
}

.task-column-portal__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 0 0 0.5rem 0.25rem;
  text-align: start;
}

.task-column-portal__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-column-empty {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin: 0.5rem 0.25rem;
  text-align: start;
}

button.task-card-portal {
  display: block;
  width: 100%;
  text-align: start;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-secondary);
  padding: 0.75rem 0.65rem;
  margin: 0;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  font: inherit;
  color: inherit;
}

button.task-card-portal:active {
  transform: scale(0.98);
}

button.task-card-portal:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.task-card-portal__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
}

.task-card-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  word-break: break-word;
  text-align: start;
  flex: 1;
  min-width: 0;
}

.task-card-status {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  flex-shrink: 0;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-card-status--pending {
  color: var(--info);
  background: color-mix(in srgb, var(--info) 12%, var(--bg-primary));
}
.task-card-status--submitted {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 12%, var(--bg-primary));
}
.task-card-status--approved {
  color: var(--success);
  background: color-mix(in srgb, var(--success) 12%, var(--bg-primary));
}
.task-card-status--declined {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, var(--bg-primary));
}
.task-card-status--reverted {
  color: var(--warning);
  background: color-mix(in srgb, var(--warning) 18%, var(--bg-primary));
}

.task-card-portal__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  align-items: center;
  font-size: 0.7rem;
  text-align: start;
}

.task-card-due {
  color: var(--text-secondary);
}

.task-card-due--soon {
  color: var(--warning);
  font-weight: 600;
}

.task-card-due--overdue {
  color: var(--danger);
  font-weight: 700;
}

.task-card-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.task-card-badge--new {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

.task-card-portal__hint {
  margin-top: 0.4rem;
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-align: end;
}

.task-card-rec {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.task-card-reviewed {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  display: block;
}

.task-card-badge--series {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-primary));
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  font-weight: 600;
}

.task-card-portal--thread {
  border-inline-start: 3px solid var(--accent);
  padding-inline-start: calc(0.65rem - 3px + 0.15rem);
}

.portal-header-spacer {
  width: 40px;
  flex-shrink: 0;
}

.portal-header--tasks {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.portal-header-title {
  flex: 1;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
  min-width: 0;
}

.tasks-board-portal--kanban {
  display: flex;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem calc(5rem + env(safe-area-inset-bottom, 0));
  overflow-x: auto;
  align-items: flex-start;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.tasks-board-portal--kanban .task-column-portal {
  flex: 1 1 10.5rem;
  min-width: min(42vw, 11.5rem);
  max-width: 14rem;
}

.portal-cal-trigger {
  color: var(--accent);
}

/* Agenda calendar modal (portal) */
.portal-cal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1400;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.portal-cal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.portal-cal-panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  background: var(--bg-primary);
  border-radius: 18px 18px 0 0;
  border: 1px solid var(--border);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
  animation: task-sheet-in 0.2s ease-out;
}

.portal-cal-screen-title {
  margin: 0 0 0.5rem 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-align: start;
}

.portal-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.portal-cal-month {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  flex: 1;
}

.portal-cal-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0 0 0.65rem 0;
  text-align: start;
  line-height: 1.35;
}

.portal-cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.15rem;
  margin-bottom: 0.25rem;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-align: center;
}

.portal-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}

.portal-cal-cell--pad {
  min-height: 2.25rem;
}

.portal-cal-day {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  min-height: 2.35rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.portal-cal-day--today {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.portal-cal-day--mark {
  background: color-mix(in srgb, var(--accent) 16%, var(--bg-secondary));
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.portal-cal-day--blackout {
  opacity: 0.45;
  background: color-mix(in srgb, var(--text-tertiary) 12%, var(--bg-secondary));
}

.portal-cal-loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 1rem 0;
}

.portal-cal-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin: 0 0 0.5rem 0;
  text-align: start;
}

.portal-cal-detail {
  margin-top: 0.75rem;
  max-height: 10rem;
  overflow-y: auto;
  text-align: start;
}

.portal-cal-detail-title {
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.portal-cal-task-row {
  display: block;
  width: 100%;
  text-align: start;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.35rem;
  background: var(--bg-secondary);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.portal-cal-task-row--virtual {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.portal-cal-task-row-main {
  flex: 1;
  min-width: 0;
  text-align: start;
}

.portal-cal-task-expected {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
}

.task-card-portal--pulse {
  animation: task-card-pulse 1.1s ease-in-out 2;
}

@keyframes task-card-pulse {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  }
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

.portal-cal-close {
  margin-top: 0.75rem;
}

/* Dashboard tasks strip */
.dashboard-tasks-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dashboard-tasks-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dashboard-tasks-body {
  padding: 0.5rem 1rem 1rem;
}

.dashboard-tasks-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dashboard-task-row {
  margin-bottom: 0.35rem;
}

.dashboard-task-row__link {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.5rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.dashboard-task-row__link:active {
  transform: scale(0.99);
}

.dashboard-task-row__title {
  grid-column: 1;
  grid-row: 1;
  font-weight: 600;
  font-size: 0.875rem;
  text-align: start;
}

.dashboard-task-row__meta {
  grid-column: 1 / -1;
  grid-row: 2;
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-align: start;
}

.status-pill--task {
  grid-column: 2;
  grid-row: 1;
  font-size: 0.65rem;
  padding: 0.12rem 0.4rem;
}

.dashboard-tasks-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.65rem;
}

.dashboard-tasks-empty {
  text-align: center;
  padding: 0.75rem 0.5rem 1rem;
}

.dashboard-tasks-empty .dashboard-tasks-link {
  margin-top: 0.5rem;
  display: inline-flex;
}

/* Task detail sheet */
.task-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.task-sheet-root:not(.hidden) {
  pointer-events: auto;
}

.task-sheet-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.task-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(92vh, 640px);
  background: var(--bg-primary);
  border-radius: 16px 16px 0 0;
  border: 1px solid var(--border);
  border-bottom: none;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  animation: task-sheet-in 0.22s ease-out;
}

@keyframes task-sheet-in {
  from {
    transform: translateY(100%);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.task-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.task-sheet-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: start;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.task-sheet-close {
  flex-shrink: 0;
}

.task-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem 1rem;
  -webkit-overflow-scrolling: touch;
}

.task-sheet-footer {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  align-items: center;
  padding: 0.65rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0));
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.task-sheet-block {
  margin-bottom: 1rem;
  text-align: start;
}

.task-sheet-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.task-sheet-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0 0 0.35rem 0;
}

.task-sheet-desc {
  font-size: 0.875rem;
  color: var(--text-primary);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-sheet-manager {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warning) 50%, transparent);
  background: color-mix(in srgb, var(--warning) 10%, var(--bg-secondary));
}

.task-sheet-manager p {
  margin: 0;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.task-sheet-steps {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-sheet-step {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-primary);
  cursor: pointer;
}

.task-sheet-step input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.task-sheet-progress {
  margin-top: 0.5rem;
}

.task-sheet-progress__bar {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  overflow: hidden;
}

.task-sheet-progress__bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--success);
  max-width: 100%;
}

.task-sheet-progress__txt {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.task-sheet-warn {
  font-size: 0.8rem;
  color: var(--danger);
  margin: 0.35rem 0 0 0;
  text-align: start;
}

.task-sheet-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 10%, var(--bg-secondary));
  text-align: start;
}

.task-sheet-success {
  font-size: 0.8rem;
  color: var(--success);
  margin-bottom: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--success) 10%, var(--bg-secondary));
  text-align: start;
}

.task-sheet-note {
  width: 100%;
  min-height: 5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
  resize: vertical;
  margin-bottom: 0.5rem;
}

.task-sheet-proof-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.task-sheet-action-ico {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.task-sheet-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.task-sheet-action-btn:active {
  transform: scale(0.98);
}

.task-sheet-action-btn--accent {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 92%, #000), var(--accent));
  color: #fff;
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 35%, transparent);
}

.task-sheet-action-btn--outline {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border);
}

.task-sheet-action-btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.task-sheet-link-card {
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-secondary) 88%, var(--bg-primary));
}

.task-sheet-link-card-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.task-sheet-link-row-inner {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

@media (min-width: 400px) {
  .task-sheet-link-row-inner {
    flex-direction: row;
    align-items: stretch;
  }

  .task-sheet-link-row-inner .task-sheet-link-input {
    flex: 1;
    min-width: 0;
  }

  .task-sheet-link-row-inner .task-sheet-action-btn {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

.task-sheet-link-input {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font: inherit;
}

.task-sheet-note-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.35rem;
}

.task-sheet-att-name {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.task-sheet-att-link {
  flex: 1;
  min-width: 0;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.task-sheet-att-link:hover {
  text-decoration: underline;
}

.task-sheet-att-empty {
  list-style: none;
  padding: 0.5rem 0;
  font-size: 0.85rem;
}

.task-sheet-link-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.task-sheet-link-row input {
  width: 100%;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
}

.task-sheet-att-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}

.task-sheet-att {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.8rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border);
  word-break: break-word;
}

.task-sheet-att-del {
  flex-shrink: 0;
  font-size: 0.7rem;
  padding: 0.25rem 0.45rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--danger);
  cursor: pointer;
}

.task-sheet-file-btn {
  margin-top: 0.25rem;
}

.task-sheet-submit {
  min-width: 8rem;
}

/* Future task item CSS */
.task-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.task-status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.task-item[data-status="pending"] .task-status-dot {
  background-color: var(--warning);
}

.task-item[data-status="in_progress"] .task-status-dot {
  background-color: var(--info);
}

.task-item[data-status="completed"] .task-status-dot {
  background-color: var(--success);
}

.task-item[data-status="cancelled"] .task-status-dot {
  background-color: var(--danger);
}

.task-body {
  flex-grow: 1;
}

.task-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.task-action {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.25rem;
  cursor: pointer;
}

/* Dashboard greeting status — high contrast on colored gradient cards */
.greeting-card #status-badge {
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  padding: 0.5rem 0.85rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: 0;
  max-width: 46%;
  flex-shrink: 0;
  text-align: center;
}

.greeting-card #status-badge.status-not_checked_in {
  color: #9a3412;
}

.greeting-card #status-badge.status-present {
  color: #1e40af;
}

.greeting-card #status-badge.status-absent {
  color: #991b1b;
}

.greeting-card #status-badge.status-day_off {
  color: #334155;
}

.greeting-card #status-badge.status-on_leave {
  color: #0f766e;
}

.greeting-card #status-badge.status-holiday {
  color: #5b21b6;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.stat-item {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}

.stat-item--present .stat-value {
  color: #2563eb;
}

.stat-item--absent .stat-value {
  color: #b91c1c;
}

.stat-item--late .stat-value {
  color: #ca8a04;
}

.stat-item--early .stat-value {
  color: #9333ea;
}

.stat-item--worked .stat-value {
  color: #0d9488;
}

.stat-item--overtime .stat-value {
  color: #c2410c;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* General Card */
.card {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.view-all {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}

/* Leave List */
.leave-list {
  padding: 1rem;
}

.leave-item {
  margin-bottom: 1rem;
}

.leave-item:last-child {
  margin-bottom: 0;
}

.leave-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.progress-bar {
  height: 8px;
  background-color: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--accent);
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

/* Request List */
.request-list {
  padding: 0;
}

.request-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.request-item:last-child {
  border-bottom: none;
}

.request-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.request-type {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: capitalize;
}

.request-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.status-pill {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-weight: 600;
}

.status-pending { background: var(--warning-bg); color: var(--warning); }
.status-approved { background: var(--success-bg); color: var(--success); }
.status-rejected { background: var(--danger-bg); color: var(--danger); }
.status-pill.status-not_checked_in {
  background: var(--warning-bg);
  color: var(--warning);
}

/* Portal self attendance */
.portal-attendance-card .portal-attendance-body {
  padding: 0 1rem 1rem;
}

.portal-attendance-hint {
  margin: 0 0 0.75rem;
}

.portal-attendance-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.portal-attendance-btn {
  width: 100%;
  min-height: 44px;
}

.portal-attendance-btn--copy {
  font-size: 0.875rem;
}

/* App toggle — matches desktop Settings backup toggle */
.app-toggle {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 2.75rem;
  height: 1.5rem;
  border: none;
  border-radius: 9999px;
  padding: 0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.app-toggle::after {
  content: '';
  position: absolute;
  top: 0.25rem;
  inset-inline-start: 0.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: inset-inline-start 0.2s;
}

.app-toggle--on {
  background: #10b981;
}

.app-toggle--on::after {
  inset-inline-start: 1.5rem;
}

.app-toggle--off {
  background: #ef4444;
}

/* Quick Actions */
.quick-actions-grid {
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.action-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 1rem;
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.1s;
}

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

.action-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.action-icon svg {
  width: 20px;
  height: 20px;
}

.action-btn span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* Empty States */
.empty-state {
  padding: 2.5rem 1rem;
  text-align: center;
}

.empty-icon {
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.empty-icon svg {
  width: 48px;
  height: 48px;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 0.5rem;
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-greeting { height: 100px; margin-bottom: 1rem; border-radius: 1.25rem; }
.skeleton-stats { height: 80px; margin-bottom: 1rem; border-radius: 1rem; }
.skeleton-card { height: 150px; margin-bottom: 1rem; border-radius: 1.25rem; }

/* Errors */
.error-container {
  padding: 3rem 1.5rem;
  text-align: center;
}

.error-container p {
  color: var(--danger);
  margin-bottom: 1.5rem;
}

/* RTL Specific */
[dir="rtl"] .greeting-content {
  text-align: right;
}

[dir="rtl"] .card-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .leave-info {
  flex-direction: row-reverse;
}

[dir="rtl"] .request-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .request-info {
  align-items: flex-end;
}

/* Views and Headers */
.view {
  display: none;
  padding: 1rem;
}

.view.active {
  display: block;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.view-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Payslip Screen */
.payslip-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.payslip-item {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.1s;
}

.payslip-item:active {
  transform: scale(0.98);
}

.payslip-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.payslip-month {
  font-weight: 700;
  font-size: 1.125rem;
}

.payslip-net {
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
}

.payslip-item-action {
  color: var(--text-tertiary);
}

.payslip-item-action svg {
  width: 20px;
  height: 20px;
}

/* Side Panel (Slide-in) */
.side-panel {
  position: fixed;
  top: 0;
  inset-inline-end: -100%;
  width: 100%;
  height: 100%;
  background-color: var(--bg-primary);
  z-index: 1000;
  transition: inset-inline-end 0.3s ease;
  display: flex;
  flex-direction: column;
}

.side-panel.active {
  inset-inline-end: 0;
}

.panel-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  background-color: var(--bg-primary);
}

.panel-header h3 {
  flex: 1;
  font-size: 1.125rem;
}

.panel-actions {
  display: flex;
  gap: 0.5rem;
}

.panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* Payslip Card Template — Official Premium Style */
.payslip-card.official-style {
  background-color: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.company-logo-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.payslip-logo {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.payslip-logo-placeholder {
  width: 50px;
  height: 50px;
  background-color: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  border-radius: 0.5rem;
}

.company-details h2 {
  font-size: 1.125rem;
  color: var(--text-primary);
  margin: 0;
}

.company-details p {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
}

.payslip-title {
  text-align: end;
}

.payslip-title h1 {
  font-size: 1.25rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0;
}

.payroll-month {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.status-paid { background-color: var(--success-bg); color: var(--success); }
.status-approved { background-color: var(--info-bg); color: var(--info); }
.status-draft { background-color: var(--warning-bg); color: var(--warning); }

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

.info-card {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.75rem;
}

.info-card h4, .section-box h4, .table-section h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  padding: 0.25rem 0;
}

.info-row span:first-child { color: var(--text-secondary); }
.info-row span:last-child { font-weight: 600; color: var(--text-primary); }

.section-box {
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 0.75rem;
}

.attendance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.att-item {
  text-align: center;
  padding: 0.5rem;
  background-color: var(--bg-primary);
  border-radius: 0.5rem;
  border: 1px solid var(--border);
}

.att-item strong { display: block; font-size: 1.125rem; }
.att-item label { font-size: 0.625rem; text-transform: uppercase; color: var(--text-tertiary); }

.att-item.accent strong { color: var(--accent); }
.att-item.success strong { color: var(--success); }
.att-item.danger strong { color: var(--danger); }
.att-item.warning strong { color: var(--warning); }

.tables-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table td {
  padding: 0.5rem 0;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border);
}

.data-table .amt { text-align: end; font-weight: 600; }
.data-table .amt.ded { color: var(--danger); }
.data-table .total-row td {
  font-weight: 700;
  color: var(--text-primary);
  border-top: 2px solid var(--border);
  padding-top: 0.75rem;
}

.net-salary-footer {
  background: linear-gradient(135deg, var(--accent), #1e40af);
  color: white;
  padding: 1.25rem;
  border-radius: 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.net-salary-footer.negative {
  background: linear-gradient(135deg, var(--danger), #991b1b);
}

.net-label-group {
  display: flex;
  flex-direction: column;
}

.net-label {
  font-size: 1rem;
  font-weight: 700;
}

.carry-note {
  font-size: 0.7rem;
  opacity: 0.8;
}

.net-value {
  text-align: end;
}

[dir="rtl"] .net-value {
  text-align: start;
}

.currency-symbol {
  font-size: 0.875rem;
  font-weight: 600;
  margin-inline-end: 4px;
}

.amount-val {
  font-size: 1.75rem;
  font-weight: 800;
}

.signatures-box {
  display: flex;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
  gap: 2rem;
}

.sig-item {
  text-align: center;
  flex: 1;
}

.sig-line {
  width: 100%;
  height: 1px;
  background-color: var(--text-primary);
  margin-bottom: 0.5rem;
  opacity: 0.5;
}

.sig-label {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: 500;
}

.footer-note {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  text-align: center;
  padding-top: 1rem;
  font-style: italic;
}

/* Helpers */
.hidden {
  display: none !important;
}

.error-message {
  color: var(--danger);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background-color: var(--danger-bg);
  border-radius: 0.5rem;
}

/* RTL Support */
[dir="rtl"] .payslip-item-action svg {
  transform: rotate(180deg);
}

[dir="rtl"] .side-panel {
  inset-inline-end: -100%;
}

[dir="rtl"] .side-panel.active {
  inset-inline-end: 0;
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent-text);
  opacity: 0.3;
  border-radius: 50%;
  border-top-color: var(--accent-text);
  border-top-style: solid;
  opacity: 1; /* Reset opacity for top color */
  animation: spin 0.8s linear infinite;
}

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

/* Toasts */
#toast-container {
  position: fixed;
  bottom: 85px;
  inset-inline-start: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  pointer-events: none;
  z-index: 200;
}

.toast {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  box-shadow: var(--shadow-md);
  font-size: 0.875rem;
  animation: slideUp 0.3s ease-out;
  border: 1px solid var(--border);
}

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

/* Requests Screen */
.requests-container {
  padding: 0;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: 1.5rem;
  border: 1px solid var(--border);
  background-color: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab.active {
  background-color: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
}

.request-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.request-item:active {
  background-color: var(--bg-secondary);
}

.request-item:last-child {
  border-bottom: none;
}

.request-icon {
  width: 40px;
  height: 40px;
  background-color: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  flex-shrink: 0;
}

.request-icon svg {
  width: 20px;
  height: 20px;
}

.request-content {
  flex: 1;
  min-width: 0;
}

.request-type {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.request-date {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Bottom Sheet */
.bottom-sheet {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.bottom-sheet.active {
  pointer-events: auto;
}

.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

.bottom-sheet.active .bottom-sheet-backdrop {
  opacity: 1;
}

.bottom-sheet-content {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  background-color: var(--bg-primary);
  border-radius: 1.5rem 1.5rem 0 0;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.bottom-sheet.active .bottom-sheet-content {
  transform: translateY(0);
}

.bottom-sheet-header {
  padding: 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.bottom-sheet-header h3 {
  flex: 1;
  font-size: 1.125rem;
  font-weight: 700;
}

.bottom-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}

.bottom-sheet-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

/* Type Picker */
.type-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.type-picker-btn {
  padding: 1.25rem 1rem;
  border: 1px solid var(--border);
  background-color: var(--bg-secondary);
  border-radius: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.1s, background-color 0.2s;
}

.type-picker-btn:active {
  transform: scale(0.95);
  background-color: var(--bg-input);
}

.type-picker-btn.type-picker-btn-muted {
  opacity: 0.88;
  border-style: dashed;
}

.type-picker-btn svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

.type-picker-btn span {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
}

/* Request Form */
.request-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-field label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-field input,
.form-field select,
.form-field textarea {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background-color: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-field textarea {
  resize: vertical;
  min-height: 80px;
}

.duration-display {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Request Detail */
.request-detail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-status {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row span:first-child {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.detail-row span:last-child {
  font-size: 0.875rem;
  color: var(--text-primary);
  font-weight: 600;
  text-align: end;
}

.detail-notes {
  flex-direction: column;
  gap: 0.5rem;
}

.detail-notes span:last-child {
  text-align: start;
  font-weight: 400;
  color: var(--text-primary);
}

/* RTL Support for Requests */
[dir="rtl"] .request-item {
  flex-direction: row-reverse;
}

[dir="rtl"] .request-content {
  text-align: right;
}

[dir="rtl"] .detail-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .detail-row span:last-child {
  text-align: start;
}

[dir="rtl"] .type-picker-btn span {
  text-align: center;
}

/* Skeleton for Requests */
.skeleton-item {
  height: 72px;
  margin-bottom: 0;
  border-radius: 0;
}

/* Button Small */
.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
}

.btn-sm svg {
  width: 16px;
  height: 16px;
}

/* Notifications & Toasts */
.badge {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid var(--bg-primary);
    line-height: 1;
}

#notification-btn {
    position: relative;
}

#toast-container {
    position: fixed;
    top: env(safe-area-inset-top, 16px);
    inset-inline-start: 16px;
    inset-inline-end: 16px;
    z-index: 2000;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background-color: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: auto;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    animation: toast-enter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-exit {
    animation: toast-exit 0.3s ease forwards;
}

@keyframes toast-enter {
    from { opacity: 0; transform: translateY(-20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-exit {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(-20px) scale(0.9); }
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-info .toast-icon { background: var(--info-bg); color: var(--info); }
.notification-success .toast-icon { background: var(--success-bg); color: var(--success); }
.notification-error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.notification-warning .toast-icon { background: var(--warning-bg); color: var(--warning); }

.toast-icon svg {
    width: 20px;
    height: 20px;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    font-size: 0.9375rem;
    margin-bottom: 2px;
}

.toast-body {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

[dir="rtl"] .badge {
    inset-inline-end: auto;
    inset-inline-start: 4px;
}

/* Mobile-First Payslip Redesign */
.payslip-mobile-view {
  background-color: var(--bg-primary);
  padding: 1rem;
  min-height: 100%;
  font-family: inherit;
  color: var(--text-primary);
}

.payslip-header-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}

.pool-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-initials {
  font-weight: 700;
  color: var(--accent);
  font-size: 1.2rem;
}

.company-name-sm {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.document-type {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge-compact {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-badge-compact.status-paid { background: #dcfce7; color: #166534; }
.status-badge-compact.status-approved { background: #dbeafe; color: #1e40af; }
.status-badge-compact.status-draft { background: #fef3c7; color: #92400e; }
.status-badge-compact.status-pending { background: #f3f4f6; color: #374151; }

.payslip-period-title {
  margin-bottom: 1.5rem;
}

.payslip-period-title h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0;
  color: var(--text-primary);
}

.payslip-period-title p {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin: 0.25rem 0 0 0;
}

.info-card {
  background: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.card-header-sm {
  background: var(--bg-secondary);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border);
}

.card-body-rows {
  padding: 0.5rem 1rem;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--bg-secondary);
}

.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.detail-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.detail-value.highlight {
  color: var(--accent);
}

.section-title-sm {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.attendance-mobile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.att-stat-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.stat-val {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.att-stat-box.accent-absent .stat-val { color: var(--danger); }
.att-stat-box.accent-late .stat-val { color: var(--warning); }
.att-stat-box.accent-ot .stat-val { color: var(--success); }

.attendance-footnote {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin: -0.5rem 0 1rem;
  padding: 0 0.5rem;
}

.finance-label-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 68%;
}

.rtl .finance-label-stack {
  text-align: right;
  align-items: flex-end;
}

.finance-card {
  background: var(--bg-card);
  border-radius: 1rem;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
}

.finance-row {
  display: flex;
  justify-content: space-between;
  padding: 0.65rem 0;
  font-size: 0.85rem;
}

.sub-label {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  padding-inline-start: 0.5rem;
}

.amt {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.amt.neg { color: var(--danger); }

.finance-total-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0 0.25rem 0;
  margin-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-weight: 700;
  font-size: 0.9rem;
}

.net-salary-mobile {
  background: linear-gradient(135deg, var(--accent), #1e40af);
  color: white;
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.net-salary-mobile.negative {
  background: linear-gradient(135deg, var(--danger), #991b1b);
}

.net-label-stack {
  display: flex;
  flex-direction: column;
}

.net-main-label {
  font-size: 1rem;
  font-weight: 700;
}

.net-sub-label {
  font-size: 0.7rem;
  opacity: 0.8;
}

.net-amount-stack {
  text-align: end;
}

.rtl .net-amount-stack { text-align: start; }

.currency-label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-inline-end: 4px;
}

.amount-large {
  font-size: 1.75rem;
  font-weight: 800;
}

.mobile-footer-note {
  text-align: center;
  padding: 2rem 0;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Schedule week view */
.view-header.schedule-view-header {
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
  margin-bottom: 0.35rem;
  padding: 0 1rem;
}
.view-header.schedule-view-header h1 {
  margin-bottom: 0;
  text-align: center;
}
.schedule-week-dates {
  margin: 0;
  padding: 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.25;
}
.schedule-week-nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  max-width: 11rem;
  margin: 0.15rem auto 0;
}
.schedule-nav-btn--compact {
  min-width: 2rem;
  width: 2.75rem;
  max-width: 40%;
  padding: 0.2rem 0.35rem;
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}
.schedule-week-hint {
  margin: 0 1rem 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.3;
}
.schedule-footer.schedule-footer-before-list {
  padding: 0 1rem 0.5rem;
}
.schedule-day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
}
.schedule-day-meta {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
}
.schedule-dow {
  font-weight: 600;
  font-size: 0.78rem;
  line-height: 1.15;
}
.schedule-date {
  font-size: 0.65rem;
  color: var(--text-secondary);
  line-height: 1.1;
}
.schedule-day-shift {
  text-align: end;
  font-size: 0.75rem;
  flex-shrink: 0;
  max-width: 52%;
}
.schedule-off {
  color: var(--text-tertiary);
}
.schedule-times {
  font-variant-numeric: tabular-nums;
}
.schedule-week-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0 1rem;
}
.schedule-day-clickable {
  cursor: pointer;
  transition: background 0.15s;
}
.schedule-day-clickable:hover {
  background: var(--bg-primary, #fff);
  border-color: var(--accent, #2563eb);
}
.schedule-day-past {
  opacity: 0.45;
  cursor: default;
}
.schedule-edit-hint {
  font-size: 0.65rem;
  color: var(--accent, #3b82f6);
  margin-inline-start: auto;
  opacity: 0.7;
  flex-shrink: 0;
}
.schedule-footer {
  padding: 0 1rem 1rem;
}
.schedule-footer-dual {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.schedule-week-edit-btn {
  border-style: dashed;
}
.btn-block {
  width: 100%;
}
.btn-disabled {
  opacity: 0.5;
  pointer-events: none;
}
.schedule-edit-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.schedule-edit-row {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
}
.schedule-edit-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}
.schedule-edit-dow {
  font-weight: 600;
  font-size: 0.85rem;
}
.schedule-edit-times {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.schedule-edit-times input[type="time"] {
  flex: 1;
  min-width: 0;
}

/* RTL Support for Mobile View */
.rtl .brand-box { flex-direction: row-reverse; }
.rtl .brand-text { text-align: right; }
.rtl .detail-row { flex-direction: row-reverse; }
.rtl .finance-row { flex-direction: row-reverse; }
.rtl .finance-total-row { flex-direction: row-reverse; }
.rtl .net-salary-mobile { flex-direction: row-reverse; }

/* Admin Dashboard Specific */
.admin-dashboard-skeleton {
  padding: 1rem;
}

.settings-list {
  background: var(--bg-secondary);
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.settings-item {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.settings-item:last-child {
  border-bottom: none;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.setting-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ═══════════════════════════════════════════════════════════
   PROFILE SCREEN
   ═══════════════════════════════════════════════════════════ */

/* Icons */
.icon-sm {
  width: 16px;
  height: 16px;
}
.icon-md {
  width: 20px;
  height: 20px;
}

/* Skeleton */
.profile-skeleton-layout {
  padding: 0 1rem 1rem;
}

.profile-hero-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 1.25rem;
  padding: 2rem 1rem 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

/* Hero Card */
.profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1.5rem 1.75rem;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(145deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border-top: 3px solid var(--accent);
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  inset-inline-end: 0;
  height: 60px;
  background: linear-gradient(135deg, hsla(220, 80%, 55%, 0.08) 0%, hsla(260, 70%, 55%, 0.08) 100%);
  pointer-events: none;
}

.profile-avatar {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), hsl(260, 70%, 55%));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  margin-bottom: 0.875rem;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.profile-hero-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.profile-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.profile-dept-pill {
  display: inline-flex;
  align-items: center;
  background: hsla(220, 80%, 55%, 0.12);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  border: 1px solid hsla(220, 80%, 55%, 0.2);
}

.profile-hero-since {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.profile-hero-id {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  margin-top: 0.125rem;
}

/* Info Cards */
.profile-info-card {
  margin-bottom: 1rem;
  padding: 1.25rem;
}

.profile-section-header {
  display: flex;
  align-items: center;
  justify-content: center; /* Symmetric: Centered header */
  gap: 0.625rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.profile-section-header h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.profile-section-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
}

/* Info Row */
.profile-info-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-row__label {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-weight: 500;
  flex-shrink: 0;
  width: 45%; /* Symmetric: Fixed label width for alignment */
  text-align: start;
}

.info-row__value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: end;
  word-break: break-word;
  flex: 1;
}

.info-row__value:empty::before {
  content: '—';
  color: var(--text-tertiary);
  font-weight: 400;
}

.profile-salary-value {
  color: var(--success);
  font-variant-numeric: tabular-nums;
}

/* Edit Card */
.profile-edit-card {
  margin-bottom: 2rem;
  border-top: 3px solid var(--accent);
  padding: 1.25rem;
}

.profile-subsection-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border);
  text-align: center; /* Symmetric: Centered subsection label */
  display: block;
  width: 100%;
}

/* Input with icon */
.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon .input-icon {
  position: absolute;
  inset-inline-start: 1rem;
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  pointer-events: none;
  flex-shrink: 0;
}

.form-control.has-icon {
  padding-inline-start: 2.75rem;
}

/* Form label & hint */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  text-align: center; /* Symmetric: Centered form labels */
}

.form-hint {
  display: block;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  line-height: 1.4;
  text-align: center;
}

.form-hint--error {
  color: var(--danger);
}

/* Button override */
#profile-submit-btn {
  height: 3.5rem;
  font-size: 1.1rem;
  margin-top: 1.5rem;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* RTL adjustments */
[dir="rtl"] .info-row {
  flex-direction: row; /* Keep as row, but swap alignment if needed */
}

[dir="rtl"] .info-row__label {
  text-align: right;
}

[dir="rtl"] .info-row__value {
  text-align: right;
}

[dir="rtl"] .profile-section-header {
  flex-direction: row; /* Symmetric centering works same */
}

[dir="rtl"] .profile-hero-meta {
  flex-direction: row;
}

/* Avatar Photo Styles */
.profile-avatar-container {
  position: relative;
  width: 76px;
  height: 76px;
  margin: 0 auto 0.875rem;
}

.profile-avatar-img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  object-cover: cover;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  position: relative;
  z-index: 1;
}

.btn-avatar-edit {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: var(--shadow-md);
  padding: 6px;
}

.btn-avatar-edit svg {
  width: 100%;
  height: 100%;
}

.btn-avatar-edit:active {
  transform: scale(0.9);
}

[dir="rtl"] .btn-avatar-edit {
  right: auto;
  left: -4px;
}

/* Chart Containers */
.chart-container {
    position: relative;
    width: 100%;
    min-height: 200px;
    margin-bottom: 1rem;
    display: block;
}

canvas {
    max-width: 100%;
}
