/* ============================================================
   OMS Custom Styles (Office Management System)
   Moved from header.php <style> blocks into one file.
   Load AFTER Bootstrap 5.3.
   ============================================================ */


/* ============================================================
   0) Global overflow helpers
   Prevents horizontal blank space / unwanted horizontal scroll.
   ============================================================ */
html, body { overflow-x: hidden; }


/* ============================================================
   1) Sidebar (UI + Layout)
   Used by: header.php + sidebar.php for desktop sidebar + mobile offcanvas.
   ============================================================ */

:root{
  --sidebar-w: 280px;

  --sb-bg: #ffffff;
  --sb-border: #e9ecef;
  --sb-text: #212529;
  --sb-muted: #adb5bd;
  --sb-heading: #2f5ae5;
  --sb-active-bg: #e7f1ff;
  --sb-active-text: #2f5ae5;
  --sb-hover-bg: #f8f9fa;
  --sb-subline: #cfe2ff;
}

.app-shell{
  min-height: 100vh;
  background: #f6f7fb;
}
/* Fixed navbar spacing */
.app-shell{
  padding-top: 56px; /* same as .topbar height */
}


.topbar{
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--sb-border);
}

.sidebar{
  width: var(--sidebar-w);
  background: var(--sb-bg);
  border-right: 1px solid var(--sb-border);
  overflow-y: auto;
}

@media (min-width: 992px){
  .sidebar.sidebar-fixed{
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 1020;
  }

  /* ✅ IMPORTANT FIX: prevents right-side blank space */
  .main-content{
    margin-left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w));
    overflow-x: hidden;
  }
}

.sb-section{
  font-size: .70rem;
  letter-spacing: .08em;
  font-weight: 700;
  color: var(--sb-heading);
  padding: .75rem 1rem .35rem 1rem;
  text-transform: uppercase;
}

.sb-nav .nav-link{
  color: var(--sb-text);
  padding: .55rem 1rem;
  font-size: .90rem;
  display: flex;
  align-items: center;
  gap: .75rem;
  border-left: 3px solid transparent;
  white-space: nowrap;
}

.sb-nav .nav-link .sb-ico{
  width: 1.25rem;
  text-align: center;
  color: #000000;
}

.sb-nav .nav-link:hover{
  background: var(--sb-hover-bg);
  color: #495057;
}

.sb-nav .nav-link.active{
  background: var(--sb-active-bg);
  color: var(--sb-active-text);
  border-left-color: var(--sb-active-text);
}

.sb-nav .nav-link.active .sb-ico{
  color: var(--sb-active-text);
}

.sb-caret{
  margin-left: auto;
  font-size: .80rem;
  color: var(--sb-muted);
  transition: transform .15s ease;
}

.sb-nav .nav-link[aria-expanded="true"] .sb-caret{
  transform: rotate(90deg);
}

.sb-sub{
  border-left: 2px solid var(--sb-subline);
  margin-left: 2.05rem;
  padding-left: .35rem;
}

.sb-sub .nav-link{
  padding: .45rem 1rem .45rem 1.0rem;
  font-size: .88rem;
  position: relative;
}

.sb-sub .nav-link::before{
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #dbeafe;
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
}

.offcanvas.offcanvas-start{
  width: var(--sidebar-w);
  border-right: 1px solid var(--sb-border);
}

.content-wrap{
  padding: 1.25rem;
}


/* ============================================================
   2) Timesheet table scroll box + sticky header
   Used by: dashboard/timesheets lists
   ============================================================ */
.timesheet-scroll {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;              /* Firefox */
}
.timesheet-scroll::-webkit-scrollbar { /* Chrome, Edge, Safari */
  display: none;
}
.timesheet-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: #f8f9fa; /* same as .table-light */
}


/* ============================================================
   3) Employee timers UI
   Used by: employee navbar timers (work/break)
   ============================================================ */
.timer-box{
  display:flex;
  align-items:center;
  gap: .6rem;
  padding: .25rem .35rem;
  border-radius: var(--bs-border-radius-sm);
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  margin-right: 1rem;
}
.timer-divider{
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.25);
}
.timer-chip{
  border-radius: var(--bs-border-radius-sm);
  border: 1px solid rgba(0,0,0,.10);
  background: linear-gradient(180deg, #f7f8fa 0%, #e9ecef 100%);
  box-shadow: 0 .6rem 1.2rem rgba(0,0,0,.12), inset 0 1px 0 rgba(255,255,255,.9);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: .0em;
  color: #6c757d;
  padding: .05rem .5rem;
  margin-right: 0;
}


/* ============================================================
   4) Hide page scrollbar but keep scroll working
   (You had this in header.php)
   ============================================================ */
html, body {
  -ms-overflow-style: none;  /* IE/Edge */
  scrollbar-width: none;     /* Firefox */
}
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;             /* Chrome/Safari */
}


/* ============================================================
   5) Registration / form styling
   Used by: add_user/register-style pages
   ============================================================ */
.reg-page-bg { min-height: calc(100vh - 120px); }

.reg-card {
  max-width: 720px;
  width: 100%;
  background: #ffffff;
  border-radius: 4px;
  overflow: hidden;
}
.reg-card-header { background: #212529; padding: 24px 32px; }
.reg-card-header h2 { font-size: 26px; letter-spacing: 1px; }
.reg-card-body { padding: 32px 40px 40px; }

.reg-section-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: #212529;
  margin-bottom: 1rem;
}
.reg-label { font-size: 0.85rem; color: #777; margin-bottom: 0.2rem; }

.reg-input {
  font-size: 0.85rem;
  border: none;
  border-bottom: 1px solid #ccc;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  padding-top: 0.15rem;
  padding-bottom: 0.15rem;
  background: transparent;
  box-shadow: none !important;
}
.form-select-sm.reg-input { min-height: calc(1.5em + .5rem + 2px); }

.reg-input:focus {
  border-bottom-color: #248aa2;
  outline: 0;
  box-shadow: none;
}

.reg-textarea {
  border: none;
  border-bottom: 1px solid #ccc;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  resize: vertical;
  min-height: 60px;
  box-shadow: none !important;
}
.reg-textarea:focus {
  border-bottom-color: #248aa2;
  outline: 0;
  box-shadow: none;
}

/* Only show red when invalid. (No green ticks / no is-valid usage) */
.reg-input.is-invalid { border-bottom-color: #dc3545 !important; }
.invalid-feedback { font-size: 0.8rem; }


/* ============================================================
   6) Attendance compact table + net payable band
   Used by: attendance/salary UI
   ============================================================ */
.table-attendance-compact > thead > tr > th,
.table-attendance-compact > tbody > tr > td {
  padding-top: 0.12rem;
  padding-bottom: 0.12rem;
}

.net-payable-band{
  background:#dff0d8;
  border-left:5px solid #2e7d32;
  padding:20px 14px;
  margin:8px 0 14px;
  font-family:inherit;
  font-size:1rem;
  line-height:1.3;
  color:#000;
}
.net-payable-band .net-title{ margin:0; font-size:1rem; }
.net-payable-band .net-amount{ font-weight:700; font-size:1.05rem; }
.net-payable-band .net-words{ font-size:1rem; color:#000; }
.net-payable-band .net-helper{ margin-top:4px; font-size:0.85rem; color:#000; }


/* ============================================================
   7) Holidays table wrapper + sticky header
   Used by: manage_holidays.php
   ============================================================ */
.holiday-table-wrap{
  max-height: 60vh;
  overflow: auto;
  position: relative;
  border: 1px solid rgba(0,0,0,.125);
  border-radius: .25rem;
}

.holiday-table{
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 0;
}

.holiday-table thead th{
  position: sticky;
  top: 0;
  z-index: 10;
  background: #f8f9fa;
  background-clip: padding-box;
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.125);
}

.holiday-table th,
.holiday-table td{
  border-left: 0 !important;
  border-right: 0 !important;
}

.holiday-table tbody td{
  border-bottom: 1px solid rgba(0,0,0,.125);
}
.holiday-table tbody tr:last-child td{
  border-bottom: 0;
}