/* =========================================================
   PADMS Technology LLP — Leave Management UI
   Shared design tokens & base styles
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

:root{
  /* --- color: sampled from the PADMS Technology LLP logo --- */
  --paper:        #F5F9FC;
  --paper-dim:    #E9F1F8;
  --surface:      #FFFFFF;
  --ink:          #132A40;
  --ink-soft:     #4C6478;
  --ink-faint:    #4573a0;
  --line:         #D9E4EE;
  --line-strong:  #BDD0E0;

  --pine:         #106CB0;   /* primary brand blue */
  --pine-deep:    #0A2E52;   /* deep navy, sidebar / dark panels */
  --pine-tint:    #E3F0FA;

  --ochre:        #C1852F;
  --ochre-tint:   #F6EBD9;

  --brick:        #A94636;
  --brick-tint:   #F4E4E0;

  --sky:          #05AEE0;   /* bright cyan, from the circuit-brain accent */
  --sky-tint:     #DFF5FC;

  /* --- type --- */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  /* --- shape --- */
  --radius-sm: 4px;
  --radius-md: 8px;

  /* --- shadow (used sparingly, only for floating elements) --- */
  --shadow-float: 0 12px 28px -12px rgba(27, 58, 49, 0.28);
}

*, *::before, *::after{ box-sizing: border-box; }

html{ -webkit-font-smoothing: antialiased; }

body{
  margin: 0;
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  text-transform: capitalize;
}

p {
    text-transform: none;
}
label {
    text-transform: none;
}

span {
    text-transform: none;
}

.title{
  text-transform: none;
}

.meta{
  text-transform: none;
}

.leave{
  text-transform: none;
}

h1, h2, h3, h4{
  font-family: var(--font-display);
  font-weight: 600;
  margin: 0;
  color: var(--ink);
}

p{ margin: 0; }

a{ color: inherit; }

button{ font-family: var(--font-body); }

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

.visually-hidden{
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}

.btn:active{ transform: translateY(1px); }

.btn-primary{
  background: var(--pine);
  color: var(--paper);
}
.btn-primary:hover{ background: var(--pine-deep); }

.btn-ghost{
  background: transparent;
  border-color: var(--line-strong);
  color: var(--ink);
}
.btn-ghost:hover{ border-color: var(--pine); color: var(--pine); }

.btn-text{
  background: none;
  border: none;
  color: var(--pine);
  padding: 8px 4px;
  font-weight: 600;
}
.btn-text:hover{ color: var(--pine-deep); text-decoration: underline; }

.btn-block{ width: 100%; }

/* =========================================================
   Form elements
   ========================================================= */

.field{
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
}

.field label{
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field .hint{
  font-size: 12px;
  color: var(--ink-faint);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
select,
textarea{
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 0.15s ease;
}

input:focus, select:focus, textarea:focus{
  border-color: var(--pine);
}

textarea{ resize: vertical; min-height: 90px; font-family: var(--font-body); }

.checkbox-row{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink-soft);
}

.checkbox-row input{ width: 16px; height: 16px; accent-color: var(--pine); }

/* =========================================================
   Status badges
   ========================================================= */

.badge{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
}

.badge::before{
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-approved{ background: var(--pine-tint); color: var(--pine); }
.badge-pending{  background: var(--ochre-tint); color: var(--ochre); }
.badge-rejected{ background: var(--brick-tint); color: var(--brick); }
.badge-cancelled{ background: var(--sky-tint); color: var(--sky); }


/* =========================================================
   App shell: sidebar + topbar
   ========================================================= */

.app-shell{
  display: grid;
  grid-template-columns: 286px 1fr;
  min-height: 100vh;
  overflow: visible;
}

.sidebar{
  background: var(--pine-deep);
  color: #C7DCEE;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.avatar-sidebar {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sidebar-profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.brand-block{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.logo-badge {
    border-radius: 12px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFFFFF;
    border-radius: 10px;
    padding: 5px;
}

.brand-icon {
    width: 70px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    flex-shrink: 0;
}

.brand-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.brand-link:hover {
    text-decoration: none;
    color: inherit;
}

.brand-block {
    cursor: pointer;
}

/* Sidebar menu icons */
.sidebar .nav-link svg,
.sidebar .nav-parent svg {
    display: inline-block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    vertical-align: middle;
}

/* Keep icon and menu text aligned */
.sidebar .nav-link,
.sidebar .nav-parent {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar .wordmark{
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--paper);
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.15;
  text-align: center;
}

.sidebar .wordmark small{
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #5FA8D3;
}

.sidebar .wordmark span{ color: #29C4F0; }

.sidebar .tagline{
  font-size: 12px;
  color: #6E96B8;
  margin-bottom: 40px;
}

.nav-group{
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-link{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: #A9C3DA;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link svg{ flex-shrink: 0; opacity: 0.85; }

.nav-link:hover{
  background: rgba(255,255,255,0.06);
  color: var(--paper);
}

.nav-link.active{
  background: rgba(255,255,255,0.1);
  color: var(--paper);
  position: relative;
}

.nav-link.active::before{
  content:'';
  position: absolute;
  left: -20px;
  top: 8px; bottom: 8px;
  width: 3px;
  background: #29C4F0;
  border-radius: 0 3px 3px 0;
}

.sidebar-foot{
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar{
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.avatar-sidebar{ background: #123F68; color: #BEE3F7; border: 1px solid rgba(255,255,255,0.12); }

.sidebar-foot .who{ flex: 1; min-width: 0; }
.sidebar-foot .who .name{ font-size: 13.5px; font-weight: 600; color: var(--paper); }
.sidebar-foot .who .role{ font-size: 12px; color: #6E96B8; }
.sidebar-foot .signout{ color: #6E96B8; }
.sidebar-foot .signout:hover{ color: var(--paper); }

.main {
    padding: 36px 44px 60px;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    height: auto;
    overflow: visible;
}

.topbar{
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 34px;
  margin-top: 15px;
  flex-wrap: wrap;
  gap: 16px;
}

.topbar h1{ font-size: 26px; }
.topbar .date-today{ color: var(--ink-faint); font-size: 13.5px; margin-top: 6px; }

.topbar-actions{ display: flex; align-items: center; gap: 18px; }

.icon-btn{
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  color: var(--ink-soft);
}
.icon-btn:hover{ border-color: var(--pine); color: var(--pine); }

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

.section-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-head h2{ font-size: 17px; }

.card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

/* balance card: styled like a torn calendar page */
.balance-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}

.balance-grid-emp{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}

.balance-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--pine);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  padding: 22px 22px 20px;
}

.balance-card.type-sick{ border-top-color: var(--sky); }
.balance-card.type-wfh{ border-top-color: var(--ochre); }

.balance-card .label{
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 14px;
}

.balance-card .count{
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-display);
}

.balance-card .count .num{ font-size: 40px; font-weight: 600; line-height: 1; }
.balance-card .count .of{ font-size: 14px; color: var(--ink-faint); font-family: var(--font-body); }

.balance-card .meter{
  margin-top: 16px;
  height: 5px;
  border-radius: 3px;
  background: var(--paper-dim);
  overflow: hidden;
}
.balance-card .meter-fill{ height: 100%; background: var(--pine); border-radius: 3px; }
.balance-card.type-sick .meter-fill{ background: var(--sky); }
.balance-card.type-wfh .meter-fill{ background: var(--ochre); }

/* two-column dashboard row */
.dash-row{
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 40px;
  align-items: start;
}

.dash-row-emp{
  display: grid;
  /* grid-template-columns: 1.5fr 1fr; */
  gap: 20px;
  margin-bottom: 40px;
  align-items: start;
}

.panel{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
}

.list-row{
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.list-row:last-child{ border-bottom: none; padding-bottom: 0; }
.list-row:first-child{ padding-top: 0; }

.date-chip{
  font-family: var(--font-display);
  background: var(--pine-tint);
  color: var(--pine-deep);
  border-radius: var(--radius-sm);
  width: 46px; height: 46px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  line-height: 1.1;
}
.date-chip .d{ font-size: 16px; font-weight: 700; }
.date-chip .m{ font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em; }

.list-row .details{ flex: 1; min-width: 0; }
.list-row .details .title{ font-size: 14px; font-weight: 600; }
.list-row .details .meta{ font-size: 12.5px; color: var(--ink-faint); margin-top: 2px; }

.who-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.who-row:last-child{ border-bottom: none; padding-bottom: 0; }
.who-row:first-child{ padding-top: 0; }

.avatar-sm{
  width: 32px; height: 32px;
  background: var(--paper-dim);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  font-size: 12px;
}

.who-row .details .title{ font-size: 13.5px; font-weight: 600; }
.who-row .details .meta{ font-size: 12px; color: var(--ink-faint); }

.empty-note{
  font-size: 13.5px;
  color: var(--ink-faint);
  padding: 6px 0;
}

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

.table-card{
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

thead th{
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-faint);
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-dim);
}

tbody td{
  text-align: center;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  text-transform: none;
}

tbody tr:last-child td{ border-bottom: none; }
tbody tr:hover{ background: var(--paper-dim); }

/* =========================================================
   Filter tabs
   ========================================================= */

.tab-row{
  display: inline-flex;
  gap: 4px;
  background: var(--paper-dim);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 22px;
}

.tab{
  border: none;
  background: transparent;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.tab.active{
  background: var(--surface);
  color: var(--pine);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* =========================================================
   Alerts / banners
   ========================================================= */

.alert{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.alert svg{ flex-shrink: 0; margin-top: 1px; }

.alert-success{ background: var(--pine-tint); border-color: #B9D2C4; color: var(--pine-deep); }
.alert-error{   background: var(--brick-tint); border-color: #E3BDB4; color: var(--brick); }

.alert .alert-title{ font-weight: 700; margin-bottom: 2px; }
.alert .alert-body{ flex: 1; }

.alert .close-alert{
  background: none;
  border: none;
  color: inherit;
  opacity: 0.6;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.alert .close-alert:hover{ opacity: 1; }

/* =========================================================
   Notification panel
   ========================================================= */

.notif-wrap{ position: relative; }

.notif-dot{
  position: absolute;
  top: 6px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brick);
  border: 1.5px solid var(--surface);
}

.notif-panel{
  position: absolute;
  top: 46px; right: 0;
  width: 328px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  z-index: 50;
  display: none;
  overflow: hidden;
}
.notif-panel.open{ display: block; }

.notif-panel-head{
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notif-panel-head .mark-read{
  font-size: 12px;
  font-weight: 600;
  color: var(--pine);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.notif-list{ max-height: 340px; overflow-y: auto; }

.notif-item{
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
}
.notif-item:last-child{ border-bottom: none; }
.notif-item.unread{ background: var(--paper-dim); }

.notif-item .ndot{
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
}
.ndot-approved{ background: var(--pine); }
.ndot-rejected{ background: var(--brick); }
.ndot-pending{ background: var(--ochre); }
.ndot-info{ background: var(--sky); }

.notif-item .body{ flex: 1; min-width: 0; }
.notif-item .body .t{ font-size: 13px; font-weight: 600; line-height: 1.4; }
.notif-item .body .m{ font-size: 12px; color: var(--ink-faint); margin-top: 2px; }

/* =========================================================
   Modal (dialog)
   ========================================================= */

dialog.modal{
  border: none;
  border-radius: var(--radius-md);
  padding: 0;
  width: 420px;
  max-width: 90vw;
  box-shadow: var(--shadow-float);
}
dialog.modal::backdrop{ background: rgba(27, 42, 36, 0.45); }

.modal-head{ padding: 24px 24px 0; }
.modal-head h3{ font-size: 17px; margin-bottom: 6px; }
.modal-head p{ font-size: 13px; color: var(--ink-faint); }

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

.modal-actions{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* =========================================================
   Approval cards (manager)
   ========================================================= */

.approval-card{
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 20px 22px;
  margin-bottom: 14px;
  transition: opacity 0.2s ease;
}

.approval-card.decided{ opacity: 0.55; }

.approval-card .top-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.approval-card .who{ display: flex; align-items: center; gap: 12px; }
.approval-card .who .name{ font-size: 14.5px; font-weight: 700; }
.approval-card .who .sub{ font-size: 12.5px; color: var(--ink-faint); }

.meta-grid{
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  background: var(--paper-dim);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 14px;
}
.meta-grid .k{ font-size: 14px; color: var(--ink-faint); margin-bottom: 3px; }
.meta-grid .v{ font-size: 13.5px; font-weight: 600; }

.approval-card .reason{
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.55;
  margin-bottom: 18px;
}
.approval-card .reason span{color: var(--ink); display: block; }

.approval-card .actions{ display: flex; gap: 10px; }

.btn-approve{ background: var(--pine); color: var(--paper); border-color: var(--pine); }
.btn-approve:hover{ background: var(--pine-deep); }

.btn-reject{ background: var(--surface); color: var(--brick); border-color: #E3BDB4; }
.btn-reject:hover{ background: var(--brick-tint); }

.decided-note{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 0 0;
}

/* =========================================================
   Role toggle (login)
   ========================================================= */

.role-toggle{
  display: flex;
  gap: 4px;
  background: var(--paper-dim);
  padding: 4px;
  border-radius: 999px;
  margin-bottom: 26px;
}
.role-toggle button{
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.role-toggle button.active{
  background: var(--surface);
  color: var(--pine);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* =========================================================
   Nav badge (pending count)
   ========================================================= */

.nav-badge{
  margin-left: auto;
  background: var(--brick);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

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

@media (max-width: 980px){
  .balance-grid{ grid-template-columns: 1fr; }
  .dash-row{ grid-template-columns: 1fr; }
  .cal-shell{ grid-template-columns: 1fr !important; }
  .settings-shell{ grid-template-columns: 1fr !important; }
  .settings-nav{
    position: static !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    gap: 6px !important;
    margin-bottom: 6px;
  }
}

@media (max-width: 600px){
  .cal-day{ min-height: 64px; }
  .cal-pill{ font-size: 9px; }
  .meta-grid{ grid-template-columns: 1fr 1fr; }
  .notif-panel{ width: calc(100vw - 40px); right: -8px; }
}

@media (max-width: 800px){
  .app-shell{ 
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
   }
  .sidebar{
    position: relative;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 16px 20px;
  }
  .sidebar .tagline{ display: none; }
  /* nav-group is shown as a scrollable row by the responsive block at the end of this file */
  .sidebar-foot{ border: none; padding: 0; margin-left: auto; }
  .sidebar-foot .who{ display: none; }
  .main{ 
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 24px 20px 48px;
   }
}

/* ==========================================
   APPLICATION LAYOUT
========================================== */

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    min-height: 100vh;
}
/* Main application layout */
.app-shell {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.main {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

/* Global footer */
.global-footer {
    width: 100%;
    flex-shrink: 0;
    margin-top: auto;
    padding: 13px 20px;
    box-sizing: border-box;

    background: #ffffff;
    border-top: 1px solid #e5eaf1;
    text-align: center;
}

.global-footer p {
    margin: 0;
    color: var(--pine-deep);;
    font-family: var(--font-body);
    font-size: 13px;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .global-footer {
        padding: 12px 14px;
    }
}

/* Footer sits directly under the content, at the bottom of the page */
.global-footer {
    position: static;
    top: auto;
    margin-top: auto;
}

/* Sidebar stays full height beside the content while the page scrolls */
.app-shell {
    align-items: flex-start;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: flex-start;
    height: 100vh;
}

.main {
    min-height: 100vh;
}

/* =========================================================
   FOOTER ALWAYS AT THE VERY BOTTOM (leave + timesheet pages)
   The footer now sits OUTSIDE <main>, in a column wrapper, so the
   page padding of <main> (36px 44px 60px on leave pages) can no
   longer push it up / inset it.  Append at the END of style.css.
   ========================================================= */
.page-col {
    flex: 1;
    min-width: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* main fills the space above the footer (it no longer needs its own 100vh) */
.page-col > .main {
    flex: 1 0 auto;
    min-height: 0;
}

.page-col > .global-footer {
    margin-top: 0;
}

/* Welcome page: whole column is exactly one screen, content area scrolls only if too short */
.page-col:has(.welcome-page) { height: 100vh; }
.page-col > .main:has(.welcome-page) { height: auto; min-height: 0; flex: 1 1 0; overflow-y: auto; }

/* =========================================================
   RESPONSIVE FIXES - keep at the END of style.css
   (the layout rules above this point override the earlier
   mobile rules, so the phone layout is restated here)
   ========================================================= */
@media (max-width: 800px){
  .app-shell{ flex-direction: column; align-items: stretch; height: auto; min-height: 100vh; }

  /* sidebar becomes a top bar with a scrollable menu row */
  .sidebar{
    position: relative; top: auto; align-self: stretch;
    width: 100%; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center;
    gap: 10px 12px; padding: 12px 16px;
  }
  .sidebar .brand-block{ margin-bottom: 0; }
  .sidebar .brand-icon{ width: 44px; }
  .sidebar .tagline{ display: none; }
  .sidebar-foot{ border: none; padding: 0; margin-left: auto; }
  .sidebar-foot .who{ display: none; }

  .nav-group{
    order: 3; flex: 1 1 100%;
    flex-direction: row; gap: 6px;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 4px; scrollbar-width: thin;
  }
  .nav-link{ white-space: nowrap; flex-shrink: 0; padding: 8px 12px; }
  .nav-link.active::before{
    left: 12px; right: 12px; top: auto; bottom: 0;
    width: auto; height: 3px; border-radius: 3px 3px 0 0;
  }

  /* content column */
  .page-col{ width: 100%; min-height: 0; }
  .page-col:has(.welcome-page){ height: auto; }
  .page-col > .main:has(.welcome-page){ flex: 1 0 auto; overflow-y: visible; }
  .main{ padding: 20px 16px 40px; }
  .topbar{ margin-bottom: 22px; }
  .topbar h1{ font-size: 22px; }
}