/* =====================================================================
   PERCUP Admin — Redesign theme (PER-96)
   A theme-override layer applied LAST. Reskins the Syndron/Bootstrap 5
   admin into the new "Centralized Console" design (cream + maroon
   gradient, Degular/DM Sans, floating rounded sidebar, soft cards).
   Functionality-preserving: only presentation is changed. All Bootstrap
   / plugin (datatables, select2, metismenu) hooks remain intact.
   ===================================================================== */

/* ---------- Fonts (self-hosted) ---------- */
@font-face {
    font-family: "Degular";
    src: url("/fonts/degular.otf") format("opentype");
    font-weight: 500 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "DM Sans";
    src: url("/fonts/dm-sans.ttf") format("truetype");
    font-weight: 400 600;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
    --pp-bg: #f2eee0;
    --pp-surface: #ffffff;
    --pp-surface-2: #faf7f2;
    --pp-surface-3: #f4efe7;
    --pp-cream: #f6f2e6;
    --pp-border: #ece6db;
    --pp-border-2: #e2dacb;

    --pp-maroon: #902921;
    --pp-maroon-dark: #7a2019;
    --pp-terra: #b15436;
    --pp-gold: #cda881;
    --pp-gold-soft: #f3e9da;

    --pp-ink: #1c1613;
    --pp-text: #2b2420;
    --pp-muted: #6f6354;
    --pp-muted-2: #9a8c75;

    --pp-success: #22a06b;
    --pp-success-bg: #e7f7ef;
    --pp-warn: #b8791f;
    --pp-warn-bg: #fbe7cf;
    --pp-danger: #c0392b;
    --pp-danger-bg: #fdeceb;
    --pp-info: #7c57c1;
    --pp-info-bg: #ece5f7;

    --pp-radius: 12px;
    --pp-radius-lg: 16px;
    --pp-radius-pill: 999px;
    --pp-shadow: 0 4px 12px rgba(27, 46, 94, 0.05);
    --pp-shadow-lg: 0 12px 30px -10px rgba(144, 41, 33, 0.45);

    --pp-sidebar-grad: linear-gradient(168deg, #7a2019 0%, #902921 38%, #b15436 82%, #cda881 124%);
    --pp-feature-grad: linear-gradient(135deg, #7a2019 0%, #902921 42%, #b15436 86%, #cda881 130%);

    --pp-sidebar-w: 272px;
    --pp-main-offset: 288px; /* floating sidebar: 16px left margin + 272px width */

    /* keep legacy template vars aligned */
    --red: #902921;
    --color_1: #f2eee0;
    --color_2: #cda881;
    --color_3: #fbfaf6;
    --chocolate: #3b2621;
    --bs-pagination-active-bg: #902921 !important;
    --bs-pagination-color: #902921 !important;
}

/* ---------- Base ---------- */
html, body {
    background: var(--pp-bg) !important;
}
body {
    font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif !important;
    color: var(--pp-text);
    letter-spacing: 0;
    font-size: 14px;
}
h1, h2, h3, h4, h5, h6,
.breadcrumb-title, .modal-title, .pp-h, .card-title {
    font-family: "Degular", "DM Sans", sans-serif;
    color: var(--pp-ink);
    letter-spacing: -0.01em;
}
a { color: var(--pp-maroon); }
a:hover { color: var(--pp-maroon-dark); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
    background: rgba(59, 38, 33, 0.18);
    border-radius: 8px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

/* =====================================================================
   SHELL — floating gradient sidebar
   ===================================================================== */
.wrapper { background: var(--pp-bg); }

.sidebar-wrapper {
    /* PER-123: floating rounded sidebar (per design) — inset 16px, 20px radius */
    width: var(--pp-sidebar-w);
    top: 16px;
    left: 16px;
    bottom: 16px;
    height: calc(100vh - 32px);
    border-radius: 20px;
    background: var(--pp-sidebar-grad) !important;
    border-right: 0 !important;
    box-shadow: 0 10px 30px -8px rgba(59, 38, 33, 0.28);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 1030;
}

.sidebar-header {
    position: static;
    width: 100%;
    height: auto;
    background: transparent !important;
    padding: 22px 22px 8px;
    display: block;
}
.sidebar-header .toggle-icon { display: none; }
.sidebar-header .pp-logo {
    height: 22px; width: auto; display: block;
}
.pp-sidebar-eyebrow {
    padding: 6px 22px 12px;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.22em;
    color: rgba(246, 242, 230, 0.66);
    text-transform: uppercase;
}
.pp-sidebar-divider {
    height: 1px;
    background: rgba(242, 238, 224, 0.2);
    margin: 0 18px 10px;
}
.pp-nav-label {
    padding: 6px 24px 6px;
    font-size: 11px;
    color: rgba(246, 242, 230, 0.6);
}

/* nav list */
.sidebar-wrapper .metismenu {
    padding: 0 12px;
    margin: 0; /* app.css sets margin-top:100px to clear the old fixed header — not needed now */
    flex: 1 1 auto;
    overflow-y: auto;
    background: transparent;
}
.sidebar-wrapper ul,
.sidebar-wrapper .metismenu { background: transparent; }
.sidebar-wrapper .metismenu li + li { margin-top: 2px; }
.sidebar-wrapper .metismenu > li > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--pp-cream);
    font-size: 14px;
    font-weight: 500;
    background: transparent;
    transition: background .15s ease, color .15s ease;
}
.sidebar-wrapper .metismenu a .parent-icon {
    font-size: 19px;
    line-height: 1;
    margin: 0;
    color: inherit;
}
.sidebar-wrapper .metismenu a .menu-title {
    font-size: 14px;
    flex: 1;
}
.sidebar-wrapper .metismenu > li > a:hover {
    background: rgba(242, 238, 224, 0.12);
    color: #fff;
}
/* active item */
.sidebar-wrapper .metismenu > li.mm-active > a,
.sidebar-wrapper .metismenu > li > a.pp-active {
    background: var(--pp-cream);
    color: var(--pp-maroon);
    font-weight: 600;
}
.sidebar-wrapper .metismenu .has-arrow:after {
    border-color: currentColor;
    opacity: .65;
    right: 16px;
    transform: rotate(135deg) translateY(-50%); /* PER-123: collapsed chevron points right (›) per design */
}
.sidebar-wrapper .metismenu li.mm-active > a.has-arrow:after,
.sidebar-wrapper .metismenu a.has-arrow[aria-expanded="true"]:after {
    transform: rotate(225deg) translateY(-50%); /* expanded → points down (⌄) */
}
/* submenu */
.sidebar-wrapper .metismenu ul {
    padding-left: 0;
    position: relative;
}
.sidebar-wrapper .metismenu ul::before { display: none; }
.sidebar-wrapper .metismenu ul a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px 9px 44px;
    border-radius: 9px;
    color: rgba(246, 242, 230, 0.82);
    font-size: 13px;
    font-weight: 500;
}
.sidebar-wrapper .metismenu ul a:hover,
.sidebar-wrapper .metismenu ul a.pp-active {
    background: rgba(242, 238, 224, 0.14);
    color: #fff;
}
.sidebar-wrapper .metismenu ul a.pp-active { font-weight: 600; }
/* PER-119: sub-items show the design's dot indicator (not an arrow) — solid cream when active, faded otherwise */
.sidebar-wrapper .metismenu ul a i { display: none; }
.sidebar-wrapper .metismenu ul a::before {
    content: ""; flex: 0 0 auto;
    width: 5px; height: 5px; border-radius: 50%;
    background: rgba(246, 242, 230, 0.5);
}
.sidebar-wrapper .metismenu ul a:hover::before,
.sidebar-wrapper .metismenu ul a.pp-active::before { background: #f6f2e6; }

/* profile card pinned at bottom */
.pp-profile {
    flex: 0 0 auto;
    padding: 12px;
}
.pp-profile-card {
    border: 1px solid rgba(242, 238, 224, 0.34);
    border-radius: 12px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--pp-cream);
    text-decoration: none;
    cursor: pointer;
}
.pp-profile-card:hover { background: rgba(242, 238, 224, 0.10); color: var(--pp-cream); }
.pp-avatar {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--pp-cream); color: var(--pp-maroon);
    display: flex; align-items: center; justify-content: center;
    font-family: "Degular", sans-serif; font-weight: 700; font-size: 16px;
    flex: 0 0 auto;
}
.pp-profile-meta { flex: 1; min-width: 0; }
.pp-profile-name { font-family: "Degular", sans-serif; font-weight: 700; font-size: 14px; line-height: 1.2; }
.pp-profile-role { font-size: 11px; opacity: .78; }

/* PER-121: sidebar profile dropup menu — styled per design (Signed in as / Change password / Logout) */
.dropdown-menu.pp-profile-menu {
    background: #fff !important;
    border: 1px solid var(--pp-border);
    border-radius: 14px;
    box-shadow: 0 18px 44px -14px rgba(27, 22, 19, 0.4);
    padding: 6px; min-width: 234px; margin-bottom: 8px;
}
.pp-profile-menu-head { padding: 11px 14px 6px; }
.pp-profile-menu-eyebrow { font-size: 10px; font-weight: 700; letter-spacing: .14em; line-height: 1.15; text-transform: uppercase; color: var(--pp-muted-2); }
.pp-profile-menu-name { font-family: "Degular", sans-serif; font-weight: 700; font-size: 14px; line-height: 1.25; color: var(--pp-ink); margin-top: 3px; }
.pp-profile-menu-sub { font-size: 12px; line-height: 1.25; color: var(--pp-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pp-profile-menu-divider { margin: 6px 8px 7px; border: 0; border-top: 1px solid var(--pp-border); opacity: 1; }
.pp-profile-menu .dropdown-item.pp-profile-menu-item {
    display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
    font-size: 13.5px; font-weight: 500; color: var(--pp-text); white-space: nowrap;
}
.pp-profile-menu .dropdown-item.pp-profile-menu-item:hover { background: var(--pp-surface-2); color: var(--pp-text); }
/* PER-123: whole logout row is maroon (icon + label), matching the design */
.pp-profile-menu .dropdown-item.pp-profile-menu-item.is-logout,
.pp-profile-menu .dropdown-item.pp-profile-menu-item.is-logout:hover { color: var(--pp-maroon); }
.pp-pm-ico { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--pp-surface-3); color: var(--pp-muted); flex: 0 0 auto; }
/* PER-123: thin Lucide-style line icons (inline SVG) to match the design 1:1, not the heavier boxicons glyphs */
.pp-pm-ico svg { width: 16px; height: 16px; display: block; color: inherit; }
.pp-pm-ico i { margin: 0; font-size: 18px; color: inherit; }
.pp-profile-menu-item.is-logout .pp-pm-ico { background: var(--pp-danger-bg); color: var(--pp-maroon); }

/* =====================================================================
   TOPBAR — slim cream bar (bell + avatar)
   ===================================================================== */
/* PER-99: bell+avatar float at the top-right of the content, on the SAME row as the
   page title (not a separate bar). Absolute within .wrapper so they scroll with the page. */
.topbar {
    position: absolute;
    top: 22px;
    right: 28px;
    left: auto;
    width: auto;
    height: auto;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    z-index: 30;
}
.topbar .navbar {
    width: auto;
    height: auto;
    padding: 0;
    background: transparent !important;
}
.topbar .search-bar { display: none; }
.pp-topbar-actions {
    display: flex; align-items: center; gap: 12px; margin-left: 0;
}
.pp-iconbtn {
    all: unset;
    cursor: pointer;
    position: relative;
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--pp-surface);
    border: 1px solid var(--pp-border);
    display: flex; align-items: center; justify-content: center;
    color: var(--pp-text);
}
.pp-iconbtn:hover { background: var(--pp-surface-2); }
.pp-iconbtn .pp-dot {
    position: absolute; top: 7px; right: 8px;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--pp-maroon); border: 2px solid #fff;
}
.pp-topbar-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    background: linear-gradient(150deg, #902921, #cda881);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-family: "Degular", sans-serif; font-weight: 700; font-size: 16px;
    border: 0;
}
.topbar .user-box { margin-left: 0; }
.topbar .user-box .user-name { color: var(--pp-text); font-weight: 600; }

/* main content area */
.page-wrapper {
    margin-left: var(--pp-main-offset);
    margin-top: 0;
    margin-bottom: 0;
}
.page-content { padding: 24px 28px 40px; position: relative; }
.page-footer { display: none !important; }
.wrapper.toggled .topbar { right: 28px; left: auto; }
.wrapper.toggled .page-wrapper { margin-left: var(--pp-main-offset); }

/* =====================================================================
   PAGE HEADER (breadcrumb + title + actions)
   ===================================================================== */
/* breadcrumbs shown per the designs (dashboard has none — its markup was removed) */
.page-breadcrumb { margin-bottom: 4px; }
.page-breadcrumb .breadcrumb {
    background: transparent; padding: 0; margin: 0; font-size: 12.5px;
}
.page-breadcrumb .breadcrumb-item,
.page-breadcrumb .breadcrumb-item a { color: var(--pp-muted-2); text-decoration: none; }
.page-breadcrumb .breadcrumb-item.active { color: var(--pp-maroon); }
/* match the design's smaller breadcrumb (app.css forces 16px) */
.page-breadcrumb .breadcrumb li.breadcrumb-item,
.page-breadcrumb .breadcrumb li.breadcrumb-item a { font-size: 12px; }
.page-breadcrumb .breadcrumb-item + .breadcrumb-item::before { color: var(--pp-muted-2); font-size: 12px; padding-right: .4rem; }
.breadcrumb-title {
    font-family: "Degular", sans-serif !important;
    font-weight: 700;
    font-size: 30px;
    line-height: 1.1;
    color: var(--pp-ink);
    border-right: 0 !important;
    padding-right: 0 !important;
    margin: 0;
}
.pp-page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: nowrap; margin: 0 0 20px;
    padding-right: 80px; /* reserve space on the right for the floating avatar */
}
.pp-page-head > :first-child { flex: 1 1 auto; min-width: 0; }
/* action buttons sit on the title row, right-aligned (matching the design) */
.pp-head-actions {
    flex: 0 0 auto;
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap; justify-content: flex-end;
}
.pp-page-head .pp-subtitle { margin: 6px 0 0; color: var(--pp-muted); font-size: 14px; }
.pp-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* =====================================================================
   CARDS
   ===================================================================== */
.card {
    background: var(--pp-surface);
    border: 1px solid var(--pp-border) !important;
    border-radius: var(--pp-radius) !important;
    box-shadow: var(--pp-shadow) !important;
}
.card .card-header,
.pp-card-head {
    background: transparent;
    border-bottom: 1px solid var(--pp-border);
    padding: 16px 20px;
    font-family: "Degular", sans-serif;
    font-weight: 700;
    color: var(--pp-ink);
}
.pp-card { background: var(--pp-surface); border: 1px solid var(--pp-border); border-radius: var(--pp-radius); box-shadow: var(--pp-shadow); }
.pp-card-pad { padding: 20px; }

/* KPI tiles */
.pp-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.pp-kpi {
    background: var(--pp-surface);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-shadow);
    padding: 20px;
}
.pp-kpi-top { display: flex; align-items: flex-start; justify-content: space-between; }
.pp-kpi-label { font-size: 12.5px; font-weight: 600; color: var(--pp-muted); }
.pp-kpi-ico {
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--pp-danger-bg); color: var(--pp-maroon);
}
.pp-kpi-ico.is-gold { background: var(--pp-gold-soft); color: #a07a51; }
.pp-kpi-ico.is-ink { background: #efe7e3; color: var(--pp-chocolate, #3b2621); }
.pp-kpi-ico.is-info { background: var(--pp-info-bg); color: var(--pp-info); }
.pp-kpi-value {
    font-family: "Degular", sans-serif; font-weight: 700;
    font-size: 34px; line-height: 1; color: var(--pp-ink); margin-top: 14px;
}
.pp-kpi-sub { font-size: 12px; color: var(--pp-muted-2); margin-top: 8px; }

/* feature gradient banner */
.pp-feature {
    position: relative; overflow: hidden;
    border-radius: var(--pp-radius-lg);
    background: var(--pp-feature-grad);
    box-shadow: var(--pp-shadow-lg);
    padding: 26px 28px; color: var(--pp-cream);
}
.pp-feature .pp-feature-label { font-size: 12.5px; font-weight: 600; letter-spacing: .16em; color: #f0d9b9; }
.pp-feature .pp-feature-value { font-family: "Degular", sans-serif; font-weight: 700; font-size: 48px; line-height: 1.02; margin-top: 10px; }
.pp-feature-stat {
    background: rgba(246, 242, 230, 0.12);
    border: 1px solid rgba(246, 242, 230, 0.22);
    border-radius: 12px; padding: 14px 18px; min-width: 150px;
}

/* =====================================================================
   BUTTONS
   ===================================================================== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: none;
}
.btn-primary,
.btn-primary:focus {
    background: var(--pp-maroon) !important;
    border: 1px solid var(--pp-maroon) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px -8px rgba(144, 41, 33, 0.5);
}
.btn-primary:hover,
.btn-primary:active,
.btn-check:checked + .btn-primary,
.show > .btn-primary.dropdown-toggle {
    background: var(--pp-maroon-dark) !important;
    border-color: var(--pp-maroon-dark) !important;
    color: #fff !important;
}
.btn-outline-primary,
.btn-outline-secondary,
.pp-btn-ghost {
    background: var(--pp-surface) !important;
    border: 1px solid var(--pp-border) !important;
    color: var(--pp-text) !important;
    border-radius: 10px;
    box-shadow: none;
    font-weight: 600;
}
.btn-outline-primary:hover,
.btn-outline-secondary:hover,
.pp-btn-ghost:hover {
    background: var(--pp-surface-2) !important;
    border-color: var(--pp-border-2) !important;
    color: var(--pp-maroon) !important;
    filter: none;
}
.btn:hover { color: inherit; }
.btn-secondary {
    background: var(--pp-surface) !important;
    border: 1px solid var(--pp-border) !important;
    color: var(--pp-text) !important;
}
.btn-success { background: var(--pp-success) !important; border-color: var(--pp-success) !important; color:#fff !important; }
.btn-danger { background: var(--pp-danger) !important; border-color: var(--pp-danger) !important; color:#fff !important; }
.btn-sm { padding: 5px 12px; font-size: 13px; }

/* small square/round icon action buttons in tables */
.pp-act {
    display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; border-radius: 8px;
    border: 1px solid var(--pp-border); background: var(--pp-surface);
    color: var(--pp-muted); cursor: pointer; text-decoration: none;
}
.pp-act:hover { background: var(--pp-surface-2); }
/* outlined (not pink-filled) action icons, per design */
.pp-act.is-edit { color: var(--pp-maroon); background: var(--pp-surface); border-color: var(--pp-border); }
.pp-act.is-del { color: var(--pp-danger); background: var(--pp-surface); border-color: var(--pp-border); }
.pp-act.is-edit:hover, .pp-act.is-del:hover { background: var(--pp-surface-2); }

/* =====================================================================
   FILTER / TOOLBAR BAR
   ===================================================================== */
.pp-filter-bar {
    display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap;
    background: var(--pp-surface);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-shadow);
    padding: 16px 18px; margin-bottom: 20px;
}
.pp-field { display: flex; flex-direction: column; gap: 7px; }
.pp-field > label { font-size: 12px; font-weight: 600; color: var(--pp-muted); margin: 0; }

/* =====================================================================
   FORMS
   ===================================================================== */
.form-label {
    font-size: 12.5px; font-weight: 600; color: var(--pp-muted); margin-bottom: 6px; margin-top: 0 !important;
}
.form-control, .form-select {
    border-radius: 10px;
    border: 1px solid var(--pp-border-2);
    /* background-color (NOT the `background` shorthand) so .form-select keeps Bootstrap's dropdown-arrow image */
    background-color: var(--pp-surface-2);
    color: var(--pp-text);
    font-size: 14px;
    min-height: 42px;
    padding: 8px 14px;
}
.form-control::placeholder { color: var(--pp-muted-2); }
.form-control:focus, .form-select:focus {
    border-color: var(--pp-maroon);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(144, 41, 33, 0.10);
    color: var(--pp-text);
}
.form-control:disabled, .form-control[readonly] {
    background-color: var(--pp-surface-3); opacity: .8;
}
.input-group-text {
    background: var(--pp-surface-2);
    border: 1px solid var(--pp-border-2);
    color: var(--pp-muted);
    border-radius: 10px;
}
textarea.form-control { min-height: 90px; }

/* PER-122: native date inputs styled consistently with the redesign; constrain the filter-bar
   date so the native widget can't balloon and overlap the adjacent refresh button. */
input[type="date"].form-control { height: 42px; box-sizing: border-box; }
.pp-filter-bar input[type="date"] { width: 184px; max-width: 184px; min-width: 0; box-sizing: border-box; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: .85; }

/* select2 alignment with new inputs */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-radius: 10px !important;
    border: 1px solid var(--pp-border-2) !important;
    background: var(--pp-surface-2) !important;
    min-height: 42px;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 40px; color: var(--pp-text);
}
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 40px; }
.select2-container--default .select2-results__option--highlighted[aria-selected] { background: var(--pp-maroon); }
.select2-dropdown { border-color: var(--pp-border-2); border-radius: 10px; }

/* =====================================================================
   TABLES
   ===================================================================== */
.pp-table-card {
    background: var(--pp-surface);
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    box-shadow: var(--pp-shadow);
    overflow: hidden;
    position: relative;
}
/* Add button lives in the table-card toolbar, top-right, paired with the search (per design) */
.pp-card-add { position: absolute; top: 14px; right: 20px; z-index: 3; }
/* in-card toolbar band (count summary on the left, search on the right) — webhooks pages */
.pp-card-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; flex-wrap: wrap; padding: 16px 20px;
    border-bottom: 1px solid var(--pp-border);
}
.pp-table-card .pp-table-head {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--pp-border);
}
.table { color: var(--pp-text); margin-bottom: 0; vertical-align: middle; }
.table > thead > tr > th {
    background: var(--pp-surface-2);
    color: var(--pp-muted);
    font-weight: 600;
    font-size: 12px;
    text-transform: none;
    border-bottom: 1px solid var(--pp-border);
    padding: 11px 16px;
    white-space: nowrap;
}
.table > tbody > tr > td {
    border-bottom: 1px solid var(--pp-surface-3);
    padding: 11px 16px;
    background: transparent;
    box-shadow: none;
    font-size: 13.5px;
}
/* designs show no column sort arrows — hide DataTables' sort indicators */
table.dataTable thead th.sorting::before, table.dataTable thead th.sorting::after,
table.dataTable thead th.sorting_asc::before, table.dataTable thead th.sorting_asc::after,
table.dataTable thead th.sorting_desc::before, table.dataTable thead th.sorting_desc::after,
table.dataTable thead th.sorting_asc_disabled::before, table.dataTable thead th.sorting_desc_disabled::after { display: none !important; }
table.dataTable thead > tr > th:not(.sorting_disabled) { padding-right: 16px !important; }
/* hide master-file's inline "+" add-row footer trigger (Add product button drives it) */
#addRowTriggerRow { display: none; }
/* master-file rows are plain text in the design; cells are `disabled` inputs in display
   mode (the edit-pencil re-enables them as boxed inputs), so render disabled ones as text. */
#masterFileTable tbody td input.form-control:disabled {
    border: 0; background: transparent; box-shadow: none; outline: none;
    padding: 2px 0; min-width: 0 !important; width: 100%; height: auto; min-height: 0;
    color: var(--pp-text) !important; -webkit-text-fill-color: var(--pp-text);
    font-size: 13.5px; opacity: 1;
}
.table > tbody > tr:hover > td { background: var(--pp-surface-2); }
.table > :not(caption) > * > * { box-shadow: none; }
.table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: rgba(244, 239, 231, 0.6);
}
.table-bordered, .table-bordered > :not(caption) > * { border-color: var(--pp-border); }

/* DataTables controls */
.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border-radius: 10px;
    border: 1px solid var(--pp-border-2);
    background: var(--pp-surface-2);
    padding: 6px 12px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--pp-maroon) !important;
    border-color: var(--pp-maroon) !important;
    color: #fff !important;
    border-radius: 8px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 8px;
}
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter { color: var(--pp-muted); }

/* PER-98: keep DataTables top/bottom controls off the card edges (table itself stays full-width) */
.dataTables_wrapper > .row { --bs-gutter-x: 0; }
.dataTables_wrapper .dataTables_info { padding: 12px 0 16px 20px; }
.dataTables_wrapper .dataTables_paginate { padding: 12px 20px 16px 0; }
/* PER-111: footer row (info left, pagination right) kept outside the table's horizontal scroll */
.pp-table-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* audit: the designs have no "Show N entries", no Copy/Excel/PDF/Print export buttons,
   and clean (un-striped) rows; the search is a single styled field. */
.dataTables_wrapper .dataTables_length { display: none !important; }
.dataTables_wrapper .dt-buttons { display: none !important; }
.table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: transparent; }
.dataTables_wrapper .dataTables_filter { float: none; text-align: left; padding: 16px 20px 8px; }
/* the filter's bootstrap column is the right half by default — force its row full-width
   so the search field lands at the card's LEFT edge (per design), paired with the
   absolutely-positioned Add button on the right. */
.dataTables_wrapper .row:has(.dataTables_filter) > div { flex: 0 0 100%; max-width: 100%; }
.dataTables_wrapper .dataTables_filter label { display: block; margin: 0; font-size: 0; width: 100%; max-width: 460px; }
.dataTables_wrapper .dataTables_filter input {
    margin: 0; width: 100%; min-height: 42px; font-size: 14px; color: var(--pp-text);
    border: 1px solid var(--pp-border-2); border-radius: 10px;
    background-color: var(--pp-surface-2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a8c75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: 14px center; background-size: 16px;
    padding: 8px 14px 8px 38px;
}

/* =====================================================================
   BADGES / PILLS / STATUS
   ===================================================================== */
.pp-badge {
    display: inline-flex; align-items: center; gap: 6px;
    height: 24px; padding: 0 11px; border-radius: var(--pp-radius-pill);
    font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.pp-badge.is-success, .pp-badge--approved { background: var(--pp-success-bg); color: var(--pp-success); }
.pp-badge.is-warn, .pp-badge--pending { background: var(--pp-warn-bg); color: var(--pp-warn); }
.pp-badge.is-neutral { background: var(--pp-surface-3); color: var(--pp-muted); }
.pp-badge.is-danger { background: var(--pp-danger-bg); color: var(--pp-danger); }
.pp-badge.is-maroon { background: var(--pp-danger-bg); color: var(--pp-maroon); }

/* reskin bootstrap contextual badges/bg used across pages */
.badge { font-weight: 600; border-radius: var(--pp-radius-pill); padding: .4em .7em; }
.badge.bg-success, .bg-success { background: var(--pp-success-bg) !important; color: var(--pp-success) !important; }
.badge.bg-warning, .bg-warning { background: var(--pp-warn-bg) !important; color: var(--pp-warn) !important; }
.badge.bg-danger { background: var(--pp-danger-bg) !important; color: var(--pp-danger) !important; }
.badge.bg-primary, .badge.bg-info { background: var(--pp-danger-bg) !important; color: var(--pp-maroon) !important; }
.badge.bg-secondary { background: var(--pp-surface-3) !important; color: var(--pp-muted) !important; }
.text-success { color: var(--pp-success) !important; }
.text-danger { color: var(--pp-danger) !important; }
.text-red, .text-primary { color: var(--pp-maroon) !important; }

/* stat pills row (e.g. pending review / approved counters) */
.pp-statpills { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 18px; }
.pp-statpill {
    display: inline-flex; align-items: center; gap: 12px;
    background: var(--pp-surface); border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius); padding: 14px 20px; min-width: 184px;
    box-shadow: var(--pp-shadow);
}
.pp-statpill .pp-statpill-ico {
    width: 34px; height: 34px; border-radius: 9px; /* rounded square, per design (was a circle) */
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.pp-statpill .pp-statpill-num { font-family: "Degular", sans-serif; font-weight: 700; font-size: 22px; line-height: 1.1; color: var(--pp-ink); }
.pp-statpill .pp-statpill-lbl { font-size: 12.5px; color: var(--pp-muted); }
.pp-statpill.is-warn .pp-statpill-ico { background: var(--pp-warn-bg); color: var(--pp-warn); }
.pp-statpill.is-success .pp-statpill-ico { background: var(--pp-success-bg); color: var(--pp-success); }
.pp-statpill.is-maroon .pp-statpill-ico { background: var(--pp-danger-bg); color: var(--pp-maroon); }
.pp-statpill.is-neutral .pp-statpill-ico { background: var(--pp-surface-3); color: var(--pp-muted); }

/* rank badges (top brands / countries lists) */
.pp-rank {
    width: 26px; height: 26px; border-radius: 8px;
    background: var(--pp-maroon); color: #fff;
    font-family: "Degular", sans-serif; font-weight: 700; font-size: 13px;
    display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.pp-rank.is-neutral { background: var(--pp-surface-3); color: var(--pp-muted); }

/* progress bars (sales by category style) */
.pp-bar { height: 8px; border-radius: 999px; background: var(--pp-surface-3); overflow: hidden; }
.pp-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--pp-gold); }
.pp-bar > span.is-maroon { background: linear-gradient(90deg, var(--pp-maroon), var(--pp-gold)); }

/* =====================================================================
   MODALS / ALERTS / DROPDOWN
   ===================================================================== */
.modal-content {
    background: var(--pp-surface);
    color: var(--pp-text);
    border: 0;
    border-radius: var(--pp-radius-lg);
    box-shadow: 0 24px 60px -12px rgba(27, 22, 19, 0.35);
}
.modal-header, .modal-footer { border-color: var(--pp-border); }
.modal-title { color: var(--pp-ink); }
.alert { border-radius: var(--pp-radius); margin-bottom: 16px; }
.alert-success { background: var(--pp-success-bg); border-color: transparent; color: #1c7a52; }
.alert-danger { background: var(--pp-danger-bg); border-color: transparent; color: var(--pp-danger); }
.alert-warning { background: var(--pp-warn-bg); border-color: transparent; color: var(--pp-warn); }
.dropdown-menu {
    background: var(--pp-surface) !important;
    border: 1px solid var(--pp-border);
    border-radius: var(--pp-radius);
    box-shadow: 0 12px 30px -8px rgba(27, 22, 19, 0.22);
    padding: 6px;
    --bs-dropdown-bg: var(--pp-surface);
}
.dropdown-item { border-radius: 8px; color: var(--pp-text); font-size: 14px; padding: 8px 12px; }
.dropdown-item:hover { background: var(--pp-surface-2); color: var(--pp-maroon); }
.dropdown-item i { margin-right: 8px; color: var(--pp-muted); }

/* =====================================================================
   NAV TABS
   ===================================================================== */
.nav-tabs {
    border-bottom: 1px solid var(--pp-border);
    gap: 4px;
}
.nav-tabs .nav-link {
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    color: var(--pp-muted);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    background: transparent;
}
.nav-tabs .nav-link:hover { color: var(--pp-maroon); border-bottom-color: var(--pp-border-2); }
.nav-tabs .nav-link.active {
    color: var(--pp-maroon);
    background: transparent;
    border-bottom-color: var(--pp-maroon);
}

/* =====================================================================
   PAGINATION (bootstrap)
   ===================================================================== */
.pagination { gap: 6px; }
.page-link {
    border-radius: 8px !important;
    border: 1px solid var(--pp-border);
    color: var(--pp-text);
    background: var(--pp-surface);
    margin: 0;
}
.page-link:hover { background: var(--pp-surface-2); color: var(--pp-maroon); }
.page-item.active .page-link, .active > .page-link {
    background: var(--pp-maroon) !important;
    border-color: var(--pp-maroon) !important;
    color: #fff !important;
}
.page-item.disabled .page-link { color: var(--pp-muted-2); background: var(--pp-surface-2); }

/* webhook page bits */
.status-indicator { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--pp-muted-2); }
.status-indicator.status-active { background: var(--pp-success); }
.status-indicator.status-inactive { background: var(--pp-muted-2); }
.webhooks-table td .status-indicator { width: 12px; height: 12px; }
.refresh-btn {
    width: 42px; height: 42px; border-radius: 10px;
    border: 1px solid var(--pp-border); background: var(--pp-surface);
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--pp-maroon); font-size: 20px;
}
.refresh-btn:hover { background: var(--pp-surface-2); }
.activate-webhook-btn {
    border: 0; border-radius: 8px; padding: 5px 12px;
    background: var(--pp-maroon); color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.activate-webhook-btn:hover { background: var(--pp-maroon-dark); }

/* webhook logs pagination + json viewer */
.pagenation-webhook-logs {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    padding: 14px 18px; border-top: 1px solid var(--pp-border); color: var(--pp-text);
}
.pagenation-webhook-logs i { font-size: 22px; cursor: pointer; color: var(--pp-maroon); }
.pagenation-webhook-logs #current-page { font-weight: 600; font-variant-numeric: tabular-nums; }
.json-dump-display {
    display: none;
    position: fixed; inset: 0; z-index: 1055;
    background: rgba(27, 22, 19, 0.5);
    align-items: center; justify-content: center; padding: 24px;
}
.json-dump-display pre {
    background: #1c1613; color: #f6f2e6;
    border-radius: var(--pp-radius-lg); padding: 24px;
    max-width: 900px; width: 100%; max-height: 80vh; overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; margin: 0;
}
.json-dump-display .json-dump-close {
    position: absolute; top: 24px; right: 28px; font-size: 28px; color: #fff; cursor: pointer; z-index: 1;
}

/* product list: image thumbnail, status dot, search field icon */
.pp-thumb {
    width: 44px; height: 44px; border-radius: 10px; object-fit: cover;
    background: var(--pp-surface-3); border: 1px solid var(--pp-border); display: block;
}
.pp-badge .pp-dot-status { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
/* clickable variants pill + its popover */
.pp-variants-pill { cursor: pointer; border: 0; display: inline-flex; align-items: center; gap: 4px; }
.pp-variants-pill i { font-size: 14px; }
.pp-variants-popover.popover {
    max-width: 320px; border: 1px solid var(--pp-border); border-radius: var(--pp-radius);
    box-shadow: 0 12px 30px -8px rgba(27, 22, 19, 0.22); font-family: "DM Sans", sans-serif;
}
.pp-variants-popover .popover-body { padding: 8px; max-height: 280px; overflow-y: auto; }
.pp-variants-popover .popover-arrow::after { border-bottom-color: #fff; }
.pp-variant-row { display: flex; justify-content: space-between; gap: 16px; padding: 7px 10px; border-radius: 8px; font-size: 13px; }
.pp-variant-row + .pp-variant-row { border-top: 1px solid var(--pp-surface-3); }
.pp-variant-row:hover { background: var(--pp-surface-2); }
.pp-variant-name { color: var(--pp-text); font-weight: 500; }
.pp-variant-price { color: var(--pp-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
/* product list action (status) dropdown: wide enough to show the label + chevron */
.status-change { min-width: 132px; }

/* PER-116: inline "All variants and prices" expansion (DataTables child row) */
.pp-variants-pill i { transition: transform .15s ease; }
tr.pp-variants-open .pp-variants-pill i { transform: rotate(180deg); }
#productTable tbody tr.pp-variants-childrow > td { padding: 0; }
#productTable tbody tr.pp-variants-childrow:hover > td { background: transparent; }
.pp-variants-expand { background: var(--pp-surface-2); border-top: 1px dashed var(--pp-border-2); padding: 16px 20px 18px 84px; }
.pp-variants-expand-title { font-family: "DM Sans", sans-serif; font-size: 12px; font-weight: 600; color: var(--pp-muted); margin-bottom: 12px; }
.pp-variants-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.pp-variants-grid .pp-variant-row { align-items: center; padding: 9px 14px; background: var(--pp-surface); border: 1px solid var(--pp-border); border-radius: 9px; }
.pp-variants-grid .pp-variant-row + .pp-variant-row { border-top: 1px solid var(--pp-border); }
.pp-variants-grid .pp-variant-name { font-weight: 400; }
.pp-variants-grid .pp-variant-price { font-family: "Degular", sans-serif; font-weight: 700; color: var(--pp-maroon); }

/* PER-116: bulk-approve bar (appears when 2+ products are selected) */
.pp-bulk-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 20px; background: #f9f1ec; border-bottom: 1px solid #f0e3da; }
.pp-bulk-count { font-size: 13.5px; font-weight: 600; color: var(--pp-maroon); }
.pp-bulk-label { font-size: 13px; color: var(--pp-muted); }
.pp-bulk-bar .form-select { max-width: 160px; }
/* PER-116: Apply + Clear same height; Clear is transparent/borderless, maroon text on hover (per design) */
.pp-bulk-bar .pp-bulk-apply { height: 36px; padding: 0 18px; display: inline-flex; align-items: center; font-size: 13.5px; }
.pp-bulk-clear { all: unset; cursor: pointer; height: 36px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 8px; color: var(--pp-muted); font-family: inherit; font-size: 13.5px; font-weight: 600; }
.pp-bulk-clear:hover { color: var(--pp-maroon); }

/* PER-114: Change password modal */
.pp-cp-modal { border-radius: 16px; overflow: hidden; border: 1px solid var(--pp-border); background: var(--pp-surface); }
.pp-cp-head { display: flex; align-items: flex-start; gap: 14px; padding: 22px 24px 8px; position: relative; }
.pp-cp-icon { width: 40px; height: 40px; border-radius: 11px; background: var(--pp-danger-bg); color: var(--pp-maroon); display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.pp-cp-titles { flex: 1; min-width: 0; }
.pp-cp-title { font-family: "Degular", sans-serif; font-weight: 700; font-size: 19px; color: var(--pp-ink); line-height: 1.2; }
.pp-cp-sub { font-size: 13px; color: var(--pp-muted); margin-top: 3px; }
.pp-cp-close { all: unset; cursor: pointer; position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--pp-muted); background: var(--pp-surface-2); font-size: 18px; }
.pp-cp-close:hover { background: var(--pp-surface-3); color: var(--pp-maroon); }
.pp-cp-body { padding: 14px 24px 4px; }
.pp-cp-field { margin-bottom: 16px; }
.pp-cp-field > label { display: block; font-size: 13px; font-weight: 600; color: var(--pp-text); margin-bottom: 7px; }
.pp-cp-input { position: relative; }
.pp-cp-input input { width: 100%; height: 46px; padding: 0 44px 0 14px; border-radius: 10px; border: 1px solid var(--pp-border-2); background: var(--pp-surface-2); font-size: 14px; color: var(--pp-text); }
.pp-cp-input input:focus { outline: none; border-color: var(--pp-maroon); box-shadow: 0 0 0 3px rgba(144,41,33,0.12); background: #fff; }
.pp-cp-eye { all: unset; cursor: pointer; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--pp-muted-2); font-size: 18px; display: flex; }
.pp-cp-eye:hover { color: var(--pp-maroon); }
.pp-cp-hint { font-size: 11.5px; color: var(--pp-muted-2); margin-top: 6px; }
.pp-cp-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 8px 24px 22px; }

/* PER-109: Add-redirection modal — excluded chips + included checkbox list */
.pp-redir-lblrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.pp-redir-lblrow > label { margin: 0; font-size: 13px; font-weight: 600; color: var(--pp-text); }
.pp-link-btn { all: unset; cursor: pointer; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.pp-link-btn.pp-link-green { background: var(--pp-success-bg); color: var(--pp-success); }
.pp-link-btn.pp-link-green:hover { background: #d3f0e2; }
.pp-link-btn.pp-link-amber { background: #f3e9da; color: #a07a51; }
.pp-link-btn.pp-link-amber:hover { background: #ead9c2; }
.pp-redir-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pp-redir-chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 5px 0 10px; border-radius: 999px; background: var(--pp-danger-bg); color: var(--pp-maroon); font-size: 11.5px; font-weight: 600; }
.pp-redir-chip-x { all: unset; cursor: pointer; font-size: 15px; line-height: 1; opacity: .65; padding: 0 2px; }
.pp-redir-chip-x:hover { opacity: 1; }
.pp-redir-list { border: 1px solid var(--pp-border-2); border-radius: 10px; background: var(--pp-surface-2); max-height: 200px; overflow-y: auto; margin-top: 8px; }
.pp-redir-list label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 0; cursor: pointer; border-bottom: 1px solid var(--pp-surface-3); font-size: 13.5px; color: var(--pp-text); }
.pp-redir-list label:last-child { border-bottom: 0; }
.pp-redir-list input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--pp-success); cursor: pointer; flex: 0 0 auto; }

/* PER-111: Add-product modal — sectioned form grid */
.pp-form-section { font-family: "DM Sans", sans-serif; font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; color: #b15436; text-transform: uppercase; margin: 18px 0 12px; }
.pp-form-section:first-child { margin-top: 0; }
.pp-form-grid { display: grid; gap: 14px 18px; margin-bottom: 2px; }
.pp-form-grid.pp-grid-2 { grid-template-columns: 1fr 1fr; }
.pp-form-grid.pp-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.pp-form-grid .pp-cp-field { margin-bottom: 0; min-width: 0; }
.pp-form-grid .pp-cp-field .form-control, .pp-form-grid .pp-cp-field .form-select { width: 100%; max-width: 100%; }
@media (max-width: 640px) { .pp-form-grid.pp-grid-2, .pp-form-grid.pp-grid-3 { grid-template-columns: 1fr; } }

/* sales report filter chips + results toggle */
.pp-filter-chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--pp-surface-2); border: 1px solid var(--pp-border-2); border-radius: 10px;
    padding: 9px 14px; font-size: 14px; font-weight: 500; color: var(--pp-text); cursor: pointer;
}
.pp-filter-chip i { color: var(--pp-maroon); font-size: 16px; }
.pp-filter-chip.dropdown-toggle::after { margin-left: 6px; color: var(--pp-muted-2); }
.pp-filter-dropdown { padding: 8px; min-width: 260px; }
/* PER-110: search box pinned at the top of multi-select filter dropdowns; options scroll below */
.pp-filter-search { position: relative; margin-bottom: 6px; }
.pp-filter-search > i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--pp-muted-2); font-size: 16px; pointer-events: none; }
.pp-filter-search-input { width: 100%; height: 38px; padding: 0 12px 0 33px; border-radius: 8px; border: 1px solid var(--pp-border-2); background: var(--pp-surface-2); font-size: 13px; color: var(--pp-text); }
.pp-filter-search-input:focus { border-color: var(--pp-maroon); outline: none; }
.pp-filter-optlist { max-height: 240px; overflow-y: auto; }
/* PER-120: custom date range inside the Date range dropdown — From/To fields kept inside the panel */
.pp-cd-range { display: flex; flex-direction: column; gap: 10px; padding: 8px 8px 4px; }
.pp-cd-range .pp-cd-field { display: flex; flex-direction: column; gap: 5px; }
.pp-cd-range .pp-cd-field label { font-size: 12px; font-weight: 600; color: var(--pp-muted); margin: 0; }
/* date inputs styled exactly per the design: white pill, #d6cbb8 border, 8px radius, 40px tall */
.pp-cd-range .form-control {
    width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; margin: 0;
    height: 40px; padding: 0 12px; border-radius: 8px;
    border: 1px solid #d6cbb8; background: #fff;
    font-size: 13.5px; color: #2b2420; line-height: normal;
}
.pp-cd-range .form-control:focus { border-color: var(--pp-maroon); box-shadow: 0 0 0 3px rgba(144,41,33,0.12); background: #fff; }
.pp-cd-range .form-control::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
.pp-cd-range .form-control::-webkit-calendar-picker-indicator:hover { opacity: .9; }
.pp-filter-opt { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 8px; font-size: 13px; cursor: pointer; margin: 0; }
.pp-filter-opt:hover { background: var(--pp-surface-2); }
.pp-filter-opt input { margin: 0; }
.pp-dl-toggle { display: inline-flex; border: 1px solid var(--pp-border); border-radius: 8px; overflow: hidden; }
.pp-dl-toggle button { border: 0; background: var(--pp-surface); color: var(--pp-text); font-size: 13px; font-weight: 600; padding: 6px 14px; cursor: pointer; }
.pp-dl-toggle button.active { background: var(--pp-maroon); color: #fff; }

/* sales report download links (PDF / CSV) */
.pp-dl-link { color: var(--pp-maroon); font-weight: 600; font-size: 13px; text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.pp-dl-link:hover { color: var(--pp-maroon-dark); text-decoration: underline; }
.pp-dl-link i { font-size: 14px; }
.pp-dl-sep { color: var(--pp-border-2); margin: 0 6px; }
.pp-search-wrap { position: relative; }
.pp-search-wrap .pp-search-ico {
    position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
    color: var(--pp-muted-2); font-size: 17px; pointer-events: none;
}

/* neutral wrapper (used to de-card heavy legacy wrappers without changing div count) */
.pp-bare { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; }

/* date fields (flatpickr) — cream pill + left maroon calendar icon, matches dashboard design */
.pp-date-wrap { position: relative; display: block; }
.pp-date-wrap .pp-date-ico {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--pp-maroon); font-size: 17px; pointer-events: none; z-index: 2;
}
.pp-dateinput { padding-left: 40px !important; font-weight: 500; cursor: pointer; }
.flatpickr-day.selected, .flatpickr-day.selected:hover,
.flatpickr-day.startRange, .flatpickr-day.endRange { background: var(--pp-maroon) !important; border-color: var(--pp-maroon) !important; color: #fff !important; }
.flatpickr-day:hover { background: var(--pp-surface-2) !important; }
.flatpickr-day.today { border-color: var(--pp-gold) !important; }
.flatpickr-day.today:hover { background: var(--pp-gold) !important; color: #fff !important; }
.flatpickr-calendar { border-radius: var(--pp-radius); box-shadow: 0 12px 30px -8px rgba(27,22,19,.22); }
.flatpickr-months .flatpickr-month, .flatpickr-current-month, .flatpickr-weekday { color: var(--pp-ink); }

/* page loader (pace.js) — recolor off-theme blue to maroon */
.pace .pace-progress { background: var(--pp-maroon) !important; }
.pace .pace-activity { border-top-color: var(--pp-maroon) !important; border-left-color: var(--pp-maroon) !important; }

/* misc helpers reused by pages */
.pointer { cursor: pointer; }
.pp-muted { color: var(--pp-muted); }
.pp-mono { font-variant-numeric: tabular-nums; }

/* mobile sidebar toggle (hamburger) lives in topbar */
.mobile-toggle-menu {
    display: none;
    font-size: 24px; color: var(--pp-ink); cursor: pointer; margin-right: 8px;
}
.pp-backdrop {
    position: fixed; inset: 0; background: rgba(27, 22, 19, 0.45);
    z-index: 1029; opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.pp-backdrop.show { opacity: 1; visibility: visible; }

/* =====================================================================
   LOGIN (split screen)
   ===================================================================== */
.pp-login {
    display: flex; min-height: 100vh; background: var(--pp-bg);
}
.pp-login-brand {
    flex: 1 1 50%;
    position: relative;
    overflow: hidden;
    background: var(--pp-feature-grad);
    color: var(--pp-cream);
    padding: 48px 56px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.pp-login-brand .pp-login-logo { height: 30px; width: auto; }
.pp-login-brand .pp-login-eyebrow {
    display: flex; align-items: center; gap: 14px;
    font-size: 11px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
    color: rgba(246,242,230,0.72);
}
.pp-login-brand .pp-login-eyebrow span { height: 1px; width: 36px; background: rgba(246,242,230,0.45); }
.pp-login-quote {
    font-family: "Degular", sans-serif; font-weight: 700;
    font-size: 34px; line-height: 1.18; letter-spacing: -0.01em; max-width: 460px;
}
.pp-login-quote-by { margin-top: 18px; font-size: 14px; color: rgba(246,242,230,0.8); }
.pp-login-curve {
    position: absolute; right: 8%; bottom: 8%; width: 280px; opacity: .5; pointer-events: none;
}
.pp-login-brand .pp-login-foot { font-size: 12px; color: rgba(246,242,230,0.7); position: relative; z-index: 1; }
.pp-login-form-wrap {
    flex: 1 1 50%;
    display: flex; align-items: center; justify-content: center;
    padding: 40px 24px;
}
.pp-login-form { width: 100%; max-width: 380px; }
.pp-login-form h1 { font-family: "Degular", sans-serif; font-weight: 700; font-size: 30px; color: var(--pp-ink); margin: 0 0 8px; }
.pp-login-form .pp-login-sub { color: var(--pp-muted); font-size: 14px; margin-bottom: 26px; }
.pp-login-form .form-control { background: #fff; }
.pp-login-form .btn-primary { width: 100%; height: 46px; }
.pp-login-foot-r { margin-top: 18px; font-size: 12px; color: var(--pp-muted-2); }
@media (max-width: 860px) {
    .pp-login { flex-direction: column; }
    .pp-login-brand { flex: 0 0 auto; padding: 32px 28px; min-height: 260px; }
    .pp-login-quote { font-size: 26px; }
    .pp-login-curve { width: 160px; right: 6%; bottom: 6%; }
}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1200px) {
    .pp-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 991.98px) {
    .sidebar-wrapper {
        left: 0 !important; /* override template's mobile left:-300px */
        top: 0; bottom: 0; height: 100%; /* full-height off-canvas on mobile (overrides the floating desktop inset) */
        border-radius: 0;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 1045;
    }
    .wrapper.pp-sidebar-open .sidebar-wrapper { transform: translateX(0); }
    .topbar { top: 16px; right: 16px !important; left: auto !important; }
    .page-wrapper { margin-left: 0 !important; }
    .page-content { padding-top: 64px; } /* clear the fixed hamburger + bell/avatar row */
    .pp-page-head { padding-right: 0; }   /* title goes full width below the icons on mobile */
    .mobile-toggle-menu {
        position: fixed; top: 16px; left: 16px; z-index: 1040;
        display: inline-flex !important; align-items: center;
    }
}
@media (max-width: 767.98px) {
    .pp-kpi-grid { grid-template-columns: 1fr; }
    .page-content { padding: 64px 16px 32px; } /* keep room for the fixed hamburger + bell/avatar row */
    .topbar .navbar { padding-left: 0; padding-right: 0; }
    .breadcrumb-title { font-size: 24px; }
    .pp-page-head { flex-direction: column; padding-right: 0; }
    .pp-feature .pp-feature-value { font-size: 36px; }
    /* let wide tables scroll horizontally */
    .pp-table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
