/* ============================================================
   Seyalix HRMS – Professional UI Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700;800&display=swap');

:root {
  /* Brand palette — derived from the Seyalix HRMS logo (navy → blue → green) */
  --pc-brand:        #0b2a5c;   /* deep navy, from wordmark */
  --pc-brand-mid:    #1670c9;   /* logo blue */
  --pc-brand-light:  #e9f2fc;
  --pc-accent:       #12934e;   /* logo green */
  --pc-accent-light: #e5f7ec;

  /* Sidebar */
  --pc-sidebar-w:    248px;
  --pc-topbar-h:     56px;
  --pc-sidebar-bg:   #0a1f42;
  --pc-sidebar-hover:#122d52;
  --pc-sidebar-text: rgba(255,255,255,0.72);
  --pc-sidebar-text-active: #ffffff;

  /* Surfaces */
  --pc-bg:           #f0f4f9;
  --pc-surface:      #ffffff;
  --pc-border:       #e1e8f0;
  --pc-border-light: #f0f4f9;

  /* Text */
  --pc-text:         #0f1c2e;
  --pc-text2:        #4e6282;
  --pc-text3:        #8fa3bc;

  /* Status */
  --pc-green:  #16a34a; --pc-green-bg:  #f0fdf4;
  --pc-blue:   #1d4ed8; --pc-blue-bg:   #eff6ff;
  --pc-amber:  #d97706; --pc-amber-bg:  #fffbeb;
  --pc-red:    #dc2626; --pc-red-bg:    #fef2f2;
  --pc-purple: #7c3aed; --pc-purple-bg: #f5f3ff;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(15,28,46,0.08), 0 1px 2px rgba(15,28,46,0.04);
  --shadow-md: 0 4px 12px rgba(15,28,46,0.10), 0 2px 4px rgba(15,28,46,0.06);
  --shadow-lg: 0 10px 30px rgba(15,28,46,0.12), 0 4px 8px rgba(15,28,46,0.06);

  /* Radius */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
}

/* ── Global Loading Overlay (create/edit/delete actions) ───── */
.pc-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 46, 0.35);
  backdrop-filter: blur(2px);
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
}
.pc-loading-overlay.show { display: flex; }
.pc-loading-box {
  background: var(--pc-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 22px 30px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 180px;
}
.pc-loading-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--pc-brand-light);
  border-top-color: var(--pc-brand);
  border-radius: 50%;
  animation: pc-spin 0.7s linear infinite;
  flex-shrink: 0;
}
.pc-loading-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--pc-text);
}
@keyframes pc-spin { to { transform: rotate(360deg); } }

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--pc-bg);
  color: var(--pc-text);
  font-size: 13.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--pc-brand-mid); }
a:hover { color: var(--pc-brand); }

h1, h2, h3, h4, .pc-page-header h5, .login-title {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* ── Scrollbars ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8d5e5; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #a8bbcc; }

/* ── Top Navigation Bar ───────────────────────────────────── */
.pc-topbar {
  background: linear-gradient(100deg, var(--pc-brand) 0%, #123a7a 100%);
  height: var(--pc-topbar-h);
  display: flex;
  align-items: center;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(15,28,46,0.20);
}

.pc-logo-badge {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #fff;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.pc-logo-badge img { width: 100%; height: 100%; object-fit: contain; display: block; }

.pc-brand-word {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: 0.2px;
}
.pc-brand-word small {
  display: block;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 9.5px;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  margin-top: -2px;
}

.pc-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 1.5px solid rgba(255,255,255,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
}

/* Topbar dropdown polish */
.pc-topbar .dropdown-menu {
  border: 1px solid var(--pc-border);
  box-shadow: var(--shadow-lg);
  border-radius: var(--r-md);
  padding: 6px;
  margin-top: 8px !important;
}
.pc-topbar .dropdown-item {
  border-radius: var(--r-sm);
  font-size: 12.5px;
  padding: 7px 10px;
  color: var(--pc-text);
}
.pc-topbar .dropdown-item:hover { background: var(--pc-brand-light); color: var(--pc-brand); }
.pc-topbar .dropdown-header { font-size: 12px; padding: 6px 10px 4px; color: var(--pc-text2); }
.pc-topbar .dropdown-divider { border-color: var(--pc-border-light); margin: 4px 0; }

/* ── Sidebar ──────────────────────────────────────────────── */
.pc-sidebar {
  width: var(--pc-sidebar-w);
  background: var(--pc-sidebar-bg);
  height: calc(100vh - var(--pc-topbar-h));
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  position: sticky;
  top: var(--pc-topbar-h);
  align-self: flex-start;
}
.pc-sidebar.collapsed { width: 0; }

/* Sidebar search */
.pc-sidebar-search { padding: 12px 12px 8px; }
.pc-sidebar-search input {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 12px;
  border-radius: var(--r-sm);
  padding: 6px 10px;
  width: 100%;
  transition: background .15s;
}
.pc-sidebar-search input::placeholder { color: rgba(255,255,255,0.38); }
.pc-sidebar-search input:focus {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.22);
  outline: none;
  box-shadow: none;
}

/* Sidebar nav */
.pc-sidebar-nav { flex: 1; overflow-y: auto; padding: 4px 0 16px; }

.pc-nav-section {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.30);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  padding: 14px 16px 4px;
  user-select: none;
}

.pc-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px 8px 16px;
  cursor: pointer;
  color: var(--pc-sidebar-text);
  font-size: 12.5px;
  font-weight: 450;
  border-left: 3px solid transparent;
  margin: 1px 8px;
  border-radius: var(--r-sm);
  transition: background .14s, color .14s;
  user-select: none;
}
.pc-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--pc-sidebar-text-active);
}
.pc-nav-item.active {
  background: rgba(27,108,168,0.35);
  color: var(--pc-sidebar-text-active);
  font-weight: 600;
  border-left-color: var(--pc-accent);
}
.pc-nav-item .ti { font-size: 16px; width: 18px; flex-shrink: 0; }
.pc-chevron { font-size: 11px; transition: transform .2s; margin-left: auto; opacity: 0.6; }

/* Submenu */
.pc-subnav { overflow: hidden; max-height: 0; transition: max-height .25s ease; }
.pc-subnav.open { max-height: 700px; }

.pc-subnav-item {
  display: flex;
  align-items: center;
  padding: 6px 14px 6px 44px;
  cursor: pointer;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  border-radius: var(--r-sm);
  margin: 1px 8px;
  transition: background .14s, color .14s;
  user-select: none;
}
.pc-subnav-item::before { content: '–'; margin-right: 7px; font-size: 10px; opacity: 0.5; }
.pc-subnav-item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.pc-subnav-item.active { color: var(--pc-accent); font-weight: 600; }

/* ── Main content wrapper ─────────────────────────────────── */
.pc-main-wrap {
  display: flex;
  height: calc(100vh - var(--pc-topbar-h));
  overflow: hidden;
}

.pc-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* Page header */
.pc-page-header {
  background: var(--pc-surface);
  border-bottom: 1px solid var(--pc-border);
  padding: 12px 22px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}
.pc-page-header h5 {
  font-size: 15px;
  font-weight: 700;
  color: var(--pc-text);
  letter-spacing: -0.2px;
}
.pc-page-header .breadcrumb { margin: 0; }
.pc-page-header .breadcrumb-item { font-size: 11px; color: var(--pc-text3); }
.pc-page-header .breadcrumb-item a { color: var(--pc-text3); }
.pc-page-header .breadcrumb-item.active { color: var(--pc-text2); }
.pc-page-header .breadcrumb-item + .breadcrumb-item::before { color: var(--pc-text3); }

/* Page body */
.pc-page-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
}

/* ── Cards ────────────────────────────────────────────────── */
.pc-card {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s;
}
.pc-card:hover { box-shadow: var(--shadow-md); }

.pc-card-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pc-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.1px;
}
.pc-card-title a { font-size: 11.5px; font-weight: 500; color: var(--pc-brand-mid); }
.pc-card-title a:hover { color: var(--pc-brand); }

/* ── Stat Cards ───────────────────────────────────────────── */
.pc-stat {
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
  position: relative;
  overflow: hidden;
}
.pc-stat::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 0 var(--r-lg) 0 80px;
  opacity: 0.04;
  background: currentColor;
}
.pc-stat:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }

.pc-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.pc-stat-icon.blue   { background: var(--pc-blue-bg);   color: var(--pc-blue); }
.pc-stat-icon.green  { background: var(--pc-green-bg);  color: var(--pc-green); }
.pc-stat-icon.amber  { background: var(--pc-amber-bg);  color: var(--pc-amber); }
.pc-stat-icon.red    { background: var(--pc-red-bg);    color: var(--pc-red); }
.pc-stat-icon.purple { background: var(--pc-purple-bg); color: var(--pc-purple); }
.pc-stat-icon.brand  { background: var(--pc-brand-light); color: var(--pc-brand); }

.pc-stat-val   { font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -0.5px; }
.pc-stat-label { font-size: 11.5px; font-weight: 500; color: var(--pc-text2); margin-top: 2px; }

/* ── Tables ───────────────────────────────────────────────── */
.pc-table-wrap { overflow-x: auto; }

.pc-table { width: 100%; border-collapse: collapse; }
.pc-table th {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--pc-text2);
  text-align: left;
  padding: 9px 12px;
  border-bottom: 2px solid var(--pc-border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: #fafbfd;
}
.pc-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--pc-border-light);
  font-size: 12.5px;
  color: var(--pc-text);
  vertical-align: middle;
}
.pc-table tbody tr:last-child td { border-bottom: none; }
.pc-table tbody tr { transition: background .12s; }
.pc-table tbody tr:hover td { background: #f7fafd; }

/* ── Forms ────────────────────────────────────────────────── */
.pc-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--pc-text2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  display: block;
}

.form-control, .form-select {
  font-size: 13px;
  border: 1.5px solid var(--pc-border);
  border-radius: var(--r-sm);
  padding: 7px 11px;
  color: var(--pc-text);
  background: var(--pc-surface);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--pc-brand-mid);
  box-shadow: 0 0 0 3px rgba(27,108,168,0.12);
  outline: none;
}
.form-control::placeholder { color: var(--pc-text3); }

.pc-section-divider {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--pc-brand);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 12px 0 8px;
  border-bottom: 2px solid var(--pc-brand-light);
  margin: 14px 0 16px;
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn-pc {
  background: var(--pc-brand);
  color: #fff;
  border: none;
  border-radius: var(--r-sm);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-pc:hover {
  background: var(--pc-brand-mid);
  color: #fff;
  box-shadow: 0 3px 10px rgba(15,76,117,0.25);
  transform: translateY(-1px);
}
.btn-pc:active { transform: translateY(0); }

.btn-outline-pc {
  background: #fff;
  color: var(--pc-brand);
  border: 1px solid var(--pc-brand-light);
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
}
.btn-check:checked + .btn-outline-pc,
.btn-outline-pc:hover {
  background: var(--pc-brand);
  color: #fff;
  border-color: var(--pc-brand);
}

/* Override Bootstrap button with brand colors */
.btn-primary { background: var(--pc-brand); border-color: var(--pc-brand); font-weight: 600; }
.btn-primary:hover { background: var(--pc-brand-mid); border-color: var(--pc-brand-mid); }
.btn-primary:focus { background: var(--pc-brand-mid); border-color: var(--pc-brand-mid); box-shadow: 0 0 0 3px rgba(15,76,117,0.2); }

/* ── Badges / Status ──────────────────────────────────────── */
.badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

/* ── Filters bar ──────────────────────────────────────────── */
.pc-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: flex-end;
  background: var(--pc-surface);
  border: 1px solid var(--pc-border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

/* ── Tabs ─────────────────────────────────────────────────── */
.pc-tabs {
  border-bottom: 2px solid var(--pc-border);
  margin-bottom: 18px;
  display: flex;
  gap: 0;
}
.pc-tab {
  padding: 9px 18px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--pc-text2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
  user-select: none;
}
.pc-tab:hover { color: var(--pc-brand); }
.pc-tab.active { color: var(--pc-brand); border-bottom-color: var(--pc-brand); font-weight: 700; }

/* ── Payslip ──────────────────────────────────────────────── */
.pc-payslip-header {
  background: linear-gradient(135deg, var(--pc-brand) 0%, var(--pc-brand-mid) 100%);
  color: #fff;
  padding: 18px 22px;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.pc-payslip-body {
  border: 1px solid var(--pc-border);
  border-top: none;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
  padding: 18px 22px;
}
.pc-payslip-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--pc-border-light);
  font-size: 12.5px;
}
.pc-payslip-total {
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--pc-brand-light);
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: 14px;
  color: var(--pc-brand);
  margin-top: 10px;
  border: 1px solid rgba(15,76,117,0.1);
}

/* ── Progress ─────────────────────────────────────────────── */
.pc-progress { height: 6px; background: var(--pc-border); border-radius: 10px; overflow: hidden; }
.pc-progress-fill { height: 100%; background: linear-gradient(90deg, var(--pc-brand) 0%, var(--pc-brand-mid) 100%); border-radius: 10px; transition: width .5s; }

/* ── Org chart ────────────────────────────────────────────── */
.org-node {
  background: var(--pc-surface);
  border: 1.5px solid var(--pc-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  text-align: center;
  min-width: 120px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  display: inline-block;
  box-shadow: var(--shadow-sm);
}
.org-node:hover { border-color: var(--pc-brand); box-shadow: var(--shadow-md); }
.org-node.root { background: linear-gradient(135deg, var(--pc-brand), var(--pc-brand-mid)); color: #fff; border-color: transparent; }
.org-node-img {
  width: 34px; height: 34px; border-radius: 50%;
  margin: 0 auto 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  background: var(--pc-brand-light); color: var(--pc-brand);
}
.org-node.root .org-node-img { background: rgba(255,255,255,0.2); color: #fff; }

/* ── Attendance calendar ──────────────────────────────────── */
.att-day {
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  cursor: pointer; aspect-ratio: 1;
  transition: transform .1s;
}
.att-day:hover { transform: scale(1.08); }
.att-day.P  { background: var(--pc-green-bg);  color: #166534; }
.att-day.A  { background: var(--pc-red-bg);    color: #991b1b; }
.att-day.H  { background: var(--pc-amber-bg);  color: #92400e; }
.att-day.L  { background: var(--pc-blue-bg);   color: #1e40af; }
.att-day.WO { background: #f3f4f6;             color: #6b7280; }
.att-day.PH { background: var(--pc-brand-light); color: var(--pc-brand); }
.att-day.future { background: transparent; color: var(--pc-text3); border: 1.5px dashed var(--pc-border); }

/* ── Alert/flash messages ─────────────────────────────────── */
.alert { border-radius: var(--r-md); font-size: 13px; border: none; }
.alert-success { background: var(--pc-green-bg); color: #166534; border-left: 4px solid var(--pc-green); }
.alert-danger  { background: var(--pc-red-bg);   color: #991b1b; border-left: 4px solid var(--pc-red); }
.alert-warning { background: var(--pc-amber-bg); color: #92400e; border-left: 4px solid var(--pc-amber); }
.alert-info    { background: var(--pc-blue-bg);  color: #1e40af; border-left: 4px solid var(--pc-blue); }

/* ── Input group polish ───────────────────────────────────── */
.input-group-text {
  background: #f5f8fc;
  border: 1.5px solid var(--pc-border);
  color: var(--pc-text2);
  font-size: 14px;
}
.input-group .form-control { border-left: 0; }
.input-group .input-group-text + .form-control { border-left: 0 !important; }

/* ── Utility ──────────────────────────────────────────────── */
.hover-lift { transition: box-shadow .15s, transform .15s; }
.hover-lift:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.text-brand  { color: var(--pc-brand) !important; }
.text-muted  { color: var(--pc-text2) !important; }
.bg-brand    { background: var(--pc-brand) !important; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .pc-sidebar {
    position: fixed;
    z-index: 1050;
    top: var(--pc-topbar-h);
    left: 0;
    height: calc(100vh - var(--pc-topbar-h));
    transform: translateX(-100%);
    transition: transform .25s;
    box-shadow: var(--shadow-lg);
  }
  .pc-sidebar.mobile-open { transform: translateX(0); }
  .pc-content { width: 100%; }
  .pc-page-body { padding: 14px 14px; }
}
