/* styles.css */
:root {
    /* Colors */
    --primary-blue: #3B82F6;
    --dark-blue: #1D4ED8;
    --light-blue-tint: #e6edf8;
    --chart-blue-light: #93C5FD;
    --chart-blue-dark: #266bff;

    --bg-main: #f1f3f8;
    --bg-card: #FFFFFF;

    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;

    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;

    --border-color: #e2e7f0;

    /* Shadows & Radii */
    --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.08);
    --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.05);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 16px;

    /* Typography */
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Application Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 240px;
    background-color: var(--bg-card);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 1000;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* Ã¢â€â‚¬Ã¢â€â‚¬ Sidebar Toggle Button Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */
.sidebar-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.2s, color 0.2s;
}

.sidebar-toggle-btn:hover {
    background: var(--light-blue-tint);
    color: var(--primary-blue);
}

.sidebar-toggle-btn i {
    width: 18px;
    height: 18px;
    transition: transform 0.28s ease;
}

/* Ã¢â€â‚¬Ã¢â€â‚¬ Collapsed Sidebar Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬Ã¢â€â‚¬ */

/* Ensure all menu icons never shrink */
.menu-item a i,
.sidebar-toggle-btn i {
    flex-shrink: 0;
}

/* Animate text spans out: max-width trick keeps icons untouched */
.menu-item a span,
.badge,
.logo span {
    transition: max-width 0.25s ease, opacity 0.2s ease;
    max-width: 200px;
    overflow: hidden;
    white-space: nowrap;
}

.app-container.sidebar-collapsed .sidebar {
    width: 64px;
}

/* Fade and collapse text spans inside links */
.app-container.sidebar-collapsed .menu-item a span,
.app-container.sidebar-collapsed .badge,
.app-container.sidebar-collapsed .logo span {
    max-width: 0;
    opacity: 0;
    pointer-events: none;
}

/* Hide block-level section labels and sub-menus entirely */
.app-container.sidebar-collapsed .menu-label,
.app-container.sidebar-collapsed .submenu-arrow,
.app-container.sidebar-collapsed .sub-menu {
    display: none !important;
}

/* Centre icons in the narrow rail */
.app-container.sidebar-collapsed .menu-item a {
    justify-content: center;
    padding: 12px 0;
}

.app-container.sidebar-collapsed .menu-item a i {
    margin-right: 0;
}

/* Header: hide logo text, keep logo image */
.app-container.sidebar-collapsed .sidebar-header {
    justify-content: center;
    padding: 0;
    gap: 0;
}

.app-container.sidebar-collapsed .logo {
    width: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0;
    margin: 0;
}

/* Menu padding tighter in compact mode */
.app-container.sidebar-collapsed .sidebar-menu {
    padding: 16px 8px;
}

/* Sidebar Hover Expand */
.app-container.sidebar-collapsed .sidebar:hover {
    width: 240px;
    z-index: 1000;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.1);
}

.app-container.sidebar-collapsed .sidebar:hover .logo {
    width: auto;
    opacity: 1;
    overflow: visible;
}

.app-container.sidebar-collapsed .sidebar:hover .sidebar-header {
    justify-content: space-between;
    padding: 0 24px;
}

.app-container.sidebar-collapsed .sidebar:hover .menu-item a {
    justify-content: flex-start;
    padding: 12px 20px;
}

.app-container.sidebar-collapsed .sidebar:hover .menu-item a i {
    margin-right: 12px;
}

.app-container.sidebar-collapsed .sidebar:hover .menu-item a span,
.app-container.sidebar-collapsed .sidebar:hover .badge,
.app-container.sidebar-collapsed .sidebar:hover .logo span {
    max-width: 200px;
    opacity: 1;
    pointer-events: auto;
}

.app-container.sidebar-collapsed .sidebar:hover .menu-label,
.app-container.sidebar-collapsed .sidebar:hover .submenu-arrow,
.app-container.sidebar-collapsed .sidebar:hover .sub-menu {
    display: block !important;
}

.app-container.sidebar-collapsed .sidebar:hover .sidebar-menu {
    padding: 24px 16px;
}

/* Keep menu items as a containing block for future tooltips */
.app-container.sidebar-collapsed .menu-item {
    position: relative;
}


.sidebar-header {
    height: 70px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-icon {
    color: var(--primary-blue);
    width: 24px;
    height: 24px;
}

.logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
}

.mobile-close-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
}

.sidebar-menu {
    flex: 1;
    overflow-y: auto;
    padding: 24px 16px;
}

/* Hide scrollbar for clean look */
.sidebar-menu::-webkit-scrollbar {
    width: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 4px;
}

.menu-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    margin-top: 24px;
    padding-left: 12px;
}

.menu-label:first-child {
    margin-top: 0;
}

.menu-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-item a {
    display: flex;
    align-items: center;
    padding: 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.25s ease-in-out;
    position: relative;
}

.menu-item a i {
    width: 18px;
    height: 18px;
    margin-right: 12px;
}

.menu-item:hover a {
    color: var(--primary-blue);
    background-color: rgba(59, 130, 246, 0.05);
}

.menu-item.active a {
    background-color: var(--light-blue-tint);
    color: var(--primary-blue);
}

.menu-item.active a i {
    color: var(--primary-blue);
}

/* Sub-menu Styles */
.menu-item-has-submenu>a {
    justify-content: space-between;
}

.submenu-arrow {
    width: 14px !important;
    height: 14px !important;
    margin-right: 0 !important;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.menu-item.expanded .submenu-arrow {
    transform: rotate(180deg);
}

.sub-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0, 0, 0, 0.02);
}

.menu-item.expanded .sub-menu {
    max-height: 500px;
    /* Adjust based on content */
    padding-bottom: 8px;
}

.sub-menu-item {
    padding-left: 44px;
}

.sub-menu-item a {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.sub-menu-item a:hover {
    color: var(--primary-blue);
}

/* Nested Menu Styles */
.nested-menu-item>a {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center;
}

.nested-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background-color: rgba(0, 0, 0, 0.02);
}

.nested-menu-item.expanded .nested-menu {
    max-height: 500px;
    /* Allow for many dynamic links */
    padding-bottom: 8px;
}

.nested-link-item {
    padding-left: 20px;
}

.nested-link-item a {
    font-size: 12px !important;
    padding: 6px 16px !important;
    opacity: 0.8;
}

.nested-link-item a:hover {
    opacity: 1;
    background-color: rgba(59, 130, 246, 0.03);
}

.badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
}

.badge-blue {
    background-color: var(--primary-blue);
    color: white;
}

.badge-blue-light {
    background-color: var(--light-blue-tint);
    color: var(--primary-blue);
}

.badge-red {
    background-color: var(--danger);
    color: white;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    width: calc(100% - 240px);
    transition: margin-left 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        width 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 0; /* Prevents overflow in flex containers */
}

.app-container.sidebar-collapsed .main-content {
    margin-left: 64px;
    width: calc(100% - 64px);
}

/* Header */
.header {
    height: 70px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left .welcome-message {
    font-size: 18px;
    font-weight: 60 0;
    color: var(--text-dark);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-search-inline {
    display: flex;
    align-items: center;
    background: #F3F4F6;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    padding: 6px 12px;
    width: 200px;
    transition: all 0.2s;
}

.header-search-inline:focus-within {
    background: #fff;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    width: 280px;
}

.header-search-inline i {
    width: 16px;
    height: 16px;
    color: var(--text-light);
    margin-right: 8px;
}

.header-search-inline input {
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    width: 100%;
    color: var(--text-primary);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
}

.welcome-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.header-action {
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    position: relative;
    transition: color 0.2s;
}

.header-action:hover {
    color: var(--primary-blue);
}

.header-action i {
    width: 20px;
    height: 20px;
}

.lang-flag {
    width: 24px;
    border-radius: 2px;
}

.notification-dot {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background-color: var(--danger);
    border-radius: 50%;
    border: 2px solid var(--bg-main);
}

.header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    user-select: none;
}

.header-profile:hover {
    background: #F9FAFB;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 180px;
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.profile-dropdown.active {
    display: block;
    animation: slideInDown 0.2s ease-out;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background: #F9FAFB;
}

.dropdown-item.logout-item {
    color: var(--danger);
    border-top: 1px solid var(--border-color);
}

.dropdown-item i {
    width: 16px;
    height: 16px;
}

.avatar,
.avatar-initials {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-initials {
    background-color: var(--primary-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

.profile-name {
    font-size: 14px;
    font-weight: 500;
}

.profile-chevron {
    width: 16px;
    height: 16px;
    color: var(--text-secondary);
}

.floating-settings {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-blue);
    color: white;
    padding: 12px 16px;
    border-radius: 8px 0 0 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: -2px 0 10px rgba(59, 130, 246, 0.3);
    z-index: 100;
    font-size: 12px;
    writing-mode: unset;
}

.floating-settings i {
    width: 18px;
    height: 18px;
}

.floating-settings span {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    margin-top: 8px;
}

/* Dashboard Container */
.dashboard-container {
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.row {
    display: flex;
    gap: 24px;
    width: 100%;
}

.row-top {
    flex-direction: row;
}

.row-bottom {
    flex-direction: row;
}

/* Card General */
.card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    transition: all 0.25s ease-in-out;
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    padding: 20px 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 24px;
    flex: 1;
}

.card-body.pad-zero {
    padding: 0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.card-dropdown i,
.card-dropdown svg {
    width: 14px;
    height: 14px;
    position: absolute;
    right: 0;
    pointer-events: none;
}

.card-dropdown select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-weight: 500;
    cursor: pointer;
    outline: none;
    padding-right: 20px;
    position: relative;
    z-index: 1;
}

.header-more {
    color: var(--text-light);
    cursor: pointer;
    width: 20px;
}

.card-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.refresh-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    color: var(--primary-blue);
    background: var(--light-blue-tint);
}

.refresh-btn i {
    width: 14px;
    height: 14px;
}

.refresh-btn.spinning i {
    animation: spin 1s linear infinite;
}

/* Columns */
.col-overview {
    flex: 1;
    min-width: 0;
}

.col-fpy,
.col-FPY {
    flex: 1;
    min-width: 0;
}

.col-stats {
    flex: 4;
}

.col-products {
    flex: 5;
}

.col-customers {
    flex: 4;
}

.col-categories {
    flex: 3;
}

/* Stats Grid */
.row-stats {
    margin-bottom: 24px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-gap: 24px;
    height: 100%;
}

.stat-card {
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon-wrapper.blue-light {
    background-color: var(--light-blue-tint);
}

.text-blue {
    color: var(--primary-blue);
}

.stat-icon-wrapper i {
    width: 18px;
    height: 18px;
}

.stat-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.stat-more {
    color: var(--text-light);
    width: 18px;
    cursor: pointer;
}

.stat-body {
    margin-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.stat-change {
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-change.positive {
    color: var(--success);
}

.stat-change.negative {
    color: var(--danger);
}

.stat-change i {
    width: 14px;
    height: 14px;
}

.stat-chart-small {
    width: 80px;
    height: 30px;
}

.stat-footer {
    margin-top: 16px;
    font-size: 12px;
    color: var(--text-light);
}

/* Chart Containers */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
}

.donut-container {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Chart Loading Overlay */
.chart-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

.chart-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.donut-inner-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
}

.donut-label {
    font-size: 14px;
    font-weight: 700;
    color: #000000;
}

.donut-value {
    font-size: 32px;
    font-weight: 800;
    color: #000000;
    line-height: 1.2;
}

/* Popular Products */
.featured-product {
    display: flex;
    padding: 24px;
    gap: 20px;
    border-bottom: 1px solid var(--border-color);
}

.featured-img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    background-color: transparent;
    border-radius: var(--radius-sm);
}

.featured-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.product-name {
    font-size: 18px;
    font-weight: 600;
    margin: 12px 0 8px;
}

.product-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.product-stats {
    display: flex;
    align-items: center;
    gap: 24px;
    width: 100%;
}

.p-stat h5 {
    font-size: 16px;
    font-weight: 600;
}

.p-stat span {
    font-size: 12px;
    color: var(--text-secondary);
}

.btn {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background-color 0.2s;
    margin-left: auto;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
}

.btn-primary:hover {
    background-color: var(--dark-blue);
}

.product-list {
    padding: 12px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.product-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-item-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.product-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-item-info h5 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.product-item-info span {
    font-size: 12px;
    color: var(--text-light);
}

.product-item-right {
    text-align: right;
}

.product-item-right h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.product-item-right span {
    font-size: 12px;
    color: var(--text-light);
}

/* Loyal Customers */
.customer-list {
    display: flex;
    flex-direction: column;
}

.customer-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.customer-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.customer-item:first-child {
    padding-top: 0;
}

.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 16px;
}

.customer-info {
    flex: 1;
}

.customer-info h5 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.customer-info span {
    font-size: 12px;
    color: var(--text-light);
}

.customer-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
}

.star-icon {
    width: 16px;
    height: 16px;
    color: var(--primary-blue);
    fill: var(--primary-blue);
}

/* Categories Legend */
.category-legend {
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.legend-row {
    display: grid;
    grid-template-columns: auto minmax(35px, 1fr) auto minmax(35px, 1fr);
    align-items: center;
    column-gap: 8px;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

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

.dot.light-blue {
    background-color: #60A5FA;
}

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

.dot.gray {
    background-color: var(--text-light);
}

.dot.yellow { background-color: #EAB308; }
.dot.orange { background-color: #F97316; }
.dot.purple { background-color: #A855F7; }
.dot.pink { background-color: #EC4899; }

.legend-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.legend-val {
    font-size: 12px;
    font-weight: 600;
    margin-right: 12px;
    text-align: right;
}

.legend-val:last-child {
    margin-right: 0;
}

/* Media Queries for Responsiveness */
@media (max-width: 1200px) {
    .row-top {
        flex-direction: column;
    }

    .col-overview,
    .col-fpy {
        width: 100%;
    }

    .col-stats {
        width: 100%;
    }

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

    .row-bottom {
        flex-wrap: wrap;
    }

    .col-products {
        flex: 1 1 100%;
    }

    .col-customers {
        flex: 1 1 100%;
    }

    .col-categories {
        flex: 1 1 100%;
    }
}

.mobile-menu-btn {
    display: none;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 64px !important;
        transform: translateX(0);
        z-index: 1001;
        transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    }

    /* Hide text/labels by default in rail mode */
    .sidebar .menu-item a span,
    .sidebar .badge,
    .sidebar .logo span,
    .sidebar .menu-label,
    .sidebar .submenu-arrow {
        max-width: 0;
        opacity: 0;
        display: none !important;
    }

    /* Submenus hidden by default */
    .sidebar .sub-menu {
        display: none !important;
    }

    /* Sidebar Hover Expansion - Increase visual width */
    .sidebar:hover {
        width: 240px !important;
        min-width: 240px !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
    }

    .sidebar:hover .menu-item a span,
    .sidebar:hover .badge,
    .sidebar:hover .logo span {
        display: flex !important;
        max-width: 200px;
        opacity: 1;
    }

    .sidebar:hover .menu-label,
    .sidebar:hover .submenu-arrow {
        display: block !important;
        opacity: 1;
    }

    /* Submenu Hover Expansion while sidebar is hovered */
    .sidebar:hover .menu-item-has-submenu:hover .sub-menu {
        display: block !important;
        opacity: 1;
    }

    /* Forced Open state (Hamburger menu / Toggle) */
    .sidebar.open {
        width: 240px !important;
        min-width: 240px !important;
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open .menu-item a span,
    .sidebar.open .badge,
    .sidebar.open .logo span,
    .sidebar.open .menu-label,
    .sidebar.open .submenu-arrow {
        display: flex !important;
        max-width: 200px;
        opacity: 1;
    }
    
    .sidebar.open .menu-label,
    .sidebar.open .submenu-arrow {
        display: block !important;
    }

    .sidebar.open .sub-menu {
        /* On mobile forced open, hide submenus unless they have class open */
        display: none !important;
    }
    
    .sidebar.open .sub-menu.open {
        display: block !important;
    }

    .main-content {
        margin-left: 64px;
        width: calc(100% - 64px);
    }

    /* Overlay for forced open state */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        backdrop-filter: blur(4px);
        z-index: 999;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--text-primary);
        width: 32px;
        height: 32px;
        margin-right: 12px;
    }

    .mobile-menu-btn i {
        width: 20px;
        height: 20px;
    }

    .mobile-close-btn {
        display: none !important;
    }

    .sidebar-header {
        justify-content: center;
        padding: 0;
        height: 64px;
    }

    .sidebar:hover .sidebar-header,
    .sidebar.open .sidebar-header {
        justify-content: space-between;
        padding: 0 24px;
    }

    .sidebar-toggle-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
    }

    .app-container.sidebar-collapsed .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* In tablet mode, header actions slightly different */
    .header-search-inline {
        width: 180px;
    }

    .header-search-inline:focus-within {
        width: 220px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .header {
        padding: 0 16px;
    }

    .welcome-message {
        font-size: 16px;
    }

    .header-search-inline {
        display: none; /* Hide in mobile header, show on search modal maybe? */
    }

    .dashboard-container {
        padding: 16px;
    }

    .row {
        gap: 16px;
    }

    .featured-product {
        flex-direction: column;
        padding: 16px;
    }

    .featured-img {
        width: 100%;
        height: auto;
    }

    .product-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .stat-card-premium {
        padding: 16px;
    }

    .stat-card-value {
        font-size: 28px;
    }

    .asgn-container {
        padding: 12px;
    }

    .asgn-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .asgn-toolbar-left {
        flex-wrap: wrap;
        gap: 12px;
    }

    .filter-group {
        flex: 1 1 140px;
    }

    .btn-clear-asgn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-right {
        gap: 8px;
    }

    .profile-name {
        display: none;
    }

    .welcome-message {
        font-size: 14px;
    }

    .card-header {
        padding: 16px 16px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .card-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .card-body {
        padding: 16px;
    }

    .legend-row {
        grid-template-columns: auto 1fr;
        row-gap: 8px;
    }

    .legend-val {
        text-align: left;
    }
}

/* Ensure tables are horizontally scrollable on small screens */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Stepper Input */
.stepper-input {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    width: fit-content;
    overflow: hidden;
}

.stepper-btn {
    background: var(--light-blue-tint);
    border: none;
    color: var(--primary-blue);
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.stepper-btn:hover {
    background: #d0e3ff;
}

.stepper-input input {
    width: 40px;
    border: none;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
}

.stepper-input input::-webkit-outer-spin-button,
.stepper-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

/* Assign Button */
.btn-assign {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-assign:hover {
    background: var(--dark-blue);
}


/* ── Notification Dropdown ─────────────────────────────────── */
.notification-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: -100px;
    width: 320px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
    display: none;
    z-index: 1000;
    overflow: hidden;
    text-align: left;
}

.notification-dropdown.active {
    display: block;
    animation: slideInDown 0.2s ease-out;
}

.notification-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notification-header h5 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

.notification-header button {
    background: none;
    border: none;
    color: var(--primary-blue);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.notification-list {
    max-height: 360px;
    overflow-y: auto;
}

.notification-item {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #F9FAFB;
}

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

.notification-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item-content h6 {
    margin: 0 0 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-item-content p {
    margin: 0 0 4px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.notification-item-content span {
    font-size: 11px;
    color: var(--text-light);
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/*  Global Search Styles  */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    display: none;
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.search-modal {
    width: 600px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-heavy);
    overflow: hidden;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.search-input-wrapper i {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    color: var(--text-secondary);
}

.search-main-input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    color: var(--text-primary);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 12px;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: var(--light-blue-tint);
}

.search-result-info h6 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
}

.search-result-info span {
    font-size: 12px;
    color: var(--text-secondary);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* HR Security Blur & Auth Modal */
.app-container.hr-blur-active {
    filter: blur(12px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.3s ease;
}

#hr-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.hr-auth-modal {
    background: #fff;
    width: 100%;
    max-width: 400px;
    padding: 32px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    text-align: center;
    animation: modalScaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.hr-auth-icon {
    width: 64px; height: 64px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-blue);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
}

.hr-auth-icon i { width: 32px; height: 32px; }

.hr-auth-modal h3 { font-size: 20px; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; }
.hr-auth-modal p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5; }

.hr-auth-input { display: flex; flex-direction: column; gap: 12px; }

.hr-auth-input input {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hr-auth-input input:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.hr-auth-buttons {
    display: flex;
    gap: 12px;
}

.hr-auth-buttons button {
    flex: 1;
}

.hr-auth-input button#hr-pass-submit {
    padding: 12px;
    background: var(--primary-blue);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.hr-auth-input button#hr-pass-submit:hover { background: var(--dark-blue); }

.hr-cancel-btn {
    padding: 12px;
    background: #f1f5f9;
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.hr-cancel-btn:hover {
    background: #e2e8f0;
}


/* Premium HR Stat Cards */
.hr-stats-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card-premium {
    background: #fff;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.02);
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.stat-card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-chart {
    height: 60px;
    margin: 8px 0;
}

.stat-card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
}

.status-badge-new {
    background: rgba(34, 197, 94, 0.1);
    color: #22C55E;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* Avatar Initials Circle */
.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    text-transform: uppercase;
    flex-shrink: 0;
}

.profile-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.profile-info-small {
    display: flex;
    flex-direction: column;
}

.profile-name-bold {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
}

/* Designation Pill */
.designation-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    background: #f1f5f9;
    color: #64748b;
}

.designation-pill.qa { background: rgba(139, 92, 246, 0.1); color: #8B5CF6; }
.designation-pill.design { background: rgba(59, 130, 246, 0.1); color: var(--primary-blue); }
.designation-pill.mfg { background: rgba(245, 158, 11, 0.1); color: #F59E0B; }

/* Contact Icons */
.contact-links {
    display: flex;
    gap: 12px;
    color: var(--text-secondary);
}

.contact-links i {
    width: 16px;
    height: 16px;
    transition: color 0.2s;
    cursor: pointer;
}

.contact-links i:hover { color: var(--primary-blue); }

/* Modal & Form Styles */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: modalSlideUp 0.3s ease-out;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--text-primary); margin: 0; }

.modal-close {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
}

.modal-close:hover { background: #f1f5f9; color: var(--text-primary); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
    background: #f8fafc;
}

.form-control:focus { border-color: var(--primary-blue); background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

.btn-submit {
    background: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-submit:hover { background: var(--dark-blue); }

.btn-cancel {
    background: #f1f5f9;
    color: var(--text-secondary);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.btn-cancel:hover { background: #e2e8f0; color: var(--text-primary); }

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

/* Assignments Dashboard Table */
.assignments-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.assignments-table th {
    text-align: left;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    border-bottom: 1.5px solid #075985;
}

.assignments-table td {
    padding: 10px 20px;
    font-size: 13px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

.assignments-table tr:last-child td {
    border-bottom: none;
}

.assignments-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-top: 1.5px solid #075985;
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

#assignmentsListContainer {
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

/* Global Responsive Overrides for Other Pages */
@media (max-width: 992px) {
    .metrics-grid {
        grid-template-columns: 1fr !important;
    }

    .metrics-stats {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
}

@media (max-width: 640px) {
    .asgn-summary {
        flex-direction: column;
        gap: 20px;
    }

    .asgn-sum-item {
        align-items: center;
    }

    .pb-hdr {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .pb-hdr-controls {
        width: 100%;
        text-align: left;
    }

    .pb-hdr-totals {
        width: 100%;
        justify-content: space-between;
    }
}

