@import url('https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  --sidebar: #04294d;
  --sidebar-hover: #0a3b66;
  --sidebar-active: #3eabf0;
  --primary: #0a3b66;
  --primary-light: #3eabf0;
  --primary-accent: #3eabf0;
  --gold: #e8a020;
  --gold-light: #ffd166;
  --green: #1e7e4a;
  --green-light: #27ae60;
  --bg: #f0f2f6;
  --card: #ffffff;
  --border: #e5e8ef;
  --text: #1a1d2e;
  --text-2: #5c6278;
  --text-3: #9aa0b4;
  --blue: #2563eb;
  --purple: #7c3aed;
  --orange: #ea580c;
  --red: #dc2626;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 16px rgba(0, 0, 0, .06);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, .12);
  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 260px;
  --topbar-h: 64px;
  --transition: .18s cubic-bezier(.4, 0, .2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Raleway", sans-serif !important;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ───────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  text-decoration: none;
}

.sidebar-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--primary-light) 100%);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
  color: #fff;
  /*   */
  font-weight: 800;
}

.sidebar-brand-text {
  flex: 1;
  min-width: 0;
}

.sidebar-brand-name {
  /*   */
  font-weight: 700;
  font-size: 13px;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand-sub {
  font-size: 10px;
  color: rgba(255, 255, 255, .45);
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-section {
  padding: 20px 12px 4px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, .3);
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 6px;
}

.nav-item {
  list-style: none;
  margin-bottom: 2px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, .65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link i {
  font-size: 16px;
  flex-shrink: 0;
  width: 20px;
  text-align: center;
}

.nav-link .badge-count {
  margin-left: auto;
  background: var(--gold);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 99px;
}

.nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-link.active {
  background: rgba(62, 171, 240, .15);
  color: var(--sidebar-active);
  font-weight: 600;
}

.nav-link.active i {
  color: var(--sidebar-active);
}

.sidebar-footer {
  margin-top: auto;
  padding: 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--gold));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.3;
}

.user-role {
  font-size: 11px;
  color: rgba(255, 255, 255, .4);
}

/* ── Topbar ───────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 24px;
  z-index: 900;
  box-shadow: 0 1px 0 var(--border);
}

.topbar-title {
  /*   */
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  flex: 1;
}

.topbar-title span {
  color: var(--primary-light);
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  min-width: 220px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.topbar-search:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(62, 171, 240, .12);
}

.topbar-search input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text);
  width: 100%;
}

.topbar-search i {
  color: var(--text-3);
  font-size: 14px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-2);
  font-size: 16px;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  position: relative;
}

.topbar-btn:hover {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--primary-light);
}

.topbar-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: var(--gold);
  border-radius: 50%;
  border: 1px solid var(--card);
}

.topbar-date {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  white-space: nowrap;
}

/* ── Main Content ─────────────────────────────────── */
.main-content {
  margin-left: var(--sidebar-w);
  margin-top: var(--topbar-h);
  padding: 28px 28px;
  min-height: calc(100vh - var(--topbar-h));
}

/* ── Card ─────────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 0;
  gap: 12px;
}

.card-title {
  /*   */
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.card-body {
  padding: 16px 20px 20px;
}

/* ── Stat Card ────────────────────────────────────── */
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  /* background: var(--accent-color, var(--primary-light)); */
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-value {
  /*   */
  font-weight: 800;
  font-size: 28px;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.stat-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: 99px;
}

.stat-change.up {
  background: rgba(39, 174, 96, .1);
  color: var(--green-light);
}

.stat-change.down {
  background: rgba(220, 38, 38, .1);
  color: var(--red);
}

/* ── Table ────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-2);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover td {
  background: rgba(62, 171, 240, .04);
}

/* ── Badges ────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.badge-present {
  background: rgba(39, 174, 96, .12);
  color: var(--green-light);
}

.badge-absent {
  background: rgba(220, 38, 38, .12);
  color: var(--red);
}

.badge-late {
  background: rgba(232, 160, 32, .12);
  color: var(--gold);
}

.badge-leave {
  background: rgba(37, 99, 235, .12);
  color: var(--blue);
}

.badge-off {
  background: rgba(156, 163, 175, .12);
  color: var(--text-3);
}

.badge-pending {
  background: rgba(232, 160, 32, .12);
  color: var(--gold);
}

.badge-approved {
  background: rgba(39, 174, 96, .12);
  color: var(--green-light);
}

.badge-rejected {
  background: rgba(220, 38, 38, .12);
  color: var(--red);
}

.badge-primary {
  background: rgba(62, 171, 240, .12);
  color: var(--primary-light);
}

.badge-purple {
  background: rgba(124, 58, 237, .12);
  color: var(--purple);
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--primary-light);
  color: #fff;
}

.btn-accent:hover {
  background: var(--primary);
}

.btn-gold {
  background: var(--gold);
  color: #fff;
}

.btn-gold:hover {
  background: var(--gold-light);
  color: var(--text);
}

.btn-green {
  background: var(--green-light);
  color: #fff;
}

.btn-green:hover {
  background: var(--green);
}

.btn-danger {
  background: var(--red);
  color: #fff;
}

.btn-danger:hover {
  opacity: .85;
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--primary);
  border-color: var(--primary-light);
}

.btn-sm {
  padding: 5px 11px;
  font-size: 12px;
}

.btn-icon {
  padding: 8px;
  gap: 0;
}

/* ── Form ─────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: .02em;
}

.form-control {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  /* font-family: var(--font-body); */
  font-size: 13.5px;
  color: var(--text);
  background: var(--card);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(62, 171, 240, .12);
}

select.form-control {
  cursor: pointer;
}

/* ── Tabs ─────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn .2s ease;
}

/* ── Modal ────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 29, 46, .45);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all .2s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(.97);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}

.modal-box.modal-lg {
  max-width: 800px;
}

.modal-box.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  /*   */
  font-weight: 700;
  font-size: 16px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Page Header ──────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-title {
  /*   */
  font-weight: 800;
  font-size: 22px;
  color: var(--text);
}

.page-sub {
  font-size: 13px;
  color: var(--text-3);
}

.page-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Avatar ───────────────────────────────────────── */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Progress ─────────────────────────────────────── */
.progress {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .6s ease;
}

/* ── Animations ───────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .5
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.animate-in {
  animation: fadeIn .35s ease both;
}

.animate-in-delayed {
  animation: fadeIn .35s .1s ease both;
}

/* ── Utility ──────────────────────────────────────── */
.d-flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-3 {
  margin-top: 12px;
}

.mt-4 {
  margin-top: 16px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-3 {
  margin-bottom: 12px;
}

.mb-4 {
  margin-bottom: 16px;
}

.text-muted {
  color: var(--text-3);
}

.text-sm {
  font-size: 12px;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.text-end {
  text-align: right;
}

.w-100 {
  width: 100%;
}

/* grid helpers */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.row>[class*="col-"] {
  padding: 0 10px;
}

.col-12 {
  flex: 0 0 100%;
  max-width: 100%;
}

.col-6 {
  flex: 0 0 50%;
  max-width: 50%;
}

.col-4 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
}

.col-3 {
  flex: 0 0 25%;
  max-width: 25%;
}

.col-8 {
  flex: 0 0 66.666%;
  max-width: 66.666%;
}

.col-9 {
  flex: 0 0 75%;
  max-width: 75%;
}

.g-3 {
  gap: 12px;
}

.g-4 {
  gap: 16px;
}

/* ── Toast ────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  animation: slideIn .25s ease;
  min-width: 260px;
  max-width: 340px;
}

.toast-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.toast.success .toast-icon {
  color: var(--green-light);
}

.toast.error .toast-icon {
  color: var(--red);
}

.toast.info .toast-icon {
  color: var(--primary-light);
}

/* ── Empty State ──────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: .4;
}

.empty-state p {
  font-size: 14px;
}

/* ── Filters bar ──────────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .topbar {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }

  :root {
    --sidebar-w: 260px;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 18px 14px;
  }

  .col-4,
  .col-3,
  .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}