/* subtitles should be inside the card*/
/*Page Title, Print button & "Back to..." button should be on same line */
/*Page intro should be above Page title and buttons*/
/*Download Csv button & upload csv section should be on same line and use the template within assets/app.css*/
/*Green button for save, submit, add, edit, Blue buttons for download, standard grey for links to other pages, unless they are edit or "holiday calc"*/
/* Page spacing and style should use month_week_converter.php as a template*/
/* Pop-up prompts should be used where appropriate and should be blue for informative messaging and red for errors & skipped rows*/


@font-face{font-family:Aptos;src:local("Aptos");}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{font-family:Aptos,"Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;background:#f5f5f5;margin:0}

/* Header bar */
.bar{background:#333;color:#fff;padding:24px 16px;position:sticky;top:0;z-index:1000;display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap}
.bar .title{font-size:24px;font-weight:800;line-height:1.15;margin-right:16px;white-space:nowrap}
.nav{display:flex;flex-wrap:wrap;gap:14px}
.nav a{color:#fff;text-decoration:none;font-size:16px;padding:8px 12px;border-radius:8px;transition:background-color .15s,box-shadow .15s}
.nav a:hover,.nav a:focus{background:rgba(255,255,255,.12);outline:none}
.nav a.active{background:rgba(255,255,255,.22);box-shadow:0 0 0 1px rgba(255,255,255,.25) inset;font-weight:600}
.nav-spacer{height:8px}

/* Page container */
.wrap{max-width:1100px;margin:16px auto;background:#fff;padding:16px;border-radius:10px;box-shadow:0 2px 10px rgba(0,0,0,.05)}

h2{margin:8px 0 12px} h3{margin:8px 0} 
.muted{color:#666;font-size:12px}

/* Sections & cards */
.section{margin:12px 0;padding:10px 0;border-top:1px solid #eee}
.section:first-of-type{border-top:0}
/* Tighten spacing after summary placards and quick-actions grid */
.section:has(> .grid.grid-4),
.section:has(> .card > .grid.grid-4) {
  margin-bottom: 0;
  padding-bottom: 8;
}
.section:has(> .grid.grid-4) + .section,
.section:has(> .card > .grid.grid-4) + .section {
  margin-top: 0;
}
.card{background:#fafafa;border:1px solid #eee;border-radius:10px;padding:12px}
/* Card links: keep plain text style (no purple/underline) */
a.card.link-card,
a.card.link-card:link,
a.card.link-card:visited,
a.card.link-card:hover,
a.card.link-card:active{
  color:inherit;
  text-decoration:none;
}



/* Allow wide tables to scroll inside cards instead of breaking layout */
.card{overflow-x:auto}
.card table{width:100%}

/* Compact placards (dashboard + any 4-col metric grids) */
.grid-4 > .card { padding-top: 8px; }
.grid-4 > .card h4 { margin-top: 0; margin-bottom: 16px; }


/* === Unified grid helpers (site-wide) === */
.grid{display:grid;gap:12px;align-items:start}
.grid-2{grid-template-columns:1fr 1fr}
.grid-3{grid-template-columns:1fr 1fr 1fr; column-gap:96px}
.grid-4{grid-template-columns:1fr 1fr 1fr 1fr}
@media (max-width:640px){
  .grid-2,.grid-3,.grid-4{grid-template-columns:1fr}
}

/* Forms */
label{display:block;margin:6px 0 4px}
input[type="text"],input[type="number"],select{width:100%;padding:8px;border:1px solid #ccc;border-radius:6px;font-family:inherit}

/* Hide native number spinners where class="no-spinner" is applied */
input.no-spinner::-webkit-inner-spin-button,
input.no-spinner::-webkit-outer-spin-button{ -webkit-appearance:none; margin:0; }
input.no-spinner{ -moz-appearance:textfield; appearance:textfield; }

/* Disabled look for “override off” fields */
select:disabled,input:disabled{background:#e9ecef;color:#6c757d;cursor:not-allowed}

/* Buttons (site-wide, unified) */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-width:140px;
  height:36px;
  padding:0 14px;
  background:#4CAF50; /* default green */
  color:#fff;
  border:0;
  border-radius:8px;
  text-decoration:none;
  cursor:pointer;
  font-size:14px;
  line-height:1;
  white-space:nowrap;
  user-select:none;
  transition:filter .15s ease, box-shadow .15s ease, transform .05s ease;
}
.btn:hover{ filter:brightness(.98); }
.btn:active{ transform:translateY(1px); }
.btn:focus-visible{
  outline:2px solid rgba(76,175,80,.45); /* match default green */
  outline-offset:2px;
}

/* Variants */
.btn.blue  { background:#007bff; }
.btn.grey  { background:#6c757d; }
.btn.danger{ background:#d9534f; }
.btn.indigo{ background:#3F51B5; }

.btn.blue:hover   { background:#006fe6; }
.btn.grey:hover   { background:#60686f; }
.btn.danger:hover { background:#c94a46; }
.btn.indigo:hover { background:#3949AB; }

.btn.blue:active   { background:#0066d6; }
.btn.grey:active   { background:#555d63; }
.btn.danger:active { background:#b84340; }
.btn.indigo:active { background:#303F9F; }

    

/* Variant focus rings (accessible, colour-keyed) */
.btn.blue:focus-visible   { outline:2px solid rgba(0,123,255,.45);  outline-offset:2px; }
.btn.grey:focus-visible   { outline:2px solid rgba(108,117,125,.35);outline-offset:2px; }
.btn.danger:focus-visible { outline:2px solid rgba(217,83,79,.45);  outline-offset:2px; }
.btn.indigo:focus-visible { outline:2px solid rgba(63,81,181,.45);  outline-offset:2px; }

/* Disabled state (works for <button disabled> and a.disabled) */
.btn[disabled],
.btn.disabled{
  opacity:.6;
  cursor:not-allowed;
  pointer-events:none;
}

/* Sizes */
.btn.sm{
  min-width:110px;
  height:32px;
  padding:0 12px;
  font-size:13px;
  border-radius:6px;
}
.btn.lg{
  min-width:150px;
  height:42px;
  padding:0 18px;
  font-size:15px;
  border-radius:10px;
}
.btn.xl{
  min-width:170px;
  height:48px;
  padding:0 22px;
  font-size:16px;
  border-radius:12px;
}

/* Full-width helper - to be used for back to top button at the bottom of all scrollable pages*/
.btn.btn-wide{ width:100%; min-width:0; }
.btn-wide{
  display:block;
  width:100%;
  text-align:center;
  background:#6c757d; /* grey by default when used alone */
  color:#fff;
  border:none;
  border-radius:8px;
  padding:12px 14px;
  font-size:14px;
  text-decoration:none;
}
/* Preserve button colours when using .btn-wide */
.btn.btn-wide          { background:#4CAF50; }
.btn.blue.btn-wide     { background:#007bff; }
.btn.grey.btn-wide     { background:#6c757d; }
.btn.danger.btn-wide   { background:#d9534f; }
.btn.indigo.btn-wide   { background:#3F51B5; }



/* Utility rows */
.actions-row{display:flex;align-items:center;justify-content:space-between;gap:0px;margin:8px 0}
.btn-row{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:flex-end}

/* Tables */
table{width:100%;border-collapse:collapse}
th,td{border-bottom:1px solid #eee;padding:8px;white-space:nowrap;text-align:left;font-size:14px;line-height:1.2}
th{background:#fafafa;font-weight:600;vertical-align:top}
td.center,th.center{text-align:center}

/* Tooltip */
.tooltip{position:fixed;z-index:99999;background:#333;color:#fff;padding:8px;border-radius:6px;font-size:12px;line-height:1.3;box-shadow:0 6px 18px rgba(0,0,0,.2);display:none;max-width:280px}
.tip{text-decoration:underline;cursor:help;color:#666}

/* Flash highlight (danger-zone jump) */
.highlight-flash{animation:flash-bg 2s ease}
@keyframes flash-bg{0%{background:#ff9999}50%{background:#ffcccc}100%{background:inherit}}

/* Page intro helper (used on all pages except Dashboard) */
.page-intro{display:block;text-align:center;color:#666;margin:0 auto 16px auto;font-size:13px}
.page-intro a{color:#007bff;text-decoration:none}
.page-intro a:hover{text-decoration:underline}

/* CSV upload area */
.csv-upload{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px}
.csv-upload .muted{font-size:12px}
.csv-upload input[type="file"]{max-width:260px;padding:6px;border:1px solid #ccc;border-radius:6px;font-family:inherit;font-size:14px}
.csv-upload .btn{white-space:nowrap}
.csv-upload p.muted{margin:0}

/* Helper to keep form inputs at 60% width (used in cards) */
.input-60 input{width:60%;max-width:60%}
.input-60 select{width:60%;max-width:60%}

/* Helper to keep form inputs at 30% width (used in cards) */
.input-30 input { width:30%; max-width:30%; }
.input-30 select { width:30%; max-width:30%; }

/* Helper to keep form inputs at 80% width (used in cards) */
.input-80 input { width:80%; max-width:80%; }
.input-80 select { width:80%; max-width:80%; }

/* Small muted note inside cards */
.card-note{margin-top:6px;color:#666;font-size:12px}

/* Sortable table header links */
.table th a.sortable,
.table th a.sortable:link,
.table th a.sortable:visited,
.table th a.sortable:hover,
.table th a.sortable:focus,
.table th a.sortable:active {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

/* Optional: subtle hover without underline (keeps look consistent with converter) */
.table th a.sortable:hover,
.table th a.sortable:focus {
  opacity: 0.85;
}

/* 60% rule for input field widths - used where 2 columns of input data exist */
.emp-details input[type="text"],
.emp-details input[type="number"],
.emp-details select{width:60%;max-width:60%}

/* --- Toasts (site-wide, centered, translucent) --- */
.toast-container{
  position:fixed;
  top:50%;
  left:50%;
  transform:translate(-50%, -50%);
  z-index:10000;
  display:flex;
  flex-direction:column;
  gap:10px;
  align-items:center;
}

.toast{
  display:flex;
  align-items:flex-start;
  gap:12px;
  max-width:420px;
  color:#fff;
  border-radius:12px;
  padding:14px 18px;
  box-shadow:
    0 10px 28px rgba(0,0,0,.22),
    0 2px 8px rgba(0,0,0,.12);
  opacity:0;
  transform:translateY(8px) scale(.98);
  transition:opacity .18s ease, transform .18s ease, box-shadow .18s ease;
  font-size:14px;
  line-height:1.4;

  /* subtle glass effect; gracefully ignored if unsupported */
  backdrop-filter:saturate(120%) blur(6px);
  -webkit-backdrop-filter:saturate(120%) blur(6px);
  border:1px solid rgba(255,255,255,.12);
}

.toast.show{
  opacity:1;
  transform:translateY(0) scale(1);
}

/* Base (fallback) — only used if a type class isn't present */
.toast{ background:rgba(33,33,33,.88); }

/* Type colours with slight transparency */
.toast.info   { background:rgba(21,101,192,.92); }   /* #1565c0 */
.toast.success{ background:rgba(76,175,80,.92); }    /* #4CAF50 */
.toast.error  { background:rgba(217,83,79,.92); }    /* #d9534f */

/* Size rules (keep your preference: success + error larger) */
.toast.success,
.toast.error{
  padding:30px 40px;
  font-size:16px;
}

/* Content & close */
.toast .msg{ line-height:1.4; }
.toast .close{
  margin-left:auto;
  cursor:pointer;
  font-weight:700;
  opacity:.9;
  align-self:center;
}
.toast .close:hover{ opacity:1; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .toast{ transition:none; transform:none !important; }
}

/* =============== Placards =============== */
.card.placard {
  display: flex;
  flex-direction: column;
    justify-content: flex-start;
  min-height: 100px; /* modest height so copy + button breathe */
  gap: 10px;
}

.placard-title {
  margin: 0 0 16px 0;
}

.placard-meta {
  margin: 0;
}

/* Optional: make the button span full width on small screens for easy tapping */
@media (max-width: 640px) {
  .card.placard .btn {
    width: 100%;
  }
}
/* Company title / switcher */
.bar .brand-title { font-weight: 800; letter-spacing: .2px; }
.bar .brand-title .title-sep { opacity:.85; }
.bar .brand-title .page-title-text { font-weight: 700; }

/* Make the company name look like text but clickable */
.company-btn{
  background:none; border:0; color:#fff; font:inherit; font-weight:800; padding:0;
  cursor:pointer; text-decoration:none;
}
.company-btn:hover, .company-btn:focus{ text-decoration:underline; outline:none; }

/* Dropdown */
.company-menu{
  position:absolute; top:100%; left:0; margin-top:10px;
  background:#fff; color:#333; width:320px; padding:10px;
  border-radius:10px; box-shadow:0 10px 30px rgba(0,0,0,.15);
  z-index:1000;
}
.company-menu .company-filter{
  width:100%; padding:8px 10px; border:1px solid #ddd; border-radius:8px; font-size:14px;
  margin-bottom:8px;
}
.company-menu .company-list{
  max-height:260px; overflow:auto; border:1px solid #eee; border-radius:8px; padding:4px;
}
.company-menu .company-list a{
  display:block; padding:8px 8px; border-radius:6px; color:#333; text-decoration:none; font-size:14px;
}
.company-menu .company-list a:hover{ background:#f6f6f6; }
.company-menu .company-list a.active{ font-weight:600; }
.company-menu .company-menu-actions{ margin-top:8px; display:flex; justify-content:flex-end; }
.company-menu { font-weight: 400; } /* reset bold inside the dropdown */

/* =========================
   Spacing utilities (global)
   =========================
   Use on any element:
     - mt-8 / mt-12 / mt-16 / mt-24       -> margin-top
     - mb-8 / mb-12 / mb-16 / mb-24       -> margin-bottom
     - space-8 / space-12 / space-16 / space-24 -> margin top & bottom
   Or drop a standalone spacer block:
     - <div class="spacer-16"></div>  (fixed height)
   Intentional: !important to win over incidental margins without
   disturbing existing component CSS. No existing selectors are changed.
*/

.mt-0   { margin-top: 0px  !important; }
.mt-8   { margin-top: 8px  !important; }
.mt-12  { margin-top: 12px !important; }
.mt-16  { margin-top: 16px !important; }
.mt-24  { margin-top: 24px !important; }

.mb-0   { margin-bottom: 0px  !important; }
.mb-8   { margin-bottom: 8px  !important; }
.mb-12  { margin-bottom: 12px !important; }
.mb-16  { margin-bottom: 16px !important; }
.mb-24  { margin-bottom: 24px !important; }

.space-8  { margin-top: 8px  !important; margin-bottom: 8px  !important; }
.space-12 { margin-top: 12px !important; margin-bottom: 12px !important; }
.space-16 { margin-top: 16px !important; margin-bottom: 16px !important; }
.space-24 { margin-top: 24px !important; margin-bottom: 24px !important; }

/* Standalone spacer blocks */
.spacer-8  { height: 8px; }
.spacer-12 { height: 12px; }
.spacer-16 { height: 16px; }
.spacer-24 { height: 24px; }

/* ==== Page header, titles & CSV bar (appended) ==== */

/* Put Page Title + buttons on one row (reuse .actions-row) */
.actions-row.page-header,
.page-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
  margin:8px 0 12px;
}

/* Title group (use with <div class="page-title"> <h2 class="title-fancy">… */
.page-title{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:36px; /* keeps height aligned with buttons */
}


/* Optional small subtitle text (use inside cards) */
.subtitle{
  font-size:14px;
  color:#666;
  margin:0 0 8px 0;
}
.card .subtitle{ margin-top:0; } /* subtitle starts flush at top inside cards */

/* CSV: button + upload area on one row */
.csv-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  flex-wrap:wrap;
}

/* When csv-upload sits in .csv-bar we remove its top margin to align with the button */
.csv-bar .csv-upload{ margin-top:0; }

/* Ensure .btn-row inside any header aligns to the right consistently */
.page-header .btn-row{ justify-content:flex-end; }
