/* TIM-OE Dashboard layout beautify patch
   Scope: ONLY /dashboard page. No business logic is changed. */

body.timoe-dashboard-page {
  --tim-dash-border: rgba(148, 163, 184, 0.20);
  --tim-dash-shadow: 0 22px 54px rgba(15, 23, 42, 0.07);
  --tim-dash-soft: 0 12px 28px rgba(15, 23, 42, 0.05);
}

body.timoe-dashboard-page main > div {
  max-width: 1640px !important;
}

body.timoe-dashboard-page main > div > div[class*="px-3"] {
  padding-top: .7rem !important;
  padding-left: .9rem !important;
  padding-right: .9rem !important;
}

body.timoe-dashboard-page main [class*="rounded-[30px]"][class*="shadow"],
body.timoe-dashboard-page main [class*="md:rounded-[36px]"] {
  border-radius: 28px !important;
  padding: .8rem !important;
  box-shadow: 0 20px 56px rgba(15, 23, 42, 0.07) !important;
}

body.timoe-dashboard-page main [class*="rounded-[24px]"],
body.timoe-dashboard-page main [class*="md:rounded-[28px]"] {
  border-radius: 22px !important;
}

body.timoe-dashboard-page [data-tim-dashboard-premium-root] {
  display: block;
}

body.timoe-dashboard-page .tim-premium-dashboard {
  display: grid;
  gap: 1.05rem;
}

body.timoe-dashboard-page .tim-premium-hero,
body.timoe-dashboard-page .tim-premium-card,
body.timoe-dashboard-page .tim-premium-kpi {
  border-radius: 22px !important;
  border-color: var(--tim-dash-border) !important;
  box-shadow: var(--tim-dash-shadow) !important;
}

body.timoe-dashboard-page .tim-premium-hero {
  position: relative;
  overflow: hidden;
  padding: 1.5rem 1.55rem !important;
  background:
    radial-gradient(circle at top right, rgba(59,130,246,.22), transparent 28%),
    radial-gradient(circle at bottom left, rgba(16,185,129,.14), transparent 24%),
    linear-gradient(135deg, #ffffff 0%, #f4f8ff 52%, #eef6ff 100%) !important;
}

body.timoe-dashboard-page .tim-premium-hero::after {
  content: '';
  position: absolute;
  right: -40px;
  top: -34px;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(14,165,233,.16), rgba(59,130,246,0));
  pointer-events: none;
}

body.timoe-dashboard-page .tim-premium-badge {
  background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(14,165,233,.11));
  color: #1d4ed8;
  font-size: .69rem;
  letter-spacing: .14em;
}

body.timoe-dashboard-page .tim-premium-hero h2 {
  font-size: clamp(1.85rem, 2.3vw, 2.45rem) !important;
  margin-top: .6rem !important;
}

body.timoe-dashboard-page .tim-premium-hero p {
  max-width: 760px;
  font-size: .94rem;
  line-height: 1.55;
}

body.timoe-dashboard-page .tim-premium-role {
  background: linear-gradient(135deg, rgba(37,99,235,.10), rgba(37,99,235,.04));
  border: 1px solid rgba(37,99,235,.12);
  height: 2.95rem;
}

body.timoe-dashboard-page .tim-premium-hero-actions button {
  height: 2.95rem;
  border-radius: 14px;
  padding: 0 1.2rem;
}

body.timoe-dashboard-page .tim-premium-kpis {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem !important;
}

body.timoe-dashboard-page .tim-premium-kpi {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 1rem 1rem 1.05rem !important;
}

body.timoe-dashboard-page .tim-premium-kpi::after {
  content: '';
  position: absolute;
  inset: auto -22px -24px auto;
  width: 96px;
  height: 96px;
  border-radius: 999px;
  background: rgba(255,255,255,.34);
  pointer-events: none;
}

body.timoe-dashboard-page .tim-premium-kpi span {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

body.timoe-dashboard-page .tim-premium-kpi strong {
  font-size: clamp(1.6rem, 2vw, 2.1rem) !important;
}

body.timoe-dashboard-page .tim-premium-kpi em {
  font-size: .8rem;
}

body.timoe-dashboard-page .tim-premium-grid {
  gap: .95rem !important;
}

body.timoe-dashboard-page .tim-premium-grid-main {
  grid-template-columns: minmax(0, 1.35fr) minmax(350px, .9fr) !important;
}

body.timoe-dashboard-page .tim-premium-grid-end {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  align-items: stretch;
}

body.timoe-dashboard-page .tim-premium-card {
  padding: 1.1rem !important;
  min-width: 0;
}

body.timoe-dashboard-page .tim-premium-grid-end > .tim-premium-card {
  min-height: 100%;
}

body.timoe-dashboard-page .tim-premium-card-head {
  margin-bottom: .85rem !important;
}

body.timoe-dashboard-page .tim-premium-card-head h3 {
  font-size: 1.1rem !important;
}

body.timoe-dashboard-page .tim-premium-card-head p {
  font-size: .83rem;
}

body.timoe-dashboard-page .tim-premium-chart {
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(248,250,252,.72), rgba(255,255,255,.95));
}

body.timoe-dashboard-page .tim-premium-list {
  gap: .7rem !important;
}

body.timoe-dashboard-page .tim-premium-list-row,
body.timoe-dashboard-page .tim-premium-notice,
body.timoe-dashboard-page .tim-premium-audit-row {
  border-radius: 18px !important;
  box-shadow: var(--tim-dash-soft);
}

body.timoe-dashboard-page .tim-premium-list-row {
  padding: .82rem .88rem !important;
  align-items: center;
}

body.timoe-dashboard-page .tim-premium-rank {
  width: 2.25rem;
  height: 2.25rem;
  font-size: .9rem;
}

body.timoe-dashboard-page .tim-premium-row-title,
body.timoe-dashboard-page .tim-premium-expense-head {
  font-size: .95rem;
}

body.timoe-dashboard-page .tim-premium-row-sub,
body.timoe-dashboard-page .tim-premium-metrics,
body.timoe-dashboard-page .tim-premium-notice-body,
body.timoe-dashboard-page .tim-premium-audit-body,
body.timoe-dashboard-page .tim-premium-audit-sub {
  font-size: .82rem;
}

body.timoe-dashboard-page .tim-premium-overdue {
  background: linear-gradient(135deg, #fff7ed, #fffbeb 62%, #ffffff) !important;
}

body.timoe-dashboard-page .tim-premium-loading,
body.timoe-dashboard-page .tim-premium-error,
body.timoe-dashboard-page .tim-premium-empty {
  border-radius: 18px;
  min-height: 8rem;
}

html.dark body.timoe-dashboard-page .tim-premium-hero,
body.dark.timoe-dashboard-page .tim-premium-hero,
html.dark body.timoe-dashboard-page .tim-premium-card,
body.dark.timoe-dashboard-page .tim-premium-card,
html.dark body.timoe-dashboard-page .tim-premium-kpi,
body.dark.timoe-dashboard-page .tim-premium-kpi {
  background: linear-gradient(180deg, rgba(15,23,42,.93), rgba(2,6,23,.90)) !important;
  border-color: rgba(51,65,85,.9) !important;
  box-shadow: none !important;
}

html.dark body.timoe-dashboard-page .tim-premium-chart,
body.dark.timoe-dashboard-page .tim-premium-chart {
  background: linear-gradient(180deg, rgba(15,23,42,.62), rgba(2,6,23,.20));
}

html.dark body.timoe-dashboard-page .tim-premium-list-row,
body.dark.timoe-dashboard-page .tim-premium-list-row,
html.dark body.timoe-dashboard-page .tim-premium-notice,
body.dark.timoe-dashboard-page .tim-premium-notice,
html.dark body.timoe-dashboard-page .tim-premium-audit-row,
body.dark.timoe-dashboard-page .tim-premium-audit-row {
  box-shadow: none;
}

@media (max-width: 1320px) {
  body.timoe-dashboard-page .tim-premium-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  body.timoe-dashboard-page .tim-premium-grid-main,
  body.timoe-dashboard-page .tim-premium-grid-end {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 760px) {
  body.timoe-dashboard-page main > div > div[class*="px-3"] {
    padding-left: .45rem !important;
    padding-right: .45rem !important;
    padding-bottom: 5.2rem !important;
  }

  body.timoe-dashboard-page .tim-premium-hero {
    padding: 1.1rem 1rem !important;
  }

  body.timoe-dashboard-page .tim-premium-hero-actions {
    width: 100%;
  }

  body.timoe-dashboard-page .tim-premium-role,
  body.timoe-dashboard-page .tim-premium-hero-actions button {
    width: 100%;
    justify-content: center;
  }

  body.timoe-dashboard-page .tim-premium-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: .65rem !important;
  }

  body.timoe-dashboard-page .tim-premium-kpi {
    min-height: 112px;
    padding: .85rem !important;
  }

  body.timoe-dashboard-page .tim-premium-card {
    padding: .95rem !important;
  }
}

@media (max-width: 520px) {
  body.timoe-dashboard-page .tim-premium-kpis {
    grid-template-columns: 1fr !important;
  }

  body.timoe-dashboard-page .tim-premium-hero h2 {
    font-size: 1.55rem !important;
  }
}
