/* ─── Hwesta Design System — Precision Core ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;600;700&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f6f6f6;
  --surface: #ffffff;
  --surface-low: #ededed;
  --surface-high: #e7e7f3;
  --border: #c3c6d7;
  --border-light: #e1e2ed;

  --text: #191b23;
  --text-secondary: #434655;
  --text-muted: #737686;

  --primary: #421bcf;
  --primary-dark: #3415a2;
  --primary-container: #6444d8;
  --primary-subtle: #e5dff8;
  --primary-on: #ffffff;

  --success: #1a7a4a;
  --success-subtle: #d6f0e3;
  --success-text: #0f5132;

  --warning: #9d5c00;
  --warning-subtle: #fff3cd;
  --warning-text: #7c4700;

  --danger: #ba1a1a;
  --danger-subtle: #ffdad6;
  --danger-text: #93000a;

  --info-subtle: #dbeafe;
  --info-text: #1e40af;

  --nav-width: 260px;
  --nav-collapsed-width: 64px;
  --header-h: 72px;
  --control-h: 40px;
  --control-h-sm: 32px;
  --radius-sm: 4px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-1: 0 4px 12px rgba(16, 16, 17, .05);
  --shadow-2: 0 8px 24px rgba(16, 16, 17, .09);
}

html,
body {
  height: 100%;
}

html {
  font-size: 14px;
}

body {
  font-family: 'Google Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}

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

/* ─── Layout shell ───────────────────────────────────────────────────────── */
.app {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--nav-width);
  background: var(--surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .22s ease;
}


.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  justify-content: space-between;
}

.sidebar-hamburger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  transition: color .15s, background .15s;
}

.sidebar-hamburger:hover {
  color: var(--text);
  background: var(--surface-low);
}

.sidebar-brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.sidebar-logo-full {
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo-sm {
  height: 28px;
  width: 28px;
  object-fit: contain;
  flex-shrink: 0;
  display: none;
}

.app.nav-collapsed .sidebar .sidebar-logo-full {
  display: none;
}

.app.nav-collapsed .sidebar .sidebar-logo-sm {
  display: block;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-brand-icon svg {
  color: #fff;
  width: 20px;
  height: 20px;
}

.sidebar-brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.sidebar-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 0;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 24px 6px;
  white-space: nowrap;
  overflow: hidden;
  transition: opacity .15s, padding .22s ease;
}

.app.nav-collapsed .sidebar .nav-section-label {
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
  pointer-events: none;
}

.nav-item {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 0;
  transition: background .15s, color .15s, padding .22s ease;
  position: relative;
  border-left: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.app.nav-collapsed .sidebar .nav-link {
  padding: 9px 0;
  justify-content: center;
  border-left-color: transparent !important;
}

.app.nav-collapsed .sidebar .nav-link.active {
  background: var(--primary-subtle);
  color: var(--primary);
}

.nav-link-text {
  overflow: hidden;
  transition: opacity .15s, max-width .22s ease;
  max-width: 200px;
}

.app.nav-collapsed .sidebar .nav-link-text {
  max-width: 0;
  opacity: 0;
}

.nav-link:hover {
  background: var(--surface-low);
  color: var(--text);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-subtle);
  border-left-color: var(--primary);
  font-weight: 600;
}

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

.nav-platform-group {
  margin-top: 8px;
}

.nav-platform-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--primary);
  border-top: 1px solid var(--border-light);
  margin-top: 8px;
}

.nav-platform-label svg {
  width: 13px;
  height: 13px;
}

.sidebar-user {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-user-info {
  overflow: hidden;
  transition: opacity .15s, max-width .22s ease;
  max-width: 200px;
  min-width: 0;
}

.app.nav-collapsed .sidebar .sidebar-user-info {
  max-width: 0;
  opacity: 0;
}

.app.nav-collapsed .sidebar .sidebar-user {
  justify-content: center;
  padding: 16px 0;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.sidebar-user-email {
  font-size: 11px;
  color: var(--text-muted);
}

/* ─── Main ───────────────────────────────────────────────────────────────── */
.main {
  margin-left: var(--nav-width);
  width: calc(100vw - var(--nav-width));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
  transition: margin-left .22s ease, width .22s ease;
  overflow-x: hidden;
  box-sizing: border-box;
}

.app.nav-collapsed .main {
  margin-left: var(--nav-collapsed-width);
  width: calc(100vw - var(--nav-collapsed-width));
}

.app.nav-collapsed .sidebar {
  width: var(--nav-collapsed-width);
}

/* ─── Header ─────────────────────────────────────────────────────────────── */
.header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-search {
  flex: 1;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-low);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 38px;
}

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

.header-search input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
}

.header-search input::placeholder {
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background .15s;
}

.header-icon-btn:hover {
  background: var(--surface-low);
}

.header-icon-btn svg {
  width: 18px;
  height: 18px;
}

.platform-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  position: relative;
}

.platform-badge svg {
  width: 15px;
  height: 15px;
}

.platform-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-full);
  background: #4ade80;
  flex-shrink: 0;
}

.platform-select-wrap {
  position: relative;
}

.platform-select-wrap select {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 32px 7px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  outline: none;
  min-width: 180px;
}

.platform-select-wrap select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 80, 212, .12);
}

.platform-select-wrap::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--text-muted);
  pointer-events: none;
}

/* User dropdown */
.user-menu {
  position: relative;
}

.user-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
  transition: background .15s;
}

.user-menu-btn:hover {
  background: var(--surface-low);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}

.user-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
}

.user-menu-role {
  font-size: 11px;
  color: var(--text-muted);
  text-align: left;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  min-width: 200px;
  padding: 8px 0;
  z-index: 200;
  display: none;
}

.user-dropdown.open {
  display: block;
}

.user-dropdown-header {
  padding: 10px 16px 8px;
  border-bottom: 1px solid var(--border-light);
}

.user-dropdown-header p {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.user-dropdown-header small {
  font-size: 11px;
  color: var(--text-muted);
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  font-family: inherit;
  transition: background .12s;
}

.user-dropdown-item:hover {
  background: var(--surface-low);
}

.user-dropdown-item.danger {
  color: var(--danger);
}

.user-dropdown-item svg {
  width: 15px;
  height: 15px;
}

/* ─── Page content ───────────────────────────────────────────────────────── */
.page {
  flex: 1;
  padding: 32px;
  max-width: 1440px;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.page-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.01em;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid transparent;
  padding: 0 16px;
  height: var(--control-h);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  text-decoration: none;
  box-sizing: border-box;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-low);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--surface-low);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--border);
}

.btn-danger-ghost:hover {
  background: var(--danger-subtle);
  border-color: var(--danger);
}

.btn-sm {
  height: var(--control-h-sm);
  padding: 0 12px;
  font-size: 12px;
}

.btn-sm svg {
  width: 13px;
  height: 13px;
}

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
}

/* ─── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.card-body {
  padding: 24px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
}

.card-header-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.card-footer {
  padding: 12px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Metric cards */
.metric-card {
  padding: 24px;
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.metric-icon svg {
  width: 18px;
  height: 18px;
}

.metric-icon.blue {
  background: var(--primary-subtle);
  color: var(--primary);
}

.metric-icon.green {
  background: var(--success-subtle);
  color: var(--success);
}

.metric-icon.red {
  background: var(--danger-subtle);
  color: var(--danger);
}

.metric-icon.amber {
  background: var(--warning-subtle);
  color: var(--warning);
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.03em;
  line-height: 1;
}

.metric-value.primary {
  color: var(--primary);
}

.metric-value.danger {
  color: var(--danger);
}

.metric-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */
.grid {
  display: grid;
  gap: 20px;
}

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

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

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

@media (max-width: 1200px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 900px) {

  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

/* ─── Badges ─────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

.badge-success {
  background: var(--success-subtle);
  color: var(--success-text);
}

.badge-warning {
  background: var(--warning-subtle);
  color: var(--warning-text);
}

.badge-danger {
  background: var(--danger-subtle);
  color: var(--danger-text);
}

.badge-info {
  background: var(--info-subtle);
  color: var(--info-text);
}

.badge-neutral {
  background: var(--surface-high);
  color: var(--text-secondary);
}

.badge-primary {
  background: var(--primary-subtle);
  color: var(--primary);
}

/* ─── Table ──────────────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  background: var(--surface-low);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

thead th:first-child {
  padding-left: 24px;
}

thead th:last-child {
  padding-right: 24px;
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background .1s;
}

tbody tr:last-child {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--surface-low);
}

tbody td {
  padding: 13px 16px;
  font-size: 13px;
  color: var(--text);
  vertical-align: middle;
}

tbody td:first-child {
  padding-left: 24px;
}

tbody td:last-child {
  padding-right: 24px;
}

/* ─── Avatar ─────────────────────────────────────────────────────────────── */
.avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* ─── Forms ──────────────────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.form-label span.req {
  color: var(--danger);
}

.form-control {
  width: 100%;
  min-height: var(--control-h);
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text);
  font-family: inherit;
  background: var(--surface);
  outline: none;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}

select.form-control {
  height: var(--control-h);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 80, 212, .12);
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23737686' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.input-group {
  display: flex;
}

.input-group .form-control {
  border-radius: var(--radius) 0 0 var(--radius);
}

.input-group .input-addon {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: var(--surface-low);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
  cursor: pointer;
}

.input-group .input-addon svg {
  width: 15px;
  height: 15px;
}

.input-group .input-addon:hover {
  background: var(--surface-high);
}

/* Search bar in page */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 0 14px;
  height: 42px;
}

.search-bar svg {
  color: var(--text-muted);
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  color: var(--text);
  width: 100%;
  font-family: inherit;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* ─── Alert ──────────────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.alert-success {
  background: var(--success-subtle);
  color: var(--success-text);
}

.alert-danger {
  background: var(--danger-subtle);
  color: var(--danger-text);
}

.alert-hidden {
  display: none;
}

/* ─── Spinner ────────────────────────────────────────────────────────────── */
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: currentColor;
  animation: spin .6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ─── Pagination ─────────────────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .12s;
}

.page-btn:hover {
  background: var(--surface-low);
  border-color: var(--border-light);
  color: var(--text);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn svg {
  width: 14px;
  height: 14px;
}

/* ─── Platform card (dashboard) ─────────────────────────────────────────── */
.platform-card {
  display: block;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: box-shadow .15s, border-color .15s;
  padding: 0;
}

.platform-card:hover {
  box-shadow: var(--shadow-2);
  border-color: var(--border);
}

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

.platform-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.platform-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--primary-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.platform-card-icon svg {
  color: var(--primary);
  width: 20px;
  height: 20px;
}

.platform-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.platform-card-stats {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border-light);
}

.platform-stat {
  flex: 1;
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid var(--border-light);
}

.platform-stat:last-child {
  border-right: none;
}

.platform-stat-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.platform-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.platform-stat-value.primary {
  color: var(--primary);
}

/* ─── Empty state ────────────────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.empty-state svg {
  width: 40px;
  height: 40px;
  opacity: .4;
}

.empty-state p {
  font-size: 14px;
}

/* ─── Logo dark/light switching ─────────────────────────────────────────── */
[data-theme="dark"] .logo-dark-img {
  display: none;
}

[data-theme="dark"] .logo-light-img {
  display: block !important;
}

/* ─── Utilities ──────────────────────────────────────────────────────────── */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-between {
  justify-content: space-between;
}

.justify-end {
  justify-content: flex-end;
}

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-5 {
  gap: 20px;
}

.gap-6 {
  gap: 24px;
}

.mt-1 {
  margin-top: 4px;
}

.mt-2 {
  margin-top: 8px;
}

.mt-4 {
  margin-top: 16px;
}

.mt-6 {
  margin-top: 24px;
}

.mt-8 {
  margin-top: 32px;
}

.mb-1 {
  margin-bottom: 4px;
}

.mb-2 {
  margin-bottom: 8px;
}

.mb-4 {
  margin-bottom: 16px;
}

.mb-6 {
  margin-bottom: 24px;
}

.mb-8 {
  margin-bottom: 32px;
}

.ml-auto {
  margin-left: auto;
}

.text-sm {
  font-size: 12px;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-primary {
  color: var(--primary);
}

.text-danger {
  color: var(--danger);
}

.text-success {
  color: var(--success);
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.font-mono {
  font-family: 'Fira Code', monospace;
  font-size: 12px;
}

.w-full {
  width: 100%;
}

.shrink-0 {
  flex-shrink: 0;
}

.hidden {
  display: none;
}

.divider {
  height: 1px;
  background: var(--border-light);
  margin: 16px 0;
}

/* ─── Kanban Board ────────────────────────────────────────────────────────── */

.kanban-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 24px;
  min-height: calc(100vh - 220px);
}

.kanban-col {
  flex: 0 0 300px;
  background: var(--surface-2, #f8f9fc);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.kanban-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface-2, #f8f9fc);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.kanban-col-title {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.kanban-col-title .col-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.kanban-col-count {
  font-size: 11px;
  font-weight: 600;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 20px;
  padding: 2px 8px;
  min-width: 24px;
  text-align: center;
}

.kanban-cards {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.kanban-cards.drag-over {
  background: rgba(var(--primary-rgb, 66, 27, 207), 0.06);
  border-radius: var(--radius);
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: grab;
  transition: box-shadow 0.15s, transform 0.1s;
  position: relative;
}

.kanban-card:hover {
  box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, .1));
  border-color: var(--primary);
}

.kanban-card.dragging {
  opacity: 0.5;
  cursor: grabbing;
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, .16));
}

.kanban-card-id {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 4px;
}

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 8px;
  cursor: pointer;
}

.kanban-card-title:hover {
  color: var(--primary);
}

.kanban-card-project {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-card-project-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.kanban-card-assignees {
  display: flex;
  gap: -4px;
}

.kanban-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--surface);
  margin-left: -4px;
  flex-shrink: 0;
}

.kanban-avatar:first-child {
  margin-left: 0;
}

.kanban-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}

.kanban-label-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-label-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 20px;
  font-weight: 500;
  background: var(--surface-2, #f0f0f5);
  color: var(--text-secondary);
}

.kanban-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  gap: 4px;
}

.kanban-card:hover .kanban-card-actions {
  display: flex;
}

.kanban-card-action-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 5px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
}

.kanban-card-action-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.kanban-card-action-btn.danger:hover {
  background: var(--danger);
  border-color: var(--danger);
}

/* Priority badges */
.priority-1 {
  background: #e8f5e9;
  color: #2e7d32;
}

.priority-2 {
  background: var(--primary-subtle);
  color: var(--primary-dark);
}

.priority-3 {
  background: #fff3e0;
  color: #e65100;
}

.priority-4 {
  background: #fce4ec;
  color: #c62828;
}

.priority-5 {
  background: #f3e5f5;
  color: #6a1b9a;
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
}

.modal-close:hover {
  color: var(--text);
  background: var(--surface-2, #f0f0f5);
}

.modal-body {
  padding: 20px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab-btn {
  padding: 10px 18px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* Kanban filters bar */
.kanban-filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.kanban-filters .form-select,
.kanban-filters .form-control {
  min-width: 0;
  flex: 1 1 140px;
  max-width: 200px;
  height: 36px;
  font-size: 13px;
}

/* Report cards */
.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.stat-bar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stat-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}

.stat-bar-label {
  width: 130px;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-size: 12px;
}

.stat-bar-track {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 20px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  border-radius: 20px;
  transition: width 0.4s;
}

.stat-bar-val {
  width: 28px;
  text-align: right;
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
}