:root,
[data-bs-theme="light"] {
  --bs-primary: #d81828;
  --bs-primary-rgb: 216, 24, 40;
  --bs-link-color: #d81828;
  --bs-link-color-rgb: 216, 24, 40;
  --bs-link-hover-color: #b0101c;
  --bs-link-hover-color-rgb: 176, 16, 28;
  --bs-focus-ring-color: rgba(216, 24, 40, 0.28);
  --bs-pagination-active-bg: #d81828;
  --bs-pagination-active-border-color: #d81828;
  --bs-pagination-hover-color: #b0101c;
  --bs-pagination-focus-color: #b0101c;
  --tornex-red: #d81828;
  --tornex-red-dark: #b0101c;
  --tornex-red-soft: #fdecee;
  --bs-topbar-height: 72px;
}

body {
  background:
    radial-gradient(900px 420px at 100% -10%, rgba(216, 24, 40, 0.08), transparent 55%),
    radial-gradient(700px 360px at -10% 0%, rgba(216, 24, 40, 0.05), transparent 50%),
    #f4f6fb;
}

a {
  color: var(--tornex-red);
}

a:hover {
  color: var(--tornex-red-dark);
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #d81828;
  --bs-btn-border-color: #d81828;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #b0101c;
  --bs-btn-hover-border-color: #b0101c;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #8e1018;
  --bs-btn-active-border-color: #8e1018;
  --bs-btn-focus-shadow-rgb: 216, 24, 40;
  --bs-btn-disabled-bg: #d81828;
  --bs-btn-disabled-border-color: #d81828;
  background-color: #d81828;
  border-color: #d81828;
  box-shadow: 0 8px 18px rgba(216, 24, 40, 0.22);
  font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
  background-color: #b0101c;
  border-color: #b0101c;
  box-shadow: 0 10px 22px rgba(216, 24, 40, 0.28);
}

.btn-secondary {
  font-weight: 600;
}

.form-control:focus,
.form-select:focus {
  border-color: #d81828;
  box-shadow: 0 0 0 0.2rem rgba(216, 24, 40, 0.16);
}

.page-content .card,
.footer .card,
.auth-header-box {
  border: 0;
  box-shadow: 0 10px 30px rgba(43, 45, 59, 0.06);
}

.page-content a.text-decoration-none > .card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.page-content a.text-decoration-none > .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(216, 24, 40, 0.12);
}

.page-content a.text-decoration-none > .card h3 {
  color: #d81828;
  letter-spacing: -0.03em;
}

.tornex-orb {
  background: var(--tornex-red-soft);
}

.tornex-orb i {
  color: #d81828;
}

.topbar {
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
}

.topbar .container-xxl {
  height: 100%;
}

.topbar .topbar-custom {
  background-color: #fff;
  position: relative;
  height: 100%;
  padding-right: 8px;
  padding-left: 8px;
  box-shadow: 0 8px 24px rgba(43, 45, 59, 0.04);
}

.topbar .topbar-custom::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, #8e1018, #d81828 45%, #f04a52);
}

.topbar .topbar-custom .topbar-item,
.topbar:has(.nav-sticky),
.topbar .topbar-custom.nav-sticky .topbar-item {
  height: var(--bs-topbar-height);
}

.topbar .welcome-text h3 {
  font-size: 1.15rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.topbar .welcome-text h6 {
  line-height: 1.2;
}

.topbar .topbar-custom .nav-link.nav-icon {
  width: 40px;
  height: 40px;
  background-color: #d81828;
  color: #fff;
  box-shadow: none;
}

.topbar .topbar-custom .nav-link.nav-icon i {
  color: #fff;
}

.topbar .topbar-custom .nav-link.nav-icon:hover,
.topbar .topbar-custom .nav-link.nav-icon:focus {
  background-color: #b0101c;
  color: #fff;
}

.page-wrapper .page-content {
  padding-top: 24px;
}

.footer .card-body {
  padding-top: 10px;
  padding-bottom: 10px;
}

.tornex-credit {
  color: #8b93a7;
  font-size: 12px;
}

.tornex-credit a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tornex-credit a:hover {
  color: #d81828;
}

.tornex-credit-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 8px 16px 14px;
  text-align: center;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(244, 246, 251, 0), #f4f6fb 36%);
}

.tornex-credit-bar .tornex-credit {
  pointer-events: auto;
}

.welcome-text h3 {
  letter-spacing: -0.03em;
}

.startbar {
  --tornex-brand-height: 92px;
  background: linear-gradient(180deg, #4f0c12 0%, #7a1019 46%, #9a141e 100%);
  box-shadow: 8px 0 28px rgba(40, 8, 12, 0.16);
}

.startbar .brand img {
  filter: brightness(0) invert(1);
}

.startbar .startbar-menu .navbar-nav .nav-item .nav-link {
  color: rgba(255, 255, 255, 0.88);
}

.startbar .startbar-menu .navbar-nav .nav-item .nav-link .menu-icon {
  color: rgba(255, 255, 255, 0.88);
}

.startbar .startbar-menu .navbar-nav .nav-item .nav-link {
  position: relative;
}

.menu-count {
  margin-left: auto;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #fff;
  color: #9a141e;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35rem;
  text-align: center;
}

body[data-sidebar-size="collapsed"] .startbar:not(:hover) .menu-count {
  position: absolute;
  top: 6px;
  right: 8px;
  margin-left: 0;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.25rem;
  font-size: 0.62rem;
  line-height: 1.05rem;
}

.startbar .brand {
  justify-content: flex-start;
  text-align: left;
  height: var(--tornex-brand-height);
  padding: 30px 16px;
}

.startbar .brand .logo {
  display: flex;
  justify-content: flex-start;
  line-height: 0;
}

.startbar .brand .logo .logo-lg {
  margin-left: 0;
}

.startbar .brand .logo-sm {
  display: none;
  width: 32px;
  height: 32px;
}

body[data-sidebar-size="collapsed"] .startbar:not(:hover) .brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

body[data-sidebar-size="collapsed"] .startbar:not(:hover) .brand .logo {
  justify-content: center;
}

body[data-sidebar-size="collapsed"] .startbar:not(:hover) .brand .logo-sm {
  display: block;
}

.startbar .startbar-menu {
  padding-bottom: var(--tornex-brand-height);
}

.startbar .startbar-menu .startbar-collapse {
  height: calc(100vh - var(--tornex-brand-height));
}

.startbar .startbar-menu .navbar-nav .nav-item .nav-link.active,
.startbar .startbar-menu .navbar-nav .nav-item .nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 0.6rem;
}

.startbar .startbar-menu .navbar-nav .nav-item .nav-link.active .menu-icon,
.startbar .startbar-menu .navbar-nav .nav-item .nav-link:hover .menu-icon {
  color: #fff;
}

.startbar .startbar-menu .navbar-nav .nav-item .nav-link.active::before,
.startbar .startbar-menu .navbar-nav .nav-item .nav-link:hover::before {
  border-color: #fff !important;
  background-color: #fff !important;
}

.table a {
  font-weight: 600;
}

.auth-header-box.bg-black {
  background: linear-gradient(145deg, #3a0d14 0%, #d81828 120%) !important;
}

.auth-header-box .text-muted {
  color: rgba(255, 255, 255, 0.78) !important;
}

.page-item.active .page-link {
  background-color: #d81828;
  border-color: #d81828;
}

.modal-header {
  background: linear-gradient(145deg, #3a0d14, #d81828);
  color: #fff;
}

.modal-header .modal-title {
  color: #fff;
}

.modal-header .btn-close {
  filter: invert(1);
}

.holiday-cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.holiday-cal-head {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a82b1;
  padding-bottom: 4px;
}

.holiday-day {
  min-height: 118px;
  border: 1px solid #e6e9f2;
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.holiday-day.is-outside {
  background: #f7f8fb;
  color: #95a0c5;
}

.holiday-day.is-today {
  border-color: #d81828;
  box-shadow: inset 0 0 0 1px #d81828;
}

.holiday-day.has-holiday {
  background: #fdecee;
  border-color: rgba(216, 24, 40, 0.28);
}

.holiday-day-num {
  font-weight: 600;
  font-size: 13px;
}

.holiday-add {
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.holiday-chip {
  background: #fff;
  border-radius: 8px;
  padding: 6px;
}

.holiday-chip strong {
  display: block;
  font-size: 12px;
  line-height: 1.3;
}

.holiday-chip span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  color: #5c6370;
  font-size: 11px;
  line-height: 1.35;
}

@media (max-width: 991.98px) {
  .holiday-cal {
    gap: 4px;
  }

  .holiday-day {
    min-height: 84px;
    padding: 4px;
  }

  .holiday-chip span {
    display: none;
  }
}

.message-unread td {
  background: #fff7f7;
  font-weight: 600;
}

.mail-back {
  display: inline-block;
  margin-bottom: 12px;
  color: #5c6370;
  font-size: 14px;
  text-decoration: none;
}

.mail-back:hover {
  color: #d81828;
}

.mail-read-head {
  padding: 22px 24px 16px;
  border-bottom: 1px solid #eef0f4;
}

.mail-read-head h2 {
  margin: 0 0 16px;
  font-size: 1.45rem;
  line-height: 1.35;
}

.mail-read-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mail-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: #fdecee;
  color: #d81828;
  font-size: 14px;
  font-weight: 600;
}

.mail-read-body {
  min-height: 180px;
  padding: 22px 24px 32px;
  font-size: 15px;
  line-height: 1.65;
}

.mail-read-reply {
  padding: 8px 24px 18px;
  border-top: 1px solid #eef0f4;
  background: #fafbfd;
}

.mail-reply-toggle {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #5c6370;
  font-weight: 600;
}

.mail-reply-toggle:hover {
  color: #d81828;
}

.mail-read-reply .ql-editor {
  min-height: 96px;
}

.message-body {
  line-height: 1.65;
}

.message-body p:last-child {
  margin-bottom: 0;
}

#message-body,
#reply-body {
  display: none;
}

.message-editor {
  background: #fff;
}

.ql-toolbar.ql-snow {
  border-color: #e6e8ee;
  border-radius: 8px 8px 0 0;
}

.ql-container.ql-snow {
  border-color: #e6e8ee;
  border-radius: 0 0 8px 8px;
  font-size: 15px;
}

.ql-editor {
  min-height: 160px;
}

.recipient-list {
  max-height: 280px;
  overflow: auto;
}

.recipient-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 12px;
  border-bottom: 1px solid #eef0f4;
  cursor: pointer;
}

.recipient-choice:last-child {
  border-bottom: 0;
}

.recipient-choice:hover {
  background: #fafbfd;
}

.recipient-choice .text-muted {
  margin-left: auto;
}

.password-field {
  position: relative;
}

.password-field .form-control {
  padding-right: 2.5rem;
}

.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: #6c757d;
}

.password-toggle:hover,
.password-toggle:focus {
  color: #212529;
}

.employee-home .row + .row {
  margin-top: 24px;
}

.employee-home .card {
  margin-bottom: 0;
}

.employee-home .home-detail {
  min-height: 168px;
}

.employee-home .thumb-xl {
  width: 56px;
  height: 56px;
}

#tornexConfirm .modal-content {
  border: 0;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(40, 8, 12, 0.18);
}

.tornex-confirm-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--tornex-red-soft);
  color: #d81828;
  font-size: 28px;
}

#tornexConfirm.is-warning .tornex-confirm-icon {
  background: #fff6e5;
  color: #b58105;
}

.datetime-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.25;
  vertical-align: middle;
}

.datetime-time {
  font-size: 0.8em;
  color: #8a909a;
}

.photo-picker-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.photo-drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 168px;
  padding: 28px 20px;
  border: 1.5px dashed #e7c5c9;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #fff 0%, #fffafb 100%);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.photo-drop:hover,
.photo-drop.is-over,
.photo-picker-input:focus + .photo-drop {
  border-color: #d81828;
  background: #fff7f8;
  box-shadow: 0 0 0 4px rgba(216, 24, 40, 0.08);
}

.photo-drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--tornex-red-soft);
  color: #d81828;
  font-size: 26px;
}

.photo-drop-title {
  font-weight: 600;
  color: #2c3038;
}

.photo-drop-hint {
  max-width: 360px;
  color: #8a909a;
  font-size: 13px;
  line-height: 1.45;
}

.photo-count {
  margin-top: 12px;
  color: #6c727c;
  font-size: 13px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photo-grid:empty {
  display: none;
}

.photo-card {
  position: relative;
  overflow: hidden;
  border: 1px solid #eceff3;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(28, 32, 40, 0.05);
}

.photo-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: #f4f6fb;
}

.photo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #3a3f47;
  box-shadow: 0 4px 12px rgba(20, 24, 32, 0.16);
}

.photo-remove:hover {
  background: #d81828;
  color: #fff;
}

.photo-meta {
  padding: 8px 10px 10px;
}

.photo-name {
  overflow: hidden;
  color: #2c3038;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.photo-size,
.photo-status {
  color: #8a909a;
  font-size: 11px;
}

.photo-progress {
  height: 4px;
  margin: 6px 0 4px;
  overflow: hidden;
  border-radius: 99px;
  background: #f3e4e6;
}

.photo-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d81828, #f05a66);
  transition: width 0.12s linear;
}

.photo-card.is-uploading .photo-remove,
.photo-picker.is-uploading .photo-remove {
  display: none;
}

.photo-picker.is-full .photo-drop {
  opacity: 0.55;
  pointer-events: none;
}
