/* Shared presentation layer. Red accents and quiet neutral surfaces. */
:root {
  --primary: #b2001e;
  --primary-dark: #a4001d;
  --brand-cyan: #c10020;
  --content-brand: #b4001e;
  --content-brand-bright: #c10020;
  --body-bg: #f2f2f4;
  --sidebar-bg: #1a1a1d;
  --sidebar-width: 254px;
  --sidebar-collapsed-width: 76px;
  --navbar-height: 76px;
  --card-radius: 16px;
  --bs-primary: #b2001e;
  --bs-primary-rgb: 22, 125, 165;
  --bs-link-color: #b2001e;
  --bs-link-hover-color: #a4001d;
  --line: #dedee0;
  --ink: #1b1b1e;
  --muted: #434348;
  --table-text-size: 12px;
  --table-secondary-size: 11px;
  --table-label-size: 10px;
  --table-text-color: #111111;
}

body {
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid #c10020;
  outline-offset: 3px;
}

.sidebar {
  background: linear-gradient(175deg, #19191c, #1c1c1f);
  border-right: 1px solid #212124;
  box-shadow: 8px 0 24px rgba(24, 24, 27,.18);
  scrollbar-width: none;
  -ms-overflow-style: none;
  overflow-y: hidden;
}

.sidebar::-webkit-scrollbar { display: none; width: 0; height: 0; }

.sidebar-brand {
  min-height: 90px;
  padding: 22px;
  gap: 13px;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff;
  padding: 5px;
  overflow: hidden;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-text {
  font-size: 19px;
  letter-spacing: .04em;
  color: #fff;
  font-weight: 800;
}

.brand-text small {
  display: block;
  font-size: 9px;
  letter-spacing: .12em;
  color: #dcdcde;
  font-weight: 650;
}

.sidebar-nav {
  padding: 15px 12px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sidebar-nav::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-thumb {
  display: none;
  width: 0;
  height: 0;
  background: transparent;
}

.sidebar-nav .nav-item {
  margin: 3px 0;
}

.sidebar-nav .nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  color: #eaeaec;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}

.sidebar-nav .nav-link:hover {
  background: rgba(255,255,255,.09);
  color: #fff;
  border-color: rgba(216, 216, 218,.16);
  transform: translateX(2px);
}

.sidebar-nav .nav-link.active {
  background: linear-gradient(90deg, rgba(193, 0, 32,.32), rgba(193, 0, 32,.16));
  border: 1px solid rgba(255, 190, 201,.38);
  color: #fff;
  padding-left: 13px;
  box-shadow: inset 3px 0 #ffbec9, 0 5px 14px rgba(22, 22, 25,.15);
}

.sidebar-nav .nav-icon,
.sidebar-footer .nav-icon,
.btn-sidebar-logout > i {
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  flex: 0 0 27px;
  border-radius: 8px;
  color: #d9d9db;
  background: rgba(255, 190, 201,.10);
  font-size: 13px;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}

.sidebar-nav .nav-link:hover .nav-icon,
.sidebar-nav .nav-link.active .nav-icon {
  color: #19191c;
  background: #d6d6d8;
  transform: scale(1.04);
}

.sidebar-nav a[href="/accounts"] .nav-icon,
.sidebar-nav a[href="/providers"] .nav-icon { color: #ffd37a; background: rgba(255,193,71,.12); }
.sidebar-nav a[href="/projects"] .nav-icon,
.sidebar-nav a[href="/documents"] .nav-icon { color: #ffbec9; }
.sidebar-nav a[href="/servers"] .nav-icon,
.sidebar-nav a[href="/services"] .nav-icon { color: #cbb5f1; background: rgba(176,143,226,.12); }
.sidebar-nav a[href="/domains"] .nav-icon { color: #7ce2bb; background: rgba(76,201,153,.12); }
.sidebar-nav a[href="/users"] .nav-icon { color: #d8d8da; }
.sidebar-nav a[href="/roles"] .nav-icon,
.sidebar-nav a[href="/permissions"] .nav-icon { color: #ffbdca; background: rgba(236,113,139,.12); }
.sidebar-nav a[href="/activity-logs"] .nav-icon { color: #ffcf73; background: rgba(240,177,56,.12); }
.sidebar-nav .nav-link.active .nav-icon { color: #19191c; background: #d6d6d8; }

.nav-section-label {
  padding: 22px 13px 8px;
  font-size: 10px;
  letter-spacing: .14em;
  color: #ffbec9;
  font-weight: 800;
  border-bottom: 1px solid rgba(212, 212, 214,.10);
}

.sidebar-footer {
  padding: 14px 12px;
  background: rgba(22, 22, 25,.32);
  border-top-color: rgba(215, 215, 217,.16);
}

.sidebar-footer .nav-link-footer,
.sidebar-footer .btn-sidebar-logout { color: #eaeaec; font-weight: 600; }
.sidebar-footer .nav-link-footer:hover { color: #fff; background: rgba(255,255,255,.09); }
.sidebar-footer .btn-sidebar-logout:hover { color: #ff9cae; background: rgba(236,79,108,.13); }
.sidebar-footer .btn-sidebar-logout:hover > i { color: #fff; background: #c64058; }

.sidebar-collapsed .brand-text {
  display: none;
}

.sidebar-collapsed .sidebar-nav {
  padding-inline: 8px;
}

.sidebar-collapsed .sidebar-nav .nav-link {
  gap: 0;
  justify-content: center;
}

.sidebar-collapsed .sidebar-nav .nav-link.active {
  border: 1px solid #da002235;
}

.top-navbar {
  background: rgba(244, 244, 246, 0.97);
  backdrop-filter: blur(14px);
  border-color: #d5d5d7;
  gap: 18px;
  box-shadow: 0 4px 18px rgba(28, 28, 31,.07);
}

.navbar-context {
  margin-right: auto;
  line-height: 1.4;
  min-width: 0;
  padding-left: 2px;
}

.navbar-context small {
  display: block;
  color: #47474c;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.navbar-context strong {
  display: block;
  max-width: min(42vw, 520px);
  color: #1d1d20;
  font-size: 14px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-toggle,
#notificationDropdown {
  width: 40px;
  height: 40px;
  border: 1px solid #e5e5e7;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #39393e !important;
  background: #fcfcfe;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}

.sidebar-toggle:hover,
#notificationDropdown:hover,
.sidebar-toggle:focus-visible,
#notificationDropdown:focus-visible {
  color: #fff !important;
  background: #b2001e;
  border-color: #b2001e;
  transform: translateY(-1px);
}

.header-actions { flex-shrink: 0; }
.header-user-btn {
  min-height: 48px;
  padding: 5px 10px 5px 6px;
  border: 1px solid transparent;
  border-radius: 13px;
  color: #1f1f22 !important;
}
.header-user-btn:hover,
.header-user-btn[aria-expanded="true"] { background: #f8f8fa; border-color: #e7e7e9; }
.header-user-copy { flex-direction: column; align-items: flex-start; line-height: 1.25; }
.header-user-copy strong { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.header-user-copy small { color: #4c4c51; font-size: 9px; font-weight: 550; }
.header-user-btn .avatar-circle {
  color: #fff;
  background: linear-gradient(145deg, #b2001e, #9f001c);
  border-color: #b2001e;
  box-shadow: 0 3px 9px rgba(178, 0, 30,.20);
}
.notification-badge { min-width: 18px; border: 2px solid #fff; font-size: 9px; }
.header-notification-btn.has-unread { color: #fff !important; background: linear-gradient(145deg,#b4001e,#c10020); border-color: #b4001e; box-shadow: 0 4px 12px rgba(180, 0, 30,.22); }
.header-notification-btn.notification-arriving::after { content: ""; position: absolute; inset: -4px; border: 2px solid #d6002280; border-radius: 14px; pointer-events: none; animation: notificationPulse 1.5s ease-out 4; }
.header-notification-btn.notification-arriving { animation: notificationGlow 1.5s ease-in-out 4; }
.notification-arriving #notificationIcon { transform-origin: 50% 15%; animation: notificationBellRing 1s ease-in-out 6; }
.notification-arriving .notification-badge { animation: notificationBadgePop 1s ease-in-out 6; }
@keyframes notificationGlow { 0%, 100% { box-shadow: 0 3px 10px #b2001e30; } 50% { box-shadow: 0 0 0 5px #ce002125, 0 5px 20px #b2001e50; } }
@keyframes notificationBellRing { 0%, 55%, 100% { rotate: 0deg; } 8%, 24% { rotate: 16deg; } 16%, 32% { rotate: -14deg; } 40% { rotate: 9deg; } 48% { rotate: -5deg; } }
@keyframes notificationBadgePop { 0%, 55%, 100% { scale: 1; } 18% { scale: 1.15; } 35% { scale: .96; } }
@media (prefers-reduced-motion: reduce) { .header-notification-btn.notification-arriving, .header-notification-btn.notification-arriving::after, .notification-arriving #notificationIcon, .notification-arriving .notification-badge { animation: none !important; } }
.header-notification-btn.notification-error { color: #9b6a10 !important; background: #fff6df; border-color: #efd28c; }
.sidebar-notification-badge { min-width: 21px; margin-left: auto; padding: 2px 6px; color: #202023; background: #dfdfe1; border: 1px solid #ededef; border-radius: 999px; font-size: 9px; font-weight: 800; line-height: 1.5; text-align: center; }
.sidebar-collapsed .sidebar-notification-badge { position: absolute; top: 2px; right: 1px; min-width: 17px; padding: 1px 4px; }
@keyframes notificationPulse { from { opacity:.8; transform:scale(.92); } to { opacity:0; transform:scale(1.18); } }
.fa-shake { animation-duration: 2.5s !important; animation-iteration-count: 1 !important; }
.top-navbar .dropdown-menu { margin-top: 9px !important; border-color: #e5e5e7; }
.top-navbar .dropdown-header { color: #1d1d20; padding: 10px 12px; }

.avatar-circle {
  width: 36px;
  height: 36px;
  background: #f5f5f7;
  color: var(--primary);
  border: 1px solid #ebebed;
  border-radius: 12px;
}

.page-body {
  padding-top: 28px;
}

#flash-container:has(.alert) {
  padding-top: 16px !important;
}

#flash-container:not(:has(.alert)) {
  padding-top: 0 !important;
}

.page-header {
  margin-bottom: 26px;
  gap: 16px;
  flex-wrap: wrap;
}

/* Shared shell for record pages opened from View actions. */
.ui-detail-view .page-header:not(.project-detail-header) {
  padding: 18px 20px;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 16px;
  box-shadow: 0 5px 18px rgba(28, 28, 31,.06);
}
.ui-detail-view .page-header:not(.project-detail-header) .page-title { color: #1c1c1f; font-weight: 780; }
.ui-detail-view .page-header:not(.project-detail-header) .breadcrumb a { color: #414146; text-decoration: none; }
.ui-detail-view .page-header:not(.project-detail-header) > .d-flex:last-child { flex-wrap: wrap; justify-content: flex-end; }
.ui-detail-view .page-header:not(.project-detail-header) .btn { min-height: 38px; display: inline-flex; align-items: center; border-radius: 9px; font-weight: 650; }
.ui-detail-view .page-body > .card,
.ui-detail-view .page-body > .row .card {
  overflow: hidden;
  border-color: #e4e4e6 !important;
  border-radius: 15px;
  box-shadow: 0 5px 18px rgba(28, 28, 31,.06) !important;
}
.ui-detail-view .page-body > .card > .card-header,
.ui-detail-view .page-body > .row .card > .card-header {
  color: #fff;
  background: linear-gradient(105deg, var(--content-brand), var(--content-brand-bright)) !important;
  border-color: var(--content-brand) !important;
}
.ui-detail-view .page-body .card-header h5,
.ui-detail-view .page-body .card-header h6 { color: inherit; }
.ui-detail-view .page-body .card-header h5 i,
.ui-detail-view .page-body .card-header h6 i { color: #d3d3d5 !important; }
.ui-detail-view .page-body .table thead th { color: #3c3c41; background: #f6f6f8; }
.ui-detail-view .page-body .table tbody td { color: #343439; border-color: #f0f0f2; }
.ui-detail-view .page-body .table tbody tr:hover > * { background: #fafafc; }

.page-title {
  font-size: clamp(22px, 2vw, 28px);
  letter-spacing: -.04em;
  font-weight: 750;
}

.breadcrumb {
  font-size: 12px;
  color: var(--muted);
}

.dashboard-intro {
  padding: 25px 28px;
  border: 1px solid #d9d9db;
  background: linear-gradient(110deg, #ebebed, #f7f7f9);
  border-radius: 18px;
  margin-bottom: 24px;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: center;
}

.dashboard-page .page-header {
  padding-bottom: 16px;
  border-bottom: 1px solid #e6e6e8;
}

.dashboard-page .page-header > .text-muted {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  color: #39393e !important;
  background: #fff;
  border: 1px solid #e5e5e7;
  border-radius: 9px;
  font-weight: 600;
}

.dashboard-page .dashboard-intro {
  color: #1e1e21;
  background: linear-gradient(115deg, #ececee, #f9f9fb);
  border-color: #d4d4d6;
  box-shadow: 0 8px 22px rgba(178, 0, 30,.11);
}

.dashboard-page .dashboard-intro .eyebrow { color: #a8001d; }
.dashboard-page .dashboard-intro h2 { color: #1e1e21; }
.dashboard-page .dashboard-intro p { color: #3f3f44; }
.dashboard-page .dashboard-intro .intro-icon {
  color: #ac001e;
  background: #f7f7f9;
  border-color: #dcdcde;
}

.dashboard-intro h2 {
  font-size: 23px;
  letter-spacing: -.03em;
  margin: 4px 0 7px;
}

.dashboard-intro p {
  color: #47474c;
  font-size: 13px;
  margin: 0;
}

.eyebrow {
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.intro-icon {
  width: 66px;
  height: 66px;
  border-radius: 19px;
  background: #fff;
  border: 1px solid #eeeef0;
  display: grid;
  place-items: center;
  color: var(--brand-cyan);
  font-size: 26px;
  flex-shrink: 0;
}

.card {
  border: 1px solid #dedee0 !important;
  box-shadow: 0 3px 14px #1b1b1e08 !important;
  background: #fbfbfd;
}

.card-header {
  padding: 18px 22px;
  border-color: #dedee0;
  background: #f6f6f8;
}

.card-header h6 {
  font-size: 14px;
}

.card-body {
  padding: 22px;
}

.card-footer {
  border-color: #dedee0;
  background: #f4f4f6;
  padding: 16px 22px;
  border-radius: 0 0 16px 16px !important;
}

.stat-card {
  background: #f7f7f9;
  border: 1px solid #dedee0;
  color: var(--ink);
  padding: 22px;
  min-height: 116px;
  box-shadow: 0 3px 14px #1b1b1e06;
  gap: 15px;
}

.dashboard-page .stat-card {
  position: relative;
  overflow: hidden;
  border-color: #e0e0e2;
  border-top: 3px solid var(--stat-accent, #b2001e);
  box-shadow: 0 5px 16px rgba(28, 28, 31,.07);
}

.dashboard-page .stat-card::after {
  content: "";
  position: absolute;
  right: -22px;
  bottom: -28px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--stat-tint, #f6f6f8);
  opacity: .58;
}

.dashboard-page .stat-card > * { position: relative; z-index: 1; }
.dashboard-page .stat-blue { --stat-accent:#b2001e; --stat-tint:#f4f4f6; }
.dashboard-page .stat-green { --stat-accent:#238265; --stat-tint:#dff5ed; }
.dashboard-page .stat-purple { --stat-accent:#71509e; --stat-tint:#eee7f8; }
.dashboard-page .stat-orange { --stat-accent:#c47a18; --stat-tint:#fff0d9; }
.dashboard-page .stat-red { --stat-accent:#bd4258; --stat-tint:#fce5ea; }
.dashboard-page .stat-yellow { --stat-accent:#a97713; --stat-tint:#fff4cc; }
.dashboard-page .stat-teal { --stat-accent:#a1001d; --stat-tint:#dcf3f1; }
.dashboard-page .stat-indigo { --stat-accent:#4d4d52; --stat-tint:#f6f6f8; }
.dashboard-page .stat-value { color: #1c1c1f; font-weight: 800; }
.dashboard-page .stat-label { color: #3b3b40; font-weight: 600; }

.dashboard-panel {
  overflow: hidden;
  border-color: #e0e0e2 !important;
  box-shadow: 0 6px 18px rgba(28, 28, 31,.07) !important;
}

.dashboard-panel > .card-header {
  color: #fff;
  background: linear-gradient(105deg, var(--content-brand), var(--content-brand-bright)) !important;
  border-color: var(--content-brand) !important;
}

.dashboard-panel > .card-header h6 { color: #fff; }
.dashboard-panel > .card-header h6 i { color: #d3d3d5 !important; }
.dashboard-panel-servers > .card-header h6 i { color: #c9aff0 !important; }
.dashboard-panel-alerts > .card-header h6 i { color: #ffd06b !important; }
.dashboard-panel > .card-header .btn { color: #a8001d; background: #fff; border-color: #fff; font-weight: 650; }
.dashboard-panel .table thead th { color: #39393e; background: #f6f6f8; }
.dashboard-panel .table tbody td { color: #333338; border-color: #efeff1; }
.dashboard-panel .table tbody tr:hover > * { background: #fafafc; }

.stat-card:hover {
  border-color: #dddddf;
  box-shadow: 0 8px 22px #1d1d200a;
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  background: #f6f6f8;
  color: var(--primary);
  font-size: 18px;
}

.stat-value {
  font-size: 29px;
  letter-spacing: -.04em;
  line-height: 1.15;
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
  opacity: 1;
}

.stat-green .stat-icon,
.stat-teal .stat-icon {
  background: #e8f7f2;
  color: #238265;
}

.stat-orange .stat-icon,
.stat-yellow .stat-icon {
  background: #fff5e5;
  color: #a76a12;
}

.stat-red .stat-icon {
  background: #fceef0;
  color: #ba4a5b;
}

.stat-purple .stat-icon,
.stat-indigo .stat-icon {
  background: #f8f8fa;
  color: #525257;
}

.table {
  --bs-table-color: var(--ink);
  --bs-table-border-color: #5e5e63;
  --bs-table-hover-bg: #f1f1f3;
  margin-bottom: 0;
}

/* Force visible borders on ALL tables sitewide */
.table > thead > tr > th,
.table > thead > tr > td {
  border-bottom: 2px solid #4e4e53 !important;
  background: #eeeef0 !important;
  color: #39393e !important;
}

.table > tbody > tr > td,
.table > tbody > tr > th {
  border-bottom: 1px solid #5e5e63 !important;
}

.table > tbody > tr:last-child > td,
.table > tbody > tr:last-child > th {
  border-bottom: 0 !important;
}

/* Override Bootstrap table-light which resets colors */
.table-light > thead > tr > th,
.table thead.table-light > tr > th,
thead.table-light th {
  background: #eeeef0 !important;
  color: #39393e !important;
  border-bottom: 2px solid #4e4e53 !important;
}

.table> :not(caption)>*>* {
  padding: 15px 18px;
  vertical-align: middle;
}

.table thead th {
  background: #eeeef0;
  color: #39393e;
  font-size: 10px;
  letter-spacing: .08em;
  border-bottom: 2px solid #4e4e53 !important;
  padding-block: 13px;
}

.table tbody td {
  font-size: 13px;
  border-bottom: 1px solid #5e5e63 !important;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table-striped {
  --bs-table-striped-bg: #f5f5f7;
}

.table-responsive {
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: #e3e3e5 transparent;
}

.table-responsive:focus-visible {
  outline-offset: -3px;
}

.table td .btn {
  white-space: nowrap;
}

.badge {
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
}

.btn {
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 15px;
  transition: background .18s, border-color .18s, box-shadow .18s;
}

.btn-sm {
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.btn-xs {
  padding: 5px 8px;
  font-size: 11px;
  border-radius: 6px;
}

.ui-action-group {
  display: inline-flex;
  gap: 7px;
  vertical-align: middle;
}

.ui-action-group>.ui-action-icon {
  border-radius: 10px !important;
  margin-left: 0 !important;
}

.ui-action-icon {
  --action-color: #ac001e;
  --action-bg: #f7f7f9;
  --action-border: #e9e9eb;
  width: 34px;
  height: 34px;
  min-width: 34px;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--action-border) !important;
  border-radius: 10px !important;
  background: linear-gradient(#fff, var(--action-bg)) !important;
  color: var(--action-color) !important;
  font-size: 12px !important;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 3px #1d1d2008, inset 0 1px 0 #fff;
  transition: color .18s, background .18s, border-color .18s, box-shadow .18s, transform .18s !important;
}

.ui-action-view {
  --action-color: #ac001e;
  --action-bg: #f7f7f9;
  --action-border: #e9e9eb;
}

.ui-action-edit {
  --action-color: #c30020;
  --action-bg: #f9f9fb;
  --action-border: #eeeef0;
}

.ui-action-download {
  --action-color: #197553;
  --action-bg: #edf8f2;
  --action-border: #cce6d9;
}

.ui-action-delete {
  --action-color: #b63c53;
  --action-bg: #fff1f4;
  --action-border: #f0d5dc;
}

.ui-action-team {
  --action-color: #71509e;
  --action-bg: #f4effb;
  --action-border: #e3d9f1;
}

.ui-action-access {
  --action-color: #976110;
  --action-bg: #fff6e5;
  --action-border: #f0e4c7;
}

.ui-action-icon:hover,
.ui-action-icon:focus-visible {
  color: #fff !important;
  background: var(--action-color) !important;
  border-color: var(--action-color) !important;
  box-shadow: 0 5px 11px #1d1d2020 !important;
  transform: translateY(-1px);
}

.ui-action-icon:active {
  transform: translateY(0);
  box-shadow: 0 2px 5px #1d1d2017 !important;
}

.ui-action-icon:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--action-color) 32%, transparent);
  outline-offset: 2px;
}

.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-dark);
  --bs-btn-hover-border-color: var(--primary-dark);
  --bs-btn-active-bg: #a4001d;
  --bs-btn-active-border-color: #a4001d;
  box-shadow: 0 3px 7px #b2001e1a;
}

.btn-outline-primary {
  --bs-btn-color: var(--primary);
  --bs-btn-border-color: #e2e2e4;
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-bg: var(--primary);
  --bs-btn-active-border-color: var(--primary);
}

.btn-outline-secondary {
  --bs-btn-color: #4a4a4f;
  --bs-btn-border-color: #eeeef0;
  --bs-btn-hover-bg: #f7f7f9;
  --bs-btn-hover-color: #1d1d20;
  --bs-btn-hover-border-color: #dcdcde;
}

.form-control,
.form-select {
  border-color: #eeeef0;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 13px;
  color: var(--ink);
  background-color: #fff;
}

.form-control-sm,
.form-select-sm {
  padding: 7px 10px;
  font-size: 12px;
}

.form-control::placeholder {
  color: #5a5a5f;
}

.form-control:focus,
.form-select:focus {
  border-color: #ffbec9;
  box-shadow: 0 0 0 3px #c100201c;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: #3e3e43;
  margin-bottom: 7px;
}

.form-text {
  color: #505055;
  line-height: 1.6;
}

.input-group-text {
  border-color: #eeeef0;
  border-radius: 9px;
  background: #fcfcfe;
  color: #515156;
}

.input-group:focus-within {
  border-radius: 9px;
  box-shadow: 0 0 0 3px #c100201c;
}

.input-group .form-control:focus {
  box-shadow: none;
}

.form-check-input:checked {
  background-color: var(--primary);
  border-color: var(--primary);
}

.nav-tabs {
  gap: 10px;
  border-color: var(--line);
}

.nav-tabs .nav-link {
  padding: 13px 16px;
}

.dropdown-menu {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  box-shadow: 0 12px 36px #1a1a1d14 !important;
}

.dropdown-item {
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13px;
  white-space: normal;
}

.dropdown-item:active {
  background: var(--primary);
}

.pagination {
  gap: 5px;
  flex-wrap: wrap;
}

.page-link {
  padding: 8px 13px;
  border-color: var(--line);
}

.empty-state {
  padding: 48px 22px;
}

.empty-state>i {
  color: #66666b !important;
}

.card.bg-gradient {
  background: #fff !important;
  color: var(--ink) !important;
}

.card.bg-gradient .card-body {
  border-top: 3px solid var(--brand-cyan);
  border-radius: 15px;
}

.card.bg-gradient .card-body>.d-flex>i {
  color: var(--primary);
  opacity: .65 !important;
}

.card.bg-gradient .card-body small {
  color: var(--muted);
}

.card-header.bg-gradient {
  background: #f7f7f9 !important;
  color: var(--ink) !important;
}

.card-header.bg-gradient .text-white {
  color: var(--ink) !important;
}

.page-body .kanban-zone {
  background: #f7f7f9;
  padding: 12px;
  border-radius: 12px;
}

.page-body .kanban-card {
  border-radius: 11px;
  padding: 14px;
  box-shadow: 0 2px 6px #1a1a1d08;
}

.page-body .kanban-zone.drag-over,
.page-body .kanban-tasks.drag-over {
  background: #f5f5f7 !important;
  border-color: var(--brand-cyan) !important;
}

.modal-content {
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: 0 25px 70px #1a1a1d30;
}

.modal-header {
  padding: 23px 25px 18px;
  border-color: var(--line);
  border-radius: 18px 18px 0 0;
}

.modal-title {
  font-size: 17px;
  letter-spacing: -.02em;
}

.modal-body {
  padding: 22px 25px;
}

.modal-footer {
  padding: 16px 25px 23px;
  border-color: var(--line);
  gap: 6px;
}

.modal-backdrop {
  --bs-backdrop-opacity: .45;
  background: #1a1a1d;
}

.login-body {
  background: radial-gradient(ellipse at 12% 12%, #c1002045, transparent 45%), radial-gradient(ellipse at 95% 90%, #c1002035, transparent 45%), #19191c;
  padding: 32px 0;
}

.login-wrapper {
  max-width: 480px;
  padding: 20px;
  position: relative;
}

.register-wrapper {
  max-width: 740px;
}

.login-card {
  padding: 38px;
  border: 1px solid #dedee0;
  border-radius: 22px;
  box-shadow: 0 26px 80px #16161950;
  background: #f9f9fb;
}

.login-brand {
  margin-bottom: 28px;
}

.login-brand-icon {
  width: 76px;
  height: 76px;
  border: 1px solid #efeff1;
  background: #fcfcfe;
  border-radius: 19px;
}

.login-brand-name {
  font-size: 24px;
  letter-spacing: -.035em;
}

.login-brand-sub {
  color: #4c4c51;
  font-size: 13px;
}

.login-card .form-control::placeholder {
  color: #5a5a5f;
}

.login-card .form-control:focus::placeholder {
  color: #5a5a5f;
}

.login-card .btn-primary {
  padding-block: 12px;
}

.auth-heading {
  margin: 0 0 5px;
  font-size: 24px;
  font-weight: 750;
  letter-spacing: -.04em;
}

.auth-caption {
  color: #505055;
  font-size: 13px;
  margin-bottom: 25px;
}

#notificationMenu {
  min-width: min(380px, calc(100vw - 24px)) !important;
}

#chatFloatingBtn {
  background: var(--primary);
  box-shadow: 0 5px 18px #b2001e30;
  border-radius: 18px;
}

#chatWidget {
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 110px);
  border-radius: 17px !important;
}

#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 11000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
  pointer-events: none;
}

.ui-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--toast-accent, #b2001e);
  border-radius: 12px;
  color: var(--ink);
  box-shadow: 0 12px 35px #1a1a1d20;
  animation: toast-enter .2s ease-out;
}

.ui-toast>i {
  color: var(--toast-accent);
  font-size: 18px;
  margin-top: 3px;
}

.ui-toast span {
  flex: 1;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ui-toast .btn-close {
  flex-shrink: 0;
  font-size: 10px;
  padding: 6px;
  margin-top: 3px;
}

.ui-toast-danger {
  --toast-accent: #c74b5b;
}

.ui-toast-success {
  --toast-accent: #258169;
}

.ui-toast-warning {
  --toast-accent: #b77913;
}

.ui-toast-info {
  --toast-accent: #b2001e;
}

.ui-confirm {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px;
  width: min(430px, calc(100vw - 32px));
  color: var(--ink);
  box-shadow: 0 25px 80px #1a1a1d40;
}

.ui-confirm::backdrop {
  background: #1a1a1d88;
  backdrop-filter: blur(3px);
}

.ui-confirm h2 {
  font-size: 21px;
  letter-spacing: -.03em;
  margin: 18px 0 10px;
}

.ui-confirm p {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 25px;
}

.ui-confirm-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #b74957;
  background: #fceff1;
  font-size: 21px;
}

.ui-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

@keyframes toast-enter {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media(min-width:1400px) {
  .page-body {
    padding-inline: 36px !important;
  }
}

@media(max-width:1100px) {
  .stat-card {
    padding: 17px 14px;
    gap: 11px;
  }

  .stat-icon {
    width: 38px;
    height: 38px;
  }
}

@media(max-width:768px) {
  :root {
    --navbar-height: 66px;
  }

  .sidebar-overlay {
    z-index: 299;
  }

  .sidebar-mobile-open {
    overflow: hidden;
  }

  .top-navbar {
    padding-inline: 16px !important;
    gap: 12px;
  }

  .page-body {
    padding: 22px 16px !important;
  }

  .page-header {
    align-items: flex-start !important;
  }

  .page-header>.d-flex {
    flex-wrap: wrap;
  }

  .dashboard-intro {
    padding: 21px;
  }

  .dashboard-intro h2 {
    font-size: 20px;
  }

  .intro-icon {
    display: none;
  }

  .card-body {
    padding: 17px;
  }

  .table> :not(caption)>*>* {
    padding: 12px 14px;
  }

  .login-card {
    padding: 28px 24px;
  }

  .stat-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .stat-value {
    font-size: 26px;
  }

  #toast-container {
    top: 12px;
    right: 16px;
  }
}

@media(prefers-reduced-motion:reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
}

/* =====================================================
   GLOBAL TABLE BORDER OVERRIDE — applies to ALL pages
   Overrides Bootstrap border-0, table-light, table-sm
   ===================================================== */
.table thead tr th,
.table thead tr td,
.table > thead > tr > th,
.table > thead > tr > td,
thead th, thead td {
  background-color: #ebebed !important;
  color: #9d001c !important;
  border-top: none !important;
  border-bottom: 2px solid #c50020 !important;
}

.table tbody tr td,
.table tbody tr th,
.table > tbody > tr > td,
.table > tbody > tr > th {
  border-bottom: 1px solid #59595e !important;
}

.table tbody tr:last-child td,
.table tbody tr:last-child th,
.table > tbody > tr:last-child > td,
.table > tbody > tr:last-child > th {
  border-bottom: none !important;
}

/* dl.row definition list borders — project detail & all detail pages */
dl.row > dt,
dl.row > dd {
  border-bottom: 1px solid #59595e !important;
}
dl.row > dt:last-of-type,
dl.row > dd:last-of-type {
  border-bottom: none !important;
}

/* Shared table typography, including custom task, issue and inbox tables.
   Important sizes also cover Bootstrap utilities and inline compact labels. */
.page-body table :is(td, th) {
  font-size: var(--table-text-size) !important;
  font-weight: 500;
  line-height: 1.6;
}

.page-body table thead :is(th, td),
.page-body table tbody th {
  font-size: var(--table-secondary-size) !important;
  font-weight: 700;
  letter-spacing: .025em;
}

.page-body table :is(small, .small, .x-small, code, .btn-sm, .btn-xs) {
  font-size: var(--table-secondary-size) !important;
}

.page-body table .text-muted {
  color: var(--table-text-color) !important;
  font-weight: 500;
}

.page-body table :is(strong, b, .fw-bold) {
  font-weight: 700 !important;
}

.page-body table .fw-semibold {
  font-weight: 600 !important;
}

.page-body table .badge {
  font-size: var(--table-label-size) !important;
  font-weight: 600;
  line-height: 1.5;
}

/* Bootstrap's bright warning/info text is faint on pale badge surfaces. */
.page-body table .badge.bg-warning-subtle.text-warning {
  color: #805400 !important;
}

.page-body table .badge.bg-info-subtle.text-info {
  color: #9f001c !important;
}

.page-body table :is(.tsl-title-link, .isl-title-link, .wm-title-link, .document-name) {
  font-size: var(--table-text-size) !important;
  font-weight: 600;
}

.page-body table :is(.tsl-due, .wm-date, .wm-assignee, .document-file-meta,
  .document-project, .document-date, .document-muted) {
  font-size: var(--table-secondary-size) !important;
  font-weight: 500;
}

.page-body table :is(.tsl-key, .isl-key, .wm-key, .tsl-platform, .isl-platform,
  .wm-platform, .isl-type) {
  font-size: var(--table-label-size) !important;
  font-weight: 600;
}

/* Dark text across standard and custom tables. Keep contrast colors on
   filled badges, avatars and action controls. */
.page-body :is(table.table, table.notification-table, table.tsl-table, table.isl-table) {
  --bs-table-color: var(--table-text-color);
  --bs-table-striped-color: var(--table-text-color);
  --bs-table-hover-color: var(--table-text-color);
}

.page-body :is(table.table, table.notification-table, table.tsl-table, table.isl-table) :is(th, td),
.page-body :is(table.table, table.notification-table, table.tsl-table, table.isl-table) :is(th, td) :not(:where(
  .badge, .badge *, .btn, .btn *, button, button *, i, svg, svg *,
  .ui-action-icon, .ui-action-icon *, .document-action, .document-action *,
  .tsl-view-btn, .tsl-view-btn *, .isl-view-btn, .isl-view-btn *,
  [class*="avatar"], [class*="avatar"] *, .notification-row-icon, .notification-row-icon *
)) {
  color: var(--table-text-color) !important;
}
