/* =========================================================
   TRIB Portal - Design aligned with tribgames.com
   ========================================================= */

/* ---------- CSS Variables ---------- */
:root {
  --color-bg: #f6f7fb;
  --color-bg-secondary: #ffffff;
  --color-bg-tertiary: #eef2f7;
  --color-white: #ffffff;
  --color-text: #0f172a;
  --color-text-muted: rgba(15, 23, 42, 0.72);
  --color-text-subtle: rgba(15, 23, 42, 0.48);

  --color-accent: #f59e0b;
  --color-accent-light: #fbbf24;
  --color-accent-glow: rgba(245, 158, 11, 0.25);
  --color-secondary: #0ea5e9;
  --color-secondary-hover: #0284c7;
  --color-secondary-light: rgba(14, 165, 233, 0.08);

  --color-success: #22c55e;
  --color-danger: #ef4444;
  --color-warning: #f97316;
  --color-purple: #a855f7;
  --color-pink: #ec4899;

  --color-border: rgba(15, 23, 42, 0.08);
  --color-border-light: rgba(15, 23, 42, 0.05);

  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-border: 1px solid rgba(15, 23, 42, 0.06);
  --glass-blur: blur(16px);

  --shadow-xs: 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 12px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.12);

  --sidebar-width: 260px;
  --bottom-nav-height: 68px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --content-max-width: 960px;
}

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

html {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; }

/* Tabular nums for numeric content */
.tnum,
.record-value,
.leave-remaining,
.leave-summary-number,
.summary-value,
.week-total-value,
.week-card-time,
.week-card-hours,
.month-label,
.cal-pill,
.info-value {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.14); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.24); }

/* ---------- Login Page ---------- */
.page-login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(900px circle at 18% 30%, rgba(245, 158, 11, 0.08) 0%, transparent 62%),
    radial-gradient(900px circle at 82% 68%, rgba(14, 165, 233, 0.06) 0%, transparent 58%),
    radial-gradient(circle at top, #ffffff 0%, #f6f7fb 55%, #eef2f7 100%);
}

.login-wrapper {
  width: 100%;
  max-width: 420px;
  padding: 24px;
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  box-shadow: var(--shadow-md);
}

.login-logo-img {
  display: block;
  height: 32px;
  width: auto;
  margin: 0 auto 10px;
}

.login-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--color-text);
  text-align: center;
  margin-bottom: 28px;
}

.login-options {
  display: flex;
  gap: 16px;
  margin: 4px 0 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--color-secondary);
}

#login-form .btn-primary {
  margin-top: 24px;
}

.login-subtitle {
  color: var(--color-text-muted);
  text-align: center;
  margin-bottom: 32px;
  font-size: 14px;
}

.login-footer {
  color: var(--color-text-subtle);
  text-align: center;
  margin-top: 24px;
  font-size: 13px;
}

/* ---------- Forms ---------- */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: 7px;
  letter-spacing: -0.01em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px var(--color-secondary-light);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(15, 23, 42, 0.32);
}

.form-group textarea { resize: vertical; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s var(--ease-out);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0);
  transition: background 0.2s;
}

.btn:active::after {
  background: rgba(0, 0, 0, 0.06);
}

.btn-primary {
  background: var(--color-secondary);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}
.btn-primary:hover {
  background: var(--color-secondary-hover);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.btn-secondary {
  background: rgba(15, 23, 42, 0.05);
  color: var(--color-text);
}
.btn-secondary:hover { background: rgba(15, 23, 42, 0.09); }

.btn-danger {
  background: var(--color-danger);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-danger:hover {
  background: #dc2626;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}
.btn-danger:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--color-text-muted);
}
.btn-ghost:hover { background: rgba(15, 23, 42, 0.05); color: var(--color-text); }

.btn-icon {
  padding: 8px;
  border-radius: var(--radius);
  color: var(--color-text-muted);
}
.btn-icon:hover { background: rgba(15, 23, 42, 0.05); color: var(--color-text); }
.btn-icon::after { display: none; }

.btn-full { width: 100%; }
.btn-lg { padding: 16px 32px; font-size: 15px; border-radius: 14px; }
.btn-sm { width: 28px; height: 28px; padding: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; border-radius: 6px; border: 1px solid var(--color-border); background: white; cursor: pointer; }
.btn-sm:hover { background: var(--color-bg); }

.btn-checkin {
  background: #0ea5e9;
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}
.btn-checkin:hover {
  background: #0284c7;
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
  transform: translateY(-1px);
}
.btn-checkin:active { transform: translateY(0); }

.btn-checkout {
  background: #ef4444;
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}
.btn-checkout:hover {
  background: #dc2626;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}
.btn-checkout:active { transform: translateY(0); }

.btn-filter {
  background: rgba(15, 23, 42, 0.04);
  color: var(--color-text-muted);
  border-radius: 20px;
  padding: 7px 16px;
  width: auto;
  height: auto;
  font-size: 13px;
  border: none;
  transition: all 0.2s var(--ease-out);
}
.btn-filter:hover {
  background: rgba(15, 23, 42, 0.08);
}
.btn-filter.active {
  background: var(--color-secondary);
  color: var(--color-white);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}
.btn-filter::after { display: none; }

.btn-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* ---------- Spinner ---------- */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: var(--color-white);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ---------- App Shell ---------- */
#app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 20px;
}

.sidebar-logo-img {
  height: 28px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.sidebar-logo-link:hover .sidebar-logo-img {
  opacity: 1;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: 2px;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px 20px;
  margin: 0 0 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12), rgba(14, 165, 233, 0.06));
  color: var(--color-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  border: 1.5px solid rgba(14, 165, 233, 0.15);
}

.sidebar-user-info { overflow: hidden; }

.sidebar-user-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.sidebar-user-email {
  font-size: 12px;
  color: var(--color-text-subtle);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
  line-height: 1.3;
}

.sidebar-menu {
  list-style: none;
  padding: 4px 12px;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--color-text-muted);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  transition: all 0.15s ease;
  margin-bottom: 2px;
  position: relative;
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.sidebar-link:hover {
  background: rgba(15, 23, 42, 0.045);
  color: var(--color-text);
}

.sidebar-link:hover svg {
  opacity: 1;
}

.sidebar-link.active {
  background: rgba(14, 165, 233, 0.07);
  color: var(--color-secondary);
  font-weight: 700;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--color-secondary);
  border-radius: 0 3px 3px 0;
}

.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 12px 20px;
  border-top: 1px solid rgba(15, 23, 42, 0.05);
}

.sidebar-footer .btn-ghost {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-subtle);
  padding: 10px 14px;
  border-radius: 10px;
  gap: 10px;
  justify-content: flex-start;
  transition: all 0.15s ease;
}

.sidebar-footer .btn-ghost:hover {
  background: rgba(239, 68, 68, 0.05);
  color: var(--color-danger);
}

.sidebar-footer .btn-ghost svg {
  width: 18px;
  height: 18px;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.sidebar-footer .btn-ghost:hover svg {
  opacity: 1;
}

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: 36px 44px 48px;
  min-height: 100vh;
  max-width: calc(var(--content-max-width) + var(--sidebar-width) + 88px);
  background:
    radial-gradient(800px circle at 10% 10%, rgba(245, 158, 11, 0.03) 0%, transparent 60%),
    radial-gradient(600px circle at 90% 80%, rgba(14, 165, 233, 0.03) 0%, transparent 50%),
    var(--color-bg);
}

/* ---------- Bottom Nav ---------- */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: var(--glass-border);
  z-index: 100;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--color-text-subtle);
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s;
}

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

.bottom-nav-item.active {
  color: var(--color-secondary);
  font-weight: 600;
}

/* ---------- Page Header ---------- */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-title {
  font-size: 26px;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.page-date {
  font-size: 14px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ---------- Cards (Glassmorphism) ---------- */
.card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  transition: box-shadow 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.01em;
}

.card-title-sub {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-subtle);
  letter-spacing: 0;
}

.card-title-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.card-title-nav .card-title {
  margin-bottom: 0;
}
.card-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.card-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: var(--color-accent);
  border-radius: 3px;
  flex-shrink: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 0;
}

/* ---------- Dashboard: Quick Actions ---------- */
.action-buttons {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
}

.action-buttons .btn { flex: 1; }

.my-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.025);
  border-radius: var(--radius);
  font-size: 14px;
}

.status-label { color: var(--color-text-muted); }

.status-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(15, 23, 42, 0.05);
  color: var(--color-text-muted);
}

.status-badge.checkin { background: rgba(34, 197, 94, 0.1); color: #15803d; }
.status-badge.checkout { background: rgba(15, 23, 42, 0.05); color: var(--color-text-muted); }
.status-badge.annual { background: rgba(239, 68, 68, 0.08); color: #b91c1c; }
.status-badge.half { background: rgba(249, 115, 22, 0.08); color: #c2410c; }
.status-badge.remote { background: rgba(168, 85, 247, 0.08); color: #7c3aed; }
.status-badge.sick { background: rgba(236, 72, 153, 0.08); color: #be185d; }

/* ---------- Attendance Status Badge ---------- */
.attendance-status {
  margin-bottom: 0;
  display: flex;
  align-items: center;
}

.att-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  vertical-align: middle;
}

.att-status-badge.before { background: #f3f4f6; color: #6b7280; }
.att-status-badge.working { background: #dcfce7; color: #16a34a; }
.att-status-badge.done { background: #dbeafe; color: #2563eb; }

/* Pulse animation for working state */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
.att-status-badge.working { animation: pulse 2s infinite; }

/* Disabled button style for checkin/checkout */
.btn-checkin:disabled, .btn-checkout:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn-checkin:disabled:hover, .btn-checkout:disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* ---------- Dashboard: Leave Circle ---------- */
.leave-circle-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.leave-circle {
  position: relative;
  width: 120px;
  height: 120px;
}

.leave-circle svg { width: 100%; height: 100%; }

.leave-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.leave-remaining {
  font-size: 28px;
  font-weight: 800;
  color: var(--color-secondary);
  line-height: 1;
}

.leave-unit {
  font-size: 12px;
  color: var(--color-text-subtle);
  margin-top: 4px;
}

.leave-detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 4px;
  font-size: 14px;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-border-light);
}

.leave-detail-row span:last-child {
  font-weight: 600;
  color: var(--color-text);
}

/* ---------- Dashboard: Today Record ---------- */
.today-record {
  border-top: 1px solid var(--color-border-light);
  padding-top: 16px;
  margin-top: 6px;
}

.today-record-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  font-size: 14px;
}

.today-record-row .record-label {
  color: var(--color-text-muted);
  font-size: 13px;
}

.today-record-row .record-value {
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.today-record-row.today-record-total {
  border-top: 1px solid var(--color-border-light);
  margin-top: 6px;
  padding-top: 12px;
}

.today-record-row.today-record-total .record-label {
  font-weight: 700;
  color: var(--color-text);
}

.today-record-row.today-record-total .record-value {
  font-weight: 800;
  font-size: 15px;
  color: var(--color-secondary);
}

/* ---------- Dashboard: Week Cards ---------- */
.week-cards {
  display: flex;
  gap: 8px;
}

.week-card {
  flex: 1;
  min-width: 0;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.week-card:hover {
  box-shadow: var(--shadow-xs);
}

.week-card.today {
  border-color: var(--color-secondary);
  background: var(--color-secondary-light);
  box-shadow: 0 0 0 1px var(--color-secondary);
}

.week-card.weekend {
  background: var(--color-bg);
  opacity: 0.7;
}

.week-card-header {
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border-light);
}

.week-card-day {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text);
}

.week-card.today .week-card-day {
  color: var(--color-secondary);
}

.week-card.weekend .week-card-day {
  color: var(--color-text-subtle);
}

.week-card-date {
  display: block;
  font-size: 11px;
  color: var(--color-text-subtle);
  margin-top: 2px;
}

.week-card-time {
  font-size: 12px;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
}

.week-card-time .wc-label {
  font-size: 10px;
  color: var(--color-text-subtle);
  margin-right: 2px;
}

.week-card-time.late {
  color: var(--color-danger);
  font-weight: 600;
}

.week-card-hours {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-secondary);
  margin-top: 4px;
}

.week-card-status {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 8px 0;
}

.week-card-status.weekend-label {
  color: var(--color-text-subtle);
}

.week-card-empty {
  font-size: 13px;
  color: var(--color-text-subtle);
  padding: 8px 0;
}

.week-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.025);
  border-radius: var(--radius);
  font-size: 14px;
}

.week-total .week-total-label {
  color: var(--color-text-muted);
  font-weight: 600;
}

.week-total .week-total-value {
  font-weight: 800;
  color: var(--color-secondary);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Dashboard: Monthly Summary ---------- */
.monthly-summary-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.monthly-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 8px;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 14px;
  transition: background 0.15s ease;
}

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

.monthly-summary-row:hover {
  background: rgba(15, 23, 42, 0.02);
}

.monthly-summary-row .summary-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

.monthly-summary-row .summary-value {
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.monthly-summary-row .summary-value.highlight {
  color: var(--color-secondary);
}

.monthly-summary-row .summary-value.danger {
  color: var(--color-danger);
}

/* ---------- Dashboard: Employee Attendance ---------- */
.employee-attendance-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.employee-attendance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  transition: background 0.2s, transform 0.2s var(--ease-out);
}

.employee-attendance-row:hover {
  background: rgba(15, 23, 42, 0.045);
  transform: translateX(2px);
}

.employee-attendance-row .name {
  font-weight: 600;
  font-size: 14px;
}

.employee-attendance-row .time {
  font-size: 13px;
  color: var(--color-text-subtle);
  font-variant-numeric: tabular-nums;
}

/* ---------- Dashboard: Week Schedule (legacy, kept for compat) ---------- */
.week-schedule {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.week-day-card {
  padding: 14px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  text-align: center;
  font-size: 13px;
  transition: all 0.2s var(--ease-out);
}

.week-day-card:hover {
  background: rgba(15, 23, 42, 0.045);
}

.week-day-card.today {
  background: var(--color-secondary-light);
  border: 2px solid var(--color-secondary);
}

.week-day-label {
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.week-day-date {
  color: var(--color-text-subtle);
  font-size: 12px;
  margin-bottom: 8px;
}

.week-day-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}

/* ---------- Calendar ---------- */
.calendar-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.month-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  min-width: 120px;
  text-align: center;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.calendar-header {
  padding: 10px 4px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-subtle);
}

.calendar-header.sun { color: var(--color-danger); }
.calendar-header.sat { color: var(--color-secondary); }

.calendar-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s var(--ease-out);
  font-size: 14px;
  position: relative;
  min-height: 90px;
  gap: 4px;
  overflow: hidden;
}

.calendar-cell:hover {
  background: rgba(15, 23, 42, 0.04);
  transform: scale(1.03);
}
.calendar-cell.empty { cursor: default; }
.calendar-cell.empty:hover { background: transparent; transform: none; }
.calendar-cell.today {
  border: 2px solid var(--color-secondary);
  font-weight: 700;
  background: var(--color-secondary-light);
}

.calendar-cell .day-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1;
}

.calendar-cell.holiday .day-number { color: var(--color-danger); }
.calendar-cell.sat .day-number { color: var(--color-secondary); }

/* Calendar pill badges */
.cal-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.4;
  margin-top: 4px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.cal-pill.checkin { background: rgba(34, 197, 94, 0.12); color: #15803d; }
.cal-pill.checkin.late { background: rgba(239, 68, 68, 0.08); color: #dc2626; border: 1px solid rgba(239, 68, 68, 0.3); }
.cal-pill.annual { background: rgba(239, 68, 68, 0.1); color: #b91c1c; }
.cal-pill.half { background: rgba(249, 115, 22, 0.1); color: #c2410c; }
.cal-pill.remote { background: rgba(168, 85, 247, 0.1); color: #7c3aed; }
.cal-pill.sick { background: rgba(236, 72, 153, 0.1); color: #be185d; }

/* Calendar work detail (checkin days) */
.cal-work-time {
  font-size: 8px;
  color: var(--color-text-muted);
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
}

.cal-work-hours {
  font-size: 8px;
  font-weight: 600;
  color: var(--color-secondary);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.cal-late {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 6px;
  font-size: 7px;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  line-height: 1.3;
  white-space: nowrap;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s var(--ease-out);
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-body {
  padding: 24px 28px 28px;
}

.modal-detail-item {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 14px;
}

.modal-detail-item:last-child { border-bottom: none; }
.modal-detail-item .label { color: var(--color-text-muted); }
.modal-detail-item .value { font-weight: 600; color: var(--color-text); }

/* ---------- Leave History ---------- */
.leave-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leave-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  gap: 16px;
  transition: background 0.2s, transform 0.2s var(--ease-out);
}

.leave-history-item:hover {
  background: rgba(15, 23, 42, 0.045);
  transform: translateX(2px);
}

.leave-history-item .leave-info { flex: 1; min-width: 0; }

.leave-history-item .leave-type {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
}

.leave-history-item .leave-dates {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

.leave-history-item .leave-memo {
  font-size: 12px;
  color: var(--color-text-subtle);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leave-status {
  padding: 5px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.leave-status.pending { background: rgba(245, 158, 11, 0.1); color: #b45309; }
.leave-status.approved { background: rgba(34, 197, 94, 0.1); color: #15803d; }
.leave-status.rejected { background: rgba(239, 68, 68, 0.08); color: #b91c1c; }
.leave-status.cancelled { background: rgba(15, 23, 42, 0.06); color: #6b7280; text-decoration: line-through; }

/* Leave actions (status + cancel button) */
.leave-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-leave-cancel {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.08);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-leave-cancel:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Leave type badge */
.leave-type-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.leave-type-badge.annual { background: rgba(239, 68, 68, 0.08); color: #b91c1c; }
.leave-type-badge.half-am,
.leave-type-badge.half-pm { background: rgba(249, 115, 22, 0.08); color: #c2410c; }
.leave-type-badge.sick { background: rgba(236, 72, 153, 0.08); color: #be185d; }
.leave-type-badge.family { background: rgba(168, 85, 247, 0.08); color: #7c3aed; }
.leave-type-badge.maternity,
.leave-type-badge.parental,
.leave-type-badge.spouse-birth { background: rgba(14, 165, 233, 0.08); color: #0369a1; }
.leave-type-badge.reserve { background: rgba(34, 197, 94, 0.08); color: #15803d; }
.leave-type-badge.unpaid { background: rgba(15, 23, 42, 0.06); color: #4b5563; }

/* ---------- My Info ---------- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.info-item {
  padding: 18px 20px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  transition: background 0.2s;
}

.info-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.info-label {
  display: block;
  font-size: 12px;
  color: var(--color-text-subtle);
  margin-bottom: 6px;
  font-weight: 500;
}

.info-value {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.leave-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.leave-summary-item {
  text-align: center;
  padding: 24px 16px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  transition: background 0.2s;
}

.leave-summary-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.leave-summary-number {
  font-size: 32px;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.leave-summary-number.used { color: var(--color-danger); }
.leave-summary-number.remaining { color: var(--color-secondary); }

.leave-summary-label {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 10px;
  font-weight: 500;
}

/* ---------- Rules ---------- */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  display: flex;
  gap: 16px;
  padding: 16px 18px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  transition: background 0.2s;
}

.rule-item:hover {
  background: rgba(15, 23, 42, 0.04);
}

.rule-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.rule-text strong {
  display: block;
  font-size: 14px;
  color: var(--color-text);
  margin-bottom: 3px;
}

.rule-text p {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ---------- Admin ---------- */
.admin-filter {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.table-wrapper {
  overflow-x: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 2px;
  font-size: 14px;
}

.data-table th {
  text-align: left;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.025);
  color: var(--color-text-muted);
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-border);
}

.data-table th:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.data-table th:last-child { border-radius: 0 var(--radius) var(--radius) 0; }

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text);
}

.data-table td:last-child {
  width: 1%;
  white-space: nowrap;
}

.data-table tbody tr {
  transition: background 0.15s ease;
}

.data-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.025);
}

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

.table-empty {
  text-align: center;
  color: var(--color-text-subtle);
  padding: 40px 24px !important;
  font-size: 14px;
}

.admin-actions {
  display: flex;
  gap: 8px;
}
.admin-actions .btn-sm {
  width: auto;
  height: auto;
  padding: 7px 14px;
  font-size: 13px;
  border-radius: 10px;
  border: none;
}

/* ---------- Toast ---------- */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--color-text);
  color: var(--color-white);
  padding: 14px 22px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s var(--ease-out), toastOut 0.3s ease forwards;
  animation-delay: 0s, 2.7s;
  max-width: 380px;
  backdrop-filter: blur(8px);
  line-height: 1.5;
}

.toast.success { background: #166534; }
.toast.error { background: #991b1b; }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ---------- Loading & Empty States ---------- */
.loading-placeholder {
  text-align: center;
  color: var(--color-text-subtle);
  padding: 48px 24px;
  font-size: 14px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.empty-state {
  text-align: center;
  color: var(--color-text-subtle);
  padding: 48px 24px;
  font-size: 14px;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.empty-state::before {
  content: '';
  display: block;
  width: 48px;
  height: 48px;
  background: rgba(15, 23, 42, 0.04);
  border-radius: 50%;
  margin-bottom: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(15,23,42,0.2)' stroke-width='1.5'%3E%3Cpath d='M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpolyline points='13 2 13 9 20 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px;
}

/* ---------- SVG stroke color override for leave circle ---------- */
.leave-circle svg circle:first-child {
  stroke: var(--color-border);
}

.leave-circle svg circle:last-of-type {
  stroke: var(--color-secondary);
  transition: stroke-dashoffset 0.6s var(--ease-out);
}

/* ---------- Responsive: Tablet ---------- */
@media (max-width: 960px) {
  .main-content {
    padding: 28px 28px 36px;
  }
}

/* ---------- Responsive: Mobile ---------- */
@media (max-width: 768px) {
  .sidebar { display: none; }

  .bottom-nav { display: flex; }

  .main-content {
    margin-left: 0;
    padding: 20px 18px calc(var(--bottom-nav-height) + 20px);
  }

  .card {
    padding: 22px;
    margin-bottom: 18px;
    border-radius: var(--radius-lg);
  }

  .card-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .card-title {
    font-size: 15px;
    margin-bottom: 16px;
  }

  .page-header {
    margin-bottom: 22px;
  }

  .page-title { font-size: 22px; }

  .week-schedule {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .week-day-card {
    padding: 10px 6px;
    font-size: 12px;
  }

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

  .info-item {
    padding: 16px;
  }

  .leave-summary-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .leave-summary-item {
    padding: 18px 12px;
  }

  .leave-summary-number { font-size: 26px; }

  .form-row { grid-template-columns: 1fr; }

  .calendar-cell { min-height: 70px; padding: 6px 3px 5px; }
  .calendar-cell .day-number { font-size: 12px; }
  .cal-pill { font-size: 8px; margin-top: 3px; padding: 1px 5px; }
  .cal-work-time { font-size: 7px; }
  .cal-work-hours { font-size: 7px; }
  .cal-late { font-size: 6px; padding: 1px 3px; }

  .data-table { font-size: 13px; }
  .data-table th { padding: 10px 12px; }
  .data-table td { padding: 12px; }

  .admin-actions { flex-direction: column; gap: 6px; }
  .admin-actions .btn { font-size: 12px; padding: 6px 10px; }

  .modal {
    border-radius: var(--radius-lg);
  }

  .modal-header { padding: 20px 22px 0; }
  .modal-body { padding: 20px 22px 24px; }

  #toast-container {
    top: auto;
    bottom: calc(var(--bottom-nav-height) + 14px);
    right: 14px;
    left: 14px;
  }

  .toast { max-width: 100%; }

  .leave-history-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    gap: 10px;
  }

  .leave-actions {
    align-self: flex-end;
  }

  .employee-attendance-row {
    padding: 12px 14px;
  }

  .rule-item {
    padding: 14px;
    gap: 12px;
  }

  .empty-state {
    padding: 36px 20px;
  }

  .empty-state::before {
    width: 40px;
    height: 40px;
    background-size: 18px;
  }

  .week-cards {
    gap: 5px;
  }
  .week-card {
    padding: 10px 4px;
    border-radius: 8px;
  }
  .week-card-day { font-size: 12px; }
  .week-card-date { font-size: 10px; }
  .week-card-time { font-size: 11px; }
  .week-card-time .wc-label { font-size: 9px; }
  .week-card-hours { font-size: 10px; }
  .week-card-status { font-size: 11px; }

  .week-total {
    padding: 12px 14px;
    font-size: 13px;
  }

  .monthly-summary-row {
    padding: 11px 4px;
    font-size: 13px;
  }

  .today-record-row {
    padding: 7px 2px;
  }
}

@media (max-width: 480px) {
  .main-content {
    padding: 16px 14px calc(var(--bottom-nav-height) + 16px);
  }

  .card {
    padding: 18px;
    margin-bottom: 14px;
  }

  .action-buttons { flex-direction: column; gap: 10px; }

  .month-nav { gap: 8px; }
  .month-label { font-size: 14px; min-width: 100px; }

  .page-title { font-size: 20px; }
  .page-header { margin-bottom: 18px; }

  .leave-summary-number { font-size: 22px; }
  .leave-summary-item { padding: 16px 10px; }

  .calendar-cell { min-height: 56px; padding: 5px 2px 4px; }
  .calendar { gap: 3px; }
  .cal-pill { font-size: 7px; margin-top: 2px; padding: 1px 4px; border-radius: 6px; }
  .cal-work-time { font-size: 6.5px; }
  .cal-work-hours { font-size: 6.5px; }
  .cal-late { font-size: 6px; padding: 0px 3px; }

  .week-cards { gap: 4px; }
  .week-card { padding: 8px 3px; }
  .week-card-header { margin-bottom: 5px; padding-bottom: 4px; }
  .week-card-day { font-size: 11px; }
  .week-card-date { font-size: 9px; }
  .week-card-time { font-size: 10px; line-height: 1.5; }
  .week-card-time .wc-label { display: none; }
  .week-card-hours { font-size: 9px; }
  .week-card-status { font-size: 10px; padding: 4px 0; }
  .week-card-empty { font-size: 11px; }
}

/* ---------- Day Detail Modal ---------- */
#day-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#day-detail-modal > .modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

#day-detail-modal > .modal-content {
  position: relative;
  z-index: 1;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: rgba(0,0,0,0.15) transparent;
}

#day-detail-modal > .modal-content::-webkit-scrollbar {
  width: 4px;
}
#day-detail-modal > .modal-content::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 4px;
}

#day-detail-modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 0;
}

#day-detail-modal .modal-header h3 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

#day-detail-modal .modal-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 22px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}

#day-detail-modal .modal-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--color-text);
}

#day-detail-modal .modal-body {
  padding: 24px 32px 8px;
}

#day-detail-modal .modal-footer {
  padding: 16px 32px 28px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
}

/* Detail info rows inside modal */
#day-detail-info .modal-detail-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--color-border-light);
  font-size: 14px;
}

#day-detail-info .modal-detail-item:last-child {
  border-bottom: none;
}

#day-detail-info .modal-detail-item .label {
  color: var(--color-text-muted);
  font-weight: 500;
  font-size: 13px;
  flex-shrink: 0;
  min-width: 80px;
}

#day-detail-info .modal-detail-item .value {
  font-weight: 600;
  color: var(--color-text);
  text-align: right;
}

/* Correction form */
#day-detail-correction h4 {
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 18px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text);
}

#day-detail-correction .form-group {
  margin-bottom: 16px;
}

#day-detail-correction .form-group:last-child {
  margin-bottom: 8px;
}

#day-detail-correction .form-group label {
  margin-bottom: 8px;
}

#day-detail-correction .form-group input[type="time"] {
  padding: 12px 14px;
}

#day-detail-correction .form-group textarea {
  padding: 12px 14px;
  line-height: 1.6;
}

.correction-pending-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

/* Delete request checkbox */
#day-detail-correction .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-danger, #dc2626);
}

#day-detail-correction .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--color-danger, #dc2626);
}

@media (max-width: 768px) {
  #day-detail-modal {
    padding: 16px;
  }
  #day-detail-modal > .modal-content {
    border-radius: var(--radius-lg);
    max-height: 85vh;
  }
  #day-detail-modal .modal-header { padding: 20px 20px 0; }
  #day-detail-modal .modal-body { padding: 16px 20px 6px; }
  #day-detail-modal .modal-footer { padding: 10px 20px 20px; }
  #day-detail-modal .modal-close {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
  #day-detail-info .modal-detail-item {
    padding: 6px 0;
    font-size: 13px;
  }
  #day-detail-correction .form-group input[type="time"],
  #day-detail-correction .form-group textarea {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  #day-detail-modal {
    padding: 12px;
  }
  #day-detail-modal .modal-header { padding: 16px 16px 0; }
  #day-detail-modal .modal-body { padding: 12px 16px 4px; }
  #day-detail-modal .modal-footer { padding: 8px 16px 16px; }
}

/* ---------- Documents Page ---------- */
.doc-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--color-border);
  margin-bottom: 24px;
}

.doc-tab {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  border-radius: 8px 8px 0 0;
}

.doc-tab:hover {
  color: var(--color-text);
  background: rgba(15, 23, 42, 0.03);
}

.doc-tab.active {
  color: var(--color-secondary);
  font-weight: 700;
  border-bottom-color: var(--color-secondary);
}

/* Payslip list */
.payslip-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payslip-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s var(--ease-out), transform 0.2s var(--ease-out);
  gap: 16px;
}

.payslip-list-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.payslip-list-info {
  flex: 1;
  min-width: 0;
}

.payslip-list-month {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.payslip-list-detail {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.payslip-list-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.payslip-list-amount {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.payslip-list-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-payslip-view {
  width: auto;
  height: auto;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: none;
  background: var(--color-secondary);
  color: var(--color-white);
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.25);
}

.btn-payslip-view:hover {
  background: var(--color-secondary-hover);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
  transform: translateY(-1px);
}

/* Publish toggle */
.publish-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  white-space: nowrap;
}

.publish-toggle input {
  display: none;
}

.toggle-slider {
  width: 36px;
  height: 20px;
  background: rgba(15, 23, 42, 0.15);
  border-radius: 10px;
  position: relative;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.publish-toggle input:checked + .toggle-slider {
  background: var(--color-success);
}

.publish-toggle input:checked + .toggle-slider::after {
  transform: translateX(16px);
}

.toggle-label {
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Payslip modal */
#payslip-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

#payslip-modal > .modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(15, 23, 42, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fadeIn 0.2s ease;
}

.payslip-modal-content {
  position: relative;
  z-index: 1;
  background: var(--color-white);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s var(--ease-out);
}

.payslip-modal-content .modal-header {
  position: sticky;
  top: 0;
  background: var(--color-white);
  padding: 24px 28px 16px;
  border-bottom: 1px solid var(--color-border-light);
  z-index: 1;
}

.payslip-modal-content .modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.payslip-modal-content .modal-close {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 22px;
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  transition: background 0.15s, color 0.15s;
}

.payslip-modal-content .modal-close:hover {
  background: rgba(15, 23, 42, 0.06);
  color: var(--color-text);
}

.payslip-modal-content .modal-body {
  padding: 24px 28px 32px;
}

/* Payslip content styling */
.payslip {
  font-size: 14px;
  line-height: 1.7;
}

.payslip-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--color-text);
  margin-bottom: 16px;
}

.payslip-period {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
}

.payslip-info {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
  font-size: 13px;
}

.payslip-info td {
  padding: 8px 12px;
  border: 1px solid var(--color-border);
}

.payslip-info td:nth-child(odd) {
  background: rgba(15, 23, 42, 0.03);
  font-weight: 600;
  color: var(--color-text-muted);
  width: 20%;
  white-space: nowrap;
}

.payslip h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin: 20px 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--color-accent);
}

.payslip-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

.payslip-table th {
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--color-border);
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 12px;
  text-align: center;
}

.payslip-table td {
  padding: 9px 12px;
  border: 1px solid var(--color-border);
}

.payslip-table td.amount {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-feature-settings: "tnum";
}

.payslip-table tr.total td {
  font-weight: 700;
  background: rgba(14, 165, 233, 0.04);
  border-top: 2px solid var(--color-border);
}

.payslip-net {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.08), rgba(14, 165, 233, 0.03));
  border-radius: var(--radius);
  margin: 24px 0;
  border: 1px solid rgba(14, 165, 233, 0.15);
}

.payslip-net span:first-child {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: 4px;
}

.payslip-net .net-amount {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.payslip-note {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.06);
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
}

.payslip-sign {
  text-align: right;
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 24px;
  line-height: 1.8;
}

/* Contract styling */
.contract {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text);
}

.contract-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 4px;
  margin-bottom: 20px;
}

.contract-parties {
  font-size: 14px;
  margin-bottom: 28px;
  color: var(--color-text);
}

.contract-items {
  margin-bottom: 32px;
}

.contract-item {
  margin-bottom: 16px;
  padding-left: 0;
}

.contract-item strong {
  color: var(--color-text);
}

.contract-date {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  margin: 32px 0 28px;
}

.contract-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.signature-block {
  padding: 20px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.8;
}

.signature-block p {
  margin-bottom: 4px;
}

.signature-block strong {
  font-size: 14px;
}

/* Admin payslip management */
.admin-payslip-group {
  margin-bottom: 20px;
}

.admin-payslip-group:last-child {
  margin-bottom: 0;
}

.admin-payslip-group-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.admin-payslip-employee-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
}

.admin-payslip-employee-email {
  font-size: 12px;
  color: var(--color-text-subtle);
}

.admin-payslip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  margin-bottom: 6px;
  transition: background 0.15s ease;
  gap: 16px;
}

.admin-payslip-row:hover {
  background: rgba(15, 23, 42, 0.04);
}

.admin-payslip-row:last-child {
  margin-bottom: 0;
}

.admin-payslip-info {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.admin-payslip-month {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.admin-payslip-date {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.admin-payslip-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.admin-payslip-amount {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Payroll employee list */
.payroll-emp-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payroll-emp-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.payroll-emp-card:hover {
  background: rgba(15, 23, 42, 0.06);
}

.payroll-emp-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.payroll-emp-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.payroll-emp-salary {
  font-size: 13px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

.payroll-emp-arrow {
  font-size: 20px;
  color: var(--color-text-subtle);
  flex-shrink: 0;
}

/* Payroll detail */
.payroll-detail-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.payroll-detail-bar .card-title {
  flex: 1;
  margin: 0;
  white-space: nowrap;
}

/* Payroll sections */
.payroll-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 10px 0;
}

.payroll-contract-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
}

.payroll-contract-info {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
}

.payroll-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.payroll-section-bar .payroll-section-title {
  margin-bottom: 0;
}

/* Payroll publish list */
.payroll-publish-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.payroll-publish-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
}

.payroll-publish-month {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-back:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--color-text);
}

.payroll-year-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.payroll-year-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  min-width: 40px;
  text-align: center;
}

/* Salary settings */
.salary-settings {
  margin-bottom: 16px;
}

.salary-emp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s ease;
}

.salary-emp-row:hover {
  background: rgba(15, 23, 42, 0.05);
}

.salary-emp-row + .salary-emp-row {
  margin-top: 6px;
}

.salary-emp-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-salary-go {
  font-size: 18px;
  color: var(--color-text-subtle);
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px 8px;
}

.salary-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
}

.salary-summary-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.salary-summary-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.salary-summary-item .salary-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--color-text-subtle);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.salary-summary-item .salary-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.salary-summary-item.salary-summary-total .salary-value {
  color: var(--color-secondary);
}

.btn-salary-edit {
  width: auto;
  height: auto;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  background: white;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-salary-edit:hover {
  background: var(--color-bg);
  color: var(--color-text);
  border-color: rgba(15, 23, 42, 0.15);
}

.salary-edit-form {
  padding: 18px;
  background: rgba(14, 165, 233, 0.03);
  border: 1px solid rgba(14, 165, 233, 0.1);
  border-radius: var(--radius);
}

.salary-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.salary-edit-grid .form-group {
  margin-bottom: 0;
}

.salary-edit-grid .form-group label {
  font-size: 12px;
  margin-bottom: 5px;
}

.salary-edit-grid .form-group input {
  padding: 9px 12px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.salary-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.salary-edit-actions .btn-sm {
  width: auto;
  height: auto;
  padding: 8px 18px;
  font-size: 13px;
  border-radius: 8px;
  border: none;
}

/* Admin payslip status badges */
.status-badge.published {
  background: rgba(34, 197, 94, 0.1);
  color: #15803d;
}

.status-badge.unpublished {
  background: rgba(15, 23, 42, 0.06);
  color: #6b7280;
}

.status-badge.clickable {
  cursor: pointer;
  transition: all 0.15s ease;
}

.status-badge.clickable:hover {
  opacity: 0.8;
}

/* Payslip month group header */
.payslip-month-header td {
  background: rgba(15, 23, 42, 0.04);
  font-weight: 700;
  font-size: 13px;
  color: var(--color-text);
  padding: 10px 16px !important;
  border-bottom: 1px solid var(--color-border) !important;
}

.btn-batch-publish {
  width: auto;
  height: auto;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid var(--color-secondary);
  background: rgba(14, 165, 233, 0.08);
  color: var(--color-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-batch-publish:hover {
  background: var(--color-secondary);
  color: var(--color-white);
}

.btn-batch-publish.all-published {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.3);
  color: #15803d;
  cursor: default;
}

.btn-batch-publish.all-published:hover {
  background: rgba(34, 197, 94, 0.08);
  color: #15803d;
}

/* Salary display compact */
.salary-display-info {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.salary-display-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  flex-shrink: 0;
}

.salary-display-annual {
  font-size: 15px;
  font-weight: 700;
  color: var(--color-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.salary-display-detail {
  font-size: 13px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Documents responsive */
@media (max-width: 768px) {
  .payslip-list-item {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 18px;
    gap: 12px;
  }
  .payslip-list-right {
    width: 100%;
    justify-content: space-between;
  }
  .payslip-list-amount { font-size: 16px; }
  .payslip-modal-content {
    max-width: 100%;
    border-radius: var(--radius-lg);
  }
  .payslip-modal-content .modal-header { padding: 20px 22px 14px; }
  .payslip-modal-content .modal-body { padding: 20px 22px 28px; }
  .payslip-net { padding: 16px 18px; flex-direction: column; gap: 8px; text-align: center; }
  .payslip-net .net-amount { font-size: 20px; }
  .payslip-info td { padding: 6px 8px; font-size: 12px; }
  .payslip-table th, .payslip-table td { padding: 7px 8px; font-size: 12px; }
  .contract-signatures { grid-template-columns: 1fr; gap: 16px; }
  .doc-tab { padding: 10px 18px; font-size: 14px; }
  #payslip-modal { padding: 16px; }
  .admin-payslip-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .admin-payslip-right { width: 100%; justify-content: space-between; }
  .admin-payslip-info { flex-direction: column; gap: 4px; }
  .payroll-detail-bar { flex-wrap: wrap; gap: 8px; }
  .payroll-detail-bar { flex-wrap: wrap; gap: 8px; }
  .salary-display { flex-direction: column; align-items: flex-start; gap: 12px; }
  .salary-summary-grid { gap: 16px; }
  .salary-display-info { flex-direction: column; gap: 4px; }
  .salary-display-detail { white-space: normal; }
  .salary-edit-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .payslip-title { font-size: 18px; letter-spacing: 3px; }
  .payslip-net span:first-child { font-size: 14px; letter-spacing: 2px; }
  .payslip-net .net-amount { font-size: 18px; }
  .contract-title { font-size: 18px; letter-spacing: 2px; }
  .doc-tab { padding: 8px 14px; font-size: 13px; }
  #payslip-modal { padding: 10px; }
}

/* ---------- Contract Management (Admin) ---------- */
.contract-emp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  transition: background 0.15s ease;
}

.contract-emp-row:hover {
  background: rgba(15, 23, 42, 0.05);
}

.contract-emp-row + .contract-emp-row {
  margin-top: 6px;
}

.contract-emp-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.contract-emp-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
  flex-shrink: 0;
}

.contract-emp-detail {
  font-size: 13px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 768px) {
  .contract-emp-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .contract-emp-row .btn-contract-view {
    align-self: flex-end;
  }
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border-light);
}

.pagination-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  background: white;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--color-bg);
  color: var(--color-text);
}

.pagination-btn.active {
  background: var(--color-secondary);
  color: white;
  border-color: var(--color-secondary);
}

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

/* ---------- My Info Editable Fields ---------- */
.info-item.editable {
  padding: 18px 20px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: background 0.2s;
}

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

.info-item.editable:hover {
  background: rgba(15, 23, 42, 0.04);
}

.info-value-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.info-edit-form {
  margin-top: 10px;
}

.info-edit-form input {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: white;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.info-edit-form input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.edit-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-text-sm {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--color-border);
  background: white;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.btn-text-sm:hover {
  background: var(--color-bg);
}

.btn-text-sm.btn-primary {
  background: var(--color-secondary);
  color: white;
  border-color: var(--color-secondary);
}

.btn-text-sm.btn-primary:hover {
  background: var(--color-secondary-hover);
  border-color: var(--color-secondary-hover);
}

.btn-text-sm.btn-secondary {
  background: rgba(15, 23, 42, 0.05);
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-text-sm.btn-secondary:hover {
  background: rgba(15, 23, 42, 0.09);
}

.btn-text-sm.btn-edit {
  color: var(--color-secondary);
  border-color: transparent;
  background: transparent;
}

.btn-text-sm.btn-edit:hover {
  background: rgba(14, 165, 233, 0.08);
}

.info-value.placeholder {
  color: var(--color-text-subtle);
  font-weight: 500;
}

.email-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(14, 165, 233, 0.1);
  color: var(--color-secondary);
  white-space: nowrap;
}

/* Contact info card spacing */
.card > .info-item:not(:last-child) {
  margin-bottom: 12px;
}

.card > .info-item {
  padding: 18px 20px;
  background: rgba(15, 23, 42, 0.02);
  border-radius: var(--radius);
}

@media (max-width: 640px) {
  .info-edit-form input {
    font-size: 16px;
  }
}

/* ---------- Document Upload ---------- */
.doc-upload-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border-light, rgba(15, 23, 42, 0.08));
}
.doc-upload-item:last-child { border-bottom: none; }

.doc-upload-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.doc-thumbnail {
  width: 120px;
  height: 80px;
  border: 1px dashed var(--color-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--color-bg);
}

.doc-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.doc-placeholder {
  font-size: 12px;
  color: var(--color-text-subtle);
}

.doc-upload-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.doc-upload-btn {
  cursor: pointer;
}

.btn-text-sm.btn-danger {
  background: var(--color-danger);
  color: white;
  border-color: var(--color-danger);
}

.btn-text-sm.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

/* ---------- Account Edit Select ---------- */
.info-edit-form select {
  width: 100%;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: white;
  color: var(--color-text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.info-edit-form select:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

@media (max-width: 640px) {
  .info-edit-form select {
    font-size: 16px;
  }
}

/* ---------- Accessibility ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
