:root {
  --portal-blue: #0b68d1;
  --portal-blue-dark: #061d36;
  --portal-blue-mid: #0a3765;
  --portal-bg: #f4f7fb;
  --portal-card: #fff;
  --portal-border: #e7edf5;
  --portal-text: #111827;
  --portal-muted: #667085;
}

body {
  background: var(--portal-bg);
}

.portal-sidebar {
  background: linear-gradient(180deg, #062849 0%, #03182c 100%) !important;
  border-right: 0 !important;
  box-shadow: 10px 0 30px rgba(5, 23, 42, .12);
  width: 19.5rem !important;
}

.portal-brand {
  height: 74px;
  padding: 14px 18px;
}

.portal-brand .app-brand-link {
  color: #fff;
  gap: 10px;
}

.portal-brand-mark {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d7df2, #0d57b7);
  color: #fff;
  font-weight: 800;
  letter-spacing: .3px;
}

.portal-brand-text {
  color: #fff;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 800;
}

.portal-sidebar .menu-header {
  color: rgba(255, 255, 255, .62);
  font-size: 11px;
  letter-spacing: .02em;
  margin: 18px 0 6px;
}

.portal-sidebar .menu-link {
  color: rgba(255, 255, 255, .86) !important;
  border-radius: 8px;
  margin: 3px 14px;
  min-height: 48px;
  font-size: 15px;
  font-weight: 650;
}

.portal-sidebar .menu-item.active > .menu-link {
  background: linear-gradient(135deg, #1677e8, #0b5dc5) !important;
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(10, 104, 209, .28);
}

.portal-sidebar .menu-icon {
  color: inherit !important;
  font-size: 20px;
}

.portal-sidebar .menu-icon::before,
.portal-quick-actions i::before,
.stat-icon i::before,
.request-list i::before,
.notice-list i::before {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  border-radius: 6px;
  font-family: Inter, Arial, sans-serif;
  font-size: .72em;
  font-weight: 800;
  line-height: 1;
}

.ri-home-5-line::before { content: "H"; }
.ri-calendar-check-line::before { content: "LV"; }
.ri-door-open-line::before { content: "IN"; }
.ri-time-line::before { content: "T"; }
.ri-team-line::before { content: "HR"; }
.ri-building-line::before { content: "D"; }
.ri-shield-user-line::before { content: "S"; }
.ri-money-dollar-circle-line::before { content: "$"; }
.ri-upload-cloud-2-line::before { content: "UP"; }
.ri-file-excel-2-line::before { content: "XL"; }
.ri-settings-4-line::before { content: "ST"; }
.ri-suitcase-line::before { content: "P"; }
.ri-file-check-line::before { content: "OK"; }
.ri-inbox-unarchive-line::before { content: "Q"; }
.ri-close-line::before { content: "X"; }
.ri-file-list-3-line::before { content: "SL"; }
.ri-megaphone-line::before { content: "!"; }
.ri-notification-3-line::before { content: "!"; }

.portal-sidebar-user {
  margin: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.portal-sidebar-user img,
.portal-user-chip img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.portal-sidebar-user strong,
.portal-sidebar-user span,
.portal-user-chip strong,
.portal-user-chip span {
  display: block;
}

.portal-sidebar-user span,
.portal-user-chip span {
  color: var(--portal-muted);
  font-size: 12px;
}

.portal-navbar {
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(14px);
}

.portal-menu-button {
  min-width: 72px;
  font-weight: 700;
}

.portal-search {
  max-width: 480px;
  width: 100%;
  background: #f7f9fc;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  padding: 0 12px;
}

.portal-search input {
  background: transparent;
}

.portal-badge {
  position: absolute;
  top: 6px;
  right: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ff3b4f;
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.portal-page {
  color: var(--portal-text);
}

.portal-page-title,
.portal-hero,
.portal-card-header,
.portal-user-chip,
.portal-stat-card,
.request-list > div,
.notice-list > div {
  display: flex;
  align-items: center;
}

.portal-page-title {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.portal-page-title h4,
.portal-page-title p,
.portal-hero h3,
.portal-hero p {
  margin: 0;
}

.portal-page-title p,
.portal-hero p {
  color: var(--portal-muted);
}

.portal-user-chip {
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--portal-border);
  border-radius: 12px;
  background: #fff;
}

.portal-hero,
.portal-card,
.portal-stat-card {
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, .06);
}

.portal-hero {
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  margin-bottom: 16px;
}

.portal-quick-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 10px;
}

.portal-quick-actions a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f9ff;
  color: #0b5dc5;
  font-weight: 600;
}

.portal-quick-actions i {
  font-size: 22px;
}

.portal-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.portal-stat-card {
  gap: 16px;
  padding: 18px;
}

.portal-stat-card p {
  margin: 0 0 4px;
  color: var(--portal-muted);
}

.portal-stat-card strong {
  font-size: 28px;
  line-height: 1;
}

.portal-stat-card small {
  margin-left: 4px;
}

.stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 12px;
  font-size: 26px;
}

.stat-blue { background: #e7f1ff; color: #0b68d1; }
.stat-green { background: #e7f8ee; color: #20a95a; }
.stat-orange { background: #fff4dc; color: #ee9b13; }
.stat-purple { background: #f2eaff; color: #8d4ee8; }

.portal-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 1.05fr) minmax(320px, 1.05fr);
  gap: 16px;
  margin-bottom: 16px;
}

.portal-card {
  padding: 18px;
}

.portal-card-header {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.portal-card-header h5 {
  margin: 0;
  font-weight: 700;
}

.portal-card-header a {
  font-size: 13px;
  font-weight: 700;
}

.leave-summary {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 22px;
}

.leave-ring {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--portal-blue) 0 78%, #e8edf4 78% 100%);
  display: grid;
  place-items: center;
}

.leave-ring span {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  align-content: center;
  font-size: 30px;
  font-weight: 800;
}

.leave-ring small {
  display: block;
  font-size: 12px;
  color: var(--portal-muted);
  font-weight: 500;
}

.leave-numbers p {
  margin: 0 0 12px;
  color: var(--portal-muted);
}

.leave-numbers strong {
  display: block;
  color: var(--portal-text);
}

.request-list,
.notice-list {
  display: grid;
  gap: 14px;
}

.request-list > div,
.notice-list > div,
.portal-notice-item {
  gap: 12px;
}

.portal-notice-item {
  display: flex;
  align-items: center;
  color: inherit;
  border-radius: 8px;
  padding: 4px;
}

.portal-notice-item:hover {
  background: #f7faff;
  color: inherit;
}

.request-list i,
.notice-list i {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #eef5ff;
  color: var(--portal-blue);
  font-size: 20px;
}

.request-list span,
.notice-list span {
  flex: 1;
}

.request-list strong,
.notice-list strong,
.request-list small,
.notice-list small {
  display: block;
}

.request-list small,
.notice-list small {
  color: var(--portal-muted);
}

.tag {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
}

.tag-warning { color: #b96b00; background: #fff2d8; }
.tag-success { color: #168543; background: #def7e8; }

.portal-table-card {
  padding-bottom: 8px;
  overflow: hidden;
}

.portal-table-card .table-responsive {
  max-width: 100%;
  overflow-x: auto;
}

.portal-table th {
  color: #344054;
  font-weight: 700;
  background: #f8fafc;
}

.qr-box {
  display: inline-flex;
  padding: 8px;
  border: 1px solid var(--portal-border);
  border-radius: 8px;
  background: #fff;
}

.qr-box svg {
  display: block;
}

@media (max-width: 1199.98px) {
  .portal-sidebar-user {
    display: none;
  }

  .portal-grid,
  .portal-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .portal-hero {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (min-width: 1200px) {
  .layout-wrapper.layout-content-navbar .layout-container {
    flex-direction: row-reverse;
  }

  .layout-menu-fixed .layout-menu,
  .layout-menu {
    left: auto !important;
    right: 0 !important;
  }

  .layout-menu-fixed:not(.layout-menu-collapsed) .layout-page,
  .layout-menu-fixed-offcanvas:not(.layout-menu-collapsed) .layout-page,
  .layout-navbar-fixed:not(.layout-menu-collapsed) .layout-page {
    padding-left: 0 !important;
    padding-right: 19.5rem !important;
  }

  .layout-menu-collapsed .layout-page {
    padding-right: 5.25rem !important;
    padding-left: 0 !important;
  }

  .portal-sidebar {
    box-shadow: -10px 0 30px rgba(5, 23, 42, .12);
  }
}

@media (max-width: 767.98px) {
  .portal-page-title {
    align-items: flex-start;
  }

  .portal-user-chip,
  .portal-search {
    display: none;
  }

  .portal-quick-actions,
  .portal-stats {
    grid-template-columns: 1fr 1fr;
  }

  .portal-grid {
    grid-template-columns: 1fr;
  }

  .portal-quick-actions a {
    min-height: 86px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }

  .portal-stat-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .leave-summary {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .portal-card,
  .portal-hero,
  .portal-stat-card {
    border-radius: 8px;
  }

  .portal-table {
    min-width: 0;
  }

  .portal-table,
  .portal-table thead,
  .portal-table tbody,
  .portal-table tr,
  .portal-table th,
  .portal-table td {
    display: block;
    width: 100%;
  }

  .portal-table thead {
    display: none;
  }

  .portal-table tr {
    border: 1px solid var(--portal-border);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 10px;
    background: #fff;
  }

  .portal-table td {
    border: 0;
    padding: 6px 0;
    white-space: normal;
  }
}
