/* ===========================
   SELFPRINTZ FRANCHISER DASHBOARD
   Navy / Purple Design System
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --purple: #6B4FFF;
    --purple-lt: rgba(107, 79, 255, 0.12);
    --purple-mid: rgba(107, 79, 255, 0.25);
    --navy: #1A1D2E;
    --navy-dark: #13161F;
    --navy-hover: #22263A;
    --navy-active: #2A2F47;
    --bg: #F5F6FA;
    --card: #FFFFFF;
    --border: rgba(0, 0, 0, 0.07);
    --text: #1E2130;
    --muted: #6B7280;
    --green: #22C55E;
    --green-lt: rgba(34, 197, 94, 0.1);
    --red: #EF4444;
    --red-lt: rgba(239, 68, 68, 0.1);
    --orange: #F97316;
    --orange-lt: rgba(249, 115, 22, 0.1);
    --blue: #3B82F6;
    --blue-lt: rgba(59, 130, 246, 0.1);
    --yellow: #EAB308;
    --yellow-lt: rgba(234, 179, 8, 0.1);
    --sidebar-w: 240px;
    --topbar-h: 60px;
    --radius: 10px;
    --radius-md: 14px;
    --radius-lg: 18px;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.10);
    --transition: 0.2s ease;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    display: flex;
}

/* ===========================  SIDEBAR  =========================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--navy);
    display: flex;
    flex-direction: column;
    z-index: 200;
    overflow: hidden;
    transition: width var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    min-height: var(--topbar-h);
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--purple);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
}

.sidebar-logo-text .brand {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.sidebar-logo-text .sub {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.45);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

.nav-group-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 14px 20px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 20px;
    margin: 1px 8px;
    border-radius: var(--radius);
    cursor: pointer;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
    user-select: none;
    position: relative;
}

.nav-item:hover {
    background: var(--navy-hover);
    color: #fff;
}

.nav-item.active {
    background: var(--purple);
    color: #fff;
    font-weight: 600;
}

.nav-item .nav-icon {
    font-size: 16px;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    line-height: 1.4;
}

.nav-badge.new {
    background: var(--green);
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}

.store-card {
    background: var(--navy-active);
    border: none;
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.store-card:hover {
    background: var(--navy-hover);
}

#franchiser-sidebar .sidebar-footer > *:not(.store-card) {
    display: none !important;
}

#franchiser-sidebar a[href="/about"],
#franchiser-sidebar a[href="/contact"],
#franchiser-sidebar a[href="/terms"],
#franchiser-sidebar a[href="/privacy"],
#franchiser-sidebar a[href="/refund"],
#franchiser-sidebar a[href="/delivery"] {
    display: none !important;
}

.store-avatar {
    width: 34px;
    height: 34px;
    background: var(--purple);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.store-info .store-name {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.store-info .store-id {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
}

.help-btn {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    background: rgba(107, 79, 255, 0.15);
    border: 1px solid rgba(107, 79, 255, 0.3);
    border-radius: var(--radius);
    color: #a78bfa;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all var(--transition);
}

.help-btn:hover {
    background: rgba(107, 79, 255, 0.25);
}

/* ===========================  MAIN LAYOUT  =========================== */
.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================  TOPBAR  =========================== */
.topbar {
    position: sticky;
    top: 0;
    height: var(--topbar-h);
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.topbar-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-sep {
    width: 1px;
    height: 24px;
    background: var(--border);
    margin: 0 4px;
}

.topbar-apm-select {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    position: relative;
    transition: all var(--transition);
}

.topbar-apm-select:hover {
    background: var(--card);
    border-color: var(--purple);
    box-shadow: 0 2px 6px rgba(107, 79, 255, 0.12);
}

.apm-count-badge {
    background: var(--purple);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 20px;
}

.select-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    font-size: 13px;
    z-index: 2;
}

.topbar-date {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
}

.topbar-store-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: auto;
    max-width: 180px;
    min-width: 0;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    text-align: right;
    padding: 4px 8px;
    border-radius: 10px;
}

.topbar-store-chip:hover {
    background: var(--purple-lt);
}

.topbar-store-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.topbar-store-id {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: all var(--transition);
    position: relative;
}

.icon-btn:hover {
    background: var(--bg);
    border-color: var(--purple);
}

.notif-dot[hidden] {
    display: none;
}

.topbar-notif-wrap {
    position: relative;
}

.partner-notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    width: 320px;
    max-width: min(92vw, 320px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-md);
    z-index: 80;
    overflow: hidden;
}

.partner-notif-dropdown[hidden] {
    display: none;
}

.partner-notif-head {
    font-size: 13px;
    font-weight: 700;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--border);
}

.partner-notif-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: inherit;
    border-bottom: 1px solid var(--border);
}

.partner-notif-item:hover {
    background: var(--purple-lt);
}

.partner-notif-item strong {
    display: block;
    font-size: 13px;
    color: var(--text);
}

.partner-notif-item span {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.partner-notif-empty {
    padding: 18px 14px;
    font-size: 13px;
    color: var(--muted);
    text-align: center;
}

/* ===========================  CONTENT AREA  =========================== */
.content-area {
    padding: 20px 24px;
    flex: 1;
}

.page-section {
    display: none;
}

.page-section.active {
    display: block;
    min-height: calc(100vh - 180px);
}

.franchiser-page-footer {
    margin-top: auto;
    padding: 18px 24px calc(18px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--border);
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

.franchiser-page-footer-brand {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.franchiser-page-footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin: 0 0 8px;
}

.franchiser-page-footer-links a {
    color: var(--purple);
    font-weight: 600;
    text-decoration: none;
}

.franchiser-page-footer-links a:hover {
    text-decoration: underline;
}

.franchiser-page-footer-copy {
    font-size: 11px;
    opacity: 0.85;
}

/* ===========================  PAGE HEADER  =========================== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-title {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.page-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}

/* ===========================  KPI CARDS  =========================== */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-card {
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.kpi-card[onclick],
.kpi-card[role="button"] {
    cursor: pointer;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.kpi-card[onclick]:hover,
.kpi-card[role="button"]:hover {
    border-color: var(--primary);
}

.kpi-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    flex-shrink: 0;
}

.kpi-body {
    flex: 1;
    min-width: 0;
}

.kpi-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 3px;
}

.kpi-value {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
}

.kpi-trend {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
    margin-top: 2px;
}

.kpi-trend.up {
    color: var(--green);
}

.kpi-trend.down {
    color: var(--red);
}

/* Icon colour variants */
.kpi-icon.purple {
    background: var(--purple-lt);
}

.kpi-icon.green {
    background: var(--green-lt);
}

.kpi-icon.orange {
    background: var(--orange-lt);
}

.kpi-icon.red {
    background: var(--red-lt);
}

.kpi-icon.blue {
    background: var(--blue-lt);
}

/* ===========================  GRID LAYOUTS  =========================== */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.grid-12 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 14px;
}

.grid-21 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 14px;
}

.grid-13 {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 14px;
}

.span-2 {
    grid-column: span 2;
}

/* ===========================  CARDS  =========================== */
.card {
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 0;
    margin-bottom: 14px;
}

.card-title {
    font-size: 13px;
    font-weight: 700;
}

.card-action {
    font-size: 11.5px;
    color: var(--purple);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
}

.card-action:hover {
    text-decoration: underline;
}

.card-body {
    padding: 0 16px 14px;
}

.card-pad {
    padding: 16px;
}

.no-pad {
    padding: 0 !important;
}

/* ===========================  PRINT SUMMARY  =========================== */
.print-summary-row {
    display: flex;
    gap: 0;
    background: #F9F9FB;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 14px;
}

.ps-item {
    flex: 1;
    padding: 12px 16px;
    border-right: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.ps-item:last-child {
    border-right: none;
}

.ps-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ps-dot.bw {
    background: #374151;
}

.ps-dot.color {
    background: var(--orange);
}

.ps-dot.custom {
    background: var(--purple);
}

.ps-dot.total {
    background: var(--blue);
}

.ps-info {}

.ps-val {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.ps-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.ps-pct {
    font-size: 11px;
    color: var(--muted);
    margin-top: 1px;
}

/* ===========================  CHART AREAS  =========================== */
.chart-wrap {
    position: relative;
    padding: 0 16px 14px;
}

.chart-wrap canvas {
    display: block;
    width: 100% !important;
}

/* ===========================  TABLES  =========================== */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    min-width: 820px; /* Guarantees all columns have room and trigger horizontal scroll if needed */
}

thead th {
    padding: 8px 14px;
    text-align: left;
    font-weight: 600;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: #F9F9FB;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: middle;
}

.td-details-wrap,
.td-wrap {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
    min-width: 240px;
    max-width: 440px;
    line-height: 1.45;
}

.td-nowrap {
    white-space: nowrap !important;
}

tbody tr:last-child td {
    border-bottom: none;
}

tbody tr:hover {
    background: #FAFBFF;
}

.td-id {
    font-weight: 600;
    color: var(--purple);
    font-size: 11px;
    font-family: monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
    vertical-align: middle;
}

td.td-id {
    display: table-cell !important;
}

span.td-id, .td-id-chip {
    display: inline-block;
    vertical-align: middle;
}

.td-name {
    font-weight: 600;
}

.td-muted {
    color: var(--muted);
    font-size: 11.5px;
}

.td-amount {
    font-weight: 700;
}

.td-pages {
    font-weight: 600;
}

/* ===========================  BADGES / STATUS  =========================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green {
    background: var(--green-lt);
    color: #16a34a;
}

.badge-blue {
    background: var(--blue-lt);
    color: #2563eb;
}

.badge-orange {
    background: var(--orange-lt);
    color: #c2410c;
}

.badge-red {
    background: var(--red-lt);
    color: #dc2626;
}

.badge-gray {
    background: #F3F4F6;
    color: var(--muted);
}

.badge-yellow {
    background: var(--yellow-lt);
    color: #854d0e;
}

.badge-purple {
    background: var(--purple-lt);
    color: var(--purple);
}

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

.dot-green {
    background: var(--green);
}

.dot-orange {
    background: var(--orange);
}

.dot-red {
    background: var(--red);
}

.dot-blue {
    background: var(--blue);
}

/* ===========================  APM CARDS  =========================== */
.apm-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

#dashboard-apm-cards {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
}

.apm-card {
    background: var(--card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 14px 16px;
}

.apm-card-dashboard {
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.apm-card-dashboard:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--primary);
}

.apm-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.apm-name {
    font-size: 14px;
    font-weight: 800;
}

.apm-loc {
    font-size: 11px;
    color: var(--muted);
}

.apm-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    margin-top: 10px;
}

.apm-stat-item {
    text-align: center;
}

.apm-stat-val {
    font-size: 15px;
    font-weight: 800;
}

.apm-stat-lbl {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.apm-consumables {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.consumable-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    font-weight: 600;
}

.apm-actions {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

/* ===========================  ALERT ITEMS  =========================== */
.alert-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: #FAFAFA;
    border: 1px solid var(--border);
    font-size: 12px;
}

.alert-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.alert-text {
    flex: 1;
}

.alert-text strong {
    font-weight: 700;
    display: block;
}

.alert-text span {
    color: var(--muted);
    font-size: 11px;
}

/* ===========================  STAT SUMMARY CARDS  =========================== */
.summary-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.summary-stat:last-child {
    border-bottom: none;
}

.ss-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    color: var(--navy);
}

.ss-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.ss-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

.ss-value {
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

/* ===========================  REFERRAL CARD  =========================== */
.referral-code-box {
    background: linear-gradient(135deg, #6B4FFF 0%, #9B59B6 100%);
    border-radius: var(--radius-md);
    padding: 16px;
    color: #fff;
    margin-bottom: 14px;
}

.ref-code-label {
    font-size: 11px;
    opacity: 0.75;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.ref-code-value {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 2px;
    margin: 4px 0;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    text-align: left;
    width: 100%;
}

.ref-share-hint {
    font-size: 11px;
    opacity: 0.8;
    margin: 4px 0 8px;
}

.ref-share-icons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.share-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff !important;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    font-family: inherit;
    pointer-events: auto;
}

.share-action:hover {
    background: rgba(255, 255, 255, 0.35);
}

.ref-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.ref-stat {
    background: #F9F9FB;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px;
}

.ref-stat-val {
    font-size: 18px;
    font-weight: 800;
}

.ref-stat-label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
}

/* ===========================  SHOP PRODUCT CARDS  =========================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.product-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    transition: all var(--transition);
    cursor: pointer;
}

.product-card:hover {
    border-color: var(--purple);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-img {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin: 0 auto 10px;
}

.product-name {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 4px;
}

.product-brand {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 6px;
}

.product-price {
    font-size: 14px;
    font-weight: 800;
    color: var(--purple);
    margin-bottom: 8px;
}

/* ===========================  BUTTONS  =========================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 12.5px;
    font-weight: 600;
    border: none;
    cursor: pointer !important;
    touch-action: manipulation;
    transition: all var(--transition);
    font-family: 'Inter', system-ui, sans-serif;
    text-decoration: none;
    position: relative;
    pointer-events: auto !important;
}

button *, .btn *, .tab-btn * {
    pointer-events: none !important;
}
input, select, textarea, label {
    pointer-events: auto !important;
}

.btn-primary {
    background: var(--purple);
    color: #fff;
    box-shadow: 0 3px 12px rgba(107, 79, 255, 0.3);
}

.btn-primary:hover {
    background: #5A3FE8;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-ghost:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: var(--purple-lt);
}

.btn-danger {
    background: var(--red-lt);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-success {
    background: var(--green-lt);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 11px;
    border-radius: 7px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 14px;
}

/* ===========================  TABS  =========================== */
.tab-bar {
    display: flex;
    gap: 2px;
    background: #F3F4F6;
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 16px;
}

.tab-btn {
    flex: 1;
    padding: 7px 14px;
    background: transparent;
    border: none;
    border-radius: calc(var(--radius) - 4px);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.tab-btn.active,
.tab-btn:hover {
    background: var(--card);
    color: var(--text);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.tab-btn.active {
    color: var(--purple);
}

/* ===========================  FILTERS  =========================== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    font-size: 12px;
    font-weight: 500;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 6px 12px;
    font-size: 12px;
    flex: 1;
    max-width: 260px;
}

.search-box input {
    border: none;
    outline: none;
    font-size: 12px;
    font-family: inherit;
    width: 100%;
    background: transparent;
}

/* ===========================  TOGGLE SWITCH  =========================== */
.toggle-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 22px;
    transition: background var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform var(--transition);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.toggle input:checked+.toggle-slider {
    background: var(--green);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(18px);
}

.toggle-label {
    font-size: 12.5px;
    font-weight: 600;
}

/* ===========================  MODAL  =========================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        transform: translateY(-16px) scale(0.97);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 16px;
    font-weight: 800;
}

.modal-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-group {
    margin-bottom: 14px;
}

.form-label {
    font-size: 11.5px;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: var(--muted);
}

.form-input {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.form-input:focus {
    border-color: var(--purple);
}

/* ===========================  CATEGORY TABS  =========================== */
.cat-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.cat-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--card);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--muted);
}

.cat-tab.active {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
}

.cat-tab:hover:not(.active) {
    border-color: var(--purple);
    color: var(--purple);
}

/* ===========================  EARNINGS TABLE  =========================== */
.earnings-table-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    align-items: center;
}

.earnings-table-row:last-child {
    border-bottom: none;
}

.earnings-table-row.header {
    background: #F9F9FB;
    font-weight: 700;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ===========================  PAGINATION  =========================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
}

.page-nums {
    display: flex;
    gap: 4px;
}

.page-num-btn {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-num-btn.active {
    background: var(--purple);
    color: #fff;
    border-color: var(--purple);
}

.page-num-btn:hover:not(.active) {
    border-color: var(--purple);
}

/* ===========================  SUPPORT  =========================== */
.support-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.support-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.support-card:hover {
    border-color: var(--purple);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.support-card-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.support-card-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.support-card-desc {
    font-size: 11.5px;
    color: var(--muted);
}

/* ===========================  SETTINGS SECTIONS  =========================== */
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #F3F4F6;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-label {
    font-size: 13px;
    font-weight: 600;
}

.settings-item-sub {
    font-size: 11px;
    color: var(--muted);
    margin-top: 2px;
}

/* ===========================  PROFILE  =========================== */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.profile-field label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    display: block;
    margin-bottom: 3px;
}

.profile-field p {
    font-size: 13.5px;
    font-weight: 600;
}

/* ===========================  MINI CHART AREA  =========================== */
.mini-chart {
    height: 60px;
    position: relative;
    overflow: hidden;
}

/* ===========================  CART BADGE  =========================== */
.cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ===========================  SCROLLBAR  =========================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* ===========================  RESPONSIVE  =========================== */
@media (max-width: 1280px) {
    .kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    :root {
        --sidebar-w: 60px;
    }

    .sidebar-logo-text,
    .nav-item span.nav-label,
    .nav-group-label,
    .store-info,
    .help-btn span {
        display: none;
    }

    .sidebar-logo {
        justify-content: center;
        padding: 18px 0;
    }

    .sidebar-logo-icon {
        margin: 0;
    }

    .nav-item {
        justify-content: center;
        padding: 12px 0;
        margin: 2px 8px;
        min-height: 42px;
    }

    .nav-item .nav-icon {
        margin: 0;
        width: auto;
    }

    .store-card {
        justify-content: center;
    }

    .help-btn {
        justify-content: center;
        padding: 9px;
    }

    .apm-cards {
        grid-template-columns: 1fr 1fr;
    }

    .kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .kpi-row > .kpi-card:last-child:nth-child(odd),
    #dash-screen .kpi-row > .kpi-card:last-child {
        grid-column: 1 / -1;
    }
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.franchiser-menu-btn {
    display: none;
    border: 1px solid var(--border);
    background: var(--bg);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4,
    .grid-12,
    .grid-21,
    .grid-13 {
        grid-template-columns: 1fr;
    }

    .apm-cards {
        grid-template-columns: 1fr;
    }

    .support-cards {
        grid-template-columns: 1fr;
    }

    .kpi-row {
        grid-template-columns: 1fr 1fr;
    }

    .content-area {
        padding: 14px 12px 28px;
    }

    .span-2 {
        grid-column: span 1;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .franchiser-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        width: min(280px, 86vw);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-logo-text,
    .nav-item span.nav-label,
    .nav-group-label,
    .store-info,
    .help-btn span {
        display: initial;
    }

    .nav-item {
        justify-content: flex-start;
        padding: 10px 14px;
        margin: 2px 8px;
        min-height: 44px;
    }

    .store-info {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .store-info .store-name,
    .store-info .store-id {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    .franchiser-page-footer {
        padding-left: 12px;
        padding-right: 12px;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .modal {
        width: calc(100vw - 24px);
        max-width: 520px;
        max-height: calc(100vh - 24px);
        overflow-y: auto;
    }

    .share-btn {
        width: 40px;
        height: 40px;
    }

    .main-wrap {
        margin-left: 0;
        width: 100%;
    }

    .topbar {
        padding: 0 12px;
        gap: 8px;
        flex-wrap: wrap;
        height: auto;
        min-height: var(--topbar-h);
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .topbar-store-id {
        display: none;
    }

    .topbar-store-chip {
        max-width: 110px;
    }

    .sidebar-backdrop {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        z-index: 199;
    }

    body.franchiser-nav-open .sidebar-backdrop {
        display: block;
    }

    .table-wrap,
    .card {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .kpi-row {
        grid-template-columns: 1fr;
    }
}

.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(16px);
    background: #1f2937;
    color: #fff;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    z-index: 4000;
    opacity: 0;
    pointer-events: none;
    max-width: min(92vw, 420px);
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: opacity .2s ease, transform .2s ease;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.toast.toast-error {
    background: #b42318;
}

/* ══════════════════════════════════════════════════════════════════════════
   SMOOTH TACTILE BUTTONS, LOADERS & MICRO-ANIMATIONS
   ══════════════════════════════════════════════════════════════════════════ */
button, .btn, .btn-admin, .btn-icon-action, a.btn, [onclick] {
  -webkit-tap-highlight-color: transparent !important;
  transition: transform 0.12s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease !important;
}

button:active, .btn:active, .btn-admin:active, .btn-icon-action:active, a.btn:active, [onclick]:active {
  transform: scale(0.965) !important;
}

button:disabled, .btn:disabled, .btn-admin:disabled, .is-disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
  transform: none !important;
  pointer-events: none !important;
}

/* Spinner Loader for Buttons */
.btn-loading, .is-loading {
  position: relative !important;
  pointer-events: none !important;
  cursor: wait !important;
  opacity: 0.88 !important;
}

.btn-loading > * {
  visibility: hidden !important;
  opacity: 0 !important;
}

.btn-loading::after {
  content: '' !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 18px !important;
  height: 18px !important;
  margin-top: -9px !important;
  margin-left: -9px !important;
  border: 2.5px solid rgba(255, 255, 255, 0.35) !important;
  border-top-color: #ffffff !important;
  border-radius: 50% !important;
  animation: btn-spin-anim 0.65s linear infinite !important;
  box-sizing: border-box !important;
  z-index: 10 !important;
}

.btn-secondary.btn-loading::after, .btn-ghost.btn-loading::after {
  border-color: rgba(99, 102, 241, 0.25) !important;
  border-top-color: var(--primary, #4f46e5) !important;
}

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

@keyframes shake-anim {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.shake-error {
  animation: shake-anim 0.35s ease-in-out !important;
}

/* Floating Toast Notification */
.selfprintz-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  max-width: 400px;
  width: calc(100vw - 32px);
  padding: 13px 18px;
  border-radius: 14px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.18), 0 4px 10px rgba(0,0,0,0.08);
  z-index: 999999;
  color: #fff;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
}

.selfprintz-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.selfprintz-toast-success { background: linear-gradient(135deg, #15803d, #16a34a); border: 1px solid rgba(255,255,255,0.2); }
.selfprintz-toast-error { background: linear-gradient(135deg, #b91c1c, #dc2626); border: 1px solid rgba(255,255,255,0.2); }
.selfprintz-toast-warning { background: linear-gradient(135deg, #b45309, #d97706); border: 1px solid rgba(255,255,255,0.2); }
.selfprintz-toast-info { background: linear-gradient(135deg, #4338ca, #6366f1); border: 1px solid rgba(255,255,255,0.2); }

/* ══════════════════════════════════════════════════════════════════
   iOS MOMENTUM SCROLLING — Smooth native scroll on all overflow areas
   ══════════════════════════════════════════════════════════════════ */
.table-wrap,
.content-area,
.page-section,
.card-body,
.sidebar,
.partner-notif-dropdown,
.apm-cards-grid {
  -webkit-overflow-scrolling: touch;
}

/* ══════════════════════════════════════════════════════════════════
   EXTRA SMALL MOBILE (≤ 360px) — Ultra-compact phone optimization
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .kpi-row {
    grid-template-columns: 1fr;
  }
  .topbar {
    padding: 0 8px;
    gap: 6px;
  }
  .topbar-title {
    font-size: 14px;
  }
  .apm-count-badge {
    display: none;
  }
  .topbar-date {
    display: none;
  }
  .kpi-card {
    padding: 12px 14px;
  }
  .kpi-value {
    font-size: 22px;
  }
  .section-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-primary, .btn-secondary, .btn-ghost {
    width: 100%;
    justify-content: center;
  }
  .topbar-store-chip {
    max-width: 80px;
  }
  /* Touch target minimum 44px for filter tabs */
  .tab-btn {
    min-height: 40px;
    padding: 8px 14px;
  }
}

/* ══════════════════════════════════════════════════════════════════
   TOUCH TARGET MINIMUMS — 44x44px per Apple HIG / Google guidelines
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .icon-btn,
  .franchiser-menu-btn,
  .topbar-icon-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .tab-btn {
    min-height: 40px;
  }
  .nav-item {
    min-height: 48px;
  }
  /* Ensure action buttons in tables are large enough */
  .action-btn,
  .btn-sm {
    min-height: 36px;
    padding: 6px 12px;
  }
}


/* ═══════════════════════════════════════════════════════════════
   SKELETON / SHIMMER LOADING STATES
   ═══════════════════════════════════════════════════════════════ */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 6px;
}
.skeleton-text {
  height: 13px;
  margin: 5px 0;
  border-radius: 4px;
}
.skeleton-circle {
  border-radius: 50%;
}
.skeleton-kpi {
  height: 72px;
  border-radius: 14px;
}

/* ═══════════════════════════════════════════════════════════════
   DASHBOARD KPI PERIOD SELECTOR & MOBILE PRINT SUMMARY REFINEMENTS
   ═══════════════════════════════════════════════════════════════ */
.kpi-period-selector {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg2, #f3f4f6);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
  width: fit-content;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.btn-kpi-period {
  background: transparent;
  border: none;
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-kpi-period.active,
.btn-kpi-period:hover {
  background: var(--card, #fff);
  color: var(--primary, #6366f1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  font-weight: 700;
}

@media (max-width: 680px) {
  .print-summary-row {
    flex-wrap: wrap !important;
  }
  .ps-item {
    flex: 1 1 50% !important;
    min-width: 130px !important;
    border-bottom: 1px solid var(--border) !important;
  }
  .ps-item:nth-child(2) {
    border-right: none !important;
  }
  .ps-item:nth-child(3),
  .ps-item:nth-child(4) {
    border-bottom: none !important;
  }
}

/* ===== APM Overflow Dropdown Item ===== */
.apm-overflow-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.apm-overflow-item:hover {
    background: var(--bg2);
    color: var(--primary);
}

.apm-overflow-item i[data-lucide] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* ===========================  MODERN FILTER PILLS & OUTLETS UI  =========================== */
.filter-pills {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pills .pill,
.pill {
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    border: 1.5px solid var(--border);
    background: var(--bg2, #f8fafc);
    color: var(--muted, #64748b);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    user-select: none;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.filter-pills .pill:hover,
.pill:hover {
    border-color: var(--primary, #6366f1);
    color: var(--text, #0f172a);
    background: var(--card, #ffffff);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.filter-pills .pill.active,
.pill.active {
    background: var(--primary, #6366f1) !important;
    border-color: var(--primary, #6366f1) !important;
    color: #ffffff !important;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

#outlets-tbody tr {
    transition: background-color 0.15s ease;
}

#outlets-tbody tr:hover {
    background-color: var(--bg2, #f8fafc);
}

.outlet-id-chip {
    font-family: monospace;
    font-weight: 700;
    font-size: 12px;
    color: var(--primary, #6366f1);
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* APM Card pulse glow animation when navigating */
@keyframes apmCardPulseGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
        border-color: var(--primary, #6366f1);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
        border-color: var(--primary, #6366f1);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

.apm-card-highlight-pulse {
    animation: apmCardPulseGlow 1.2s ease-in-out 2;
    border-color: var(--primary, #6366f1) !important;
}

/* ============================================================
   REPORTS DUAL ACTION CARDS & IN-WEBSITE REPORT VIEWER
   ============================================================ */
.report-grid-card {
    background: var(--card, #ffffff);
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.report-grid-card:hover {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.report-grid-card-icon {
    font-size: 28px;
    margin-bottom: 10px;
}

.report-grid-card-title {
    font-size: 14.5px;
    font-weight: 800;
    color: var(--text, #111827);
    margin-bottom: 4px;
}

.report-grid-card-desc {
    font-size: 11.5px;
    color: var(--muted, #6b7280);
    line-height: 1.45;
    margin-bottom: 14px;
    flex: 1;
}

.report-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}

.btn-view-report {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    background: var(--primary, #6366f1);
    color: #fff;
    border: 1px solid var(--primary, #6366f1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-view-report:hover {
    filter: brightness(1.1);
}

.btn-download-direct {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 700;
    background: var(--bg2, #f9fafb);
    color: var(--text, #374151);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.btn-download-direct:hover {
    background: #f3f4f6;
    border-color: #cbd5e1;
}

/* ============================================================
   OPERATIONS SUPPORT HUB & FAQ ACCORDION
   ============================================================ */
.support-hero-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    border: 1.5px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.support-action-card {
    background: var(--card, #fff);
    border: 1.5px solid var(--border, #e5e7eb);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.support-action-card:hover {
    border-color: var(--primary, #6366f1);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.08);
}

.support-action-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.support-faq-item {
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.support-faq-item.active {
    border-color: var(--primary, #6366f1);
}

.support-faq-q {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 13px;
    color: var(--text, #111827);
    background: var(--bg2, #f9fafb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.support-faq-q:hover {
    background: #f1f5f9;
}

.support-faq-a {
    padding: 12px 16px;
    font-size: 12.5px;
    color: var(--muted, #4b5563);
    line-height: 1.6;
    background: var(--card, #fff);
    display: none;
}

.support-faq-item.active .support-faq-a {
    display: block;
}

/* ============================================================
   CUSTOMER DIRECTORY ENHANCEMENTS
   ============================================================ */
.customer-channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
}

.customer-channel-wa {
    background: rgba(37, 211, 102, 0.12);
    color: #15803d;
    border: 1px solid rgba(37, 211, 102, 0.3);
}

.customer-channel-web {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.id-chip {
    font-family: monospace;
    font-weight: 700;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary, #6366f1);
    display: inline-block;
}


