/* empdash.css */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --primary: #3c63c4;
  --primary-600: #2e54b8;
  --ink: #1a2340;
  --ink-2: #323d50;
  --muted: #5a6c91;
  --line: #e3e6ed;
  --line-2: #e9edf7;
  --brand: #134674;
  --accent: #2349a3;
}

:root{
  --nav-h: 56px;         /* navbar height on mobile */
  --nav-gap: 10px;       /* extra breathing room below the bar */
}            /* default navbar height */
@media (max-width: 480px) { :root { --nav-h: 50px; } }  /* shorter on very small screens */	

  /* Fluid type & spacing */
  --step--1: clamp(12px, 0.75rem + 0.2vw, 14px);
  --step-0: clamp(14px, 0.85rem + 0.25vw, 16px);
  --step-1: clamp(16px, 1rem + 0.5vw, 18px);
  --step-2: clamp(18px, 1.1rem + 0.8vw, 22px);
  --step-3: clamp(20px, 1.25rem + 1vw, 26px);

  --radius: 14px;
  --shadow: 0 6px 18px rgba(23, 43, 99, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1220;
    --card: #131a2c;
    --ink: #f0f3ff;
    --ink-2: #dbe3ff;
    --muted: #a9b7e1;
    --line: #233052;
    --line-2: #2b3a60;
    --primary: #6e8cf0;
    --primary-600: #5878df;
    --brand: #9cc2ff;
    --accent: #9ab2ff;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Arial, Helvetica, sans-serif;
  font-size: var(--step-0);
  line-height: 1.45;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== Top Nav ========== */
.top-navbar {
  position: sticky; top: 0; z-index: 1100;
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  padding: 0 clamp(10px, 2vw, 24px);
  min-height: 56px;
}

.logo-bar {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.main-logo { height: 38px; width: 38px; object-fit: cover; }
.brand-name {
  font-weight: 800; color: var(--brand);
  font-size: var(--step-2); letter-spacing: .5px;
}

/* Hamburger */
.nav-toggle{
  margin-left:auto;
  display:none;
  background:transparent;border:0;cursor:pointer;
  height:40px;width:44px;padding:0 4px;position:relative;z-index:1401;
}
.nav-toggle span{
  position:absolute;left:9px;right:9px;height:2.5px;border-radius:2px;
  background: var(--ink);                /* auto swaps in dark mode */
  transition:transform .24s ease,opacity .18s ease,top .24s ease;
}
.nav-toggle span:nth-child(1){ top:12px; }
.nav-toggle span:nth-child(2){ top:19px; }
.nav-toggle span:nth-child(3){ top:26px; }

.nav-toggle[aria-expanded="true"] span:nth-child(1){
  top:19px; transform:rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2){
  opacity:0;
}
.nav-toggle[aria-expanded="true"] span:nth-child(3){
  top:19px; transform:rotate(-45deg);
}

/* --- Backdrop for menu --- */
.nav-backdrop{
  position:fixed;inset:0;
  background:rgba(0,0,0,.35);
  backdrop-filter:saturate(140%) blur(2px);
  z-index:1390;
}

.nav-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 2px;
  margin-left: clamp(6px, 2vw, 24px);
  flex: 1;
	z-index: 1300;
}
.nav-links li { position: relative; }
.nav-links li.logout-li { margin-left: auto; }
.nav-links a {
  display: inline-block;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: clamp(14px, .9rem, 15px);
  padding: 14px 16px;
  border-bottom: 3px solid transparent;
  border-radius: 8px 8px 0 0;
}
.nav-links li a:hover,
.nav-links li.active a {
  border-bottom-color: var(--primary);
  color: var(--primary-600);
  background: color-mix(in hsl, var(--primary) 8%, transparent);
}

/* Submenu */
.has-submenu > a::after {
  content: ""; display: inline-block; margin-left: 8px;
  border: 5px solid transparent; border-top-color: var(--accent);
  transform: translateY(2px);
}
.submenu {
  display: none; position: absolute; left: 0; top: 100%;
  min-width: 240px; background: var(--card);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  padding: 6px 0; z-index: 1200; border-radius: 12px;
}
.submenu li { list-style: none; }
.submenu a {
  display: block; padding: 10px 14px;
  color: var(--ink); border: 0 !important; border-radius: 8px;
}
.submenu a:hover {
  background: color-mix(in hsl, var(--primary) 10%, transparent);
  color: var(--primary-600);
}
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu,
.has-submenu.open > .submenu { display: block; }

/* ========== Layout ========== */
.page-container { flex: 1 0 auto; display: flex; flex-direction: column; padding-top: 8px; }

.dash-main {
  display: grid;
  grid-template-columns: 320px 1fr 360px;
  gap: clamp(14px, 2.2vw, 28px);
  padding: clamp(16px, 2.2vw, 35px);
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

/* Cards & panels */
.profile-col, .profile-panel, .attendance-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Left column */
.profile-col { display: flex; flex-direction: column; align-items: center; overflow: hidden; }
.profile-photo-box {
  text-align: center; width: 100%;
  background: color-mix(in hsl, var(--primary) 6%, var(--card));
  padding: 20px 0 16px; border-bottom: 1px solid var(--line);
}
.profile-photo-box img {
  width: 112px; height: 112px; object-fit: cover; border-radius: 50%;
  border: 4px solid color-mix(in hsl, var(--card) 60%, var(--bg));
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.emp-name { font-size: var(--step-2); font-weight: 800; color: color-mix(in hsl, var(--ink) 85%, var(--brand)); }
.emp-position { color: var(--muted); font-size: var(--step-0); }
.emp-status-badge {
  margin-top: 6px;
  display: inline-block; padding: 4px 12px;
  background: #1e8b49; color: #fff; font-weight: 700; font-size: var(--step--1);
  border-radius: 999px;
}
.emp-atwork {
  width: 100%; margin: 10px 0 12px; padding: 8px 0;
  background: color-mix(in hsl, var(--primary) 14%, var(--card));
  color: var(--accent); font-weight: 600; font-size: var(--step--1);
}

.profile-card-metrics { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; background: color-mix(in hsl, var(--bg) 70%, var(--card)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.profile-card-metrics > div { padding: 12px 6px; text-align: center; border-right: 1px dashed var(--line-2); }
.profile-card-metrics > div:last-child { border-right: 0; }
.metric-value { font-size: var(--step-2); color: var(--accent); font-weight: 800; }
.metric-label { font-size: var(--step--1); color: var(--muted); letter-spacing: .4px; }
.profile-birthday {
  width: 100%; margin: 14px 0 16px;
  background: #fff9e7; color: #a88c36; padding: 10px 12px; font-weight: 600;
  border-radius: 10px;
}

/* Middle & right columns */
.center-cols { display: grid; grid-template-columns: 1fr; gap: clamp(12px, 1.4vw, 18px); min-width: 0; }
.right-cols { display: grid; grid-template-columns: 1fr; gap: clamp(12px, 1.6vw, 20px); min-width: 0; }

/* Panels */
.profile-panel { overflow: hidden; }
.panel-title {
  display: flex; align-items: center; gap: 10px; margin: 0;
  padding: 12px 16px;
  color: #fff; background: var(--primary);
  font-weight: 800; letter-spacing: .2px; font-size: var(--step-1);
}

/* Tables */
.profile-table, .attendance-table {
  width: 100%; border-collapse: collapse; margin: 0;
  font-size: var(--step-0);
}
.profile-table td {
  padding: 10px 16px; color: var(--ink-2);
  border-bottom: 1px solid var(--line-2);
}
.profile-table tr:last-child td { border-bottom: 0; }
.profile-table tr td:first-child {
  color: var(--primary-600); font-weight: 700; width: 30%;
  min-width: 130px;
}

/* Notice / holidays */
.notice-content { min-height: 120px; }
.notice-item {
  background: var(--card); border: 1px solid var(--line-2);
  padding: 10px 12px; border-radius: 10px; margin-bottom: 8px;
}
.notice-title { font-weight: 800; color: var(--accent); margin: 0 0 4px; }
.notice-body { white-space: pre-wrap; color: var(--ink-2); }
.notice-meta { margin-top: 6px; font-size: var(--step--1); color: var(--muted); display:flex; gap:10px; }
.notice-badge { background:#fff5d9; border:1px solid #f3d48a; padding:2px 8px; font-weight:700; color:#8c6a00; border-radius: 999px; }

.holidays-list { display:flex; flex-direction:column; gap:8px; padding: 10px 12px 14px; }
.holiday {
  display:flex; justify-content:space-between; align-items:center;
  padding: 10px 12px; border-radius: 10px; font-weight: 700; color:#fff;
}
.holiday span { font-weight: 500; opacity:.95; }
.holiday-red{background:#e3706d;} .holiday-green{background:#62bc5f;}
.holiday-yellow{background:#ffd96c;color:#5b4a00;} .holiday-blue{background:#6697d8;}
.holiday-purple{background:#ae81d5;}

/* Attendance */
.attendance-panel { margin: 18px auto 0; max-width: 1400px; }
.attendance-panel .panel-title {
  background: var(--primary); font-size: var(--step-1); justify-content: space-between;
}
.attendance-panel select { font-size: var(--step-0); padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }

.attendance-table th, .attendance-table td {
  border: 1px solid var(--line-2); padding: 8px 10px; text-align: center;
}
.attendance-table th {
  background: var(--primary); color: #fff; font-weight: 800;
}

/* Footer */
.main-footer {
  position: sticky;
  bottom: 0;
  z-index: 1100;

  margin-top: clamp(18px, 2.4vw, 30px);
  background: #214688;
  color: #fff;
  text-align: center;
  padding: 14px 0 calc(12px + env(safe-area-inset-bottom)); /* iOS safe-area */
  font-size: var(--step-0);
}

@media (min-width: 1024px) {
  .dash-main {
    max-width: 1400px !important;  /* override inline 980px */
  }
}


/* ========== Mobile-first ========== */

/* ≤ 1100px: stack main columns */
@media (max-width: 1100px) {
  .dash-main { grid-template-columns: 1fr; }
}

:root{
  --nav-h: 56px;         /* navbar height on mobile */
  --nav-gap: 10px;       /* extra breathing room below the bar */
}

/* MOBILE */
@media (max-width: 900px){
  /* The bar sits fixed at the top with NO extra padding inside it */
  .top-navbar{
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1400;
    height: var(--nav-h);
    min-height: var(--nav-h);
    padding-left: clamp(10px, 2vw, 24px);
    padding-right: clamp(10px, 2vw, 24px);
    /* IMPORTANT: remove any padding-top you had here */
    padding-top: 0;
    background: color-mix(in hsl, var(--card) 96%, transparent);
    backdrop-filter: blur(6px);
  }

  /* Push the whole page down by the bar height + safe-area + a small gap */
  .page-container{
    padding-top: calc(var(--nav-h) + env(safe-area-inset-top) + var(--nav-gap));
  }

  .nav-toggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Dropdown positions itself just under the bar + the gap */
  .nav-links{
    position: fixed;
    left: 8px; right: 8px;
    top: calc(var(--nav-h) + env(safe-area-inset-top) + var(--nav-gap));
    display: none;
    flex-direction: column;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 16px 32px rgba(0,0,0,.14);
    padding: 10px;
    z-index: 1402;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
  }
  .nav-links.show{ display:flex; transform:translateY(0); opacity:1; }

  .nav-links a{
    padding:12px 14px;
    border-radius:10px;
    border-bottom:0;
    font-weight:700;
    text-align:center;
  }
  .nav-links a:hover{
    background: color-mix(in hsl, var(--primary) 10%, transparent);
  }

  /* Submenu becomes accordion */
  .submenu{
    position: static;
    display: none;
    min-width: 0;
    border: 0;
    box-shadow: none;
    padding: 0 0 6px;
  }
  .has-submenu > a{
    display:flex; align-items:center; justify-content:center; gap:8px;
  }
  .has-submenu > a::after{
    content:"";
    width:8px; height:8px;
    border:2px solid var(--accent);
    border-left:0; border-top:0;
    transform: rotate(45deg);
    transition: transform .2s ease;
  }
  .has-submenu.open > a::after{ transform: rotate(-135deg); }
  .has-submenu.open > .submenu{ display:block; }
  .submenu a{ padding:10px 12px; font-weight:600; }
}

/* Prevent background scroll when menu is open (if you use a backdrop) */
body.nav-open{ overflow: hidden; }


/* prevent body scroll when menu is open */
body.nav-open{ overflow:hidden; }

/* motion-respect */
@media (prefers-reduced-motion: reduce){
  .nav-toggle span,
  .nav-links{ transition:none; }
}


/* ≤ 700px: tighten layout, hide right rail if you want max focus */
@media (max-width: 700px) {
  .dash-main { padding: 16px 3vw; gap: 14px; }
  .right-cols { display: contents !important; }
  .profile-card-metrics { grid-template-columns: repeat(3, 1fr); }
  .panel-title { font-size: var(--step-1); }
}

/* ≤ 600px: compact tables & smaller type */
@media (max-width: 600px) {
  .brand-name { font-size: var(--step-1); }
  .nav-links a { font-size: var(--step--1); padding: 10px 10px; }

  /* Smaller table text */
  .profile-table,
  .attendance-table { font-size: var(--step--1); } /* ~12–14px */

  .profile-table td,
  .attendance-table th,
  .attendance-table td {
    padding: 6px 6px;      /* tighter rows */
    line-height: 1.25;
    word-break: break-word;
  }

  /* Attendance: wrap (no sideways scroll) */
  .attendance-panel { overflow-x: visible; }
  .attendance-table {
    display: table;
    table-layout: fixed;
    width: 100%;
    min-width: 0;
    white-space: normal;
  }
  .attendance-table th,
  .attendance-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Optional: slightly smaller panel header on mobile */
  .panel-title { font-size: var(--step-0); padding: 10px 12px; }
}

/* ≤ 480px: compact yet airy */
@media (max-width: 480px) {
  .top-navbar { padding: 0 8px; min-height: 50px; }
  .brand-name { font-size: var(--step-1); }
  .profile-photo-box img { width: 72px; height: 72px; }
  .panel-title { font-size: var(--step-0); padding: 10px 12px; }
  .main-footer { font-size: var(--step--1); padding: 10px 0 9px; }
}

/* Inputs in editable tables */
.profile-table input[type="text"],
.profile-table input[type="email"],
.profile-table input[type="date"],
.profile-table input[type="time"],
.profile-table input[type="number"],
.profile-table select,
.profile-table textarea {
  width: 100%; font-size: var(--step-0);
  padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.profile-table textarea { min-height: 96px; resize: vertical; }

.edit-btn {
  background: transparent; border: 0; cursor: pointer;
  padding: 6px 10px; font-size: 18px; border-radius: 8px;
}
@media (hover: none) and (pointer: coarse) {
  .edit-btn:active, .edit-btn:focus { background: color-mix(in hsl, var(--primary) 18%, transparent); }
}

/* Pending applications, chips */
.pending-apps { display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 14px; }
.pending-app {
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 8px;
  background: color-mix(in hsl, var(--bg) 60%, var(--card));
  border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px;
}
.pending-app-title { font-weight: 700; color: var(--ink); }
.pending-app-sub { font-size: var(--step--1); color: var(--muted); margin-top: 2px; }
.pending-app-actions { display: inline-flex; align-items: center; gap: 8px; }
.status-chip {
  padding: 4px 8px; font-size: var(--step--1); font-weight: 800;
  text-transform: uppercase; letter-spacing: .02em; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--line);
}
.status-chip.pending  { background:#fff4cc; color:#8a6d00; border-color:#ffe8a3; }
.status-chip.for-approval { background:#fff4cc; color:#8a6d00; border-color:#ffe8a3; }
.status-chip.approved { background:#d9fbe0; color:#156d2f; border-color:#bff3cb; }
.status-chip.rejected { background:#fde2e1; color:#b42318; border-color:#f7b0ac; }
.del-btn {
  background: transparent; border: none; cursor: pointer;
  font-size: 18px; line-height: 1; padding: 4px 6px; color: #9ca3af;
  border-radius: 8px;
}
.del-btn:hover { background: #fee2e2; color: #b91c1c; }

/* Utility */
.hidden { display: none !important; }

/* Keep your narrow time input overrides */
#timeFrom, #timeTo {
  width: 110px !important; min-width: 85px; max-width: 85px; text-align: center;
}
#timeFrom::-webkit-calendar-picker-indicator,
#timeTo::-webkit-calendar-picker-indicator { transform: scale(0.85); }
.hidden-time { position: absolute !important; left: -9999px !important; width: 0 !important; height: 0 !important; padding: 0 !important; margin: 0 !important; border: 0 !important; }
.time-12h.hour-only .t-hour { width: 66px; min-width: 66px; font-size: var(--step-0); padding: 4px 6px; border: 1px solid var(--line); height: 34px; }

.mode-tabs{display:inline-flex;border-radius:10px;overflow:hidden;border:1px solid var(--line);margin-bottom:6px}
.mode-tabs button{padding:6px 10px;border:0;background:color-mix(in hsl, var(--bg) 60%, var(--card));font-weight:700;cursor:pointer}
.mode-tabs button.active{background:var(--primary);color:#fff}
.sched-pair{display:flex;gap:8px;align-items:center;margin-bottom:6px}
.dash{opacity:.7}

.apps-filter{
  display:flex; gap:8px; padding:8px 10px; margin:-6px -6px 10px;
  border-bottom:1px solid #273043; background:rgba(255,255,255,0.02);
  position:sticky; top:0; z-index:1;
}
.apps-filter .pill{
  display:inline-flex; align-items:center; gap:3px;
  font-weight:600; font-size:10px; letter-spacing:.2px;
  padding:6px 10px; border-radius:999px; border:1px solid #2f3b54;
  background:#0f172a; color:#dbe4f3; cursor:pointer;
  transition:transform .05s ease, background .2s ease, border-color .2s ease;
}
.apps-filter .pill:hover{ background:#111b34; border-color:#3c4b6e; }
.apps-filter .pill.active{
  background:#1f2b49; border-color:#4f6ad7; box-shadow:0 0 0 1px inset #4f6ad7;
}
.apps-filter .pill:focus-visible{ outline:2px solid #6282ff; outline-offset:2px; }

.apps-filter .pill .count{
  min-width:18px; height:18px; border-radius:9px; padding:0 6px;
  display:inline-flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:700; background:#222b45; color:#c6d3ff;
}

/* Optional: different badge hues by category (auto-applied via [data-appfilter]) */
.apps-filter .pill[data-appfilter="approved"] .count     { background:#13331f; color:#7ff0a3; }
.apps-filter .pill[data-appfilter="for approval"] .count { background:#332b12; color:#ffd38c; }
.apps-filter .pill[data-appfilter="rejected"] .count     { background:#3a1720; color:#ff9fb0; }

/* ==== Attendance width (desktop only) ==== */
@media (min-width: 1100px){
  /* make the panel wider but still centered */
  .attendance-panel{
    max-width: min(96vw, 1300px);   /* was 1400 cap but you were seeing ~700; pick what you like */
    width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  /* let the table use available width comfortably */
  .attendance-table{
    table-layout: auto;             /* not fixed */
    width: 100%;
  }

  /* optional: slightly wider first/last columns for readability */
  .attendance-table th:nth-child(1),
  .attendance-table td:nth-child(1){ width: 130px; }  /* Date */
  .attendance-table th:last-child,
  .attendance-table td:last-child{ width: 130px; }    /* Status (or Undertime if present) */
}

/* === Leave Request page: optional compact layout (disabled by default) === */
.leave-page.form-compact .dash-main {
  display: flex;
  justify-content: center;
  max-width: 1400px;
  margin: 0 auto;
}

.leave-page.form-compact .center-cols {
  max-width: 700px;
  width: 100%;
}
