@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ============================================
   Avento Pulse Super Admin Dashboard
   Complete CSS Stylesheet
   Color Theme: Black, Grey & Orange
   ============================================ */

/* ========== CSS Variables ========== */
:root {
    /* Primary Colors */
    --primary-black: #171717;
    --dark-black: #222222;
    --secondary-grey: #6B7280;
    --light-grey: #F3F4F6;
    --border-grey: #E5E7EB;
    --white: #FFFFFF;
    --primary-orange: #F97316;
    --primary: var(--primary-orange);

    /* Aliases used by page templates */
    --text-primary: var(--primary-black);
    --text-secondary: var(--secondary-grey);
    --text-muted: #9CA3AF;
    --bg-light: #F8F9FB;
    --border-color: var(--border-grey);
    --dark-orange: #EA580C;
    --light-orange: #FFF0E5;

    /* Semantic Colors */
    --success: #22C55E;
    --success-light: #F0FDF4;
    --danger: #EF4444;
    --danger-light: #FEF2F2;
    --warning: #EAB308;
    --warning-light: #FEFCE8;
    --info: #3B82F6;
    --info-light: #EFF6FF;

    /* Layout */
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 84px;
    --header-height: 70px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 14px;

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);

    /* Typography */
    --font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* ========== Reset & Base ========== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--light-grey);
    color: var(--primary-black);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

table {
    border-collapse: collapse;
    width: 100%;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
    background: none;
}

/* ========== Main Layout ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-normal);
}

.content-area {
    padding: 30px;
    flex: 1;
    min-width: 0;
}

/* ========== Sidebar ========== */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--primary-black);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition-normal);
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

/* Sidebar Header / Logo */
.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    background-color: var(--primary-orange);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.sidebar-brand {
    color: var(--white);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-brand span {
    color: var(--primary-orange);
}

/* Sidebar Menu */
.sidebar-menu {
    padding: 16px 0;
}

.sidebar-menu-label {
    padding: 16px 24px 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.3);
}

.sidebar-menu-item {
    position: relative;
}

.sidebar-menu-item a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 11px 24px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    font-weight: 400;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.sidebar-menu-item a:hover {
    color: var(--white);
    background-color: rgba(255, 255, 255, 0.05);
}

.sidebar-menu-item a i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

/* Active sidebar menu item */
.sidebar-menu-item.active a {
    color: var(--primary-orange);
    background-color: rgba(249, 115, 22, 0.08);
    border-left-color: var(--primary-orange);
    font-weight: 500;
}

.sidebar-menu-item.active a i {
    color: var(--primary-orange);
}

/* Sidebar submenu indicator arrow */
.menu-arrow {
    margin-left: auto;
    font-size: 10px;
    transition: transform var(--transition-fast);
}

.sidebar-menu-item.open .menu-arrow {
    transform: rotate(90deg);
}

/* Sidebar footer */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: auto;
}

/* ========== Top Header / Navbar ========== */
.top-header {
    height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--border-grey);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 900;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Sidebar toggle (hamburger) */
.mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 17px;
    color: var(--primary-black);
    background-color: var(--light-grey);
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.mobile-menu-toggle:hover {
    background-color: var(--light-orange);
    border-color: rgba(249, 115, 22, 0.3);
    color: var(--primary-orange);
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* ========== Collapsed Sidebar (icon-only rail, desktop) ========== */
.sidebar {
    transition: transform var(--transition-normal), width var(--transition-normal);
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 20px 0;
}

.sidebar-collapsed .sidebar-brand,
.sidebar-collapsed .sidebar-menu-item a span,
.sidebar-collapsed .menu-arrow {
    display: none;
}

/* Section labels become thin dividers */
.sidebar-collapsed .sidebar-menu-label {
    font-size: 0;
    padding: 0;
    margin: 10px 22px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.08);
}

.sidebar-collapsed .sidebar-menu-label:first-child {
    display: none;
}

.sidebar-collapsed .sidebar-menu-item {
    display: flex;
    justify-content: center;
    padding: 3px 0;
}

.sidebar-collapsed .sidebar-menu-item a {
    width: 46px;
    height: 46px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-left: none;
    border-radius: var(--radius-md);
}

.sidebar-collapsed .sidebar-menu-item a i {
    font-size: 17px;
}

/* Active item: rounded tile + accent bar on the left edge */
.sidebar-collapsed .sidebar-menu-item.active a {
    background-color: rgba(249, 115, 22, 0.14);
}

.sidebar-collapsed .sidebar-menu-item.active::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    width: 4px;
    height: 26px;
    border-radius: 4px;
    background-color: var(--primary-orange);
    transform: translateY(-50%);
}

/* Hover tooltip with the item name */
.sidebar-tooltip {
    position: fixed;
    z-index: 1100;
    padding: 6px 12px;
    background-color: var(--primary-black);
    color: var(--white);
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translate(-4px, -50%);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.sidebar-tooltip.visible {
    opacity: 1;
    transform: translate(0, -50%);
}

/* Page info: title + breadcrumb */
.page-info {
    display: flex;
    flex-direction: column;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-black);
    line-height: 1.3;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--secondary-grey);
}

.breadcrumb a {
    color: var(--secondary-grey);
    transition: color var(--transition-fast);
}

.breadcrumb a:hover {
    color: var(--primary-orange);
}

.breadcrumb .separator {
    font-size: 10px;
}

/* Header right side */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Header search bar */
.header-search {
    position: relative;
    margin-right: 16px;
}

.header-search input {
    width: 260px;
    padding: 9px 16px 9px 40px;
    background-color: var(--light-grey);
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--primary-black);
    transition: all var(--transition-fast);
}

.header-search input::placeholder {
    color: var(--secondary-grey);
}

.header-search input:focus {
    border-color: var(--primary-orange);
    background-color: var(--white);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-grey);
    font-size: 14px;
}

/* Header icon buttons (notification, message, settings) */
.header-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-grey);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    font-size: 18px;
}

.header-icon-btn:hover {
    background-color: var(--light-grey);
    color: var(--primary-black);
}

/* Notification badge */
.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 18px;
    height: 18px;
    background-color: var(--primary-orange);
    color: var(--white);
    border-radius: 50%;
    font-size: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

.header-divider {
    width: 1px;
    height: 32px;
    background-color: var(--border-grey);
    margin: 0 8px;
}

/* Profile area in header */
.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.header-profile:hover {
    background-color: var(--light-grey);
}

.header-profile-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.header-profile-info {
    display: flex;
    flex-direction: column;
}

.header-profile-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-black);
    line-height: 1.3;
}

.header-profile-role {
    font-size: 12px;
    color: var(--secondary-grey);
}

.header-profile .fa-chevron-down {
    font-size: 10px;
    color: var(--secondary-grey);
    margin-left: 4px;
}

/* ========== Dashboard Stat Cards ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.stat-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-grey);
    box-shadow: var(--shadow-xs);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: rgba(249, 115, 22, 0.25);
    transform: translateY(-4px);
}

/* Decorative corner glow */
.stat-card::after {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.10) 0%, rgba(249, 115, 22, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    transition: transform var(--transition-slow);
}

.stat-card:hover::after {
    transform: scale(1.4);
}

/* Top accent bar on hover */
.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-orange), #FDBA74);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-normal);
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform var(--transition-normal);
}

.stat-card:hover .stat-card-icon {
    transform: scale(1.08) rotate(-4deg);
}

/* Icon color variants */
.stat-card-icon.orange { background-color: var(--light-orange); color: var(--primary-orange); }
.stat-card-icon.blue   { background-color: var(--info-light);   color: var(--info); }
.stat-card-icon.green  { background-color: var(--success-light);color: var(--success); }
.stat-card-icon.red    { background-color: var(--danger-light); color: var(--danger); }

.stat-card-menu {
    color: var(--secondary-grey);
    cursor: pointer;
    font-size: 16px;
}

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary-black);
    line-height: 1.2;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    overflow-wrap: anywhere;
}

.stat-card-label {
    font-size: 13px;
    color: var(--secondary-grey);
    margin-bottom: 12px;
}

.stat-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--border-grey);
}

.stat-growth {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
}

.stat-growth.up,
.stat-growth.down {
    padding: 2px 8px;
    border-radius: 20px;
}

.stat-growth.up   { color: #16A34A; background-color: var(--success-light); }
.stat-growth.down { color: #DC2626; background-color: var(--danger-light); }
.stat-growth i    { font-size: 11px; }

.stat-period {
    color: var(--secondary-grey);
}

/* ========== Section Headers ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-black);
}

.section-subtitle {
    font-size: 13px;
    color: var(--secondary-grey);
    margin-top: 2px;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== Generic Card Component ========== */
.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-grey);
    box-shadow: var(--shadow-xs);
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-grey);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-black);
}

.card-body {
    padding: 24px;
}

.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-grey);
    background-color: rgba(243, 244, 246, 0.5);
}

/* ========== CSS-Only Charts ========== */

/* Analytics grid layout */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

/* Vertical Bar Chart */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    height: 200px;
    padding-top: 20px;
    border-bottom: 2px solid var(--border-grey);
    padding-bottom: 0;
}

.bar-chart-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    height: 100%;
    justify-content: flex-end;
}

.bar {
    width: 100%;
    max-width: 40px;
    border-radius: 6px 6px 0 0;
    background: linear-gradient(180deg, var(--primary-orange) 0%, var(--dark-orange) 100%);
    transition: opacity var(--transition-normal);
    position: relative;
    min-height: 4px;
}

.bar:hover {
    opacity: 0.8;
}

.bar-value {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary-black);
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
}

.bar-label {
    font-size: 11px;
    color: var(--secondary-grey);
    text-align: center;
    margin-top: 8px;
}

/* Bar color variants */
.bar.blue   { background: linear-gradient(180deg, var(--info) 0%, #2563EB 100%); }
.bar.green  { background: linear-gradient(180deg, var(--success) 0%, #16A34A 100%); }
.bar.red    { background: linear-gradient(180deg, var(--danger) 0%, #DC2626 100%); }
.bar.dark   { background: linear-gradient(180deg, var(--dark-black) 0%, var(--primary-black) 100%); }

/* Horizontal Bar Chart */
.h-bar-chart {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.h-bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.h-bar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.h-bar-label {
    font-size: 13px;
    color: var(--primary-black);
    font-weight: 500;
}

.h-bar-value {
    font-size: 13px;
    color: var(--secondary-grey);
    font-weight: 600;
}

.h-bar-track {
    height: 8px;
    background-color: var(--light-grey);
    border-radius: 4px;
    overflow: hidden;
}

.h-bar-fill {
    height: 100%;
    border-radius: 4px;
    background-color: var(--primary-orange);
    transition: width var(--transition-slow);
}

/* Horizontal bar color variants */
.h-bar-fill.blue   { background-color: var(--info); }
.h-bar-fill.green  { background-color: var(--success); }
.h-bar-fill.red    { background-color: var(--danger); }
.h-bar-fill.orange { background-color: var(--primary-orange); }
.h-bar-fill.dark   { background-color: var(--primary-black); }
.h-bar-fill.grey   { background-color: var(--secondary-grey); }

/* Donut / Circle Progress (CSS only) */
.donut-chart {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.donut-chart-inner {
    width: 90px;
    height: 90px;
    background-color: var(--white);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.donut-chart-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-black);
}

.donut-chart-label {
    font-size: 11px;
    color: var(--secondary-grey);
}

/* Legend */
.chart-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.chart-legend.horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--secondary-grey);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.legend-dot.orange { background-color: var(--primary-orange); }
.legend-dot.blue   { background-color: var(--info); }
.legend-dot.green  { background-color: var(--success); }
.legend-dot.red    { background-color: var(--danger); }
.legend-dot.grey   { background-color: var(--secondary-grey); }
.legend-dot.dark   { background-color: var(--primary-black); }

/* Mini sparkline bars */
.mini-chart {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
}

.mini-chart .mini-bar {
    width: 4px;
    background-color: var(--primary-orange);
    border-radius: 2px;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.mini-chart .mini-bar:last-child {
    opacity: 1;
}

/* ========== Tables ========== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    padding: 14px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-grey);
    background-color: var(--light-grey);
    border-bottom: 1px solid var(--border-grey);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--primary-black);
    border-bottom: 1px solid var(--border-grey);
    vertical-align: middle;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: rgba(249, 115, 22, 0.02);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-cell-primary {
    font-weight: 600;
    color: var(--primary-black);
}

.table-cell-secondary {
    color: var(--secondary-grey);
    font-size: 13px;
}

.table-cell-id {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--secondary-grey);
}

/* ========== Status Badges ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-approved, .badge-active, .badge-resolved, .badge-success, .badge-completed {
    background-color: var(--success-light);
    color: var(--success);
}

.badge-pending, .badge-warning, .badge-in-progress {
    background-color: var(--light-orange);
    color: var(--dark-orange);
}

.badge-rejected, .badge-danger, .badge-closed, .badge-failed, .badge-overdue {
    background-color: var(--danger-light);
    color: var(--danger);
}

.badge-suspended, .badge-inactive, .badge-grey, .badge-draft {
    background-color: var(--light-grey);
    color: var(--secondary-grey);
}

.badge-info, .badge-open {
    background-color: var(--info-light);
    color: var(--info);
}

/* ========== Buttons ========== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-orange);
    color: var(--white);
    border-color: var(--primary-orange);
}

.btn-primary:hover {
    background-color: var(--dark-orange);
    border-color: var(--dark-orange);
}

.btn-secondary {
    background-color: var(--primary-black);
    color: var(--white);
    border-color: var(--primary-black);
}

.btn-secondary:hover {
    background-color: var(--dark-black);
}

.btn-outline {
    background-color: var(--white);
    color: var(--primary-black);
    border-color: var(--border-grey);
}

.btn-outline:hover {
    background-color: var(--light-grey);
    border-color: var(--secondary-grey);
}

.btn-outline-orange {
    background-color: var(--white);
    color: var(--primary-orange);
    border-color: var(--primary-orange);
}

.btn-outline-orange:hover {
    background-color: var(--light-orange);
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-danger:hover {
    background-color: #DC2626;
}

.btn-success {
    background-color: var(--success);
    color: var(--white);
    border-color: var(--success);
}

.btn-success:hover {
    background-color: #16A34A;
}

/* Button sizes */
.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 15px;
}

/* Icon-only button */
.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

.btn-icon.btn-sm {
    width: 32px;
    height: 32px;
}

/* Table action buttons */
.action-btns {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 13px;
}

.action-btn-view {
    background-color: var(--info-light);
    color: var(--info);
}
.action-btn-view:hover {
    background-color: var(--info);
    color: var(--white);
}

.action-btn-edit {
    background-color: var(--light-orange);
    color: var(--primary-orange);
}
.action-btn-edit:hover {
    background-color: var(--primary-orange);
    color: var(--white);
}

.action-btn-approve {
    background-color: var(--success-light);
    color: var(--success);
}
.action-btn-approve:hover {
    background-color: var(--success);
    color: var(--white);
}

.action-btn-reject, .action-btn-delete {
    background-color: var(--danger-light);
    color: var(--danger);
}
.action-btn-reject:hover, .action-btn-delete:hover {
    background-color: var(--danger);
    color: var(--white);
}

/* ========== Filters & Search ========== */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--secondary-grey);
}

.filter-select,
.filter-input {
    padding: 8px 14px;
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--primary-black);
    background-color: var(--white);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.search-input-group {
    position: relative;
}

.search-input-group input {
    padding: 8px 14px 8px 36px;
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--primary-black);
    background-color: var(--white);
    width: 240px;
    transition: all var(--transition-fast);
}

.search-input-group input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.search-input-group i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-grey);
    font-size: 13px;
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
}

.pagination-info {
    font-size: 13px;
    color: var(--secondary-grey);
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-grey);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.pagination-btn:hover {
    background-color: var(--light-grey);
    color: var(--primary-black);
}

.pagination-btn.active {
    background-color: var(--primary-orange);
    color: var(--white);
    border-color: var(--primary-orange);
}

/* ========== Activity Timeline ========== */
.activity-timeline {
    padding: 4px 0;
}

.timeline-item {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    position: relative;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 52px;
    bottom: -2px;
    width: 2px;
    background-color: var(--border-grey);
}

.timeline-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.timeline-icon.orange { background-color: var(--light-orange); color: var(--primary-orange); }
.timeline-icon.green  { background-color: var(--success-light);color: var(--success); }
.timeline-icon.blue   { background-color: var(--info-light);   color: var(--info); }
.timeline-icon.red    { background-color: var(--danger-light); color: var(--danger); }

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-black);
    margin-bottom: 2px;
}

.timeline-title span {
    color: var(--primary-orange);
    font-weight: 600;
}

.timeline-time {
    font-size: 12px;
    color: var(--secondary-grey);
}

/* ========== Subscription Plan Cards ========== */
.subscription-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.subscription-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-grey);
    box-shadow: var(--shadow-xs);
    padding: 24px;
    text-align: center;
    transition: all var(--transition-normal);
}

.subscription-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.subscription-card.featured {
    border-color: var(--primary-orange);
    position: relative;
}

.subscription-card.featured::before {
    content: 'Popular';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-orange);
    color: var(--white);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 14px;
    border-radius: 0 0 8px 8px;
}

.subscription-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto 16px;
}

.subscription-card-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-black);
    margin-bottom: 4px;
}

.subscription-card-price {
    font-size: 14px;
    color: var(--secondary-grey);
    margin-bottom: 20px;
}

.subscription-stats {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.subscription-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-grey);
    font-size: 13px;
}

.subscription-stat:last-child {
    border-bottom: none;
}

.subscription-stat-label {
    color: var(--secondary-grey);
}

.subscription-stat-value {
    font-weight: 600;
    color: var(--primary-black);
}

/* ========== Support Section ========== */
.support-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.support-card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-grey);
    box-shadow: var(--shadow-xs);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition-normal);
}

.support-card:hover {
    box-shadow: var(--shadow-md);
}

.support-card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.support-card-info h4 {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-black);
    line-height: 1.2;
}

.support-card-info p {
    font-size: 13px;
    color: var(--secondary-grey);
}

/* ========== Grid Layouts ========== */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.grid-2-1 {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 24px;
}

.grid-1-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    gap: 24px;
}

/* ========== Forms ========== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-black);
    margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-grey);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--primary-black);
    background-color: var(--white);
    transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--secondary-grey);
    margin-top: 4px;
}

/* ========== Tabs ========== */
.tabs {
    display: flex;
    border-bottom: 2px solid var(--border-grey);
    margin-bottom: 24px;
    gap: 0;
}

.tab-item {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-grey);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab-item:hover {
    color: var(--primary-black);
}

.tab-item.active {
    color: var(--primary-orange);
    border-bottom-color: var(--primary-orange);
    font-weight: 600;
}

/* ========== Empty State ========== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: var(--light-orange);
    color: var(--primary-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin: 0 auto 20px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-black);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 14px;
    color: var(--secondary-grey);
    margin-bottom: 24px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ========== Tags ========== */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background-color: var(--light-grey);
    color: var(--secondary-grey);
}

.tag-orange {
    background-color: var(--light-orange);
    color: var(--primary-orange);
}

.tag-blue {
    background-color: var(--info-light);
    color: var(--info);
}

.tag-green {
    background-color: var(--success-light);
    color: var(--success);
}

/* ========== Toggle Switch (CSS Only) ========== */
.toggle {
    width: 44px;
    height: 24px;
    background-color: var(--border-grey);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    flex-shrink: 0;
}

.toggle.active {
    background-color: var(--primary-orange);
}

.toggle::after {
    content: '';
    width: 18px;
    height: 18px;
    background-color: var(--white);
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle.active::after {
    transform: translateX(20px);
}

/* ========== Avatars ========== */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: var(--white);
    flex-shrink: 0;
}

.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg  { width: 48px; height: 48px; font-size: 18px; }
.avatar-xl  { width: 64px; height: 64px; font-size: 24px; }

.avatar-orange { background-color: var(--primary-orange); }
.avatar-blue   { background-color: var(--info); }
.avatar-green  { background-color: var(--success); }
.avatar-red    { background-color: var(--danger); }
.avatar-grey   { background-color: var(--secondary-grey); }
.avatar-dark   { background-color: var(--primary-black); }

/* ========== List Group ========== */
.list-group {
    display: flex;
    flex-direction: column;
}

.list-group-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-grey);
}

.list-group-item:last-child {
    border-bottom: none;
}

/* ========== Info Rows ========== */
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-grey);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row-label {
    font-size: 14px;
    color: var(--secondary-grey);
}

.info-row-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-black);
}

/* ========== Utility Classes ========== */

/* Text colors */
.text-orange { color: var(--primary-orange); }
.text-green  { color: var(--success); }
.text-red    { color: var(--danger); }
.text-blue   { color: var(--info); }
.text-grey   { color: var(--secondary-grey); }
.text-black  { color: var(--primary-black); }
.text-white  { color: var(--white); }

/* Background colors */
.bg-orange       { background-color: var(--primary-orange); }
.bg-light-orange { background-color: var(--light-orange); }
.bg-green        { background-color: var(--success); }
.bg-light-green  { background-color: var(--success-light); }
.bg-red          { background-color: var(--danger); }
.bg-light-red    { background-color: var(--danger-light); }
.bg-blue         { background-color: var(--info); }
.bg-light-blue   { background-color: var(--info-light); }
.bg-grey         { background-color: var(--light-grey); }
.bg-dark         { background-color: var(--primary-black); }

/* Font weights */
.fw-400 { font-weight: 400; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* Margins */
.mb-0  { margin-bottom: 0; }
.mb-10 { margin-bottom: 10px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.mb-30 { margin-bottom: 30px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

/* Flexbox */
.d-flex         { display: flex; }
.align-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap      { flex-wrap: wrap; }
.flex-col       { flex-direction: column; }
.flex-1         { flex: 1; }
.gap-8  { gap: 8px; }
.gap-10 { gap: 10px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.gap-24 { gap: 24px; }

/* Text */
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* ========== Visual Polish ========== */

/* Soft ambient page background */
body {
    background-color: #F5F6FA;
    background-image:
        radial-gradient(1200px 500px at 100% -10%, rgba(249, 115, 22, 0.07), transparent 60%),
        radial-gradient(900px 400px at 0% 110%, rgba(59, 130, 246, 0.05), transparent 60%);
    background-attachment: fixed;
}

::selection {
    background-color: rgba(249, 115, 22, 0.2);
}

/* Sidebar: deep gradient + pill-style menu items */
.sidebar {
    background: linear-gradient(180deg, #1C1C1E 0%, #121212 100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

.sidebar-logo {
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.35);
}

.sidebar-menu-item {
    padding: 0 12px;
}

.sidebar-menu-item a {
    padding: 10px 14px;
    margin: 2px 0;
    border-left: none;
    border-radius: 10px;
}

.sidebar-menu-item a:hover {
    background-color: rgba(255, 255, 255, 0.06);
}

.sidebar-menu-item a:hover i {
    transform: scale(1.1);
}

.sidebar-menu-item a i {
    transition: transform var(--transition-fast);
}

.sidebar-menu-item.active a {
    color: var(--white);
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.22) 0%, rgba(249, 115, 22, 0.06) 100%);
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.18);
}

.sidebar-menu-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 4px;
    height: 24px;
    border-radius: 0 4px 4px 0;
    background-color: var(--primary-orange);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.6);
    transform: translateY(-50%);
}

.sidebar-menu-label {
    padding: 18px 26px 8px;
}

/* Collapsed rail keeps its own spacing */
.sidebar-collapsed .sidebar-menu-item {
    padding: 3px 0;
}

.sidebar-collapsed .sidebar-menu-item a {
    margin: 0;
}

.sidebar-collapsed .sidebar-menu-label {
    padding: 0;
}

/* Header profile avatar */
.header-profile-img {
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Section titles with accent bar */
.section-title {
    position: relative;
    padding-left: 14px;
    letter-spacing: -0.2px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    bottom: 15%;
    width: 4px;
    border-radius: 4px;
    background: linear-gradient(180deg, #FB923C, var(--dark-orange));
}

.section-subtitle {
    padding-left: 14px;
}

/* Cards */
.card,
.stat-card,
.subscription-card,
.support-card {
    border-radius: 16px;
    border-color: rgba(229, 231, 235, 0.8);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.03);
}

.card {
    transition: box-shadow var(--transition-normal), transform var(--transition-normal);
}

.card:hover {
    box-shadow: 0 12px 24px -8px rgba(16, 24, 40, 0.10), 0 4px 8px -4px rgba(16, 24, 40, 0.05);
}

.stat-card:hover,
.subscription-card:hover,
.support-card:hover {
    box-shadow: 0 16px 32px -12px rgba(249, 115, 22, 0.25), 0 4px 10px -4px rgba(16, 24, 40, 0.06);
}

.card-header {
    border-bottom-color: #F1F2F4;
}

.card-title {
    letter-spacing: -0.2px;
}

/* Stat card icons: subtle gradient tiles */
.stat-card-icon {
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.stat-card-icon.orange { background: linear-gradient(135deg, #FFF4EC 0%, #FFE2CC 100%); }
.stat-card-icon.blue   { background: linear-gradient(135deg, #F0F6FF 0%, #DBEAFE 100%); }
.stat-card-icon.green  { background: linear-gradient(135deg, #F0FDF4 0%, #D1FAE5 100%); }
.stat-card-icon.red    { background: linear-gradient(135deg, #FEF2F2 0%, #FEE2E2 100%); }

.stat-card-value {
    font-weight: 800;
}

.stat-card-footer {
    border-top-style: dashed;
}

/* Clean stat cards on every page: icon + menu, value, label (growth row hidden) */
.stat-card {
    min-height: 200px;
    padding: 22px 24px 28px;
}

.stat-card::after,
.stat-card .stat-card-footer {
    display: none;
}

.stat-card-header {
    align-items: flex-start;
    margin-bottom: 18px;
}

.stat-card-header .stat-card-icon {
    width: 52px;
    height: 52px;
    font-size: 22px;
}

.stat-card .stat-card-value {
    font-size: 30px;
    font-weight: 800;
    margin-bottom: 6px;
}

.stat-card .stat-card-label {
    font-size: 15px;
    margin-bottom: 0;
}

/* Charts */
.bar {
    border-radius: 8px 8px 3px 3px;
    transform-origin: bottom;
    animation: bar-grow 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.bar:hover {
    opacity: 1;
    filter: brightness(1.08);
    box-shadow: 0 6px 14px rgba(249, 115, 22, 0.3);
}

.bar-chart {
    border-bottom: 1px dashed var(--border-grey);
}

.h-bar-track {
    height: 10px;
    border-radius: 6px;
    background-color: #F1F2F5;
}

.h-bar-fill {
    border-radius: 6px;
    transform-origin: left;
    animation: bar-fill 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.h-bar-fill,
.h-bar-fill.orange { background: linear-gradient(90deg, #FDBA74, var(--primary-orange)); }
.h-bar-fill.blue   { background: linear-gradient(90deg, #93C5FD, var(--info)); }
.h-bar-fill.green  { background: linear-gradient(90deg, #86EFAC, var(--success)); }
.h-bar-fill.red    { background: linear-gradient(90deg, #FCA5A5, var(--danger)); }
.h-bar-fill.dark   { background: linear-gradient(90deg, #525252, var(--primary-black)); }
.h-bar-fill.grey   { background: linear-gradient(90deg, #D1D5DB, var(--secondary-grey)); }

.donut-chart-inner {
    box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
}

@keyframes bar-grow {
    from { transform: scaleY(0); }
    to   { transform: scaleY(1); }
}

@keyframes bar-fill {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

/* Tables */
.data-table thead th {
    padding: 16px;
    background-color: #C2410C;
    color: var(--white);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.6px;
    border-bottom: none;
}

.data-table thead th:first-child {
    border-top-left-radius: 12px;
}

.data-table thead th:last-child {
    border-top-right-radius: 12px;
}

.data-table thead th i,
.data-table thead th a {
    color: rgba(255, 255, 255, 0.85);
}

/* Header sits flush under a card header, so square the corners there */
.card-header + .table-container .data-table thead th,
.card-header + .data-table thead th {
    border-radius: 0;
}

.data-table tbody td {
    border-bottom-color: #F1F2F4;
}

.data-table tbody tr:hover {
    background-color: #FFF8F3;
}

/* Badges without an icon get a status dot */
.badge:not(:has(i))::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    margin-right: 6px;
    flex-shrink: 0;
}

.badge i {
    margin-right: 5px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    border-color: transparent;
    box-shadow: 0 6px 14px -4px rgba(249, 115, 22, 0.5);
}

.btn-primary:hover {
    box-shadow: 0 10px 20px -6px rgba(249, 115, 22, 0.6);
    transform: translateY(-1px);
}

.btn-outline:hover,
.btn-outline-orange:hover {
    transform: translateY(-1px);
}

/* Timeline icons */
.timeline-icon {
    box-shadow: 0 0 0 4px var(--white);
}

/* Content entrance animation */
.content-area > * {
    animation: fade-up 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.content-area > *:nth-child(2) { animation-delay: 0.05s; }
.content-area > *:nth-child(3) { animation-delay: 0.10s; }
.content-area > *:nth-child(4) { animation-delay: 0.15s; }
.content-area > *:nth-child(5) { animation-delay: 0.20s; }
.content-area > *:nth-child(n+6) { animation-delay: 0.25s; }

@keyframes fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0s !important;
        transition-duration: 0.01ms !important;
    }
}

/* ========== Listing Pages (stat cards, filters, table actions) ========== */

/* Stat card variant: icon beside an info column */
.stat-card:has(> .stat-card-info) {
    display: flex;
    align-items: center;
    gap: 18px;
}

.stat-card:has(> .stat-card-info) .stat-card-icon {
    width: 56px;
    height: 56px;
    font-size: 22px;
    flex-shrink: 0;
}

.stat-card-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-card-info .stat-card-label {
    order: -1;
    margin-bottom: 2px;
    font-weight: 500;
}

.stat-card-info .stat-card-value {
    margin-bottom: 8px;
}

.stat-card-icon.yellow { background: linear-gradient(135deg, #FEFCE8 0%, #FEF08A 100%); color: #CA8A04; }

.stat-card-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.stat-card-change i { font-size: 10px; }
.stat-card-change.positive { color: #16A34A; background-color: var(--success-light); }
.stat-card-change.negative { color: #DC2626; background-color: var(--danger-light); }

/* Missing badge variants */
.badge-primary {
    background-color: var(--light-orange);
    color: var(--dark-orange);
}

.badge-secondary {
    background-color: var(--light-grey);
    color: var(--secondary-grey);
}

/* Filter bar as a soft panel */
.filter-bar {
    padding: 14px;
    background-color: #FAFAFB;
    border: 1px solid #F1F2F4;
    border-radius: var(--radius-md);
}

.filter-select,
.filter-input {
    height: 42px;
    padding: 0 14px;
    border-radius: 10px;
}

.filter-select:hover,
.filter-input:hover {
    border-color: #D1D5DB;
}

.filter-search {
    position: relative;
    flex: 1;
    min-width: 220px;
}

.filter-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-grey);
    font-size: 14px;
    pointer-events: none;
}

.filter-search input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 40px;
    border: 1px solid var(--border-grey);
    border-radius: 10px;
    background-color: var(--white);
    font-size: 13px;
    color: var(--primary-black);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.filter-search input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.filter-search input:focus + i,
.filter-search:focus-within i {
    color: var(--primary-orange);
}

/* Table: rounded scroll container, readable cells */
.card-body > .table-container {
    border: 1px solid #F1F2F4;
    border-radius: 12px;
}

.table-container .data-table tbody td {
    white-space: nowrap;
}

.data-table tbody tr:nth-child(even) {
    background-color: #FCFCFD;
}

.data-table tbody tr:hover {
    background-color: #FFF8F3;
}

.data-table tbody td strong {
    color: var(--dark-orange);
    font-weight: 600;
}

/* Action buttons */
.action-buttons {
    display: flex;
    align-items: center;
    gap: 6px;
}

.action-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px -4px rgba(16, 24, 40, 0.25);
}

/* Pagination without info text: keep buttons grouped on the right */
.pagination:not(:has(.pagination-info)) {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    padding: 20px 0 0;
}

.pagination-btn {
    border-color: var(--border-grey);
    background-color: var(--white);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    border-color: transparent;
    box-shadow: 0 6px 14px -4px rgba(249, 115, 22, 0.5);
}

.pagination-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination-ellipsis {
    padding: 0 4px;
    color: var(--secondary-grey);
}

/* ========== Shared Page Components ========== */

/* More stat icon tints */
.stat-card-icon.purple { background: linear-gradient(135deg, #F5F3FF 0%, #E0E7FF 100%); color: #6366F1; }
.stat-card-icon.grey   { background: linear-gradient(135deg, #F9FAFB 0%, #E5E7EB 100%); color: var(--secondary-grey); }

/* Stat card info using h3 / p */
.stat-card-info h3 {
    font-size: 26px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.5px;
    color: var(--primary-black);
}

.stat-card-info p {
    font-size: 13px;
    color: var(--secondary-grey);
    margin-top: 2px;
}

/* Trend chip pinned to the card's top-right */
.stat-card:has(> .stat-card-trend) {
    padding-right: 90px;
}

.stat-card-trend {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.stat-card-trend i { font-size: 10px; }
.stat-card-trend.trend-up   { color: #16A34A; background-color: var(--success-light); }
.stat-card-trend.trend-down { color: #DC2626; background-color: var(--danger-light); }

/* Tabs written as .tab links */
.tabs:has(> .tab) {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    background-color: var(--light-grey);
    border-radius: 12px;
    border-bottom: none;
    margin-bottom: 0;
    max-width: 100%;
    overflow-x: auto;
}

.tab {
    padding: 8px 18px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 500;
    color: var(--secondary-grey);
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.tab:hover {
    color: var(--primary-black);
}

.tab.active {
    background-color: var(--white);
    color: var(--dark-orange);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.1);
}

/* Toggle switch: <label class="toggle-switch"><input type="checkbox"><span class="toggle-slider"></span></label> */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background-color: #D1D5DB;
    border-radius: 24px;
    transition: background-color var(--transition-normal);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background-color: var(--white);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-normal);
}

.toggle-switch input:checked + .toggle-slider {
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.25);
}

/* Standalone action buttons (card footers) */
.action-btn-primary,
.action-btn-warning,
.action-btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 38px;
    height: 38px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.action-btn-primary {
    background-color: var(--light-orange);
    color: var(--dark-orange);
}

.action-btn-primary:hover {
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    color: var(--white);
    box-shadow: 0 6px 14px -4px rgba(249, 115, 22, 0.5);
}

.action-btn-warning {
    background-color: var(--warning-light);
    color: #CA8A04;
}

.action-btn-warning:hover {
    background-color: #EAB308;
    color: var(--white);
}

.action-btn-danger {
    background-color: var(--danger-light);
    color: var(--danger);
}

.action-btn-danger:hover {
    background-color: var(--danger);
    color: var(--white);
}

/* Cards placed directly in a grid (plan / role / integration cards) */
.stats-grid > .card,
.grid-2 > .card,
.grid-3 > .card,
.grid-4 > .card {
    position: relative;
}

.stats-grid > .card:hover,
.grid-3 > .card:hover,
.grid-4 > .card:hover {
    transform: translateY(-4px);
    border-color: rgba(249, 115, 22, 0.25);
}

/* Inputs */
.form-input,
.form-select,
.form-textarea {
    border-radius: 10px;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
    border-color: #D1D5DB;
}

/* ========== Sidebar Logout ========== */
.sidebar-logout {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-menu-item button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 10px 14px;
    margin: 2px 0;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.sidebar-menu-item button i {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
}

.sidebar-logout button:hover {
    color: #FCA5A5;
    background-color: rgba(239, 68, 68, 0.12);
}

.sidebar-collapsed .sidebar-logout {
    margin: 10px 0 0;
}

.sidebar-collapsed .sidebar-menu-item form {
    display: flex;
    justify-content: center;
}

.sidebar-collapsed .sidebar-menu-item button {
    width: 46px;
    height: 46px;
    padding: 0;
    gap: 0;
    margin: 0;
    justify-content: center;
    border-radius: var(--radius-md);
}

.sidebar-collapsed .sidebar-menu-item button span {
    display: none;
}

.sidebar-collapsed .sidebar-menu-item button i {
    font-size: 17px;
}

/* ========== Header Profile Dropdown ========== */
.header-profile {
    position: relative;
}

.header-profile .fa-chevron-down {
    transition: transform var(--transition-fast);
}

.header-profile.open .fa-chevron-down {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 240px;
    padding: 8px;
    background-color: var(--white);
    border: 1px solid var(--border-grey);
    border-radius: 14px;
    box-shadow: 0 20px 40px -12px rgba(16, 24, 40, 0.2), 0 4px 10px -4px rgba(16, 24, 40, 0.08);
    cursor: default;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    z-index: 1000;
}

.header-profile.open .profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 14px;
    margin-bottom: 6px;
    border-bottom: 1px solid #F1F2F4;
}

.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary-black);
    text-align: left;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.profile-dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--secondary-grey);
    transition: color var(--transition-fast);
}

.profile-dropdown-item:hover {
    background-color: var(--light-orange);
    color: var(--dark-orange);
}

.profile-dropdown-item:hover i {
    color: var(--dark-orange);
}

.profile-dropdown-item.logout {
    color: var(--danger);
}

.profile-dropdown-item.logout i {
    color: var(--danger);
}

.profile-dropdown-item.logout:hover {
    background-color: var(--danger-light);
    color: #DC2626;
}

.profile-dropdown-divider {
    height: 1px;
    margin: 6px 4px;
    background-color: #F1F2F4;
}

/* ========== Profile Page ========== */
.profile-hero {
    overflow: hidden;
}

.profile-cover {
    height: 140px;
    background:
        radial-gradient(400px 160px at 85% 0%, rgba(255, 255, 255, 0.25), transparent 70%),
        linear-gradient(120deg, #1C1C1E 0%, #7C2D12 55%, var(--primary-orange) 100%);
}

.profile-hero-body {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 0 28px 24px;
    margin-top: -44px;
    flex-wrap: wrap;
}

.profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 24px;
    border: 4px solid var(--white);
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    color: var(--white);
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px -8px rgba(249, 115, 22, 0.6);
    flex-shrink: 0;
}

.profile-hero-info {
    flex: 1;
    min-width: 200px;
    margin-top: 56px;
    padding-bottom: 4px;
}

.profile-hero-info h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--primary-black);
}

.profile-hero-info p {
    font-size: 14px;
    color: var(--secondary-grey);
}

.profile-hero-info p i {
    color: var(--primary-orange);
    margin-right: 4px;
}

/* ========== Module Pages (CRM, HR, AI, Reports, Support, Audit, Tools) ========== */
.w-100 { width: 100%; justify-content: center; }
.ml-auto { margin-left: auto; }

.legend-item strong {
    color: var(--primary-black);
    font-weight: 600;
}

/* Avatar + name cell */
.person-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.person-cell .avatar {
    flex-shrink: 0;
}

/* Long text inside nowrap tables */
.data-table td .text-wrap {
    display: block;
    min-width: 220px;
    max-width: 320px;
    white-space: normal;
}

/* Settings row with toggle */
.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid #F1F2F4;
}

.setting-row:last-child {
    border-bottom: none;
}

/* Star ratings */
.stars {
    display: inline-flex;
    gap: 2px;
    color: #F59E0B;
    font-size: 12px;
}

.stars .fa-regular,
.stars .far {
    color: #D1D5DB;
}

.rating-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px dashed var(--border-grey);
}

.rating-big {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    color: var(--primary-black);
}

.rating-summary .stars {
    font-size: 16px;
    margin-bottom: 4px;
}

/* AI image gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.gallery-item {
    border: 1px solid #F1F2F4;
    border-radius: 12px;
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -10px rgba(16, 24, 40, 0.2);
}

.gallery-thumb {
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 28px;
}

.gallery-thumb.thumb-sm {
    width: 56px;
    border-radius: 8px;
    font-size: 16px;
}

.gallery-thumb.g1 { background: linear-gradient(135deg, #F97316, #7C2D12); }
.gallery-thumb.g2 { background: linear-gradient(135deg, #FBBF24, #EA580C); }
.gallery-thumb.g3 { background: linear-gradient(135deg, #F472B6, #9D174D); }
.gallery-thumb.g4 { background: linear-gradient(135deg, #1F2937, #F97316); }
.gallery-thumb.g5 { background: linear-gradient(135deg, #34D399, #047857); }
.gallery-thumb.g6 { background: linear-gradient(135deg, #60A5FA, #1E3A8A); }

.gallery-info {
    padding: 10px 12px;
    font-size: 13px;
}

/* QR preview */
.qr-preview {
    width: 140px;
    height: 140px;
    margin: 0 auto 20px;
    border-radius: 16px;
    border: 2px dashed rgba(249, 115, 22, 0.4);
    background-color: #FFF8F3;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    color: var(--primary-black);
}

/* Website builder workflow */
.workflow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.workflow-step {
    position: relative;
    text-align: center;
    padding: 8px;
}

.workflow-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 30px;
    left: calc(50% + 36px);
    right: calc(-50% + 36px);
    height: 2px;
    background: repeating-linear-gradient(90deg, #FDBA74 0 6px, transparent 6px 12px);
}

.workflow-step-icon {
    width: 48px;
    height: 48px;
    margin: 6px auto 10px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--white);
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    box-shadow: 0 8px 16px -6px rgba(249, 115, 22, 0.55);
}

.workflow-step:last-child .workflow-step-icon {
    background: linear-gradient(135deg, #4ADE80 0%, #16A34A 100%);
    box-shadow: 0 8px 16px -6px rgba(34, 197, 94, 0.55);
}

.workflow-step-count {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary-black);
    line-height: 1.2;
}

.workflow-step-label {
    font-size: 13px;
    color: var(--secondary-grey);
}

@media (max-width: 768px) {
    .gallery-grid,
    .workflow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .workflow-step::after {
        display: none;
    }
}

/* ========== Layout Refinements ========== */

/* Plan ribbon: corner pill so it never covers the plan icon */
.plan-ribbon {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    padding: 4px 12px;
    border-radius: 20px;
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    box-shadow: 0 6px 14px -4px rgba(249, 115, 22, 0.5);
}

/* Cards whose content isn't wrapped in .card-body still get padding */
.card:not(.profile-hero):not(.chat-layout):not(:has(> .card-header, > .card-body, > .table-container, > .card-footer, > .tabs)) {
    padding: 22px;
}

/* Filter bar as the last thing in a card: no trailing gap */
.card-body > .filter-bar:last-child {
    margin-bottom: 0;
}

/* Chips and footer notes stay on one line */
.stat-growth,
.stat-card-change,
.stat-card-trend {
    white-space: nowrap;
}

.stat-card-footer {
    flex-wrap: wrap;
    row-gap: 6px;
}

.stat-card-footer > span:last-child {
    white-space: nowrap;
}

/* Icon-beside-text stat cards: stack vertically when the grid is narrow */
.stats-grid {
    container-type: inline-size;
    container-name: stats;
}

@container stats (max-width: 1150px) {
    .stat-card:has(> .stat-card-info) {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .stat-card:has(> .stat-card-trend) {
        padding-right: 24px;
    }

    .stat-card:has(> .stat-card-info) .stat-card-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}

/* Tables need the full width: stack table + side card until the screen is wide */
@media (max-width: 1500px) {
    .grid-2-1:has(.data-table),
    .grid-1-2:has(.data-table) {
        grid-template-columns: minmax(0, 1fr);
    }

    /* Donut side cards get a horizontal layout once they're full width */
    .grid-2-1:has(.data-table) .card-body:has(> .donut-chart),
    .grid-1-2:has(.data-table) .card-body:has(> .donut-chart) {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 48px;
        flex-wrap: wrap;
    }

    .grid-2-1:has(.data-table) .card-body:has(> .donut-chart) .chart-legend,
    .grid-1-2:has(.data-table) .card-body:has(> .donut-chart) .chart-legend {
        margin-top: 0;
        min-width: 220px;
    }

    .grid-2-1:has(.data-table) .card-body > .donut-chart,
    .grid-1-2:has(.data-table) .card-body > .donut-chart {
        margin: 0;
    }
}

/* ========== Rewards Components (loyalty card, coupons, receipt) ========== */
/* Loyalty stamp card */
.loyalty-card {
    padding: 22px;
    border-radius: 18px;
    color: var(--white);
    background:
        radial-gradient(260px 120px at 100% 0%, rgba(255, 255, 255, 0.18), transparent 70%),
        linear-gradient(135deg, #1C1C1E 0%, #7C2D12 60%, var(--primary-orange) 100%);
    box-shadow: 0 16px 32px -16px rgba(124, 45, 18, 0.7);
}

.loyalty-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.loyalty-card-top i {
    font-size: 26px;
    color: #FDBA74;
}

.loyalty-card-brand {
    font-size: 17px;
    font-weight: 700;
}

.loyalty-card-sub,
.loyalty-card-bottom {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
}

.stamps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 52px));
    gap: 12px;
    margin-bottom: 18px;
}

.stamp {
    aspect-ratio: 1;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.4);
}

.stamp.filled {
    border: none;
    background: linear-gradient(135deg, #FDBA74, var(--primary-orange));
    color: var(--white);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.loyalty-card-bottom {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* Coupons */
.coupon-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.coupon {
    display: flex;
    background-color: var(--white);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 16px;
    overflow: hidden;
}

.coupon.is-expired {
    opacity: 0.6;
}

.coupon-left {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 140px;
    padding: 18px;
    background-color: #FFF8F3;
    border-right: 2px dashed rgba(249, 115, 22, 0.35);
}

.coupon-code {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--dark-orange);
    letter-spacing: 1px;
}

.coupon-right {
    flex: 1;
    min-width: 0;
    padding: 18px;
}

.coupon-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--secondary-grey);
}

/* Receipt preview */
.receipt {
    padding: 20px;
    border: 1px dashed var(--border-grey);
    border-radius: 12px;
    background-color: #FCFCFD;
    font-size: 13px;
}

.receipt-head {
    text-align: center;
    padding-bottom: 14px;
    margin-bottom: 10px;
    border-bottom: 1px dashed var(--border-grey);
}

.receipt-row,
.receipt-total {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}

.receipt-total {
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-grey);
    font-size: 16px;
    font-weight: 800;
}

.receipt-foot {
    margin-top: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
}

@media (max-width: 1024px) {
    .coupon-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 768px) {
    .coupon {
        flex-direction: column;
    }

    .coupon-left {
        border-right: none;
        border-bottom: 2px dashed rgba(249, 115, 22, 0.35);
    }
}

/* ========== Quick Actions ========== */
/* Quick actions row */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
}

.quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 18px 10px;
    background-color: var(--white);
    border: 1px solid rgba(229, 231, 235, 0.8);
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.quick-action:hover {
    transform: translateY(-3px);
    border-color: rgba(249, 115, 22, 0.3);
    box-shadow: 0 12px 24px -12px rgba(249, 115, 22, 0.35);
}

.quick-action-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.quick-action-icon.orange { background-color: var(--light-orange); color: var(--primary-orange); }
.quick-action-icon.blue   { background-color: var(--info-light); color: var(--info); }
.quick-action-icon.green  { background-color: var(--success-light); color: #16A34A; }
.quick-action-icon.purple { background-color: #EEF2FF; color: #6366F1; }
.quick-action-icon.grey   { background-color: var(--light-grey); color: var(--primary-black); }
.quick-action-icon.yellow { background-color: var(--warning-light); color: #CA8A04; }

@media (max-width: 1280px) {
    .quick-actions {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ========== Chat ========== */
/* Chat */
.chat-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    height: 640px;
    padding: 0;
}

.chat-sidebar {
    border-right: 1px solid #F1F2F4;
    overflow-y: auto;
    padding: 14px;
}

.chat-search {
    margin-bottom: 10px;
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    transition: background-color var(--transition-fast);
}

.chat-contact:hover,
.chat-contact.active {
    background-color: #FFF8F3;
}

.chat-contact-info {
    flex: 1;
    min-width: 0;
}

.chat-contact-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    font-size: 14px;
}

.chat-preview {
    font-size: 12px;
    color: var(--secondary-grey);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-time {
    font-size: 11px;
    color: #9CA3AF;
    white-space: nowrap;
}

.chat-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background-color: var(--primary-orange);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #F1F2F4;
}

.chat-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    overflow-y: auto;
    background-color: #FAFAFB;
}

.chat-msg {
    max-width: 70%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-msg.out {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg-author {
    font-size: 12px;
    font-weight: 600;
    color: var(--dark-orange);
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 14px 14px 14px 4px;
    background-color: var(--white);
    border: 1px solid #F1F2F4;
    font-size: 14px;
    line-height: 1.5;
}

.chat-msg.out .chat-bubble {
    border-radius: 14px 14px 4px 14px;
    border: none;
    background: linear-gradient(135deg, #FB923C 0%, var(--dark-orange) 100%);
    color: var(--white);
}

.chat-input {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #F1F2F4;
}

.chat-input input {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-grey);
    border-radius: 12px;
    font-size: 14px;
}

.chat-input input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.chat-input .btn {
    height: 44px;
}

@media (max-width: 1024px) {
    .chat-layout {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
    }

    .chat-sidebar {
        border-right: none;
        border-bottom: 1px solid #F1F2F4;
        max-height: 260px;
    }

    .chat-messages {
        min-height: 360px;
    }
}

@media (max-width: 768px) {
    .chat-msg {
        max-width: 90%;
    }
}

/* ========== Mobile Sidebar Overlay ========== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ========== Responsive Design ========== */

/* Large screens down */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .stats-grid,
    .subscription-grid,
    .support-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content,
    .sidebar-collapsed .main-content {
        margin-left: 0;
    }

    .analytics-grid,
    .grid-2,
    .grid-2-1,
    .grid-1-2 {
        grid-template-columns: 1fr;
    }

    .header-search input {
        width: 180px;
    }

    .header-profile-info {
        display: none;
    }
}

/* Small tablet / large phone */
@media (max-width: 768px) {
    .content-area {
        padding: 20px 16px;
    }

    .top-header {
        padding: 0 16px;
    }

    .stats-grid,
    .subscription-grid,
    .support-grid,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .header-search {
        display: none;
    }

    .header-divider {
        display: none;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .bar-chart {
        height: 150px;
    }

    .pagination {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tabs {
        overflow-x: auto;
    }
}

/* Phone */
@media (max-width: 480px) {
    .page-title {
        font-size: 16px;
    }

    .breadcrumb {
        display: none;
    }

    .stat-card-value {
        font-size: 24px;
    }

    .content-area {
        padding: 16px 12px;
    }

    .card-body {
        padding: 16px;
    }

    .card-header {
        padding: 16px;
    }
}

/* ========== Print Styles ========== */
@media print {
    .sidebar,
    .top-header,
    .sidebar-overlay,
    .mobile-menu-toggle {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
    }

    .stat-card:hover,
    .subscription-card:hover,
    .support-card:hover {
        transform: none;
        box-shadow: var(--shadow-xs);
    }
}
