/* ---------- Notice bar ---------- */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 10px 18px;
  margin-bottom: 18px;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05);
  max-width: 620px;
  position: relative;
  overflow: hidden;
}

.notice-bar__badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  flex-shrink: 0;
}

.notice-bar__icon {
  font-size: 13px;
  line-height: 1;
}

.notice-bar__label {
  font-size: 11px;
  font-weight: 700;
  color: var(--c-navy);
  letter-spacing: 0.5px;
}

.notice-bar__ticker {
  height: 24px;
  overflow: hidden;
  flex-grow: 1;
  position: relative;
}

.notice-bar__list {
  margin: 0;
  padding: 0;
  list-style: none;
  animation: ticker-slide 6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.notice-bar:hover .notice-bar__list {
  animation-play-state: paused;
}

.notice-bar__list li {
  height: 24px;
  display: flex;
  align-items: center;
}

.notice-bar__link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-decoration: none;
  color: var(--c-text-muted);
  transition: color 0.2s ease;
}

.notice-bar__link:hover {
  color: var(--c-text-main, #1e293b);
}

.notice-bar__title {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-bar__list time {
  color: var(--c-text-faint);
  font-size: 12px;
  margin-left: 16px;
  font-feature-settings: "tnum";
}

@keyframes ticker-slide {
  0%, 40% {
    transform: translateY(0);
  }
  50%, 90% {
    transform: translateY(-24px);
  }
  100% {
    transform: translateY(-48px);
  }
}

/* ---------- Grids ---------- */
.dash-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.dash-grid--top {
  grid-template-columns: 1.1fr 1fr;
}

.dash-grid--bottom {
  grid-template-columns: 1.3fr 1fr;
}

.dash-line-card {
  margin-bottom: 18px;
}

.card__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.card__sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--c-text-faint);
}

/* ---------- Segmented control ---------- */
.seg {
  display: flex;
  background: var(--c-bg);
  border-radius: 100px;
  padding: 3px;
  gap: 2px;
}

.seg__btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-text-muted);
  border-radius: 100px;
}

.seg__btn.is-active {
  background: var(--c-surface);
  color: var(--c-navy);
  box-shadow: 0 1px 3px rgba(23, 43, 45, 0.12);
}

/* ---------- Donut ---------- */
.donut-row {
  display: flex;
  align-items: center;
  gap: 34px;
}

.donut {
  --p1: 0;
  --p2: 0;
  --p3: 0;
  --p4: 0;
  width: 172px;
  height: 172px;
  border-radius: 50%;
  flex-shrink: 0;
  background: conic-gradient(
    var(--chart-1) 0 calc(var(--p1) * 1%),
    var(--chart-2) calc(var(--p1) * 1%) calc((var(--p1) + var(--p2)) * 1%),
    var(--chart-3) calc((var(--p1) + var(--p2)) * 1%) calc((var(--p1) + var(--p2) + var(--p3)) * 1%),
    var(--chart-5) calc((var(--p1) + var(--p2) + var(--p3)) * 1%) 100%
  );
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.donut::before {
  content: "";
  position: absolute;
  inset: 22px;
  background: var(--c-surface);
  border-radius: 50%;
}

.donut__center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.25;
}

.donut__center strong {
  font-size: 28px;
  color: var(--c-navy);
  font-weight: 800;
}

.donut__center span {
  font-size: 11.5px;
  color: var(--c-text-muted);
}

.donut-legend {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
}

.donut-legend li {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--c-text);
}

.donut-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.donut-legend b {
  color: var(--c-navy);
  font-weight: 700;
}

.donut-legend em {
  font-style: normal;
  color: var(--c-text-faint);
  min-width: 34px;
  text-align: right;
}

/* ---------- Change columns ---------- */
.change-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.change-col__label {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

.change-col__label--a {
  background: var(--c-primary);
}

.change-col__label--b {
  background: var(--c-navy);
}

.change-col__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.change-col__list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed var(--c-border);
  font-size: 13px;
}

.change-col__list li:last-child {
  border-bottom: none;
}

.change-col__list b {
  color: var(--c-navy);
  font-weight: 700;
}

/* ---------- Line chart ---------- */
.line-chart-wrap {
  position: relative;
  padding-left: 30px;
}

.line-chart-label {
  position: absolute;
  top: -6px;
  left: 0;
  font-size: 11.5px;
  color: var(--c-text-faint);
}

.line-chart-wrap svg {
  width: 100%;
  height: 220px;
  display: block;
  overflow: visible;
}

.line-chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--c-text-faint);
  padding: 0 2px;
}

/* ---------- Bar chart ---------- */
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  height: 200px;
  padding-top: 26px;
}

.bar-chart__group {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 100%;
  position: relative;
}

.bar-chart__bar {
  width: 12px;
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
  position: relative;
}

.bar-chart__bar[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 6px;
  background: var(--c-navy);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

.bar-chart__cat {
  position: absolute;
  bottom: -22px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--c-text-muted);
}

.bar-chart--single .bar-chart__group {
  gap: 0;
}

.bar-chart--single .bar-chart__bar {
  width: 34px;
}

@media (max-width: 1080px) {
  .dash-grid--top,
  .dash-grid--bottom {
    grid-template-columns: 1fr;
  }
}

/* ---------- Recent login table ---------- */

.dash-login-card {
  min-width: 0;
}

.dash-login-card__body {
  /*padding-top: 2px;*/
}

.card__title-wrap {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.card__more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--c-text-muted);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.card__more:hover {
  color: var(--c-navy);
}

.card__more span {
  font-size: 17px;
  line-height: 10px;
}

/* table */

.login-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12.5px;
}

.dash-table thead th {
  height: 36px;
  padding: 0 10px;
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-faint);
  font-size: 11.5px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.dash-table tbody td {
  height: 46px;
  padding: 0 10px;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: middle;
}

.dash-table tbody tr:last-child td {
  /*border-bottom: none;*/
}

/* column widths */

.dash-table th:nth-child(1),
.dash-table td:nth-child(1) {
  width: 34%;
}

.dash-table th:nth-child(2),
.dash-table td:nth-child(2) {
  width: 25%;
}

.dash-table th:nth-child(3),
.dash-table td:nth-child(3) {
  width: 15%;
  text-align: center;
}

.dash-table th:nth-child(4),
.dash-table td:nth-child(4) {
  width: 26%;
}

/* user */

.login-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.login-user__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-navy);
  font-weight: 700;
}

.login-user__id {
  flex-shrink: 0;
  color: var(--c-text-faint);
  font-size: 11px;
}

/* ip */

.login-ip {
  color: var(--c-text-muted);
  font-size: 12px;
  font-family: inherit;
  white-space: nowrap;
}

/* status */

.login-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 24px;
  padding: 0 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
}

.login-status--success {
  background: color-mix(in srgb, var(--chart-1) 12%, transparent);
  color: var(--chart-1);
}

.login-status--danger {
  background: color-mix(in srgb, var(--chart-5) 12%, transparent);
  color: var(--chart-5);
}

/* datetime */

.login-time {
  color: var(--c-text-faint);
  font-size: 11.5px;
  white-space: nowrap;
}

/* empty / loading */

.dash-table__empty td {
  height: 120px;
  border-bottom: none;
  text-align: center;
}

.dash-table__empty span {
  color: var(--c-text-faint);
  font-size: 12px;
}

/* hover */

.dash-table tbody tr:not(.dash-table__empty) {
  transition: background 0.15s ease;
}

.dash-table tbody tr:not(.dash-table__empty):hover {
  background: var(--c-bg);
}

@media (max-width: 700px) {

  .dash-table {
    min-width: 560px;
  }

  .dash-login-card__body {
    overflow: hidden;
  }

}

/* GA4 Card Styles */
.dash-ga4-card .card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.badge--success {
    background-color: rgba(16, 185, 129, 0.12);
    color: #10b981;
    font-size: 0.725rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
}

.ga4-kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ga4-kpi {
    background: var(--bg-surface-subtle, #f8fafc);
    padding: 6px 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ga4-kpi__label {
    font-size: 0.8rem;
    color: var(--txt-muted, #64748b);
}

.ga4-kpi__val {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--txt-main, #0f172a);
}

.ga4-site-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
}

.ga4-site-item__info {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    margin-bottom: 4px;
}

.ga4-site-item__name {
    font-weight: 500;
    word-break: break-all;
}

.ga4-site-item__count {
    color: var(--txt-muted, #64748b);
    flex-shrink: 0;
    margin-left: 8px;
}

.ga4-site-item__bar-bg {
    height: 6px;
    background: var(--border-color, #e2e8f0);
    border-radius: 3px;
    overflow: hidden;
}

.ga4-site-item__bar-fill {
    height: 100%;
    background: var(--c-primary, #3b82f6);
    border-radius: 3px;
    transition: width 0.4s ease;
}

.ga4-loading, .ga4-empty {
    text-align: center;
    padding: 20px 0;
    color: var(--txt-muted, #64748b);
    font-size: 0.875rem;
}

.ga4-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    gap: 12px;
    color: #666;
    font-size: 0.9rem;
}

.ga4-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: ga4-spin 0.8s linear infinite;
}

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