:root {
  --blue: #034EA2;
  --orange: #F37021;
  --green: #51B848;
  --dark-blue: #072D94;

  --sidebar-bg: #061a4a;
  --sidebar-bg-2: #0a2568;
  --sidebar-text: #9fb0dd;
  --sidebar-text-active: #ffffff;
  --accent: var(--blue);
  --accent-2: var(--dark-blue);
  --accent-soft: #e6eef8;
  --gold: var(--orange);
  --gold-soft: #ffe9d8;
  --ink: #0f172a;
  --muted: #64748b;
  --bg: #f2f5f4;
  --card-border: #e6ebe9;
  --success: var(--green);
  --success-soft: #e8f7e6;
  --warn: #c58a1a;
  --warn-soft: #fbf1de;
  --danger: #d3453b;
  --danger-soft: #fbeae9;
  --info: var(--blue);
  --info-soft: #e6eef8;
  --sidebar-w: 264px;
  --font: "Google Sans Flex", system-ui, sans-serif;
  --bs-font-sans-serif: var(--font);
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 1rem;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 14px;
}

html, body, input, button, select, textarea {
  font-family: var(--font);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  font-size: 1rem;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

body.auth-body {
  background: #061a4a;
}

body.sidebar-open {
  overflow: hidden;
}

/* ========== Sidebar ========== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  max-height: 100vh;
  max-height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  padding: 0;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .25s ease;
}

.sidebar-mobile-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.sidebar-mobile-head .icon-btn {
  background: rgba(255, 255, 255, .06);
  border-color: rgba(255, 255, 255, .12);
  color: #fff;
}

.sidebar .brand {
  padding: 10px 20px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  text-decoration: none;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
  max-width: 168px;
  object-fit: contain;
}

.brand-logo-lg {
  height: 55px;
  max-width: 200px;
}

.brand-logo-topbar {
  height: 32px;
  max-width: 140px;
}

.sidebar .brand .logo,
.login-hero-brand .logo,
.login-mobile-brand .logo,
.login-card .logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--dark-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 3px 10px rgba(3, 78, 162, .4);
  position: relative;
  flex-shrink: 0;
}

.sidebar .brand .logo::after,
.login-hero-brand .logo::after,
.login-mobile-brand .logo::after {
  content: '';
  position: absolute;
  width: 11px;
  height: 11px;
  background: var(--orange);
  border-radius: 50%;
  top: -4px;
  right: -4px;
  border: 2px solid var(--sidebar-bg);
}

.sidebar .brand-name,
.login-hero-brand .brand-name,
.login-mobile-brand .brand-name {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: .01em;
  line-height: 1.1;
}

.sidebar .brand-sub,
.login-hero-brand .brand-sub,
.login-mobile-brand .brand-sub {
  font-size: 10px;
  color: #7a8bb0;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-top: 2px;
}

.sidebar .tenant-pill {
  margin: 14px 18px;
  padding: 8px 12px;
  background: var(--sidebar-bg-2);
  border-radius: 8px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sidebar-text);
  flex-shrink: 0;
}

.nav-group-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: #5c6d94;
  padding: 15px 22px 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8.5px 22px;
  font-size: 13.3px;
  color: var(--sidebar-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: .15s;
  background: none;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
}

.side-link i {
  width: 18px;
  text-align: center;
  font-size: 13.5px;
}

.side-link:hover {
  background: rgba(255, 255, 255, .04);
  color: #fff;
}

.side-link.active {
  background: rgba(243, 112, 33, .16);
  color: var(--sidebar-text-active);
  border-left-color: var(--orange);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, .28) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .22);
  border-radius: 10px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, .38);
}

.sidebar-foot {
  padding: 12px 18px 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  flex-shrink: 0;
}

.sidebar-foot form {
  margin: 0;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 26, 74, .45);
  z-index: 1035;
  backdrop-filter: blur(2px);
}

.sidebar-backdrop.show {
  display: block;
}

/* ========== Main ========== */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--card-border);
  padding: 12px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-left {
  min-width: 0;
  flex: 1;
}

.topbar-right {
  flex: 1;
  justify-content: flex-end;
}

.topbar-brand {
  display: none;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 0;
  pointer-events: auto;
}

.topbar .searchbox {
  position: relative;
  width: min(320px, 100%);
}

.topbar .searchbox i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa1b5;
  font-size: 13px;
}

.topbar .searchbox input {
  padding-left: 34px;
  background: var(--bg);
  border: 1px solid var(--card-border);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--card-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
}

.icon-btn:hover,
.topbar-pop.open .icon-btn {
  background: #f3f5f9;
  color: var(--ink);
}

.topbar-pop {
  position: relative;
}

.topbar-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(380px, calc(100vw - 24px));
  max-height: min(70vh, 480px);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(16, 19, 34, .12);
  z-index: 1200;
}

.topbar-panel-head,
.topbar-panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
}

.topbar-panel-head {
  border-bottom: 1px solid #eef0f4;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.topbar-panel-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar-panel-empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
}

.topbar-panel-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid #f1f3f7;
}

.topbar-panel-item:hover {
  background: #f7f8fb;
  color: var(--ink);
}

.topbar-panel-item.is-unread {
  background: #f4f8fd;
}

.topbar-panel-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--info-soft);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 12px;
  margin-top: 1px;
}

.topbar-panel-copy {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.topbar-panel-title {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-panel-sub,
.topbar-panel-time {
  font-size: 11px;
  color: var(--muted);
}

.topbar-panel-time {
  flex-shrink: 0;
  white-space: nowrap;
  max-width: 78px;
  text-align: right;
}

.topbar-panel-foot {
  justify-content: center;
  color: var(--blue);
  text-decoration: none;
  font-weight: 600;
  background: #fafbfd;
  position: sticky;
  bottom: 0;
}

.topbar-panel-foot:hover {
  color: var(--dark-blue);
}

.avatar-sm {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--blue), var(--dark-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.user-menu {
  position: relative;
}

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 4px 6px;
  border-radius: 10px;
  cursor: pointer;
}

.user-menu-toggle:hover,
.user-menu.open .user-menu-toggle {
  background: #f3f5f9;
}

.user-menu-meta {
  text-align: left;
  line-height: 1.15;
}

.user-menu-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
}

.user-menu-role {
  font-size: 10.5px;
  color: var(--muted);
}

.user-menu-caret {
  font-size: 10px;
  color: var(--muted);
  margin-left: 2px;
}

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(16, 19, 34, .12);
  padding: 8px;
  z-index: 1200;
}

.user-menu-head {
  padding: 10px 12px 12px;
  border-bottom: 1px solid #eef0f4;
  margin-bottom: 6px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  text-align: left;
}

.user-menu-item:hover {
  background: #f5f7fb;
  color: var(--ink);
}

.user-menu-item i {
  width: 16px;
  color: var(--muted);
}

.user-menu-item-btn {
  cursor: pointer;
}

.user-menu-divider {
  height: 1px;
  background: #eef0f4;
  margin: 6px 4px;
}

.page {
  padding: 24px 26px 60px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.page-title {
  font-size: 19px;
  font-weight: 800;
  margin: 0;
}

.page-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.module-tag {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--info-soft);
  color: var(--info);
  font-weight: 700;
  letter-spacing: .02em;
}

.card {
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 19, 34, .04);
  background: #fff;
}

.card-body {
  padding: 18px 20px;
}

.kpi-card .kpi-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 23px;
  font-weight: 800;
  margin-top: 2px;
  color: var(--ink);
}

.section-title {
  font-size: 13.5px;
  font-weight: 700;
  margin-bottom: 2px;
}

.section-sub {
  font-size: 11.5px;
  color: var(--muted);
}

.table-modern thead th {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--card-border);
  font-weight: 700;
  padding: 10px 14px;
  background: #fafbfd;
  white-space: nowrap;
}

.table-modern tbody td {
  padding: 12px 14px;
  font-size: 12.8px;
  vertical-align: middle;
  border-bottom: 1px solid #f1f2f6;
}

.table-modern tbody tr:hover {
  background: #fafbfe;
}

.badge-status {
  font-size: 10.8px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.st-new,
.st-active,
.st-trial {
  background: var(--success-soft);
  color: var(--success);
}

.st-progress,
.st-suspended {
  background: var(--warn-soft);
  color: var(--warn);
}

.st-won {
  background: var(--success-soft);
  color: var(--success);
}

.st-lost,
.st-cancelled {
  background: var(--danger-soft);
  color: var(--danger);
}

.st-off {
  background: #eef0f4;
  color: #8a90a3;
}

.st-core {
  background: var(--info-soft);
  color: var(--info);
}

.btn-primary {
  background: var(--blue);
  border-color: var(--blue);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--dark-blue);
  border-color: var(--dark-blue);
}

.btn-accent {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}

.btn-accent:hover {
  background: #d96212;
  border-color: #d96212;
  color: #fff;
}

.btn-outline-primary {
  color: var(--blue);
  border-color: var(--blue);
}

.btn-outline-primary:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

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

.flash {
  padding: .7rem .9rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 13px;
}

.flash.ok {
  background: var(--success-soft);
  color: #1d6b28;
  border: 1px solid #c5e8c1;
}

.flash.err {
  background: var(--danger-soft);
  color: #8a2e28;
  border: 1px solid #f0c4c0;
}

code {
  font-size: .85em;
  background: #f0f3f8;
  padding: .1em .35em;
  border-radius: 4px;
  color: var(--dark-blue);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #d3d6e0;
  border-radius: 10px;
}

/* ========== Login (split) ========== */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
}

.login-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(28px, 4vw, 48px);
  min-height: 100vh;
}

.login-hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(160deg, rgba(7, 45, 148, .88) 0%, rgba(3, 78, 162, .72) 45%, rgba(6, 26, 74, .9) 100%),
    url('/images/login-hero.jpg');
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  animation: loginBgDrift 18s ease-in-out infinite alternate;
}

.login-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 400px at 20% 15%, rgba(243, 112, 33, .28), transparent 60%),
    radial-gradient(500px 360px at 90% 80%, rgba(81, 184, 72, .18), transparent 55%);
  pointer-events: none;
}

@keyframes loginBgDrift {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }

  to {
    transform: scale(1.08) translate3d(-1.5%, -1%, 0);
  }
}

.login-hero-content,
.login-hero-foot {
  position: relative;
  z-index: 1;
}

.login-hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(40px, 8vh, 72px);
}

.login-hero-title {
  font-size: clamp(1.75rem, 3.2vw, 2.45rem);
  font-weight: 800;
  line-height: 1.2;
  max-width: 18ch;
  margin: 0 0 14px;
  letter-spacing: -.02em;
}

.login-hero-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .82);
  max-width: 38ch;
  margin: 0 0 28px;
}

.login-hero-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.login-hero-points li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, .9);
}

.login-hero-points i {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(81, 184, 72, .22);
  color: #9be48f;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.login-hero-foot {
  margin-top: 40px;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  background:
    radial-gradient(500px 320px at 100% 0%, rgba(3, 78, 162, .08), transparent 60%),
    radial-gradient(420px 280px at 0% 100%, rgba(243, 112, 33, .07), transparent 55%),
    #f7f9fc;
}

.login-panel-inner {
  width: min(420px, 100%);
  padding: clamp(24px, 4vw, 36px);
  background: #fff;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(7, 45, 148, .08);
  animation: loginPanelIn .45s ease both;
}

@keyframes loginPanelIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.login-mobile-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}

.login-mobile-brand .brand-name {
  color: var(--dark-blue);
}

.login-mobile-brand .brand-sub {
  color: var(--muted);
}

.login-mobile-brand .logo::after {
  border-color: #fff;
}

.login-form-title {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0 0 6px;
  color: var(--dark-blue);
  letter-spacing: -.02em;
}

.login-form-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 28px;
}

.login-demo {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #e8eef5;
}

.login-demo-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 10px;
}

.login-demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.login-demo-chip {
  border: 1px solid #dbe2ea;
  background: #f8fafc;
  color: #334155;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 6px;
  cursor: pointer;
}

.login-demo-chip:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: #fff;
}

.login-form .form-label {
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
}

.input-icon {
  position: relative;
}

.input-icon>i:first-child {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 14px;
  z-index: 2;
}

.input-icon .form-control {
  padding-left: 42px;
  padding-right: 44px;
  border-radius: 10px;
  border-color: #dbe2ea;
  font-size: 14.5px;
  background: #fff;
}

.input-icon .form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 .2rem rgba(3, 78, 162, .15);
}

.toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #94a3b8;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
}

.toggle-pass:hover {
  color: var(--blue);
  background: var(--accent-soft);
}

.login-submit {
  border-radius: 10px;
  font-weight: 700;
  padding: .85rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(3, 78, 162, .25);
}

.login-submit:hover {
  box-shadow: 0 10px 24px rgba(7, 45, 148, .3);
}

/* ========== Responsive ========== */

/* --- 992px: tablet — sidebar off-canvas --- */
@media (max-width: 991.98px) {
  .sidebar {
    transform: translateX(-105%);
    box-shadow: 8px 0 30px rgba(0, 0, 0, .2);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-mobile-head {
    display: flex;
  }

  .main-wrap {
    margin-left: 0;
  }

  .topbar {
    padding: 10px 16px;
    position: sticky;
  }

  .topbar .searchbox {
    display: none;
  }

  .topbar-brand {
    display: flex;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: auto;
  }

  .topbar-left,
  .topbar-right {
    flex: 0 0 auto;
  }

  .page {
    padding: 16px 16px 48px;
  }

  .page-title {
    font-size: 17px;
  }

  /* Page-head: keep row layout but allow wrap */
  .page-head {
    align-items: center;
    gap: 8px;
  }

  .page-head .page-actions,
  .page-head > .d-flex {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Kanban: horizontal scroll */
  .kanban-board {
    gap: 10px;
  }

  .kanban-col {
    flex: 0 0 220px;
    max-width: 240px;
    min-width: 200px;
  }

  .kanban-board-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .kanban-board-scroll > .row {
    flex-wrap: nowrap;
    min-width: max-content;
  }

  .kanban-board-scroll > .row > .col,
  .kanban-board-scroll > .row > [class*="col-"] {
    min-width: 230px;
    max-width: 270px;
    flex: 0 0 auto;
  }

  /* KPI value: slight reduce */
  .kpi-value {
    font-size: 20px;
  }

  /* Login split */
  .login-shell {
    grid-template-columns: 1fr;
    min-height: 100vh;
  }

  .login-hero {
    min-height: auto;
    padding: 28px 22px 32px;
  }

  .login-hero-title {
    max-width: none;
    font-size: 1.55rem;
  }

  .login-hero-text {
    max-width: none;
    margin-bottom: 18px;
  }

  .login-hero-points {
    display: none;
  }

  .login-hero-foot {
    display: none;
  }

  .login-hero-brand {
    margin-bottom: 24px;
  }

  .login-panel {
    padding: 28px 18px 40px;
    align-items: flex-start;
  }
}

/* --- 768px: large phone / small tablet --- */
@media (max-width: 767.98px) {
  /* Page-head: title left, actions right — compact */
  .page-head {
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 10px;
  }

  .page-head > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-head .page-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
  }

  .page-head .page-sub {
    display: none; /* hide subtitle on phone to save vertical space */
  }

  /* page-head actions: icon+label compact pill buttons */
  .page-head .page-actions,
  .page-head > .d-flex.gap-2 {
    flex: 0 0 auto;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
  }

  /* Filter panel: compact 2-col grid on medium phone */
  .filter-panel {
    padding: 12px 12px;
  }

  .filter-panel .row {
    --bs-gutter-x: 8px;
    --bs-gutter-y: 8px;
  }

  /* Timeline: horizontal scroll instead of stack */
  .timeline-flow {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
    padding-bottom: 4px;
  }

  .timeline-step {
    flex-shrink: 0;
    padding: 6px 10px;
    font-size: 11px;
  }

  /* Chart boxes: reduce height */
  .chart-box {
    height: 180px;
  }

  .chart-box-lg {
    height: 200px;
  }

  .chart-box-full {
    height: 240px;
  }

  /* stat-pill: keep single line, shrink font slightly */
  .stat-pill {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .stat-pill .val {
    font-size: 14px;
    flex-shrink: 0;
  }

  .table td.col-actions .row-actions,
  .table td.col-actions .d-flex {
    flex-wrap: nowrap;
    gap: 4px;
  }
}

/* --- 576px: phone --- */
@media (max-width: 575.98px) {
  .page {
    padding: 12px 12px 40px;
  }

  /* Page-head: keep inline — title truncated, actions stay right */
  .page-head {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
  }

  .page-head > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
  }

  .page-head .page-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Actions: keep compact, do NOT go full-width on phone —
     that breaks the inline head layout */
  .page-head .page-actions,
  .page-head > .d-flex.gap-2 {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 4px;
  }

  /* Primary CTA in page-head: auto-width pill */
  .page-head .btn-primary,
  .page-head .btn-accent {
    white-space: nowrap;
    font-size: 12px;
    padding: 0.3rem 0.6rem;
  }

  /* module-tag: hide text, keep icon on very small screens */
  .page-head .module-tag {
    display: none;
  }

  /* Filter panel on phone: full-width inputs, 2-col grid */
  .filter-panel {
    padding: 10px 10px;
    border-radius: 10px;
  }

  .filter-panel .row {
    --bs-gutter-x: 6px;
    --bs-gutter-y: 6px;
  }

  /* Filter inputs: stack to single column */
  .filter-panel .col-md-2,
  .filter-panel .col-md-3,
  .filter-panel .col-md-4,
  .filter-panel .col-md-5,
  .filter-panel .col-12 {
    width: 100%;
    max-width: 100%;
  }

  .filter-panel .form-control,
  .filter-panel .form-select {
    font-size: 13px;
    min-height: 38px;
  }

  /* Filter submit row: inline flex — label + button side by side */
  .filter-panel .filter-submit-row {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
  }

  .filter-panel .btn[type="submit"] {
    min-width: 72px;
    font-size: 13px;
    padding: 0.4rem 0.9rem;
    font-weight: 600;
  }

  /* KPI cards */
  .kpi-card .card-body {
    padding: 14px 14px;
  }

  .kpi-value {
    font-size: 18px;
  }

  .kpi-label {
    font-size: 11px;
  }

  .work-stat {
    padding: 12px 12px;
    gap: 10px;
  }
  .work-stat-icon { width: 36px; height: 36px; font-size: 14px; }
  .work-stat-value { font-size: 20px; }
  .work-stat-label { font-size: 11px; }

  /* Table: tighter */
  .table-modern tbody td,
  .table-modern thead th {
    padding: 9px 10px;
    font-size: 12px;
  }

  /* Topbar */
  .topbar {
    padding: 8px 12px;
  }

  /* Kanban col min-width on phone */
  .kanban-board-scroll > .row > .col,
  .kanban-board-scroll > .row > [class*="col-"] {
    min-width: 185px;
  }

  /* Timeline: horizontal scroll on phone too (no vertical stack) */
  .timeline-flow {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    gap: 4px;
    padding-bottom: 6px;
  }

  .timeline-step {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 10px;
    font-size: 11px;
    border-radius: 8px;
  }

  .timeline-flow > .fa-chevron-right {
    flex-shrink: 0;
    font-size: 9px;
  }

  /* Unit grid */
  .unit-grid {
    grid-template-columns: repeat(5, 1fr) !important;
  }

  /* Login */
  .login-form-title {
    font-size: 1.4rem;
  }
}
/* ===== Workspace Proply extras ===== */
.side-link .badge-count {
  margin-left: auto;
  background: rgba(255, 255, 255, .08);
  font-weight: 500;
  font-size: 10px;
  color: #fff;
}
.icon-btn .dot {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--danger);
  border-radius: 50%;
}
.row-avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: #eef1fb; color: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; flex-shrink: 0;
}
.score-bar { height: 6px; border-radius: 3px; background: #eceef4; overflow: hidden; width: 70px; }
.score-bar > div { height: 100%; background: var(--orange); }
.st-violet { background: #f0e9fb; color: #7c4fd6; }

.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
  align-items: stretch;
}

.kanban-col {
  background: #f6f8f7;
  border-radius: 14px;
  padding: 12px;
  min-height: 280px;
  height: auto;
  flex: 1 0 236px;
  max-width: 320px;
  border: 1px solid transparent;
}

.kanban-col-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 2px 2px 10px;
  border-bottom: 2px solid #d7dde8;
}

.kanban-col-head .title {
  font-size: 12.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.kanban-col-head .title i {
  font-size: 11px;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8eaef;
  color: var(--muted);
}

.kanban-col-head .count {
  font-size: 11px;
  font-weight: 700;
  background: #e4e6ee;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--muted);
  flex-shrink: 0;
}

.kanban-empty,
.kanban-more {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 16px 8px;
}

.kanban-more {
  padding: 6px 8px 2px;
  font-weight: 600;
}

.kanban-col.stage-new {
  background: linear-gradient(180deg, #e7f0fb 0%, #f3f7fb 56px, #f5f7f9 56px);
  border-color: #d3e2f4;
}
.kanban-col.stage-new .kanban-col-head { border-bottom-color: var(--blue); }
.kanban-col.stage-new .kanban-col-head .title { color: var(--blue); }
.kanban-col.stage-new .kanban-col-head .title i { background: #d6e6f8; color: var(--blue); }
.kanban-col.stage-new .kanban-col-head .count { background: var(--blue); color: #fff; }
.kanban-col.stage-new .deal-card { border-left-color: var(--blue); }
.kanban-col.stage-new .lead-avatar { background: #d6e6f8; color: var(--blue); }

.kanban-col.stage-warm {
  background: linear-gradient(180deg, #fff1e6 0%, #fbf6f1 56px, #f7f6f4 56px);
  border-color: #f3ddc8;
}
.kanban-col.stage-warm .kanban-col-head { border-bottom-color: var(--orange); }
.kanban-col.stage-warm .kanban-col-head .title { color: #c45a12; }
.kanban-col.stage-warm .kanban-col-head .title i { background: #ffe3cc; color: var(--orange); }
.kanban-col.stage-warm .kanban-col-head .count { background: var(--orange); color: #fff; }
.kanban-col.stage-warm .deal-card { border-left-color: var(--orange); }
.kanban-col.stage-warm .lead-avatar { background: #ffe3cc; color: #c45a12; }

.kanban-col.stage-hot {
  background: linear-gradient(180deg, #f1e9fb 0%, #f7f4fb 56px, #f6f5f8 56px);
  border-color: #e0d4f2;
}
.kanban-col.stage-hot .kanban-col-head { border-bottom-color: #7c4fd6; }
.kanban-col.stage-hot .kanban-col-head .title { color: #6b3cc4; }
.kanban-col.stage-hot .kanban-col-head .title i { background: #eadff8; color: #7c4fd6; }
.kanban-col.stage-hot .kanban-col-head .count { background: #7c4fd6; color: #fff; }
.kanban-col.stage-hot .deal-card { border-left-color: #7c4fd6; }
.kanban-col.stage-hot .lead-avatar { background: #eadff8; color: #6b3cc4; }

.kanban-col.stage-won {
  background: linear-gradient(180deg, #e7f6e6 0%, #f2f8f1 56px, #f4f7f4 56px);
  border-color: #cfe8cc;
}
.kanban-col.stage-won .kanban-col-head { border-bottom-color: var(--green); }
.kanban-col.stage-won .kanban-col-head .title { color: #2f8a2a; }
.kanban-col.stage-won .kanban-col-head .title i { background: #d8f0d5; color: var(--green); }
.kanban-col.stage-won .kanban-col-head .count { background: var(--green); color: #fff; }
.kanban-col.stage-won .deal-card { border-left-color: var(--green); }
.kanban-col.stage-won .lead-avatar { background: #d8f0d5; color: #2f8a2a; }

.kanban-col.stage-lost {
  background: linear-gradient(180deg, #fbeeee 0%, #f8f4f4 56px, #f6f5f5 56px);
  border-color: #efd5d3;
}
.kanban-col.stage-lost .kanban-col-head { border-bottom-color: var(--danger); }
.kanban-col.stage-lost .kanban-col-head .title { color: #b23a32; }
.kanban-col.stage-lost .kanban-col-head .title i { background: #f8d9d6; color: var(--danger); }
.kanban-col.stage-lost .kanban-col-head .count { background: var(--danger); color: #fff; }
.kanban-col.stage-lost .deal-card { border-left-color: var(--danger); }
.kanban-col.stage-lost .lead-avatar { background: #f8d9d6; color: #b23a32; }
.deal-card {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--card-border);
  border-left: 3px solid var(--blue);
  border-radius: 10px;
  padding: 12px 12px 12px 14px;
  margin-bottom: 10px;
  box-shadow: 0 1px 2px rgba(16,19,34,.03);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
  transition: box-shadow .12s, transform .12s;
}
a.deal-card:hover {
  color: var(--ink);
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(16,19,34,.08);
  transform: translateY(-1px);
}
.deal-card .name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lead-card .name { margin-bottom: 2px; }
.lead-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-bottom: 8px;
}
.lead-card-id {
  min-width: 0;
  flex: 1;
}
.lead-avatar {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  background: #eef1fb;
  color: var(--blue);
}
.lead-phone {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.src-chip,
.ai-score,
.lead-flag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.2;
}
.src-chip {
  padding: 3px 8px;
  max-width: 62%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.src-fb { background: #e8f1fe; color: #1877f2; }
.src-zalo { background: #e6f1ff; color: #0068ff; }
.src-web { background: #e7f6f4; color: #0f766e; }
.src-ctv { background: #fff1e6; color: #c45a12; }
.src-other { background: #eef0f4; color: #64748b; }
.ai-score {
  padding: 3px 8px;
  background: #eef0f4;
  color: #64748b;
}
.ai-score.is-mid { background: #fff1e6; color: #c45a12; }
.ai-score.is-high { background: #e7f6e6; color: #2f8a2a; }
.lead-flag {
  margin-top: 8px;
  padding: 3px 8px;
  background: #eadff8;
  color: #6b3cc4;
}
.lead-flag.is-won { background: #e7f6e6; color: #2f8a2a; }
.lead-flag.is-lost { background: #fbeae9; color: #b23a32; }

.lead-st-new { background: #e7f0fb; color: var(--blue); }
.lead-st-contacted { background: #fff1e6; color: #c45a12; }
.lead-st-qualified { background: #f0e9fb; color: #6b3cc4; }
.lead-st-converted { background: #e7f6e6; color: #2f8a2a; }
.lead-st-lost { background: #fbeae9; color: #b23a32; }
.deal-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  min-width: 0;
}
.deal-card .meta > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.deal-card .meta > span:last-child {
  flex-shrink: 0;
  max-width: 55%;
  text-align: right;
}
.deal-card .deal-val,
.deal-card .val {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue);
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.unit-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
@media (min-width: 768px) { .unit-grid { grid-template-columns: repeat(10, 1fr); } }
.unit-cell {
  aspect-ratio: 1; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 700; cursor: pointer; border: 1px solid transparent; transition: .12s;
}
.unit-cell.available { background: var(--success-soft); color: var(--success); }
.unit-cell.held { background: var(--warn-soft); color: var(--warn); }
.unit-cell.sold { background: #eceef4; color: #9aa1b5; }
.unit-cell:hover { transform: translateY(-2px); box-shadow: 0 3px 8px rgba(16,19,34,.12); }

.timeline-flow { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.timeline-step {
  border: 1px solid var(--card-border); border-radius: 10px; padding: 10px 16px;
  font-size: 12px; background: #fff;
}
.timeline-step.done { border-color: var(--success); color: var(--success); background: var(--success-soft); }
.timeline-step.current { border-color: var(--orange); color: #8a6115; background: var(--gold-soft); font-weight: 700; }
.timeline-step.pending { color: #b3b8c9; }

.nav-tabs .nav-link { font-size: 13px; color: var(--muted); border: none; padding: 10px 4px; margin-right: 22px; }
.nav-tabs .nav-link.active { color: var(--ink); font-weight: 700; border-bottom: 2px solid var(--blue); background: none; }
.nav-tabs-wrap { flex-wrap: wrap; row-gap: 4px; }

.work-stat {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #fff;
  text-decoration: none;
  color: inherit;
  height: 100%;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.work-stat:hover { color: inherit; border-color: #c9d4e5; }
.work-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.work-stat-value {
  font-size: 24px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
}
.work-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}
.work-stat.is-todo .work-stat-icon { background: var(--info-soft); color: var(--blue); }
.work-stat.is-overdue .work-stat-icon { background: var(--danger-soft); color: var(--danger); }
.work-stat.is-pending .work-stat-icon { background: var(--gold-soft); color: var(--orange); }
.work-stat.is-urgent .work-stat-icon { background: #fde8e8; color: #c2410c; }
.work-stat.is-todo.is-active { border-color: var(--blue); background: #f3f7fd; box-shadow: 0 0 0 3px rgba(3, 78, 162, .08); }
.work-stat.is-overdue.is-active { border-color: var(--danger); background: #fdf6f5; box-shadow: 0 0 0 3px rgba(211, 69, 59, .1); }
.work-stat.is-pending.is-active { border-color: var(--orange); background: #fff8f3; box-shadow: 0 0 0 3px rgba(243, 112, 33, .1); }
.work-stat.is-urgent.is-active { border-color: #c2410c; background: #fff6f4; box-shadow: 0 0 0 3px rgba(194, 65, 12, .1); }
.work-stat.is-todo.is-active .work-stat-value { color: var(--blue); }
.work-stat.is-overdue.is-active .work-stat-value { color: var(--danger); }
.work-stat.is-pending.is-active .work-stat-value { color: var(--orange); }
.work-stat.is-urgent.is-active .work-stat-value { color: #c2410c; }

.work-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 999px;
  background: #eef2f7;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
}

.nav-link.active .work-tab-count {
  background: rgba(3, 78, 162, .12);
  color: var(--blue);
}

.work-pos-tabs .nav-link {
  font-size: 12.5px;
  margin-right: 16px;
  padding: 8px 2px;
}

.work-list { display: flex; flex-direction: column; }
.work-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--card-border);
  color: inherit;
  text-decoration: none;
}
.work-item:last-child { border-bottom: 0; }
.work-item:hover { background: #f8fafc; color: inherit; }
.work-item.is-urgent { background: #fff6f4; }
.work-item.is-overdue { background: #fdf7f6; }
.work-item.is-pending { background: #fffaf3; }
.work-item.is-urgent .work-item-icon { background: #fde8e8; color: #c2410c; }
.work-item.is-overdue .work-item-icon { background: var(--danger-soft); color: var(--danger); }
.work-item.is-pending .work-item-icon { background: var(--gold-soft); color: var(--orange); }
.work-item-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--info-soft);
  color: var(--blue);
  flex-shrink: 0;
}
.work-item-body { flex: 1; min-width: 0; }
.work-item-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.work-item-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.work-item-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}
.work-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(3, 78, 162, .08);
  border-radius: 999px;
  padding: 2px 8px;
}
.work-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  border-radius: 6px;
  padding: 2px 7px;
}
.work-badge-urgent { color: #c2410c; background: #fde8e8; }
.work-badge-overdue { color: var(--danger); background: var(--danger-soft); }
.work-badge-pending { color: #b45309; background: #fef3c7; }
.work-item-go { color: #cbd5e1; font-size: 12px; }
@media (max-width: 767px) {
  .work-item { flex-wrap: wrap; }
  .work-item-meta { align-items: flex-start; width: 100%; padding-left: 52px; }
  .work-item-go { display: none; }
}
.text-pre-wrap { white-space: pre-wrap; }
.catalog-thumb { height: 180px; object-fit: cover; background: #f3f4f8; }

.stat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fafbfa;
  border: 1px solid var(--card-border);
  font-size: 12px;
  height: auto;
}

.row > [class*="col"] > .stat-pill {
  height: 100%;
}
.stat-pill .val { font-weight: 800; font-size: 15px; margin-left: auto; }


.chart-box {
  position: relative;
  height: 220px;
  width: 100%;
}

.chart-box-lg {
  height: 260px;
}

.chart-box-full {
  height: 320px;
}

.chart-box canvas {
  width: 100% !important;
  height: 100% !important;
}

.month-stat {
  min-width: 88px;
  padding: 8px 14px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
  background: #fafbfd;
  text-align: right;
}
.month-stat-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}
.month-stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

.honor-card {
  background: linear-gradient(180deg, #fffdf6 0%, #fff 48px);
  border-color: #f0e2b8;
}
.honor-list { display: flex; flex-direction: column; gap: 8px; }
.honor-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: #fff;
}
.honor-row.rank-1 { border-color: #e8c547; background: #fffbeb; }
.honor-row.rank-2 { border-color: #c9d3e0; background: #f8fafc; }
.honor-row.rank-3 { border-color: #e0c4a8; background: #fff8f3; }
.honor-rank {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 13px;
  background: #eef2f7;
  color: #64748b;
  flex-shrink: 0;
}
.honor-row.rank-1 .honor-rank { background: #f5d76e; color: #7a5b00; }
.honor-row.rank-2 .honor-rank { background: #d5dde8; color: #334155; }
.honor-row.rank-3 .honor-rank { background: #e8b98a; color: #7a3e12; }
.honor-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--info-soft);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}
.honor-who { flex: 1; min-width: 0; }
.honor-name { font-weight: 700; font-size: 14px; color: var(--ink); }
.honor-dept { font-size: 12px; color: var(--muted); margin-top: 1px; }
.honor-metrics {
  display: flex;
  gap: 16px;
  flex-shrink: 0;
}
.honor-metric { text-align: right; }
.honor-metric strong { display: block; font-size: 16px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.honor-metric span { font-size: 11px; color: var(--muted); font-weight: 600; }
@media (max-width: 767px) {
  .honor-row { flex-wrap: wrap; }
  .honor-metrics { width: 100%; padding-left: 40px; justify-content: flex-start; }
}

.progress-thin .progress-bar { background: var(--blue); border-radius: 4px; }
.module-switch .form-check-input { width: 2.4em; height: 1.25em; cursor: pointer; }
.module-switch .form-check-input:checked { background: var(--green); border-color: var(--green); }


/* ========== Settings page ========== */
.card-header {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: #fafbfd;
  border-bottom: 1px solid var(--card-border);
  border-radius: 12px 12px 0 0;
}

/* stat-pill: label truncates, value stays right */
.stat-pill {
  overflow: hidden;
}

.stat-pill > i,
.stat-pill > svg {
  flex-shrink: 0;
}

.stat-pill > span:not(.val) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.stat-pill .val {
  flex-shrink: 0;
  white-space: nowrap;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}
