/* ABM PTO — shared glassmorphic design system, branded with ABM Industries'
   official colors (blue #0040F0 / #0545F5, navy #151F6D, orange #FF8200). */

:root {
  --accent-1: #0040f0;
  --accent-2: #151f6d;
  --accent-gradient: linear-gradient(135deg, var(--accent-1) 0%, var(--accent-2) 100%);

  --brand-blue: #0040f0;
  --brand-blue-bright: #0545f5;
  --brand-navy: #151f6d;
  --brand-orange: #ff8200;
  --brand-tint: #e6f4ff;
  --brand-accent-bar: linear-gradient(90deg, var(--brand-blue) 0%, var(--brand-orange) 100%);

  --ink-900: #151f6d;
  --ink-700: #33395e;
  --ink-500: #5d6c7b;
  --ink-400: #8697a6;

  --glass-bg: rgba(255, 255, 255, 0.55);
  --glass-bg-strong: rgba(255, 255, 255, 0.72);
  --glass-bg-soft: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-border-soft: rgba(21, 31, 109, 0.1);

  --success-bg: rgba(0, 165, 81, 0.16);
  --success-fg: #12793f;
  --warning-bg: rgba(255, 130, 0, 0.16);
  --warning-fg: #a04e00;
  --danger-bg: rgba(234, 56, 76, 0.14);
  --danger-fg: #c31432;
  --neutral-bg: rgba(93, 108, 123, 0.14);
  --neutral-fg: #48545f;

  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-pill: 980px;

  --shadow-float: 0 24px 70px rgba(0, 30, 110, 0.2), 0 2px 8px rgba(0, 30, 110, 0.08);
  --shadow-card: 0 8px 30px rgba(0, 30, 110, 0.1);
  --shadow-card-hover: 0 14px 38px rgba(0, 30, 110, 0.16), 0 4px 12px rgba(0, 30, 110, 0.08);
  --shadow-btn: 0 8px 20px rgba(0, 64, 240, 0.35);
  --shadow-btn-hover: 0 12px 28px rgba(0, 64, 240, 0.42);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  color: var(--ink-900);
  min-height: 100vh;
  padding: clamp(16px, 4vw, 48px);
  background-color: var(--brand-tint);
  background-image:
    radial-gradient(circle at 10% 6%, rgba(0, 64, 240, 0.5) 0%, rgba(0, 64, 240, 0) 42%),
    radial-gradient(circle at 90% 12%, rgba(21, 31, 109, 0.45) 0%, rgba(21, 31, 109, 0) 45%),
    radial-gradient(circle at 18% 94%, rgba(5, 69, 245, 0.4) 0%, rgba(5, 69, 245, 0) 45%),
    radial-gradient(circle at 94% 90%, rgba(255, 130, 0, 0.28) 0%, rgba(255, 130, 0, 0) 40%),
    linear-gradient(160deg, #eef5fd 0%, #e6f0fc 45%, #eef5fd 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
}

/* ===== Motion primitives ===== */

@keyframes containerIn {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

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

@keyframes softPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.62; }
}

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

/* ===== Shell ===== */

.container {
  max-width: 960px;
  margin: 0 auto;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(34px) saturate(180%);
  backdrop-filter: blur(34px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float);
  overflow: hidden;
  animation: containerIn 0.7s var(--ease-out) both;
}

.header {
  position: relative;
  padding: 40px 34px 30px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(120% 200% at 12% -30%, rgba(0, 64, 240, 0.18) 0%, rgba(0, 64, 240, 0) 55%),
    radial-gradient(120% 200% at 88% -30%, rgba(255, 130, 0, 0.16) 0%, rgba(255, 130, 0, 0) 55%),
    linear-gradient(180deg, rgba(21, 31, 109, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.55);
}

.header::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 84px; height: 4px;
  border-radius: var(--radius-pill);
  margin-top: 14px;
  background: var(--brand-accent-bar);
  background-size: 200% 100%;
  opacity: 0.9;
  animation: shimmer 3.5s linear infinite;
}

.brand-logo {
  box-sizing: content-box;
  display: block;
  height: 26px;
  width: auto;
  margin: 18px auto 16px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  box-shadow: 0 14px 32px rgba(21, 31, 109, 0.18), 0 3px 8px rgba(21, 31, 109, 0.1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fadeInUp 0.6s var(--ease-out) 0.05s both;
}

.brand-logo-hero {
  height: 44px;
  margin: 24px auto 18px;
  padding: 18px 28px;
}

.header h1 {
  font-size: clamp(1.5em, 2.6vw, 1.9em);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--ink-900);
  margin-bottom: 8px;
  margin-top: 8px;
  animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

.header p {
  display: inline-block;
  color: var(--ink-700);
  font-weight: 600;
  font-size: 0.85em;
  letter-spacing: 0.15px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.75);
  animation: fadeInUp 0.6s var(--ease-out) 0.16s both;
}

.header p:empty {
  display: none;
}

.content { padding: 26px 30px 30px; }

/* ===== Cards ===== */

.card {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 22px 24px;
  margin-bottom: 18px;
  transition: box-shadow 0.3s var(--ease-smooth), transform 0.3s var(--ease-smooth), border-color 0.3s var(--ease-smooth);
  animation: fadeInUp 0.5s var(--ease-out) both;
}

.content > .card:nth-of-type(1) { animation-delay: 0.08s; }
.content > .card:nth-of-type(2) { animation-delay: 0.14s; }
.content > .card:nth-of-type(3) { animation-delay: 0.2s; }
.content > .card:nth-of-type(4) { animation-delay: 0.26s; }
.content > .card:nth-of-type(n+5) { animation-delay: 0.3s; }

.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
}

.card h3 {
  color: var(--ink-900);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 14px;
}

/* ===== Forms ===== */

label {
  display: block;
  font-weight: 600;
  font-size: 0.92em;
  margin-bottom: 6px;
  color: var(--ink-700);
}

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--glass-border-soft);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-900);
  transition: border-color 0.22s var(--ease-smooth), box-shadow 0.22s var(--ease-smooth), background 0.22s var(--ease-smooth);
}

input::placeholder, textarea::placeholder { color: var(--ink-400); }

input:hover, select:hover, textarea:hover {
  border-color: rgba(21, 31, 109, 0.2);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent-1);
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 4px rgba(0, 64, 240, 0.16);
}

:focus-visible {
  outline: 2px solid var(--accent-1);
  outline-offset: 2px;
}

.btn:focus-visible, button.btn:focus-visible {
  outline-offset: 3px;
}

input[type="checkbox"] { width: auto; }

textarea { min-height: 90px; resize: vertical; }

input[type="file"] {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 8px 16px;
  margin-right: 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  color: #fff;
  font-weight: 600;
  font-family: inherit;
  font-size: 0.88em;
  cursor: pointer;
  transition: filter 0.18s ease;
}

input[type="file"]::file-selector-button:hover { filter: brightness(1.05); }

input[type="date"], input[type="number"] { color-scheme: light; }

/* ===== Buttons ===== */

.btn, button.btn {
  position: relative;
  display: inline-block;
  padding: 11px 22px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.95em;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.2s var(--ease-smooth), box-shadow 0.2s var(--ease-smooth), filter 0.2s var(--ease-smooth);
}

.btn::before, button.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, 0.35) 48%, transparent 62%);
  background-size: 220% 100%;
  background-position: 140% 0;
  transition: background-position 0.55s var(--ease-smooth);
}

.btn:hover, button.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: var(--shadow-btn-hover);
}

.btn:hover::before, button.btn:hover::before {
  background-position: -40% 0;
}

.btn:active, button.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn:disabled, button.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.btn-secondary,
a.btn-secondary,
button.btn-secondary {
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink-900);
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  /* Reset the primary button's overflow/isolation: combined with
     backdrop-filter it causes some browsers to repaint the button as a
     solid white block on hover/press. The shine sweep below is also
     disabled for secondary buttons, so neither property is needed here. */
  overflow: visible;
  isolation: auto;
}

.btn-secondary::before,
a.btn-secondary::before,
button.btn-secondary::before { display: none; }

.btn-secondary:hover,
a.btn-secondary:hover,
button.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 64, 240, 0.22);
  box-shadow: 0 6px 16px rgba(21, 31, 109, 0.1);
  /* Combining CSS filter with backdrop-filter on hover is what caused the
     whiteout — secondary buttons get their hover feedback from the
     background/border/shadow changes above instead. */
  filter: none;
}

.link-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; align-items: center; }

/* ===== Landing ===== */

.landing-card {
  padding-top: 22px;
  padding-bottom: 22px;
}

.landing-group + .landing-group {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid rgba(17, 17, 20, 0.08);
}

.landing-group-label {
  margin: 0 0 10px;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-500);
  text-align: left;
}

.landing-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.landing-btn-row .btn,
.landing-btn-row .btn-secondary {
  flex: 1 1 140px;
  text-align: center;
  margin: 0;
}

.landing-card .pto-eligibility-note a {
  color: #0040f0;
  font-weight: 700;
}

/* ===== WFM Correction form ===== */

.wfm-hours-block {
  margin: 18px 0 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 17, 20, 0.08);
}

.wfm-hours-title {
  margin: 0 0 10px;
  font-size: 0.95em;
  font-weight: 700;
  color: var(--ink-900);
}

.wfm-time-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.wfm-time-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.wfm-time-field label {
  margin: 0;
  font-size: 0.85em;
  font-weight: 600;
  color: var(--ink-500);
}

.wfm-time-field input[type="time"] {
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 10px 8px;
  font-size: 14px;
  -webkit-appearance: none;
  appearance: none;
}

.employee-top-nav {
  margin: 0 0 16px;
}

.employee-top-nav .btn,
.employee-top-nav .btn-secondary,
.employee-top-nav button.btn {
  margin: 0;
  flex: 1 1 auto;
  text-align: center;
  padding-top: 11px;
  padding-bottom: 11px;
  font-size: 0.92em;
}

.wfm-reason-block {
  margin: 18px 0;
  padding-top: 14px;
  border-top: 1px solid rgba(17, 17, 20, 0.08);
}

.wfm-reason-intro {
  color: var(--ink-700);
  font-size: 0.92em;
  margin-bottom: 12px;
  line-height: 1.45;
}

.wfm-reason-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 10px;
  font-weight: 500;
  cursor: pointer;
}

.wfm-reason-option input {
  width: auto;
  margin: 3px 0 0;
}

.wfm-system-details {
  margin: 0 0 12px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.wfm-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  margin: 0;
}

.wfm-check input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.wfm-certify {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(0, 64, 240, 0.06);
  border: 1px solid rgba(0, 64, 240, 0.12);
  font-size: 0.92em;
  line-height: 1.45;
  color: var(--ink-700);
}

.wfm-certify p { margin: 0; }

@media (max-width: 720px) {
  .wfm-time-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .wfm-time-field input[type="time"] {
    padding: 12px 10px;
    font-size: 16px; /* avoids iOS zoom-on-focus */
  }
}

@media (max-width: 720px) {
  .landing-btn-row .btn,
  .landing-btn-row .btn-secondary {
    flex: 1 1 calc(50% - 5px);
    width: auto;
    min-width: 0;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 0.92em;
  }
}

/* ===== Layout helpers ===== */

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

.pto-balance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }

.pto-stat {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  text-align: center;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform 0.25s var(--ease-smooth), box-shadow 0.25s var(--ease-smooth), border-color 0.25s var(--ease-smooth);
}

.pto-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 30, 110, 0.12);
  border-color: rgba(0, 64, 240, 0.22);
}

.pto-stat-value {
  display: block;
  font-size: 1.7em;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.pto-stat-label {
  font-size: 0.78em;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-top: 4px;
  display: block;
}

.pto-eligibility-note {
  background: var(--warning-bg);
  border: 1px solid rgba(255, 159, 10, 0.35);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: var(--warning-fg);
}

.pto-rules-notice {
  background: rgba(0, 64, 240, 0.06);
  border: 1px solid rgba(0, 64, 240, 0.2);
  border-left: 4px solid var(--accent-1);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
  color: var(--ink-700);
}

.pto-rules-notice .pto-rules-title {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--ink-900);
  margin: 0 0 12px;
}

.pto-rules-list {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.88em;
  line-height: 1.55;
  color: var(--ink-700);
}

.pto-rules-list li {
  margin-bottom: 10px;
}

.pto-rules-list li:last-child {
  margin-bottom: 0;
}

.pto-blackout-notice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 130, 0, 0.12);
  border: 2px solid rgba(255, 130, 0, 0.55);
  color: var(--ink-700);
  font-size: 0.9em;
  line-height: 1.45;
}

.pto-blackout-notice strong {
  color: #c45c00;
}

.hidden-file-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.attachment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.attachment-btn {
  width: auto;
  padding: 10px 16px;
  margin: 0;
  cursor: pointer;
}

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

.attachment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(0, 64, 240, 0.05);
  border: 1px solid rgba(0, 64, 240, 0.15);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.attachment-item .attachment-remove {
  width: auto;
  padding: 6px 12px;
  font-size: 0.85em;
  flex-shrink: 0;
}

/* ===== Table ===== */

.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.92em; }

.table th, .table td {
  border-bottom: 1px solid rgba(17, 17, 20, 0.06);
  padding: 11px 10px;
  text-align: left;
}

.table th {
  color: var(--ink-500);
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.table tbody tr { transition: background 0.18s var(--ease-smooth); }
.table tbody tr:hover { background: rgba(0, 64, 240, 0.06); }

/* ===== Balance progress bars ===== */

.balance-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-bar-value {
  font-weight: 700;
  color: var(--ink-900);
  min-width: 44px;
}

.balance-bar {
  flex: 1;
  min-width: 60px;
  max-width: 120px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(0, 64, 240, 0.12);
  overflow: hidden;
}

.balance-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  transition: width 0.5s var(--ease-out);
}

/* ===== Badges ===== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: transform 0.15s var(--ease-smooth);
}

.badge-pending { background: var(--warning-bg); color: var(--warning-fg); }
.badge-approved { background: var(--success-bg); color: var(--success-fg); }
.badge-rejected { background: var(--danger-bg); color: var(--danger-fg); }
.badge-cancelled { background: var(--neutral-bg); color: var(--neutral-fg); }
.badge-multisite {
  background: rgba(0, 64, 240, 0.12);
  color: #0040f0;
  margin-left: 8px;
  cursor: help;
}

.badge-pending::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: softPulse 1.8s ease-in-out infinite;
}

/* ===== Messages ===== */

/* Neutral glass box with a colored accent bar in currentColor, so JS that
   overrides .style.color (success/warning/danger/neutral text) always stays
   legible without needing to also override the background. */
.error, .success {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(17, 17, 20, 0.08);
  border-left: 4px solid currentColor;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 0.92em;
  font-weight: 600;
}

.error { color: var(--danger-fg); }
.success { color: var(--success-fg); }

.hidden { display: none; }

.hint {
  color: var(--ink-500);
  font-size: 0.9em;
  margin-bottom: 14px;
  line-height: 1.55;
}

.text-link {
  color: var(--accent-1);
  font-weight: 600;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }

pre.hint {
  background: rgba(17, 17, 20, 0.04);
  border: 1px solid rgba(17, 17, 20, 0.06);
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  overflow: auto;
  color: var(--ink-700);
  white-space: pre-wrap;
}

/* ===== Employee: two-column layout on wide screens ===== */

.employee-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.employee-layout .employee-main { min-width: 0; }
.employee-layout .employee-side { min-width: 0; order: -1; }

@media (min-width: 900px) {
  .employee-layout { grid-template-columns: 1fr 340px; }
  .employee-layout .employee-side { order: 0; }
}

/* ===== Admin: dashboard shell (sidebar + content) ===== */

.container-wide {
  max-width: 1240px;
  transition: max-width 0.3s var(--ease-smooth);
}

.admin-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: stretch;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-logout-btn {
  width: 100%;
}

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

.admin-content-header {
  margin-bottom: 18px;
  animation: fadeInUp 0.4s var(--ease-out) both;
}

.admin-content-header h2 {
  font-size: 1.3em;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin-bottom: 4px;
}

.admin-stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.admin-stat-strip:empty { display: none; margin-bottom: 0; }

.admin-stat-strip .pto-stat {
  padding: 14px 12px;
}

.admin-stat-strip .pto-stat-value { font-size: 1.5em; }

.container-wide {
  max-width: 1180px;
}

.overview-exception {
  padding: 14px 16px;
  margin-bottom: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(17, 17, 20, 0.08);
}

.overview-exception-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.overview-exception-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.92em;
}

.overview-exception-list a {
  color: #0040f0;
  font-weight: 700;
}

/* ===== Requests: pending grid + history cards (no horizontal scroll) ===== */

.req-pending-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@media (min-width: 700px) {
  .req-pending-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

.req-pending-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(17, 17, 20, 0.08);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.22s var(--ease-smooth), border-color 0.22s var(--ease-smooth), transform 0.22s var(--ease-smooth);
}

.req-pending-card:hover {
  box-shadow: 0 8px 20px rgba(0, 30, 110, 0.1);
  border-color: rgba(0, 64, 240, 0.16);
  transform: translateY(-1px);
}

.req-pending-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.req-pending-card-name {
  font-weight: 700;
  color: var(--ink-900);
}

.req-pending-card-meta {
  color: var(--ink-500);
  font-size: 0.88em;
}

.req-pending-card-reason {
  color: var(--ink-700);
  font-size: 0.92em;
  line-height: 1.5;
}

.req-pending-card-submitted {
  color: var(--ink-400);
  font-size: 0.82em;
}

.req-pending-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(17, 17, 20, 0.06);
}

.req-pending-card-actions .btn,
.req-pending-card-actions .btn-secondary {
  width: auto;
  padding: 8px 14px;
  font-size: 0.86em;
  margin: 0;
}

.req-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.req-history-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(17, 17, 20, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: background 0.2s var(--ease-smooth), border-color 0.2s var(--ease-smooth);
}

.req-history-card:hover {
  background: rgba(0, 64, 240, 0.04);
  border-color: rgba(0, 64, 240, 0.14);
}

.req-history-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px 12px;
  margin-bottom: 10px;
}

.req-history-card-name {
  font-weight: 700;
  color: var(--ink-900);
}

.req-history-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px 18px;
  margin-bottom: 8px;
}

.req-history-card-meta div { min-width: 0; }

.req-history-card-meta dt {
  margin: 0 0 2px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-500);
}

.req-history-card-meta dd {
  margin: 0;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--ink-900);
  word-break: break-word;
}

.req-history-card-notes {
  color: var(--ink-700);
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 8px;
}

.req-history-card-docs {
  font-size: 0.88em;
  margin-bottom: 10px;
}

.req-history-card-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(17, 17, 20, 0.06);
}

.req-history-card-footer .btn,
.req-history-card-footer .btn-secondary {
  width: auto;
  padding: 6px 12px;
  font-size: 0.85em;
  margin: 0;
}

@media (min-width: 960px) {
  .admin-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .admin-sidebar {
    flex: 0 0 220px;
  }

  .tabs#admin-tabs {
    flex-direction: column;
    align-items: stretch;
    padding: 8px;
    gap: 2px;
    overflow: visible;
    margin: 0;
  }

  .tabs#admin-tabs .tab {
    justify-content: flex-start;
    padding: 11px 14px;
    text-align: left;
  }

  .tabs#admin-tabs .tab-indicator {
    top: 8px;
    left: 8px;
    width: calc(100% - 16px) !important;
    height: 42px;
  }
}

/* ===== Admin: tabs (segmented control) ===== */

.tabs {
  position: relative;
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -4px 18px;
  padding: 4px;
  background: rgba(17, 17, 20, 0.05);
  border-radius: var(--radius-pill);
  max-width: 100%;
  animation: fadeInUp 0.5s var(--ease-out) 0.05s both;
}

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

.tab-indicator {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  border-radius: var(--radius-pill);
  background: var(--accent-gradient);
  box-shadow: 0 6px 16px rgba(0, 64, 240, 0.35);
  opacity: 0;
  transition: transform 0.35s var(--ease-out), width 0.35s var(--ease-out), opacity 0.2s ease;
  z-index: 0;
  pointer-events: none;
}

.tabs.tabs-indicator-ready .tab-indicator { opacity: 1; }
.tabs.tabs-indicator-ready .tab.active { background: none; box-shadow: none; }

.tab {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink-700);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88em;
  white-space: nowrap;
  transition: color 0.25s var(--ease-smooth);
}

.tab:hover { color: var(--ink-900); }

.tab.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 64, 240, 0.35);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.72em;
  font-weight: 800;
  line-height: 1;
}

.tab.active .tab-badge {
  background: #fff;
  color: #e11d48;
}

/* Pending-alert glow on tabs that need attention */
.tab.tab-alert {
  color: #9f1239;
  box-shadow:
    0 0 0 1px rgba(225, 29, 72, 0.35),
    0 0 14px rgba(225, 29, 72, 0.45),
    0 0 28px rgba(225, 29, 72, 0.25);
  animation: tabAlertPulse 1.8s ease-in-out infinite;
}

.tab.tab-alert.active {
  color: #fff;
  box-shadow:
    0 6px 16px rgba(0, 64, 240, 0.35),
    0 0 0 2px rgba(255, 255, 255, 0.55),
    0 0 18px rgba(255, 80, 120, 0.7),
    0 0 32px rgba(225, 29, 72, 0.45);
  animation: tabAlertPulseActive 1.8s ease-in-out infinite;
}

@keyframes tabAlertPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(225, 29, 72, 0.3),
      0 0 10px rgba(225, 29, 72, 0.35),
      0 0 20px rgba(225, 29, 72, 0.18);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(225, 29, 72, 0.55),
      0 0 18px rgba(225, 29, 72, 0.6),
      0 0 36px rgba(225, 29, 72, 0.35);
  }
}

@keyframes tabAlertPulseActive {
  0%, 100% {
    box-shadow:
      0 6px 16px rgba(0, 64, 240, 0.35),
      0 0 0 2px rgba(255, 255, 255, 0.45),
      0 0 14px rgba(255, 80, 120, 0.55),
      0 0 26px rgba(225, 29, 72, 0.35);
  }
  50% {
    box-shadow:
      0 6px 16px rgba(0, 64, 240, 0.35),
      0 0 0 2px rgba(255, 255, 255, 0.75),
      0 0 22px rgba(255, 100, 140, 0.85),
      0 0 40px rgba(225, 29, 72, 0.55);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab.tab-alert,
  .tab.tab-alert.active {
    animation: none;
  }
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e11d48;
  color: #fff;
  font-size: 0.75em;
  font-weight: 800;
  vertical-align: middle;
}

.btn.nav-alert {
  box-shadow:
    0 0 0 1px rgba(225, 29, 72, 0.4),
    0 0 14px rgba(225, 29, 72, 0.45);
  animation: tabAlertPulse 1.8s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .btn.nav-alert {
    animation: none;
  }
}

.panel.hidden { display: none; }

.panel {
  animation: fadeInUp 0.35s var(--ease-out) both;
}

/* ===== Admin: upload calendar ===== */

.upload-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.upload-cal-head h3 { margin: 0; }
.upload-cal-nav { display: flex; gap: 8px; align-items: center; }
.upload-cal-nav .btn, .upload-cal-nav .btn-secondary { padding: 8px 14px; }

.upload-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }

.upload-cal-dow {
  text-align: center;
  font-size: 0.72em;
  font-weight: 700;
  color: var(--ink-500);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.upload-cal-day {
  min-height: 52px;
  border: 1px solid rgba(17, 17, 20, 0.06);
  border-radius: var(--radius-sm);
  padding: 6px;
  font-size: 0.8em;
  background: rgba(255, 255, 255, 0.5);
  color: var(--ink-700);
  transition: background 0.22s var(--ease-smooth), border-color 0.22s var(--ease-smooth), transform 0.22s var(--ease-smooth), box-shadow 0.22s var(--ease-smooth);
}

.upload-cal-day.outside { opacity: 0.35; background: rgba(255, 255, 255, 0.25); }

.upload-cal-day.uploaded {
  background: var(--success-bg);
  border-color: rgba(52, 199, 89, 0.35);
}

.upload-cal-day.today { box-shadow: inset 0 0 0 2px var(--accent-1); }

.upload-cal-day-num { font-weight: 700; margin-bottom: 4px; }

.upload-cal-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin: 14px 0;
  font-size: 0.85em;
  color: var(--ink-500);
}

.upload-cal-legend span { display: flex; align-items: center; gap: 6px; }

.upload-cal-swatch {
  width: 14px; height: 14px;
  border-radius: 5px;
  border: 1px solid rgba(17, 17, 20, 0.12);
  display: inline-block;
}
.upload-cal-swatch.uploaded { background: var(--success-bg); border-color: rgba(52, 199, 89, 0.35); }
.upload-cal-swatch.missing { background: rgba(255, 255, 255, 0.5); }
.upload-cal-swatch.pto-pending { background: rgba(255, 149, 0, 0.28); border-color: rgba(255, 149, 0, 0.45); }
.upload-cal-swatch.pto-approved { background: var(--success-bg); border-color: rgba(52, 199, 89, 0.35); }
.upload-cal-swatch.pto-mixed {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.28) 50%, var(--success-bg) 50%);
  border-color: rgba(52, 199, 89, 0.35);
}

.upload-cal-day.pto-off-pending {
  background: rgba(255, 149, 0, 0.22);
  border-color: rgba(255, 149, 0, 0.4);
  cursor: pointer;
}

.upload-cal-day.pto-off-approved {
  background: var(--success-bg);
  border-color: rgba(52, 199, 89, 0.35);
  cursor: pointer;
}

.upload-cal-day.pto-off-mixed {
  background: linear-gradient(135deg, rgba(255, 149, 0, 0.22) 50%, var(--success-bg) 50%);
  border-color: rgba(52, 199, 89, 0.35);
  cursor: pointer;
}

.upload-cal-day.pto-off-selected { box-shadow: inset 0 0 0 2px var(--accent-1); }

.upload-cal-day.pto-off-pending:hover,
.upload-cal-day.pto-off-approved:hover,
.upload-cal-day.pto-off-mixed:hover {
  filter: brightness(0.97);
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 30, 110, 0.1);
}

.pto-cal-count {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--ink-700);
}

.pto-cal-detail-title {
  font-weight: 700;
  margin-bottom: 10px;
}

.pto-cal-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pto-cal-detail-item {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.65);
  font-size: 0.92em;
}

.upload-week-list { margin-top: 12px; font-size: 0.88em; color: var(--ink-700); line-height: 1.7; }

/* ===== Tables: horizontal scroll on narrow screens ===== */

#emp-table, #req-table, #req-history-table, #balance-table {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Employee roster: card layout so all fields are visible without horizontal scroll */
.emp-roster {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.emp-card {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(17, 17, 20, 0.08);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  transition: background 0.22s var(--ease-smooth), border-color 0.22s var(--ease-smooth), box-shadow 0.22s var(--ease-smooth), transform 0.22s var(--ease-smooth);
}

.emp-card:hover {
  background: rgba(0, 64, 240, 0.05);
  border-color: rgba(0, 64, 240, 0.14);
  box-shadow: 0 6px 18px rgba(0, 30, 110, 0.08);
  transform: translateY(-1px);
}

.emp-card-inactive {
  opacity: 0.78;
}

.emp-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.emp-card-name {
  margin: 0;
  font-size: 1em;
  font-weight: 700;
  color: var(--ink-900);
  line-height: 1.35;
  flex: 1 1 180px;
}

.emp-card-meta {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.emp-card-meta div {
  min-width: 0;
}

.emp-card-meta-wide {
  grid-column: 1 / -1;
}

.emp-card-meta dt {
  margin: 0 0 2px;
  font-size: 0.72em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--ink-500);
}

.emp-card-meta dd {
  margin: 0;
  font-size: 0.92em;
  font-weight: 600;
  color: var(--ink-900);
  word-break: break-word;
}

.emp-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 17, 20, 0.06);
}

.emp-card-actions .btn,
.emp-card-actions .btn-secondary {
  width: auto;
  padding: 8px 14px;
  font-size: 0.88em;
  margin: 0;
}

.emp-card-selected {
  border-color: rgba(0, 64, 240, 0.35);
  background: rgba(0, 64, 240, 0.08);
  box-shadow: 0 0 0 2px rgba(0, 64, 240, 0.12);
}

.emp-form-editing {
  border-color: rgba(0, 64, 240, 0.28);
  box-shadow: 0 0 0 2px rgba(0, 64, 240, 0.1);
}

/* Action buttons in table rows wrap onto their own line instead of
   forcing extra horizontal scroll on small screens. */
.table td.row-actions {
  white-space: normal !important;
}
.table td.row-actions .btn, .table td.row-actions .btn-secondary {
  width: auto;
  padding: 6px 12px;
  font-size: 0.85em;
  margin: 2px 4px 2px 0;
  display: inline-block;
}

/* ===== E-signatures ===== */

.signature-wrap {
  border: 1px solid rgba(21, 31, 109, 0.18);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}

.signature-canvas {
  display: block;
  width: 100%;
  height: 140px;
  touch-action: none;
  cursor: crosshair;
}

.sign-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.sign-modal.hidden {
  display: none;
}

.sign-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 20, 40, 0.45);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s var(--ease-smooth) both;
}

.sign-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 480px);
  margin: 0;
  animation: modalPopIn 0.3s var(--ease-out) both;
}

@keyframes modalPopIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== Loading states ===== */

.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(0, 64, 240, 0.2);
  border-top-color: var(--accent-1);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -0.15em;
}

.loading-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-500);
  font-weight: 500;
}

.skeleton {
  display: block;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, rgba(21, 31, 109, 0.08) 25%, rgba(21, 31, 109, 0.15) 37%, rgba(21, 31, 109, 0.08) 63%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

/* ===== Scrollbar polish ===== */

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(17, 17, 20, 0.18); border-radius: var(--radius-pill); }
::-webkit-scrollbar-track { background: transparent; }

/* ===== Responsive ===== */

@media (max-width: 720px) {
  body { padding: 12px; }
  .container { border-radius: 22px; }
  .header { padding: 28px 20px 20px; }
  .header::before { margin-top: 12px; }
  .brand-logo { height: 22px; padding: 11px 16px; margin: 14px auto 12px; }
  .brand-logo-hero { height: 36px; padding: 14px 20px; }
  .content { padding: 16px 14px 20px; }
  .card { padding: 16px; border-radius: var(--radius-sm); margin-bottom: 14px; }

  .btn, button.btn { width: 100%; text-align: center; padding: 13px 20px; }
  .link-row .btn, .link-row button.btn { width: auto; flex: 1 1 auto; }
  .link-row { gap: 10px; }

  .upload-cal-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .upload-cal-nav { justify-content: space-between; }
  .upload-cal-nav .btn, .upload-cal-nav .btn-secondary { width: auto; flex: 0 0 auto; padding: 8px 14px; }
  .upload-cal-day { min-height: 40px; padding: 4px; font-size: 0.72em; }
  .upload-cal-day-num { margin-bottom: 2px; }

  .pto-balance-grid { grid-template-columns: repeat(2, 1fr); }
  .pto-stat { padding: 14px 10px; }
  .pto-stat-value { font-size: 1.4em; }

  .tabs { width: 100%; }

  input, select, textarea { font-size: 16px; }
}

@media (max-width: 420px) {
  .header h1 { font-size: 1.4em; }
  .upload-cal-grid { gap: 4px; }
  .upload-cal-day { min-height: 34px; font-size: 0.65em; }
  .upload-cal-dow { font-size: 0.62em; }
  .pto-balance-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
