/* =========================================================================
   Premium theme layer
   Loaded after style.css / color1.css / skin-modes.css so these rules win
   the cascade on equal-specificity selectors without needing !important.
   Scope: refine existing classes (colors, shadows, radius, spacing) rather
   than change layout-critical structure (widths/positions/flex), so the
   sidebar/responsive behavior already provided by the base theme keeps
   working untouched.
   ========================================================================= */

:root {
    --pt-primary: #6c5ffc;
    --pt-primary-dark: #4b3ff0;
    --pt-primary-light: #8b7cf6;
    --pt-gradient: linear-gradient(135deg, var(--pt-primary) 0%, var(--pt-primary-light) 100%);
    --pt-gradient-dark: linear-gradient(160deg, #2c2350 0%, #423a72 60%, #574b96 100%);

    --pt-success: #198754;
    --pt-warning: #b8860b;
    --pt-danger: #dc3545;
    --pt-info: #0891b2;
    --pt-secondary: #6c757d;

    --pt-ink: #2d2d3f;
    --pt-muted: #8c92a4;
    --pt-surface: #ffffff;
    --pt-border: #edeef5;

    --pt-radius: 1rem;
    --pt-radius-sm: .6rem;
    --pt-shadow: 0 4px 24px rgba(45, 45, 63, .06);
    --pt-shadow-lift: 0 12px 32px rgba(45, 45, 63, .12);
}

/* ---------------------------------------------------------------------
   Fix: these "light" tint utilities are used everywhere (stat icons,
   badges) but only .bg-primary-light exists in style.css, defined as
   plain white. Give all of them real tinted backgrounds.
   --------------------------------------------------------------------- */
.bg-primary-light   { background-color: rgba(108, 95, 252, .12); border-radius: 7px; }
.bg-success-light   { background-color: rgba(25, 135, 84, .12);  border-radius: 7px; }
.bg-warning-light   { background-color: rgba(255, 193, 7, .18);  border-radius: 7px; }
.bg-danger-light    { background-color: rgba(220, 53, 69, .12);  border-radius: 7px; }
.bg-info-light      { background-color: rgba(13, 202, 240, .16); border-radius: 7px; }
.bg-secondary-light { background-color: rgba(108, 117, 125, .12); border-radius: 7px; }

.text-primary   { color: var(--pt-primary) !important; }
.text-warning   { color: var(--pt-warning) !important; }
.text-info      { color: var(--pt-info) !important; }

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
    border-radius: var(--pt-radius);
    box-shadow: var(--pt-shadow);
}
.card.shadow-sm { box-shadow: var(--pt-shadow) !important; }
.card .card-header {
    border-radius: var(--pt-radius) var(--pt-radius) 0 0 !important;
    background: transparent;
}
.card .card-header .card-title {
    color: var(--pt-ink);
}
a.card:hover, .card-link-hover:hover {
    box-shadow: var(--pt-shadow-lift);
    transform: translateY(-2px);
    transition: box-shadow .2s ease, transform .2s ease;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn { border-radius: .65rem; font-weight: 500; }
.btn-primary {
    background: var(--pt-gradient);
    border: none;
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--pt-primary-dark) 0%, var(--pt-primary) 100%);
    box-shadow: 0 6px 16px rgba(108, 95, 252, .35);
}
.btn-outline-primary {
    border-color: var(--pt-primary);
    color: var(--pt-primary);
}
.btn-outline-primary:hover {
    background: var(--pt-gradient);
    border-color: transparent;
}

/* ---------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------- */
.badge { border-radius: 50rem; font-weight: 600; letter-spacing: .01em; }

/* ---------------------------------------------------------------------
   Tables
   --------------------------------------------------------------------- */
.table thead.table-light th {
    background: #f8f8fd;
    color: var(--pt-muted);
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
    border-bottom: 1px solid var(--pt-border);
}
.table > tbody > tr:hover > * {
    background-color: rgba(108, 95, 252, .035);
}

/* ---------------------------------------------------------------------
   Page hero — replaces the plain .page-header bar across pages
   --------------------------------------------------------------------- */
.page-hero {
    background: var(--pt-gradient);
    border-radius: var(--pt-radius);
    box-shadow: var(--pt-shadow);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    color: #fff;
}
.page-hero__icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex: 0 0 auto;
}
.page-hero__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 .15rem;
}
.page-hero__subtitle {
    color: rgba(255, 255, 255, .78);
    margin: 0;
    font-size: .9rem;
}
.page-hero__crumb {
    background: rgba(255, 255, 255, .15);
    padding: .4rem .9rem;
    border-radius: 50rem;
    margin: 0;
}
.page-hero__crumb .breadcrumb-item,
.page-hero__crumb .breadcrumb-item a { color: rgba(255, 255, 255, .85); }
.page-hero__crumb .breadcrumb-item.active { color: #fff; font-weight: 600; }
.page-hero__crumb .breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, .55); }
.page-hero__actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.page-hero__actions .btn-primary {
    background: rgba(255, 255, 255, .95);
    color: var(--pt-primary);
}
.page-hero__actions .btn-primary:hover { background: #fff; box-shadow: none; }
.page-hero__actions .btn-outline-primary {
    border-color: rgba(255, 255, 255, .55);
    color: #fff;
}
.page-hero__actions .btn-outline-primary:hover { background: rgba(255, 255, 255, .15); border-color: #fff; }

/* ---------------------------------------------------------------------
   Sidebar / topbar — color & spacing refinements only, no structural
   (width/position/flex) changes so responsive collapse keeps working.
   --------------------------------------------------------------------- */
.app-sidebar {
    background: var(--pt-gradient-dark) !important;
    border-right: none !important;
}
.app-sidebar .side-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(255, 255, 255, .08) !important;
}
.app-sidebar .sub-category h3 {
    color: rgba(255, 255, 255, .38) !important;
    letter-spacing: .06em;
}
.app-sidebar .side-menu__item {
    color: rgba(255, 255, 255, .75) !important;
    border-radius: .6rem;
    margin: .1rem .75rem;
}
.app-sidebar .side-menu__item:hover {
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
}
.app-sidebar .side-menu__icon {
    color: inherit !important;
    fill: currentColor !important;
}
.app-sidebar .slide.active > .side-menu__item,
.app-sidebar .slide.active > .side-menu__item:hover {
    background: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
    box-shadow: inset 3px 0 0 0 #fff;
}

.app-header {
    background: #fff !important;
    box-shadow: 0 2px 12px rgba(45, 45, 63, .05) !important;
    border-bottom: none !important;
}

/* ---------------------------------------------------------------------
   Dashboard widgets
   --------------------------------------------------------------------- */
.funnel-tile {
    border-radius: var(--pt-radius-sm);
    padding: 1rem 1.1rem;
    display: flex;
    align-items: center;
    gap: .85rem;
    height: 100%;
    text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease;
}
.funnel-tile:hover { box-shadow: var(--pt-shadow-lift); transform: translateY(-2px); }
.funnel-tile__value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.funnel-tile__label { font-size: .78rem; color: var(--pt-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

.health-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--pt-border); }
.health-row:last-child { border-bottom: none; }
.health-dot { width: .55rem; height: .55rem; border-radius: 50%; flex: 0 0 auto; }
.health-dot.is-active { background: var(--pt-success); box-shadow: 0 0 0 3px rgba(25, 135, 84, .15); }
.health-dot.is-inactive { background: var(--pt-danger); box-shadow: 0 0 0 3px rgba(220, 53, 69, .15); }

.activity-item { display: flex; gap: .85rem; padding: .65rem 0; }
.activity-item__icon {
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex: 0 0 auto; font-size: .95rem;
}
.activity-item__body { min-width: 0; }
.activity-item__time { font-size: .74rem; color: var(--pt-muted); }

.quick-action {
    display: flex; align-items: center; gap: .75rem;
    padding: 1rem 1.1rem;
    border-radius: var(--pt-radius-sm);
    border: 1.5px solid var(--pt-border);
    text-decoration: none;
    color: var(--pt-ink);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
    height: 100%;
}
.quick-action:hover {
    border-color: transparent;
    box-shadow: var(--pt-shadow-lift);
    transform: translateY(-2px);
    color: var(--pt-ink);
}
.quick-action__icon {
    width: 42px; height: 42px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem; flex: 0 0 auto;
}
