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

        body {
            font-family: 'Inter', 'Roboto', system-ui, -apple-system, sans-serif;
            background: #FFFFFF;
            color: #111827;
            min-width: 1280px;
            line-height: 1.3;
        }


        /* ========== HEADER ========== */
        .header {
            background: #FFFFFF;
            height: 64px;
            border-bottom: 1px solid #E5E7EB;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 32px;
        }

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

        .logo {
            display: flex;
            align-items: center;
            text-decoration: none;
            height: 50px;
            font-size: 24px;
            font-weight: 700;
            color: #111827;
            letter-spacing: -0.5px;
            font-family: 'Inter', 'Roboto', system-ui, -apple-system, sans-serif;
        }

        .region-selector {
            position: relative;
        }

        .region-btn {
            background: transparent;
            border: 1px solid #E5E7EB;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            color: #374151;
            transition: all 0.15s;
        }

        .region-btn:hover {
            background: #F9FAFB;
            border-color: #D1D5DB;
        }

        .region-dropdown {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 4px;
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            min-width: 200px;
            z-index: 1000;
        }

        .region-dropdown.active {
            display: block;
        }

        .region-item {
            padding: 10px 16px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.1s;
        }

        .region-item:hover {
            background: #F3F4F6;
        }

        .region-item:first-child {
            border-radius: 8px 8px 0 0;
        }

        .region-item:last-child {
            border-radius: 0 0 8px 8px;
        }

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

        .date-text {
            font-size: 14px;
            color: #111827;
            white-space: nowrap;
            overflow: visible;
            flex-shrink: 0;
        }

        .theme-btn {
            background: transparent;
            border: none;
            cursor: pointer;
            padding: 8px;
            border-radius: 6px;
            transition: background 0.15s;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            color: #6B7280;
        }

        .theme-btn:hover {
            background: #F3F4F6;
        }

        .login-btn {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border: none;
            padding: 10px 20px;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 600;
            color: white;
            transition: all 0.2s;
            box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
        }

        .login-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
            background: linear-gradient(135deg, #5a67d8 0%, #6b3fa0 100%);
        }

        .login-btn:active {
            transform: translateY(0);
            box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
        }

        .telegram-link {
            display: flex;
            align-items: center;
            padding: 8px;
            border-radius: 6px;
            transition: background 0.15s;
            color: #6B7280;
            text-decoration: none;
        }

        .telegram-link:hover {
            background: #F3F4F6;
            color: #3B82F6;
        }

        .telegram-link svg {
            width: 24px;
            height: 24px;
        }

        /* ========== FOOTER ========== */
        .footer-bottom {
            max-width: 1600px;
            margin: 48px auto 32px;
            padding: 0 32px;
            text-align: center;
            color: #9CA3AF;
            font-size: 12px;
        }

        /* ========== MAIN CONTENT ========== */
        .container {
            max-width: 1600px;
            margin: 0 auto;
            padding: 32px;
        }

        .title-row {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .page-title {
            font-size: 24px;
            font-weight: 600;
            color: #111827;
        }

        .share-btn {
            background: transparent;
            border: 1px solid #E5E7EB;
            padding: 8px 16px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            color: #374151;
            transition: all 0.15s;
            font-weight: 500;
        }

        .share-btn:hover {
            background: #F9FAFB;
            border-color: #3B82F6;
            color: #3B82F6;
        }

        .share-btn.copied {
            background: #10B981;
            border-color: #10B981;
            color: white;
        }

        .share-btn svg {
            width: 16px;
            height: 16px;
        }

        /* ========== EXCEL DOWNLOAD DROPDOWN ========== */
        .excel-dropdown {
            position: relative;
            display: inline-flex;
        }

        .excel-dropdown-menu {
            display: none;
            position: absolute;
            top: calc(100% + 4px);
            right: 0;
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 6px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.10);
            min-width: 200px;
            z-index: 100;
            overflow: hidden;
        }

        .excel-dropdown-menu.open {
            display: block;
        }

        .excel-dropdown-item {
            display: flex;
            flex-direction: column;
            padding: 10px 16px;
            cursor: pointer;
            transition: background 0.1s;
            border: none;
            background: transparent;
            width: 100%;
            text-align: left;
            gap: 2px;
        }

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

        .excel-dropdown-item + .excel-dropdown-item {
            border-top: 1px solid #F3F4F6;
        }

        .excel-dropdown-item-title {
            font-size: 13px;
            font-weight: 500;
            color: #111827;
        }

        .excel-dropdown-item-desc {
            font-size: 11px;
            color: #6B7280;
        }

        /* ========== METRIC TOGGLE ========== */
        .metric-toggle {
            display: flex;
            background: #F3F4F6;
            border-radius: 8px;
            padding: 4px;
            gap: 4px;
        }

        .metric-btn {
            padding: 8px 20px;
            border: none;
            background: transparent;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            color: #6B7280;
            transition: all 0.15s;
        }

        .metric-btn.active {
            background: #3B82F6;
            color: white;
        }

        .metric-btn:not(.active):hover {
            background: #E5E7EB;
        }

        /* ========== SEARCH INPUT ========== */
        .search-container {
            display: flex;
            align-items: center;
        }

        .search-input {
            padding: 8px 16px;
            border: 1px solid #E5E7EB;
            border-radius: 8px;
            font-size: 14px;
            color: #374151;
            background: #FFFFFF;
            transition: all 0.15s;
            min-width: 250px;
            outline: none;
        }

        .search-input:focus {
            border-color: #3B82F6;
            box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
        }

        .search-input::placeholder {
            color: #9CA3AF;
        }

        /* ========== LOADING STATE ========== */
        .loading {
            text-align: center;
            padding: 60px 20px;
            color: #6B7280;
            font-size: 16px;
        }

        .loading-spinner {
            display: inline-block;
            width: 40px;
            height: 40px;
            border: 4px solid #E5E7EB;
            border-top-color: #3B82F6;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin-bottom: 16px;
        }

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

        /* ========== TOOLTIPS ========== */
        .tooltip-wrapper {
            position: relative;
            display: inline-block;
            cursor: help;
        }

        .tooltip-wrapper::after {
            content: attr(data-tooltip);
            position: absolute;
            top: calc(100% + 4px);
            left: 50%;
            transform: translateX(-50%);
            background: #1F2937;
            color: white;
            padding: 12px 16px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 500;
            z-index: 9999;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
            line-height: 1.4;
            max-width: 320px;
            white-space: normal;
            text-align: center;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0s ease 0s;
        }

        .tooltip-wrapper:hover::after {
            opacity: 1;
            transition: opacity 0.2s ease 1s;
        }

        .tooltip-wrapper::before {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-bottom-color: #1F2937;
            z-index: 10000;
            pointer-events: none;
            margin-top: -2px;
            opacity: 0;
            transition: opacity 0s ease 0s;
        }

        .tooltip-wrapper:hover::before {
            opacity: 1;
            transition: opacity 0.2s ease 1s;
        }
        
        /* Allow tooltips to overflow table */
        .table thead {
            position: relative;
            z-index: 10;
        }
        
        .table thead th {
            overflow: visible;
        }

        /* ========== TABLE ========== */
        .table-container {
            overflow-x: auto;
            overflow-y: visible;
            background: white;
            border-radius: 12px;
            border: 1px solid #E5E7EB;
            padding-bottom: 80px;
        }

        .table-wrapper {
            min-width: 1200px;
            overflow: visible;
        }

        .table {
            width: 100%;
            border-collapse: collapse;
        }

        .table thead {
            background: #F9FAFB;
        }

        .table th {
            padding: 12px 8px;
            text-align: center;
            font-size: 12px;
            font-weight: 500;
            color: #6B7280;
            border-bottom: 1px solid #F1F5F9;
            white-space: nowrap;
        }

        .table th.sticky-col {
            position: sticky;
            background: #F9FAFB;
            z-index: 11;
        }

        .table th.sticky-col:nth-child(1) {
            left: 0;
            min-width: 50px;
        }

        .table th.sticky-col:nth-child(2) {
            left: 50px;
            min-width: 200px;
        }

        .table th.group-header {
            background: #F3F4F6;
            font-weight: 600;
            color: #374151;
            font-size: 13px;
            vertical-align: middle;
        }
        
        .median-header {
            font-size: 11px;
            line-height: 1.2;
        }

        .table td {
            padding: 12px 8px;
            text-align: center;
            font-size: 13px;
            border-bottom: 1px solid #F1F5F9;
        }

        .table tbody tr {
            transition: background 0.1s;
        }

        .table tbody tr:hover {
            background: #F9FAFB;
        }

        .table tbody tr.clickable-row {
            cursor: pointer;
        }

        .table tbody tr.clickable-row:hover {
            background: #EEF2FF;
        }

        .table td.sticky-col {
            position: sticky;
            background: white;
            z-index: 5;
        }

        .table td.sticky-col:nth-child(1) {
            left: 0;
            min-width: 50px;
        }

        .table td.sticky-col:nth-child(2) {
            left: 50px;
            min-width: 200px;
        }

        .table tbody tr:hover td.sticky-col {
            background: #F9FAFB;
        }

        /* Allow tooltips to overflow from cells */
        .table td {
            position: relative;
        }

        .table tbody tr,
        .table tbody td {
            overflow: visible !important;
        }

        .rank-cell {
            font-weight: 600;
            color: #6B7280;
            width: 50px;
        }

        .pharmacy-cell {
            display: flex;
            align-items: center;
            gap: 12px;
            text-align: left;
            min-width: 200px;
            flex-wrap: nowrap;
        }

        .pharmacy-logo {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
            flex-shrink: 0;
        }

        .pharmacy-logo-fallback {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 14px;
            color: white;
            flex-shrink: 0;
        }

        .pharmacy-name {
            font-weight: 500;
            color: #111827;
        }

        .arrow-icon {
            opacity: 0;
            transition: opacity 0.2s;
            color: #3B82F6;
            font-weight: 700;
            margin-left: 6px;
        }

        .clickable-row:hover .arrow-icon {
            opacity: 1;
        }

        .clickable-row:hover .pharmacy-name .arrow-icon {
            opacity: 1;
        }

        .producer-analysis-btn {
            font-size: 13px;
            padding: 8px 16px;
            border-radius: 8px;
            background: #EEF2FF;
            border: 1px solid #C7D2FE;
            color: #4F46E5;
            cursor: pointer;
            font-weight: 500;
            white-space: nowrap;
            transition: background 0.2s, border-color 0.2s;
        }

        .producer-analysis-btn:hover {
            background: #E0E7FF;
            border-color: #A5B4FC;
        }

        .verified-badge {
            color: #3B82F6;
            font-size: 16px;
        }

        .deviation-cell {
            font-weight: 600;
        }
        
        .deviation-positive {
            color: #DC2626; /* Red for positive (more expensive) */
        }
        
        .deviation-negative {
            color: #059669; /* Green for negative (cheaper) */
        }
        
        .deviation-neutral {
            color: #6B7280; /* Gray for neutral */
        }

        .dynamics-cell {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            font-size: 13px;
        }

        .dynamics-positive {
            color: #DC2626;
        }

        .dynamics-negative {
            color: #059669;
        }

        .dynamics-neutral {
            color: #6B7280;
        }

        /* Color gradients for price buckets */
        .bucket-cell {
            font-weight: 500;
        }


        /* ========== BREADCRUMB ========== */
        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 24px;
            font-size: 14px;
            color: #6B7280;
        }

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

        .breadcrumb-link {
            color: #3B82F6;
            text-decoration: none;
            cursor: pointer;
            transition: color 0.15s;
        }

        .breadcrumb-link:hover {
            color: #2563EB;
        }

        .breadcrumb-current {
            color: #111827;
            font-weight: 500;
        }

        .back-button {
            background: transparent;
            border: 1px solid #E5E7EB;
            padding: 8px 12px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 14px;
            color: #374151;
            transition: all 0.15s;
            margin-bottom: 16px;
        }

        .back-button:hover {
            background: #F3F4F6;
            border-color: #D1D5DB;
        }

        /* ========== PRICE RANGE BAR ========== */
        .price-range-container {
            position: relative;
            width: 100%;
            min-width: 200px;
            padding-top: 18px;
            padding-bottom: 2px;
        }

        .price-range-bar {
            position: relative;
            height: 8px;
            background: #E5E7EB;
            border-radius: 4px;
            overflow: visible;
            cursor: pointer;
        }

        .price-marker {
            position: absolute;
            width: 2px;
            height: 150%;
            top: -25%;
        }

        .price-marker.other {
            background: #9CA3AF;
            z-index: 1;
        }

        /* Кружочки для медианы и текущей аптеки */
        .price-marker.median {
            width: 12px;
            height: 12px;
            background: #FCD34D;
            border-radius: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            z-index: 3;
        }

        .price-marker.retailer {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            z-index: 4;
        }

        .price-marker.retailer.cheaper {
            background: #22C55E;
        }

        .price-marker.retailer.expensive {
            background: #EF4444;
        }

        /* Градиентная заливка между медианой и текущей ценой */
        .price-gradient-fill {
            position: absolute;
            height: 100%;
            top: 0;
            z-index: 2;
        }

        .price-gradient-fill.cheaper {
            background: linear-gradient(to right, #22C55E, #FCD34D);
        }

        .price-gradient-fill.expensive {
            background: linear-gradient(to left, #EF4444, #FCD34D);
        }

        .price-label {
            position: absolute;
            top: -20px;
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;
        }

        .price-label.min {
            left: 0;
            color: #6B7280;
        }

        .price-label.max {
            right: 0;
            color: #6B7280;
        }

        /* ========== PRICE TOOLTIP ========== */
        .price-tooltip {
            position: fixed;
            display: none;
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 8px;
            padding: 12px;
            font-size: 12px;
            color: #374151;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
            z-index: 99999;
            min-width: 280px;
            max-width: 400px;
            max-height: 400px;
            overflow-y: auto;
            pointer-events: auto;
        }


        .price-tooltip-title {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 8px;
            color: #111827;
        }

        .price-tooltip-legend {
            display: flex;
            flex-direction: column;
            gap: 6px;
            margin-top: 12px;
            padding-top: 8px;
            border-top: 1px solid #E5E7EB;
            font-size: 11px;
        }

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

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

        .legend-marker.regular {
            background: #9CA3AF;
        }

        .legend-marker.current-cheaper {
            background: #22C55E;
        }

        .legend-marker.current-expensive {
            background: #EF4444;
        }

        .legend-marker.median {
            width: 10px;
            height: 10px;
            background: transparent;
            border: none;
            position: relative;
        }

        .legend-marker.median::before {
            content: '◆';
            position: absolute;
            left: -1px;
            top: -5px;
            color: #FCD34D;
            font-size: 12px;
        }

        .legend-marker.promo {
            background: transparent;
            border: 2px solid #9CA3AF;
        }

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

        .price-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 4px 6px;
            border-radius: 4px;
            transition: background 0.1s;
        }

        .price-item:hover {
            background: #F3F4F6;
        }

        .price-item-store {
            display: flex;
            align-items: center;
            gap: 4px;
            flex: 1;
        }

        .price-item-value {
            font-weight: 600;
            color: #111827;
        }

        .store-price-icon {
            font-size: 10px;
            margin-right: 4px;
        }

        .store-price-icon.regular {
            color: #9CA3AF;
        }

        .store-price-icon.cheaper,
        .store-price-icon.current-cheaper {
            color: #22C55E;
        }

        .store-price-icon.expensive,
        .store-price-icon.current-expensive {
            color: #EF4444;
        }

        .store-price-icon.median {
            color: #FCD34D;
        }

        /* ========== PRICE HISTORY BUTTON ========== */
        .price-history-button {
            background: #3B82F6;
            color: white;
            border: none;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            transition: opacity 0.2s;
        }

        .price-history-button:hover {
            background: #2563EB;
        }

        .product-row-container:hover .price-history-button {
            opacity: 1;
        }

        /* ========== PRICE HISTORY VIEW ========== */
        .price-history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 24px;
        }

        .price-history-title {
            font-size: 20px;
            font-weight: 600;
            color: #111827;
        }

        .period-selector {
            display: flex;
            background: #F3F4F6;
            border-radius: 8px;
            padding: 4px;
            gap: 4px;
        }

        .period-btn {
            padding: 8px 16px;
            border: none;
            background: transparent;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            color: #6B7280;
            transition: all 0.15s;
        }

        .period-btn.active {
            background: #3B82F6;
            color: white;
        }

        .period-btn:not(.active):hover {
            background: #E5E7EB;
        }

        #price-history-content {
            position: relative;
        }

        .price-stats-row {
            display: flex;
            gap: 24px;
            margin-bottom: 32px;
        }

        .price-stat-card {
            flex: 1;
            background: #F9FAFB;
            border-radius: 12px;
            padding: 20px;
            border: 1px solid #E5E7EB;
        }

        .price-stat-label {
            font-size: 12px;
            font-weight: 500;
            color: #6B7280;
            margin-bottom: 8px;
            text-transform: uppercase;
        }

        .price-stat-value {
            font-size: 28px;
            font-weight: 700;
            color: #111827;
            margin-bottom: 4px;
        }

        .price-stat-store {
            font-size: 13px;
            color: #6B7280;
        }

        .chart-container-wrapper {
            display: flex;
            gap: 24px;
            margin-bottom: 32px;
        }

        .chart-container {
            flex: 1;
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 12px;
            padding: 24px;
            min-height: 500px;
        }

        .stores-legend {
            width: 280px;
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 12px;
            padding: 20px;
        }

        .stores-legend-title {
            font-size: 14px;
            font-weight: 600;
            color: #111827;
            margin-bottom: 16px;
        }

        .store-legend-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid #F3F4F6;
            cursor: pointer;
            transition: background-color 0.2s;
            text-decoration: none;
            color: inherit;
        }

        .store-legend-item:hover {
            background-color: #F9FAFB;
        }

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

        .store-legend-info {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
        }

        .store-legend-color {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .store-legend-name {
            font-size: 13px;
            color: #374151;
            flex: 1;
        }

        .store-legend-price {
            font-size: 13px;
            font-weight: 600;
            color: #111827;
        }

        /* ========== TOOLTIP ========== */
        .tooltip {
            position: fixed;
            display: none;
            background: white;
            border: 1px solid #E5E7EB;
            border-radius: 6px;
            padding: 8px 12px;
            font-size: 12px;
            color: #374151;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            z-index: 1000;
            max-width: 250px;
            pointer-events: none;
        }

        .tooltip.active {
            display: block;
        }

        /* ========== VIEW MANAGEMENT ========== */
        .view {
            display: none;
        }

        .view.active {
            display: block;
        }

        /* ========== RESPONSIVE ========== */
        @media (max-width: 1280px) {
            body {
                min-width: auto;
            }
            .table-container {
                overflow-x: scroll;
            }
        }

        /* ========== MOBILE ========== */
        @media (max-width: 768px) {
            body {
                min-width: 320px;
            }

            /* Header */
            .header {
                height: auto;
                padding: 12px 16px;
                flex-direction: column;
                gap: 12px;
            }

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

            .header-right {
                width: 100%;
                justify-content: space-between;
                gap: 12px;
            }

            .logo {
                font-size: 18px;
            }

            .logo-dot {
                left: 54px;
            }

            .date-text {
                font-size: 11px;
            }

            .region-btn {
                padding: 4px 8px;
                font-size: 12px;
            }

            /* Main content */
            .container {
                padding: 16px;
            }

            .title-row {
                flex-direction: column;
                gap: 16px;
                align-items: flex-start;
            }

            .page-title {
                font-size: 18px;
                line-height: 1.4;
            }

            .metric-toggle {
                width: 100%;
            }

            .metric-btn {
                flex: 1;
                padding: 8px 12px;
                font-size: 13px;
            }

            /* Table */
            .table-container {
                border-radius: 8px;
                margin: 0 -16px;
                border-left: none;
                border-right: none;
            }

            .table-wrapper {
                min-width: 800px;
            }

            .table th,
            .table td {
                padding: 8px 6px;
                font-size: 11px;
            }

            .table th {
                font-size: 10px;
            }

            .rank-cell {
                width: 35px;
                min-width: 35px;
            }

            .table th.sticky-col:nth-child(1),
            .table td.sticky-col:nth-child(1) {
                left: 0;
                min-width: 35px;
            }

            .table th.sticky-col:nth-child(2),
            .table td.sticky-col:nth-child(2) {
                left: 35px;
                min-width: 140px;
            }

            .pharmacy-cell {
                min-width: 140px;
                gap: 8px;
            }

            .pharmacy-logo,
            .pharmacy-logo-fallback {
                width: 24px;
                height: 24px;
                font-size: 11px;
            }

            .pharmacy-name {
                font-size: 12px;
            }

            .verified-badge {
                font-size: 14px;
            }

            .bucket-cell {
                font-size: 11px;
            }

            /* Loading */
            .loading {
                padding: 40px 16px;
                font-size: 14px;
            }

            .loading-spinner {
                width: 32px;
                height: 32px;
                border-width: 3px;
            }

        }

        @media (max-width: 480px) {
            /* Extra small screens */
            .page-title {
                font-size: 16px;
            }

            .table-wrapper {
                min-width: 700px;
            }
        }
        /* Sorting styles */
        .sortable-header {
            cursor: pointer;
            user-select: none;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .sortable-header:hover {
            color: #3B82F6;
        }

        .sort-arrow {
            font-size: 10px;
            color: #9CA3AF;
            transition: color 0.2s;
        }

        .sort-arrow.active {
            color: #3B82F6;
        }

        .sort-arrow.asc::before {
            content: '▲';
        }

        .sort-arrow.desc::before {
            content: '▼';
        }

        .sort-arrow.neutral::before {
            content: '▲';
            opacity: 0.3;
        }

        /* ========== AUTH MODAL ========== */
        .auth-modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            z-index: 10000;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.2s ease-out;
        }

        .auth-modal-overlay.active {
            display: flex;
        }

        .auth-modal {
            background: white;
            border-radius: 12px;
            width: 90%;
            max-width: 440px;
            padding: 32px;
            position: relative;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: slideUp 0.3s ease-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

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

        .auth-modal-close {
            position: absolute;
            top: 16px;
            right: 16px;
            background: none;
            border: none;
            font-size: 28px;
            color: #9CA3AF;
            cursor: pointer;
            line-height: 1;
            padding: 4px 8px;
            transition: color 0.15s;
        }

        .auth-modal-close:hover {
            color: #374151;
        }

        .auth-form h2 {
            margin: 0 0 24px 0;
            font-size: 24px;
            font-weight: 600;
            color: #111827;
        }

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

        .form-group label {
            display: block;
            margin-bottom: 8px;
            font-size: 14px;
            font-weight: 500;
            color: #374151;
        }

        .form-group input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid #D1D5DB;
            border-radius: 8px;
            font-size: 14px;
            transition: all 0.15s;
            box-sizing: border-box;
        }

        .form-group input:focus {
            outline: none;
            border-color: #111827;
            box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1);
        }

        .form-hint {
            margin-top: 6px;
            font-size: 12px;
            color: #6B7280;
        }

        .form-error {
            margin: 16px 0;
            padding: 12px;
            background: #FEE2E2;
            border: 1px solid #FCA5A5;
            border-radius: 8px;
            color: #991B1B;
            font-size: 14px;
            display: none;
        }

        .form-error.active {
            display: block;
        }

        .auth-submit-btn {
            width: 100%;
            padding: 12px;
            background: #111827;
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.15s;
        }

        .auth-submit-btn:hover {
            background: #1F2937;
        }

        .auth-submit-btn:active {
            transform: scale(0.98);
        }

        .auth-submit-btn:disabled {
            background: #9CA3AF;
            cursor: not-allowed;
        }

        .auth-submit-btn.loading {
            position: relative;
            color: transparent;
            pointer-events: none;
        }

        .auth-submit-btn.loading::after {
            content: '';
            position: absolute;
            width: 16px;
            height: 16px;
            top: 50%;
            left: 50%;
            margin-left: -8px;
            margin-top: -8px;
            border: 2px solid #ffffff;
            border-top-color: transparent;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }

        .auth-switch {
            margin-top: 20px;
            text-align: center;
            font-size: 14px;
            color: #6B7280;
        }

        .auth-switch a {
            color: #111827;
            font-weight: 600;
            text-decoration: none;
            transition: color 0.15s;
        }

        .auth-switch a:hover {
            color: #374151;
            text-decoration: underline;
        }

        .auth-switch a.loading {
            pointer-events: none;
            opacity: 0.6;
            position: relative;
            padding-left: 20px;
        }

        .auth-switch a.loading::before {
            content: '';
            position: absolute;
            left: 0;
            top: 50%;
            width: 12px;
            height: 12px;
            margin-top: -6px;
            border: 2px solid #3B82F6;
            border-top-color: transparent;
            border-radius: 50%;
            animation: spin 0.6s linear infinite;
        }

        .auth-switch a.disabled {
            pointer-events: none;
            color: #9CA3AF;
            cursor: not-allowed;
        }

        .auth-switch a.disabled:hover {
            text-decoration: none;
        }

        .verify-description {
            margin-bottom: 24px;
            font-size: 14px;
            color: #6B7280;
            line-height: 1.5;
        }

        .verify-description strong {
            color: #111827;
            font-weight: 600;
        }

        #verify-code {
            text-align: center;
            font-size: 28px;
            font-weight: 600;
            letter-spacing: 12px;
            font-family: 'Courier New', monospace;
        }

        /* Success form styles */
        .success-icon {
            display: flex;
            justify-content: center;
            margin-bottom: 24px;
            animation: scaleIn 0.5s ease-out;
        }

        @keyframes scaleIn {
            0% {
                transform: scale(0);
                opacity: 0;
            }
            50% {
                transform: scale(1.1);
            }
            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        .success-description {
            margin-bottom: 24px;
            font-size: 15px;
            color: #6B7280;
            line-height: 1.5;
            text-align: center;
        }

        #success-form h2 {
            text-align: center;
            color: #10B981;
        }

        /* Update header user info styles */
        .header-user-info {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .user-email {
            font-size: 14px;
            color: #374151;
            font-weight: 500;
        }

        .logout-btn {
            background: transparent;
            border: 1px solid #E5E7EB;
            padding: 6px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            color: #374151;
            transition: all 0.15s;
        }

        .logout-btn:hover {
            background: #F9FAFB;
            border-color: #D1D5DB;
        }

        /* ========== PRICE HISTORY LIMIT OVERLAY ========== */
        .price-history-limit-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 9999;
        }

        .price-history-limit-overlay.active {
            display: flex;
        }

        .price-history-limit-card {
            background: white;
            border-radius: 16px;
            padding: 48px 40px;
            max-width: 500px;
            width: 90%;
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            text-align: center;
            animation: slideIn 0.3s ease-out;
        }

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

        .price-history-limit-icon {
            font-size: 64px;
            margin-bottom: 24px;
        }

        .price-history-limit-title {
            font-size: 24px;
            font-weight: 700;
            color: #111827;
            margin-bottom: 16px;
        }

        .price-history-limit-text {
            font-size: 16px;
            color: #6B7280;
            line-height: 1.6;
            margin-bottom: 16px;
        }

        .price-history-limit-btn {
            background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
            color: white;
            border: none;
            padding: 14px 32px;
            border-radius: 8px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 8px;
            width: 100%;
        }

        .price-history-limit-btn:hover {
            background: linear-gradient(135deg, #2563EB 0%, #1E40AF 100%);
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
        }

        .price-history-limit-link {
            display: block;
            margin-top: 16px;
            color: #3B82F6;
            text-decoration: none;
            font-size: 14px;
            transition: color 0.2s;
        }

        .price-history-limit-link:hover {
            color: #2563EB;
            text-decoration: underline;
        }

        .price-history-limit-skip {
            display: block;
            margin-top: 12px;
            color: #111827;
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            transition: color 0.2s;
        }

        .price-history-limit-skip:hover {
            color: #374151;
            text-decoration: underline;
        }

        .price-history-limit-skip:visited {
            color: #111827;
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
        }

        .price-history-limit-skip:visited:hover {
            color: #374151;
            text-decoration: underline;
        }

        /* Blur effect for price history content when limit is reached */
        #price-history-view:has(.price-history-limit-overlay.active) .price-history-header,
        #price-history-view:has(.price-history-limit-overlay.active) #price-history-content,
        #price-history-view:has(.price-history-limit-overlay.active) .breadcrumb {
            filter: blur(8px);
            pointer-events: none;
            user-select: none;
        }

        /* Alternative for browsers that don't support :has() */
        .price-history-limit-blur {
            filter: blur(8px);
            pointer-events: none;
            user-select: none;
        }
