:root {
      --orange-1: #fff7ed;
      --orange-2: #ffedd5;
      --orange-3: #fed7aa;
      --orange-4: #fdba74;
      --orange-5: #fb923c;
      --orange-6: #f59e0b;
      --orange-7: #ea580c;
      --text-1: #2a211b;
      --text-2: #7a6a5f;
      --success: #16a34a;
      --danger: #dc2626;
      --card-shadow: 0 12px 30px rgba(63, 29, 4, 0.06);
      --soft-border: 1px solid rgba(245, 158, 11, 0.10);
      --radius-xl: 24px;
      --radius-lg: 18px;
      --radius-md: 14px;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      font-family: 'Inter', sans-serif;
      color: var(--text-1);
      background: linear-gradient(135deg, #f2a278 0%, #f6b08d 18%, #f7d3b7 55%, #f3e4d6 100%);
      min-height: 100vh;
      padding: 28px;
    }

    .app-shell {
      background: rgba(255, 252, 248, 0.86);
      backdrop-filter: blur(8px);
      border-radius: 30px;
      overflow: hidden;
      box-shadow: 0 24px 70px rgba(69, 31, 5, 0.10);
      min-height: calc(100vh - 56px);
      border: 1px solid rgba(255,255,255,0.45);
    }

    .sidebar {
      width: 280px;
      background: linear-gradient(180deg, rgba(255,247,237,0.92) 0%, rgba(255,252,248,0.98) 100%);
      border-right: var(--soft-border);
      padding: 26px 18px;
      min-height: calc(100vh - 56px);
    }

    .brand {
      display: flex;
      align-items: center;
      gap: 12px;
      font-weight: 800;
      font-size: 1.8rem;
      color: #d78a18;
      margin-bottom: 34px;
    }

    .brand-icon {
      width: 42px;
      height: 42px;
      border-radius: 14px;
      background: linear-gradient(135deg, var(--orange-4), var(--orange-6));
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: white;
      box-shadow: 0 10px 20px rgba(245, 158, 11, 0.25);
      font-size: 1rem;
    }

    .nav-title {
      font-size: 0.78rem;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: #9b8a7b;
      font-weight: 700;
      margin-bottom: 14px;
      padding: 0 8px;
    }

    .sidebar .nav-link {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      color: #4f443b;
      padding: 14px 16px;
      border-radius: 14px;
      font-weight: 600;
      margin-bottom: 6px;
      transition: all 0.25s ease;
    }

    .sidebar .nav-link .left {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .sidebar .nav-link i {
      width: 18px;
      text-align: center;
      opacity: 0.9;
    }

    .sidebar .nav-link:hover,
    .sidebar .nav-link.active {
      background: linear-gradient(90deg, var(--orange-4), #f4bb7c);
      color: #fff;
      box-shadow: 0 10px 24px rgba(251, 146, 60, 0.22);
    }

    .count-badge {
      background: rgba(245, 158, 11, 0.12);
      color: #c37411;
      padding: 5px 10px;
      border-radius: 999px;
      font-size: 0.78rem;
      font-weight: 700;
    }

    .sidebar .nav-link.active .count-badge,
    .sidebar .nav-link:hover .count-badge {
      background: rgba(255,255,255,0.22);
      color: #fff;
    }

    .upgrade-card {
      margin-top: 28px;
      background: linear-gradient(180deg, #f9d885, #f5b252);
      border-radius: 18px;
      padding: 20px;
      color: #6a4204;
      box-shadow: var(--card-shadow);
    }

    .upgrade-card h6 {
      font-weight: 800;
      margin-bottom: 10px;
    }

    .upgrade-card p {
      font-size: 0.9rem;
      opacity: 0.9;
      margin-bottom: 16px;
    }

    .btn-upgrade {
      background: rgba(255,255,255,0.82);
      color: #8a5308;
      border: 0;
      font-weight: 700;
      border-radius: 12px;
      padding: 10px 16px;
    }

    .content-area {
      padding: 22px 24px 30px;
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 14px;
      margin-bottom: 26px;
      padding-bottom: 16px;
      border-bottom: 1px solid rgba(122, 106, 95, 0.10);
    }

    .search-wrap {
      position: relative;
      max-width: 360px;
      width: 100%;
    }

    .search-wrap i {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: #a19185;
      font-size: 0.92rem;
    }

    .search-input {
      width: 100%;
      border: 1px solid rgba(245, 158, 11, 0.12);
      background: rgba(255,255,255,0.88);
      height: 46px;
      border-radius: 14px;
      padding: 0 16px 0 40px;
      outline: none;
      color: var(--text-1);
    }

    .icon-pill,
    .today-pill {
      height: 46px;
      border-radius: 14px;
      background: rgba(255,255,255,0.88);
      border: 1px solid rgba(245, 158, 11, 0.12);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: #5f5348;
    }

    .icon-pill {
      width: 46px;
    }

    .today-pill {
      padding: 0 16px;
      gap: 10px;
      font-weight: 600;
    }

    .welcome-title {
      font-size: 1.815rem;
      font-weight: 800;
      letter-spacing: -0.03em;
      margin-bottom: 10px;
    }

    .welcome-subtitle {
      color: var(--text-2);
      font-size: 1rem;
      margin-bottom: 24px;
    }

    .dashboard-card {
      background: rgba(255,255,255,0.84);
      border: var(--soft-border);
      border-radius: var(--radius-lg);
      box-shadow: var(--card-shadow);
    }

    .metric-card {
      padding: 22px;
      height: 100%;
    }

    .metric-label {
      color: #9a887a;
      font-size: 0.95rem;
      font-weight: 600;
      margin-bottom: 8px;
    }

    .metric-value {
      font-size: 2rem;
      font-weight: 800;
      letter-spacing: -0.03em;
      margin-bottom: 8px;
      line-height: 1;
    }

    .metric-footer {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .metric-trend {
      font-size: 0.92rem;
      font-weight: 700;
    }

    .metric-trend.positive { color: var(--success); }
    .metric-trend.negative { color: var(--danger); }

    .metric-subtext {
      color: #a09083;
      font-size: 0.88rem;
      font-weight: 500;
    }

    .metric-icon {
      width: 58px;
      height: 58px;
      border-radius: 16px;
      background: linear-gradient(135deg, var(--orange-5), var(--orange-6));
      color: #fff;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 14px 30px rgba(245, 158, 11, 0.25);
      font-size: 1.2rem;
      flex-shrink: 0;
    }

    .section-card {
      padding: 24px;
      height: 100%;
      position: relative;
      overflow: hidden;
    }

    .section-title {
      font-size: 1.55rem;
      font-weight: 800;
      margin-bottom: 4px;
    }

    .section-subtitle {
      color: var(--text-2);
      font-size: 0.96rem;
      margin-bottom: 22px;
    }

    .soft-pill {
      position: absolute;
      top: 22px;
      right: 22px;
      background: #ecfdf5;
      color: var(--success);
      padding: 8px 12px;
      border-radius: 999px;
      font-size: 0.9rem;
      font-weight: 700;
    }

    .chart-area {
      height: 320px;
      position: relative;
      display: flex;
      align-items: end;
      justify-content: center;
      padding: 26px 10px 18px 50px;
      border-radius: 18px;
      background: linear-gradient(180deg, rgba(255,243,230,0.65), rgba(255,255,255,0.5));
    }

    .chart-grid {
      position: absolute;
      inset: 20px 16px 16px 48px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      pointer-events: none;
    }

    .chart-grid span {
      border-top: 1px dashed rgba(210, 177, 143, 0.35);
      width: 100%;
      display: block;
    }

    .y-labels {
      position: absolute;
      top: 18px;
      left: 0;
      bottom: 18px;
      width: 44px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      font-size: 0.78rem;
      color: #b09a8d;
      text-align: right;
      padding-right: 10px;
    }

    .x-labels {
      display: grid;
      grid-template-columns: repeat(12, 1fr);
      gap: 6px;
      margin-top: 12px;
      padding-left: 50px;
      font-size: 0.78rem;
      color: #b09a8d;
      text-align: center;
    }

    .chart-svg {
      position: absolute;
      inset: 16px 10px 18px 48px;
      width: calc(100% - 58px);
      height: calc(100% - 34px);
    }

    .heart-glow {
      position: absolute;
      right: 60px;
      top: 52px;
      width: 150px;
      height: 150px;
      background: radial-gradient(circle at 30% 30%, rgba(255, 183, 77, 0.85), rgba(251, 146, 60, 0.4) 35%, rgba(217, 70, 239, 0.30) 65%, rgba(96, 165, 250, 0.15) 100%);
      transform: rotate(-10deg);
      filter: blur(0.4px);
      opacity: 0.85;
      clip-path: path('M 75 135 C 25 95 0 65 0 35 C 0 5 24 -10 48 -10 C 63 -10 73 -2 75 10 C 77 -2 87 -10 102 -10 C 126 -10 150 5 150 35 C 150 65 125 95 75 135 Z');
    }

    .bottom-metrics {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 16px;
      margin-top: 18px;
    }

    .mini-stat {
      background: linear-gradient(180deg, rgba(255,248,241,0.95), rgba(255,255,255,0.9));
      border: 1px solid rgba(245, 158, 11, 0.10);
      border-radius: 16px;
      padding: 16px 18px;
    }

    .mini-stat .value {
      font-size: 1.9rem;
      font-weight: 800;
      line-height: 1;
      margin-bottom: 6px;
    }

    .mini-stat .caption {
      color: #9a887a;
      font-weight: 600;
      font-size: 0.92rem;
    }

    .funnel-rate {
      position: absolute;
      top: 24px;
      right: 24px;
      text-align: right;
    }

    .funnel-rate .value {
      font-size: 2.1rem;
      font-weight: 800;
      color: #e7a726;
      line-height: 1;
    }

    .funnel-rate .caption {
      color: #b29784;
      font-size: 0.9rem;
      font-weight: 600;
    }

    .funnel-bars {
      margin-top: 16px;
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .funnel-item {
      display: grid;
      grid-template-columns: 110px 1fr;
      gap: 14px;
      align-items: center;
    }

    .funnel-label {
      color: #7d6d60;
      font-weight: 600;
      font-size: 0.94rem;
    }

    .funnel-track {
      background: rgba(245, 158, 11, 0.08);
      border-radius: 999px;
      height: 22px;
      position: relative;
      overflow: hidden;
    }

    .funnel-fill {
      height: 100%;
      border-radius: 999px;
      background: linear-gradient(90deg, #f7c76a, #efaf2f);
      box-shadow: inset 0 -1px 0 rgba(255,255,255,0.3);
    }

    .scale-row {
      display: grid;
      grid-template-columns: 110px repeat(6, 1fr);
      gap: 14px;
      font-size: 0.77rem;
      color: #b09a8d;
      margin-top: 12px;
      text-align: center;
    }

    .traffic-box {
      margin-top: 30px;
      display: grid;
      grid-template-columns: 180px 1fr;
      gap: 18px;
      align-items: center;
    }

    .donut {
      width: 150px;
      height: 150px;
      border-radius: 50%;
      background: conic-gradient(
        #e9aa23 0% 45%,
        #ef9f4e 45% 70%,
        #f4cd7c 70% 90%,
        #56b96f 90% 100%
      );
      position: relative;
      margin: 0 auto;
      box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), 0 10px 25px rgba(245, 158, 11, 0.10);
    }

    .donut::after {
      content: '';
      position: absolute;
      inset: 34px;
      background: rgba(255,252,248,0.95);
      border-radius: 50%;
      box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.08);
    }

    .traffic-list {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .traffic-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      font-weight: 600;
      color: #6f6054;
    }

    .traffic-left {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      display: inline-block;
    }

    .dot.organic { background: #e9aa23; }
    .dot.social { background: #ef9f4e; }
    .dot.email { background: #f4cd7c; }
    .dot.direct { background: #56b96f; }

    @media (max-width: 1199.98px) {
      .sidebar {
        width: 100%;
        min-height: auto;
      }

      .traffic-box {
        grid-template-columns: 1fr;
        justify-items: start;
      }
    }

    @media (max-width: 991.98px) {
      body {
        padding: 16px;
      }

      .app-shell {
        border-radius: 22px;
      }

      .content-area {
        padding: 18px;
      }

      .welcome-title {
        font-size: 1.65rem;
      }

      .topbar {
        flex-wrap: wrap;
        justify-content: flex-start;
      }
    }

    @media (max-width: 767.98px) {
      .sidebar {
        padding: 18px 14px;
      }

      .brand {
        font-size: 1.5rem;
      }

      .metric-value {
        font-size: 1.7rem;
      }

      .section-title {
        font-size: 1.3rem;
      }

      .chart-area {
        height: 260px;
      }

      .heart-glow {
        width: 110px;
        height: 110px;
        right: 20px;
        top: 62px;
      }

      .funnel-item,
      .scale-row {
        grid-template-columns: 1fr;
      }

      .scale-row {
        text-align: left;
      }

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

    /* Auth (login) — based on admin-template/login.html, adapted to theme variables above */
    body.login-page {
      padding: 0;
    }

    .fw-800 { font-weight: 800 !important; }

    .login-shell {
      min-height: 100vh;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 32px;
    }

    .login-wrapper {
      width: 100%;
      max-width: 1180px;
      background: rgba(255, 252, 248, 0.86);
      backdrop-filter: blur(8px);
      border-radius: 32px;
      overflow: hidden;
      box-shadow: 0 24px 70px rgba(69, 31, 5, 0.10);
      border: 1px solid rgba(255, 255, 255, 0.45);
    }

    .login-left {
      background: linear-gradient(180deg, rgba(255,247,237,0.92) 0%, rgba(255,252,248,0.98) 100%);
      padding: 48px;
      height: 100%;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      border-right: var(--soft-border);
    }

    .login-right {
      background: linear-gradient(180deg, rgba(255, 252, 248, 0.95) 0%, rgba(255, 252, 248, 0.88) 100%);
      padding: 56px;
      display: flex;
      align-items: center;
      justify-content: center;
      min-height: 760px;
    }

    .login-card {
      width: 100%;
      max-width: 430px;
      background: linear-gradient(180deg, rgba(255, 252, 248, 0.95) 0%, rgba(255, 252, 248, 0.88) 100%);
      border: 1px solid rgba(245, 158, 11, 0.14);
      border-radius: 28px;
      padding: 36px;
      box-shadow: 0 18px 50px rgba(95, 65, 35, 0.07);
    }

    .badge-soft {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      background: rgba(245, 158, 11, 0.14);
      color: #c37411;
      border-radius: 999px;
      padding: 8px 14px;
      font-size: 0.9rem;
      font-weight: 700;
      margin-bottom: 18px;
    }

    .login-card h2 {
      font-size: 2rem;
      font-weight: 800;
      margin-bottom: 10px;
      letter-spacing: -0.02em;
    }

    .login-card .subtitle {
      color: var(--text-2);
      margin-bottom: 28px;
      line-height: 1.6;
    }

    body.login-page .form-label {
      font-weight: 700;
      font-size: 0.95rem;
      margin-bottom: 10px;
      color: #5b4a40;
    }

    body.login-page .form-control {
      height: 56px;
      border-radius: 16px;
      border: 1px solid rgba(245, 158, 11, 0.14);
      background: rgba(255, 250, 245, 0.92);
      padding: 0 18px;
      font-size: 1rem;
      color: var(--text-1);
      box-shadow: none;
    }

    body.login-page .form-control:focus {
      border-color: rgba(245, 158, 11, 0.60);
      box-shadow: 0 0 0 0.2rem rgba(245, 158, 11, 0.16);
      background: rgba(255, 253, 249, 0.96);
    }

    .btn-login {
      height: 58px;
      border: none;
      border-radius: 18px;
      background: linear-gradient(135deg, var(--orange-6), var(--orange-7));
      color: white;
      font-size: 1rem;
      font-weight: 800;
      width: 100%;
      transition: all 0.25s ease;
      box-shadow: 0 12px 24px rgba(245, 158, 11, 0.25);
    }

    .btn-login:hover {
      transform: translateY(-1px);
      filter: brightness(1.02);
    }

    .helper-text {
      text-align: center;
      color: var(--text-2);
      margin-top: 18px;
      font-size: 0.95rem;
    }

    .helper-text a {
      color: #c37411;
      font-weight: 700;
      text-decoration: none;
    }

    .mini-stats {
      display: flex;
      gap: 14px;
      margin-top: 28px;
    }

    .mini-stat {
      flex: 1;
      background: rgba(255, 249, 242, 0.95);
      border: 1px solid rgba(245, 158, 11, 0.14);
      border-radius: 18px;
      padding: 16px;
      text-align: center;
    }

    .mini-stat .value {
      font-size: 1.35rem;
      font-weight: 800;
      color: var(--text-1);
    }

    .mini-stat .label {
      font-size: 0.85rem;
      color: var(--text-2);
      margin-top: 4px;
    }

    @media (max-width: 991.98px) {
      .login-left { display: none; }
      .login-right { min-height: auto; padding: 32px 22px; }
      .login-wrapper { max-width: 520px; }
    }

    @media (max-width: 575.98px) {
      .login-card { padding: 28px 22px; border-radius: 24px; }
      .login-card h2 { font-size: 1.7rem; }
      .mini-stats { flex-direction: column; }
    }
