/* ==========================================================================
   Brandspectra CRM — Core Styles
   ========================================================================== */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-app);
  font-family: var(--font-body);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ---------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------- */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: linear-gradient(165deg, var(--sidebar-grad-start), var(--sidebar-grad-end));
  box-shadow: var(--shadow-sidebar);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 40;
  transition: margin-left var(--duration-med) var(--ease-standard);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 28px 26px 22px;
}

.sidebar__logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar__logo-mark svg { width: 26px; height: 26px; }

.sidebar__brand-text {
  line-height: 1.15;
}

.sidebar__brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  color: #fff;
  letter-spacing: 0.3px;
}

.sidebar__brand-sub {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar__nav {
  padding: 6px 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.nav-item { margin-bottom: 4px; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 14.5px;
  font-weight: 600;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}

.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.nav-link:hover {
  background: var(--sidebar-hover-bg);
  color: var(--sidebar-text-active);
}

.nav-item.is-active > .nav-link {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
}

.nav-link__label { flex: 1; }

.nav-link__chevron {
  width: 16px !important;
  height: 16px !important;
  transition: transform var(--duration-fast) var(--ease-standard);
}

.nav-item.is-open .nav-link__chevron { transform: rotate(90deg); }

/* Parent + submenu form one solid capsule when expanded */
.nav-item.is-open {
  background: var(--brand-blue-600);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.nav-item.is-open > .nav-link {
  background: transparent;
  color: #fff;
}

.nav-submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--duration-med) var(--ease-standard);
}

.nav-item.is-open .nav-submenu {
  max-height: 400px;
  padding-bottom: 8px;
}

.nav-subitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px 9px 48px;
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.65);
}

.nav-subitem:hover { color: #fff; }

.nav-subitem__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  flex-shrink: 0;
}

.nav-subitem.is-active {
  color: #bcdcff;
  font-weight: 700;
}

.nav-subitem.is-active .nav-subitem__dot {
  opacity: 1;
  background: #bcdcff;
}

/* ---------------------------------------------------------------------
   Main column
   --------------------------------------------------------------------- */
.main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 0 40px;
}

.topbar__search {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin-right: auto;
}

.topbar__search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 0 44px 0 16px;
  font-size: 14px;
  color: var(--text-heading);
  box-shadow: var(--shadow-card);
}

.topbar__search input::placeholder { color: var(--text-muted); }
.topbar__search input:focus { outline: 2px solid var(--brand-blue-500); outline-offset: -1px; }

.topbar__search svg {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.chat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}

.chat-btn:hover { box-shadow: var(--shadow-card-hover); }
.chat-btn svg { width: 19px; height: 19px; color: var(--text-heading); }

.chat-btn__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--radius-pill);
  background: var(--status-online);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar__user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 4px;
  border: none;
  background: transparent;
  text-align: left;
}

.topbar__user-text { line-height: 1.2; }
.topbar__user-name { font-size: 14px; font-weight: 700; color: var(--text-heading); }
.topbar__user-role { font-size: 12px; color: var(--text-muted); }
.topbar__user-caret { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

.topbar__menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  margin-right: auto;
}

.topbar__menu-toggle svg { width: 20px; height: 20px; color: var(--text-heading); }

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
  color: var(--text-heading);
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}

.icon-btn:hover { box-shadow: var(--shadow-card-hover); }
.icon-btn svg { width: 20px; height: 20px; }

.icon-btn__badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--status-badge);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-app);
}

.topbar__profile {
  position: relative;
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: var(--shadow-card);
  flex-shrink: 0;
}

.topbar__profile img { width: 100%; height: 100%; object-fit: cover; }

.status-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--status-online);
  border: 2px solid #fff;
}

/* ---------------------------------------------------------------------
   Content
   --------------------------------------------------------------------- */
.content {
  padding: 4px 40px 48px;
  max-width: var(--content-max);
  width: 100%;
}

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-heading);
  margin: 0 0 20px;
}

/* Welcome banner */
.welcome-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.welcome-card__heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 8px;
}

.welcome-card__subtext {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0 0 22px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: none;
  background: linear-gradient(135deg, var(--brand-blue-600), var(--brand-blue-700));
  color: #fff;
  font-weight: 700;
  font-size: 14.5px;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 20px rgba(29, 63, 196, 0.28);
  transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(29, 63, 196, 0.34);
}

.btn-primary svg { width: 18px; height: 18px; }
.btn-primary.is-checked-in {
  background: linear-gradient(135deg, #1fa15c, #17864b);
  box-shadow: 0 10px 20px rgba(31, 161, 92, 0.28);
}

.welcome-card__portrait {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
  border: 4px solid var(--bg-app);
}

.welcome-card__portrait img { width: 100%; height: 100%; object-fit: cover; }
.welcome-card__portrait .status-dot {
  width: 16px;
  height: 16px;
  bottom: 6px;
  right: 6px;
  border-width: 3px;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 26px 24px;
  transition: box-shadow var(--duration-fast) var(--ease-standard), transform var(--duration-fast) var(--ease-standard);
}

.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.stat-card__icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.stat-card__icon svg { width: 24px; height: 24px; }

.stat-card__label {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 6px;
}

.stat-card__value {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0;
}

.tint-blue   { background: var(--tint-blue-bg);   color: var(--tint-blue-fg); }
.tint-red    { background: var(--tint-red-bg);    color: var(--tint-red-fg); }
.tint-purple { background: var(--tint-purple-bg); color: var(--tint-purple-fg); }
.tint-green  { background: var(--tint-green-bg);  color: var(--tint-green-fg); }
.tint-orange { background: var(--tint-orange-bg); color: var(--tint-orange-fg); }
.tint-pink   { background: var(--tint-pink-bg);   color: var(--tint-pink-fg); }
.tint-teal   { background: var(--tint-teal-bg);   color: var(--tint-teal-fg); }

.app-footer {
  padding: 20px 40px 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ---------------------------------------------------------------------
   Page header + breadcrumb
   --------------------------------------------------------------------- */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-header__heading {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 6px;
}

.page-header__subtext {
  font-size: 14.5px;
  color: var(--text-muted);
  margin: 0;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.breadcrumb a:hover { color: var(--brand-blue-600); }
.breadcrumb__current { color: var(--text-heading); font-weight: 600; }
.breadcrumb svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------------
   Buttons (secondary / icon-outline variants)
   --------------------------------------------------------------------- */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}

.btn-secondary:hover { box-shadow: var(--shadow-card-hover); }
.btn-secondary svg { width: 17px; height: 17px; }

.btn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 22px;
  border: none;
  background: linear-gradient(135deg, var(--brand-blue-600), var(--brand-blue-700));
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: var(--radius-pill);
  box-shadow: 0 10px 20px rgba(29, 63, 196, 0.24);
  transition: transform var(--duration-fast) var(--ease-standard), box-shadow var(--duration-fast) var(--ease-standard);
}

.btn-pill:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(29, 63, 196, 0.30); }
.btn-pill svg { width: 18px; height: 18px; }

/* ---------------------------------------------------------------------
   Toolbar (search + filter + export row above tables)
   --------------------------------------------------------------------- */
.toolbar-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 22px 24px 4px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 20px;
}

.toolbar-search {
  position: relative;
  width: 100%;
  max-width: 320px;
}

.toolbar-search input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 40px 0 14px;
  font-size: 13.5px;
  color: var(--text-heading);
}

.toolbar-search input::placeholder { color: var(--text-muted); }
.toolbar-search input:focus { outline: 2px solid var(--brand-blue-500); outline-offset: -1px; }

.toolbar-search svg {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.toolbar-actions { display: flex; align-items: center; gap: 12px; }

.filter-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
  background: var(--bg-card);
}

.filter-select svg { width: 15px; height: 15px; }
.filter-select svg:last-child { color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Data table
   --------------------------------------------------------------------- */
.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.data-table thead th {
  text-align: left;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 16px;
  font-size: 14px;
  color: var(--text-body);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.data-table tbody tr:hover { background: var(--bg-card-hover); }
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-primary { font-weight: 700; color: var(--text-heading); }

.badge-code {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--tint-blue-bg);
  color: var(--tint-blue-fg);
  font-size: 12.5px;
  font-weight: 700;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 700;
}

.badge-status--active { background: var(--tint-green-bg); color: var(--tint-green-fg); }
.badge-status--inactive { background: var(--tint-red-bg); color: var(--tint-red-fg); }
.badge-status--expiring { background: var(--tint-orange-bg); color: var(--tint-orange-fg); }

.row-actions { display: flex; align-items: center; gap: 8px; }

.row-action-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
  color: var(--brand-blue-600);
}

.row-action-btn svg { width: 15px; height: 15px; }
.row-action-btn:hover { background: var(--tint-blue-bg); }
.row-action-btn--danger { color: var(--tint-red-fg); }
.row-action-btn--danger:hover { background: var(--tint-red-bg); }

.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 4px 20px;
  font-size: 13.5px;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 12px;
}

.pagination { display: flex; align-items: center; gap: 8px; }

.pagination-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted);
}

.pagination-btn svg { width: 15px; height: 15px; }
.pagination-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.pagination-btn--active {
  background: var(--brand-blue-600);
  border-color: var(--brand-blue-600);
  color: #fff;
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Form panels
   --------------------------------------------------------------------- */
.panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 32px 36px 36px;
}

.panel__section + .panel__section { margin-top: 30px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.section-title__bar {
  width: 4px;
  height: 18px;
  border-radius: var(--radius-pill);
  background: var(--brand-blue-600);
  flex-shrink: 0;
}

.form-grid {
  display: grid;
  gap: 22px 24px;
  grid-template-columns: repeat(3, 1fr);
}

.form-grid--2 { grid-template-columns: repeat(2, 1fr); }
.form-grid--3 { grid-template-columns: repeat(3, 1fr); }
.form-grid--4 { grid-template-columns: repeat(4, 1fr); }

.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field--full { grid-column: 1 / -1; }

.form-field label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-heading);
}

.form-field .required { color: var(--tint-red-fg); }

.form-field input,
.form-field select,
.form-field textarea {
  height: 44px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-heading);
  background: #fff;
  width: 100%;
}

.form-field textarea {
  height: auto;
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.form-field input::placeholder,
.form-field textarea::placeholder { color: var(--text-muted); }

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid var(--brand-blue-500);
  outline-offset: -1px;
}

.form-field--select { position: relative; }
.form-field--select select { appearance: none; padding-right: 38px; }
.form-field--select svg {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-field--date { position: relative; }
.form-field--date svg {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 17px;
  height: 17px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 32px;
}

.btn-outline {
  height: 46px;
  padding: 0 26px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-heading);
  font-size: 14.5px;
  font-weight: 700;
}

.btn-outline:hover { background: var(--bg-card-hover); }

.btn-save {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 26px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--brand-blue-600), var(--brand-blue-700));
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(29, 63, 196, 0.24);
}

.btn-save svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------------
   Sidebar footer (pinned user card)
   --------------------------------------------------------------------- */
.sidebar__footer {
  position: relative;
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar__footer-user {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: left;
}

.sidebar__footer-user:hover { background: var(--sidebar-hover-bg); }

.sidebar__footer-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

.sidebar__footer-text { flex: 1; line-height: 1.2; }
.sidebar__footer-name { font-size: 13.5px; font-weight: 700; color: #fff; }
.sidebar__footer-role { font-size: 11.5px; color: rgba(255, 255, 255, 0.55); }
.sidebar__footer-caret { width: 15px; height: 15px; color: rgba(255, 255, 255, 0.5); flex-shrink: 0; transition: transform var(--duration-fast) var(--ease-standard); }
.sidebar__footer-user[aria-expanded="true"] .sidebar__footer-caret { transform: rotate(180deg); }

/* ---------------------------------------------------------------------
   Compact stat row (5-up)
   --------------------------------------------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card--compact {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
}

.stat-card--compact .stat-card__icon { width: 46px; height: 46px; margin-bottom: 0; flex-shrink: 0; }
.stat-card--compact .stat-card__icon svg { width: 21px; height: 21px; }
.stat-card--compact .stat-card__label { margin-bottom: 4px; }
.stat-card--compact .stat-card__value { font-size: 21px; }

.stat-card__trend {
  font-size: 12.5px;
  font-weight: 700;
  margin: 2px 0 0;
}

.trend-blue { color: var(--tint-blue-fg); }
.trend-green { color: var(--tint-green-fg); }
.trend-orange { color: var(--tint-orange-fg); }
.trend-purple { color: var(--tint-purple-fg); }
.trend-red { color: var(--tint-red-fg); }

/* ---------------------------------------------------------------------
   Filter toolbar (date range + multi-selects + search)
   --------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.filter-bar .toolbar-search { max-width: 240px; }

.date-range-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
}

.date-range-btn svg:first-child { width: 16px; height: 16px; color: var(--text-muted); }
.date-range-btn svg:last-child { width: 14px; height: 14px; color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Tabs
   --------------------------------------------------------------------- */
.tabs {
  display: flex;
  align-items: center;
  gap: 28px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 24px;
  overflow-x: auto;
}

.tab-item {
  position: relative;
  padding: 16px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  border: none;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.tab-item svg { width: 16px; height: 16px; }

.tab-item.is-active {
  color: var(--brand-blue-600);
  font-weight: 700;
}

.tab-item.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--brand-blue-600);
  border-radius: 2px;
}

/* ---------------------------------------------------------------------
   Task table specifics
   --------------------------------------------------------------------- */
.cell-title__main { font-weight: 700; color: var(--text-heading); font-size: 14px; }
.cell-title__sub { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; white-space: normal; }

.checkbox-cell input {
  width: 17px;
  height: 17px;
  accent-color: var(--brand-blue-600);
}

.assignee-cell { display: flex; align-items: center; gap: 10px; }

.assignee-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.assignee-name { font-weight: 700; color: var(--text-heading); font-size: 13.5px; }
.assignee-role { font-size: 12px; color: var(--text-muted); }

.badge-priority,
.badge-task-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-priority--high { background: var(--tint-red-bg); color: var(--tint-red-fg); }
.badge-priority--medium { background: var(--tint-orange-bg); color: var(--tint-orange-fg); }
.badge-priority--low { background: var(--tint-green-bg); color: var(--tint-green-fg); }

.badge-task-status--inprogress { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }
.badge-task-status--completed { background: var(--tint-green-bg); color: var(--tint-green-fg); }
.badge-task-status--pending { background: #eef0f5; color: var(--text-muted); }
.badge-task-status--overdue { background: var(--tint-pink-bg); color: var(--tint-pink-fg); }

.due-date--ok { color: var(--tint-green-fg); font-weight: 600; }
.due-date--warn { color: var(--tint-orange-fg); font-weight: 600; }
.due-date--danger { color: var(--tint-red-fg); font-weight: 600; }
.due-date--neutral { color: var(--brand-blue-600); font-weight: 600; }

.progress-cell { min-width: 110px; }
.progress-cell__value { font-size: 12.5px; font-weight: 700; color: var(--text-heading); margin-bottom: 6px; }

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: var(--radius-pill);
  background: #eef0f5;
  overflow: hidden;
}

.progress-fill { height: 100%; border-radius: var(--radius-pill); }
.progress-fill--blue { background: var(--tint-blue-fg); }
.progress-fill--green { background: var(--tint-green-fg); }
.progress-fill--faint { background: var(--text-muted); opacity: 0.5; }

.row-action-plain {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: 8px;
}

.row-action-plain svg { width: 16px; height: 16px; }
.row-action-plain:hover { background: var(--bg-card-hover); color: var(--brand-blue-600); }

/* ---------------------------------------------------------------------
   Domains table specifics
   --------------------------------------------------------------------- */
.th-sortable { display: inline-flex; align-items: center; gap: 5px; }
.th-sort-icon { width: 12px; height: 12px; color: var(--text-muted); opacity: 0.7; }

.domain-cell { display: flex; align-items: center; gap: 12px; }

.domain-cell__icon {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--tint-blue-bg);
  color: var(--tint-blue-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.domain-cell__icon svg { width: 17px; height: 17px; }

.domain-cell__icon-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.dot-green { background: var(--tint-green-fg); }
.dot-blue { background: var(--tint-blue-fg); }

.domain-cell__name { font-weight: 700; color: var(--text-heading); font-size: 14px; }
.domain-cell__tld { font-size: 12px; color: var(--text-muted); }

.client-cell__name { font-weight: 700; color: var(--text-heading); font-size: 13.5px; }
.client-cell__code { font-size: 12px; color: var(--text-muted); }

.badge-type {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
}

.badge-type--primary { background: var(--tint-blue-bg); color: var(--tint-blue-fg); }
.badge-type--addon { background: var(--tint-purple-bg); color: var(--tint-purple-fg); }

.expiry-cell__date { font-weight: 600; color: var(--text-heading); font-size: 13.5px; }
.expiry-cell__note { font-size: 12px; margin-top: 2px; }
.expiry-cell__note--ok { color: var(--tint-green-fg); }
.expiry-cell__note--warn { color: var(--tint-orange-fg); }
.expiry-cell__note--danger { color: var(--tint-red-fg); }

.next-billing__date { font-weight: 600; color: var(--text-heading); font-size: 13.5px; }
.next-billing__amount { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.next-billing__empty { color: var(--text-muted); }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch__track {
  position: absolute;
  inset: 0;
  background: #dfe2eb;
  border-radius: var(--radius-pill);
  transition: background var(--duration-fast) var(--ease-standard);
  cursor: pointer;
}

.toggle-switch__track::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--duration-fast) var(--ease-standard);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-switch__track { background: var(--tint-green-fg); }
.toggle-switch input:checked + .toggle-switch__track::before { transform: translateX(18px); }

/* ---------------------------------------------------------------------
   Auth / Login page
   --------------------------------------------------------------------- */
.auth-shell {
  display: flex;
  min-height: 100vh;
}

.auth-panel--brand {
  width: 44%;
  min-width: 420px;
  position: relative;
  overflow: hidden;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  color: #fff;
  background: linear-gradient(165deg, var(--sidebar-grad-start), var(--sidebar-grad-end));
}

.auth-panel--form {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: linear-gradient(160deg, #eef1fb 0%, #f7f9fd 100%);
}

.auth-dots {
  position: absolute;
  width: 130px;
  height: 130px;
  background-image: radial-gradient(circle, currentColor 1.4px, transparent 1.4px);
  background-size: 18px 18px;
  pointer-events: none;
}

.auth-dots--brand { top: 22px; left: 24px; color: rgba(255, 255, 255, 0.22); }
.auth-dots--form { top: 30px; right: 30px; color: rgba(37, 71, 224, 0.14); }

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 48px;
  position: relative;
  z-index: 1;
}

.auth-brand__mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auth-brand__mark svg { width: 32px; height: 32px; }
.auth-brand__name { font-family: var(--font-display); font-weight: 800; font-size: 21px; letter-spacing: 0.4px; }
.auth-brand__sub { font-size: 10.5px; letter-spacing: 1px; color: rgba(255, 255, 255, 0.55); text-transform: uppercase; margin-top: 3px; }

.auth-tagline { position: relative; z-index: 1; }
.auth-tagline h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  line-height: 1.18;
  margin: 0;
}
.auth-tagline h1 .highlight { color: #4fc3ff; display: block; }
.auth-tagline p {
  font-size: 14.5px;
  color: rgba(255, 255, 255, 0.68);
  max-width: 360px;
  margin: 14px 0 0;
  line-height: 1.6;
}

.auth-illustration {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 20px 0;
  position: relative;
  z-index: 1;
}

.auth-features {
  display: flex;
  gap: 22px;
  position: relative;
  z-index: 1;
  margin-bottom: 22px;
}

.auth-feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  width: 84px;
}

.auth-feature__icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7fb7ff;
}

.auth-feature__icon svg { width: 21px; height: 21px; }
.auth-feature__label { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.85); line-height: 1.3; }

.auth-carousel { display: flex; gap: 8px; position: relative; z-index: 1; }
.auth-carousel span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  display: block;
}
.auth-carousel span.is-active { background: #4fc3ff; border-color: #4fc3ff; }

.auth-card {
  width: 100%;
  max-width: 500px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(20, 30, 80, 0.14);
  padding: 44px 48px 40px;
  position: relative;
  z-index: 1;
}

.auth-card__logo {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--tint-blue-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.auth-card__logo svg { width: 36px; height: 36px; color: var(--brand-blue-600); }

.auth-card h1 {
  text-align: center;
  font-family: var(--font-display);
  font-size: 23px;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 6px;
}

.auth-subtext { text-align: center; font-size: 14px; color: var(--text-muted); margin: 0 0 30px; }

.auth-field { margin-bottom: 20px; }

.auth-field__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.auth-field label { font-size: 13.5px; font-weight: 700; color: var(--text-heading); }
.auth-field__link { font-size: 13px; font-weight: 700; color: var(--brand-blue-600); }

.auth-input-wrap { position: relative; }

.auth-input-wrap input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 44px;
  font-size: 14px;
  color: var(--text-heading);
  font-family: inherit;
}

.auth-input-wrap input::placeholder { color: var(--text-muted); }
.auth-input-wrap input:focus { outline: 2px solid var(--brand-blue-500); outline-offset: -1px; }

.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.auth-toggle-visibility {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-toggle-visibility svg { width: 18px; height: 18px; }

.auth-remember { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.auth-remember input { width: 17px; height: 17px; accent-color: var(--brand-blue-600); }
.auth-remember label { font-size: 13.5px; color: var(--text-body); }

.auth-submit {
  width: 100%;
  height: 50px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #2547e0, #1533b8);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 14px 30px rgba(37, 71, 224, 0.28);
  transition: transform var(--duration-fast) var(--ease-standard);
}

.auth-submit:hover { transform: translateY(-1px); }

.auth-submit__arrow {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-submit__arrow svg { width: 14px; height: 14px; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px 0;
  color: var(--text-muted);
  font-size: 12.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.auth-oauth { display: flex; gap: 14px; margin-bottom: 26px; }

.auth-oauth-btn {
  flex: 1;
  height: 48px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-heading);
  background: #fff;
}

.auth-oauth-btn:hover { background: var(--bg-card-hover); }
.auth-oauth-btn svg { width: 19px; height: 19px; }

.auth-card__footer { text-align: center; font-size: 13.5px; color: var(--text-muted); }
.auth-card__footer a { color: var(--brand-blue-600); font-weight: 700; }

.auth-footer-note {
  margin-top: 26px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  position: relative;
  z-index: 1;
}

.topbar__account { position: relative; }

.topbar__user-caret { transition: transform var(--duration-fast) var(--ease-standard); }
.topbar__user[aria-expanded="true"] .topbar__user-caret { transform: rotate(180deg); }

.user-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-hover);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--duration-fast) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard),
              visibility var(--duration-fast) var(--ease-standard);
  z-index: 60;
}

.user-dropdown.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-heading);
}

.user-dropdown__item:hover { background: var(--bg-card-hover); }
.user-dropdown__item svg { width: 16px; height: 16px; color: var(--text-muted); flex-shrink: 0; }

.user-dropdown__item--danger { color: var(--tint-red-fg); }
.user-dropdown__item--danger svg { color: var(--tint-red-fg); }

.user-dropdown__divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 6px 4px;
}

.user-dropdown--upward {
  top: auto;
  bottom: calc(100% + 10px);
  left: 0;
  right: 0;
  transform: translateY(6px);
}

.user-dropdown--upward.is-open { transform: translateY(0); }

/* ---------------------------------------------------------------------
   Profile page
   --------------------------------------------------------------------- */
.profile-header-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin-bottom: 22px;
  position: relative;
}

.profile-avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.profile-avatar-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue-600);
}

.profile-avatar-edit svg { width: 15px; height: 15px; }

.profile-identity { flex: 1; min-width: 220px; }

.profile-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-name-row h2 {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0;
}

.badge-role {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--tint-blue-bg);
  color: var(--tint-blue-fg);
  font-size: 12px;
  font-weight: 700;
}

.profile-contact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
}

.profile-contact-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--text-body);
  list-style: none;
}

.profile-contact-list svg { width: 15px; height: 15px; color: var(--text-muted); flex-shrink: 0; }

.profile-stats-mini {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.mini-stat {
  width: 108px;
  text-align: center;
  padding: 14px 8px;
}

.mini-stat__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.mini-stat__icon svg { width: 19px; height: 19px; }
.mini-stat__label { font-size: 12px; color: var(--text-muted); margin: 0 0 4px; }
.mini-stat__value { font-size: 13.5px; font-weight: 700; color: var(--text-heading); margin: 0; }

.profile-edit-btn { position: absolute; top: 28px; right: 32px; }

/* Chip-style section title (icon chip instead of a plain bar) */
.section-title--chip {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 22px;
}

.section-title__chip {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--tint-blue-bg);
  color: var(--tint-blue-fg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-title__chip svg { width: 18px; height: 18px; }
.section-title__chip--purple { background: var(--tint-purple-bg); color: var(--tint-purple-fg); }
.section-title__chip--teal { background: var(--tint-teal-bg); color: var(--tint-teal-fg); }

.profile-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 22px;
  align-items: start;
}

.profile-grid .panel + .panel { margin-top: 22px; }

.phone-input-group { display: flex; gap: 8px; }

.phone-country {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-heading);
  background: #fff;
  flex-shrink: 0;
}

.phone-country svg { width: 13px; height: 13px; color: var(--text-muted); }

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.info-row__label { font-size: 13.5px; font-weight: 700; color: var(--text-heading); margin-bottom: 6px; }
.info-row__value { font-size: 14px; color: var(--text-body); }

.social-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.social-row:last-child { margin-bottom: 0; }

.social-row__icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.social-row__icon svg { width: 18px; height: 18px; }
.social-icon--linkedin { background: #0a66c2; }
.social-icon--twitter { background: #1d9bf0; }
.social-icon--facebook { background: #1877f2; }
.social-icon--instagram { background: linear-gradient(135deg, #f9ce34, #ee2a7b, #6228d7); }

.social-row__input {
  flex: 1;
  height: 42px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 13.5px;
  color: var(--text-heading);
  min-width: 0;
}

.social-row__link {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.social-row__link svg { width: 15px; height: 15px; }
.social-row__link:hover { background: var(--bg-card-hover); }

/* Utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
