/* ==========================================================================
   FoodTracker Dashboard - Apple-like Minimal Design
   Custom CSS with CSS Variables for Dark/Light Theme
   ========================================================================== */

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

/* ==========================================================================
   CSS Custom Properties (Light Theme - Default)
   ========================================================================== */
:root {
    /* Primary */
    --color-primary: #0066FF;
    --color-primary-hover: #0052CC;
    --color-primary-light: rgba(0, 102, 255, 0.08);
    --color-primary-soft: rgba(0, 102, 255, 0.12);

    /* Surfaces */
    --color-bg: #F5F5F7;
    --color-surface: #FFFFFF;
    --color-surface-hover: #F9F9FB;
    --color-surface-raised: #FFFFFF;

    /* Sidebar */
    --sidebar-bg: #FBFBFD;
    --sidebar-border: #E8E8ED;
    --sidebar-item-hover: rgba(0, 0, 0, 0.04);
    --sidebar-item-active-bg: var(--color-primary-light);
    --sidebar-item-active-text: var(--color-primary);
    --sidebar-text: #1D1D1F;
    --sidebar-text-muted: #86868B;

    /* Top bar */
    --topbar-bg: rgba(255, 255, 255, 0.72);
    --topbar-border: #E8E8ED;

    /* Text */
    --color-text: #1D1D1F;
    --color-text-secondary: #6E6E73;
    --color-text-tertiary: #86868B;
    --color-text-placeholder: #AEAEB2;

    /* Borders */
    --color-border: #E8E8ED;
    --color-border-light: #F2F2F7;
    --color-divider: #E5E5EA;

    /* Status colors */
    --color-success: #34C759;
    --color-success-bg: rgba(52, 199, 89, 0.08);
    --color-warning: #FF9500;
    --color-warning-bg: rgba(255, 149, 0, 0.08);
    --color-danger: #FF3B30;
    --color-danger-bg: rgba(255, 59, 48, 0.08);
    --color-info: #5AC8FA;
    --color-info-bg: rgba(90, 200, 250, 0.08);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 0.5px 1px rgba(0, 0, 0, 0.04), 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);

    /* Layout */
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --content-padding: 32px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Scrollbar */
    --scrollbar-thumb: #C7C7CC;
    --scrollbar-track: transparent;

    /* Platform Colors */
    --platform-yemeksepeti: #E31E52;
    --platform-trendyolgo: #FF9F43;
    --platform-getiryemek: #5D3EBC;
    --platform-migrosyemek: #D35400;

    /* Form controls */
    --input-bg: #FFFFFF;
    --input-border: #D2D2D7;
    --input-border-focus: var(--color-primary);
    --input-text: var(--color-text);
    --input-placeholder: var(--color-text-placeholder);

    /* Misc */
    --color-bg-secondary: #F2F2F7;
    --color-purple: #5856D6;
    --color-overlay: rgba(255, 255, 255, 0.7);
    --color-point-bg: #FFFFFF;

    /* Badge */
    --badge-coming-soon-bg: #F2F2F7;
    --badge-coming-soon-text: #86868B;
}

/* ==========================================================================
   Dark Theme
   ========================================================================== */
[data-theme="dark"] {
    /* Primary */
    --color-primary: #0A84FF;
    --color-primary-hover: #409CFF;
    --color-primary-light: rgba(10, 132, 255, 0.12);
    --color-primary-soft: rgba(10, 132, 255, 0.18);

    /* Surfaces */
    --color-bg: #000000;
    --color-surface: #1C1C1E;
    --color-surface-hover: #2C2C2E;
    --color-surface-raised: #2C2C2E;

    /* Sidebar */
    --sidebar-bg: #1C1C1E;
    --sidebar-border: #38383A;
    --sidebar-item-hover: rgba(255, 255, 255, 0.06);
    --sidebar-item-active-bg: var(--color-primary-light);
    --sidebar-item-active-text: var(--color-primary);
    --sidebar-text: #F5F5F7;
    --sidebar-text-muted: #98989D;

    /* Top bar */
    --topbar-bg: rgba(28, 28, 30, 0.72);
    --topbar-border: #38383A;

    /* Text */
    --color-text: #F5F5F7;
    --color-text-secondary: #A1A1A6;
    --color-text-tertiary: #98989D;
    --color-text-placeholder: #636366;

    /* Borders */
    --color-border: #38383A;
    --color-border-light: #2C2C2E;
    --color-divider: #38383A;

    /* Status colors */
    --color-success: #30D158;
    --color-success-bg: rgba(48, 209, 88, 0.12);
    --color-warning: #FF9F0A;
    --color-warning-bg: rgba(255, 159, 10, 0.12);
    --color-danger: #FF453A;
    --color-danger-bg: rgba(255, 69, 58, 0.12);
    --color-info: #64D2FF;
    --color-info-bg: rgba(100, 210, 255, 0.12);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 0.5px 1px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);

    /* Scrollbar */
    --scrollbar-thumb: #48484A;

    /* Form controls */
    --input-bg: #2C2C2E;
    --input-border: #48484A;
    --input-border-focus: var(--color-primary);
    --input-text: var(--color-text);
    --input-placeholder: #636366;

    /* Misc */
    --color-bg-secondary: #2C2C2E;
    --color-purple: #BF5AF2;
    --color-overlay: rgba(0, 0, 0, 0.6);
    --color-point-bg: #1C1C1E;

    /* Badge */
    --badge-coming-soon-bg: #2C2C2E;
    --badge-coming-soon-text: #636366;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-hover);
}

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

::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-thumb);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--color-text-tertiary);
}

/* ==========================================================================
   Layout: Sidebar + Main
   ========================================================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ---------- Sidebar ---------- */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
    transition: background-color var(--transition-normal);
}

.sidebar-header {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

/* Theme-aware logo images */
.sidebar-logo-img {
    display: block;
    object-fit: contain;
}

.sidebar-logo-dark { display: none; }
.sidebar-logo-light { display: block; }

[data-theme="dark"] .sidebar-logo-dark { display: block; }
[data-theme="dark"] .sidebar-logo-light { display: none; }

/* PlatformIQ badge */
.piq-badge {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 2px 7px;
    border-radius: 5px;
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
    line-height: 1.4;
    white-space: nowrap;
}

.piq-badge--lg {
    font-size: 13px;
    padding: 3px 9px;
    border-radius: 6px;
}

/* Login page theme toggle */
.login-theme-toggle {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    color: var(--color-text-tertiary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.login-theme-toggle:hover {
    background: var(--color-surface-hover);
    color: var(--color-text);
}

.sidebar-brand {
    font-size: 15px;
    font-weight: 600;
    color: var(--sidebar-text);
    letter-spacing: -0.01em;
}

/* ---------- Sidebar Navigation ---------- */
.sidebar-nav {
    flex: 1;
    padding: 0 12px;
    overflow-y: auto;
}

.sidebar-section-label {
    padding: 20px 8px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--sidebar-text-muted);
}

.sidebar-divider {
    margin: 8px 8px;
    border: 0;
    border-top: 1px solid var(--color-divider);
}

.nav-item {
    list-style: none;
}

.nav-divider {
    list-style: none;
    height: 1px;
    background: var(--sidebar-border);
    margin: 8px 16px;
}

.nav-group-label {
    list-style: none;
    padding: 16px 20px 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--sidebar-text-muted, var(--color-text-tertiary));
    opacity: 0.6;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    position: relative;
    margin-bottom: 1px;
}

.nav-link:hover {
    background-color: var(--sidebar-item-hover);
    color: var(--sidebar-text);
}

.nav-link.active {
    background-color: var(--sidebar-item-active-bg);
    color: var(--sidebar-item-active-text);
    font-weight: 600;
}

.nav-link .nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    opacity: 0.7;
}

.nav-link.active .nav-icon {
    opacity: 1;
}

/* Disabled / Coming Soon nav items */
.nav-link.disabled {
    opacity: 0.45;
    cursor: default;
    pointer-events: none;
}

.nav-link.disabled:hover {
    background-color: transparent;
}

.badge-coming-soon {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 4px;
    background-color: var(--badge-coming-soon-bg);
    color: var(--badge-coming-soon-text);
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- Sidebar Footer ---------- */
.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--color-divider);
    flex-shrink: 0;
}

.sidebar-footer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

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

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--sidebar-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    font-size: 11px;
    color: var(--sidebar-text-muted);
}

.sidebar-footer-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
}

.sidebar-footer-actions form {
    display: flex;
    margin: 0;
}

.sidebar-icon-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--sidebar-text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
    font-family: inherit;
}

.sidebar-icon-btn svg {
    width: 18px;
    height: 18px;
}

.sidebar-icon-btn:hover {
    background-color: var(--sidebar-item-hover);
    color: var(--sidebar-text);
}

.theme-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--sidebar-text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.theme-toggle:hover {
    background-color: var(--sidebar-item-hover);
    color: var(--sidebar-text);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ---------- Top Bar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: var(--topbar-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--topbar-border);
    min-height: var(--topbar-height);
    display: flex;
    align-items: center;
    padding: 8px var(--content-padding);
    transition: background-color var(--transition-normal);
}

.topbar-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    row-gap: 4px;
    flex: 1;
    flex-wrap: wrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
    flex-shrink: 0;
}

.brand-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.topbar-separator {
    width: 1px;
    height: 24px;
    background-color: var(--color-divider);
    flex-shrink: 0;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    font-family: inherit;
    text-decoration: none;
}

.btn-logout:hover {
    color: var(--color-danger);
    background-color: var(--color-danger-bg);
}

/* ---------- Main Content ---------- */
.main-content {
    flex: 1;
    padding: var(--content-padding);
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   Form Controls (Apple-like)
   ========================================================================== */
.form-select,
.form-input,
select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="date"] {
    appearance: none;
    -webkit-appearance: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    color: var(--input-text);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    outline: none;
    transition: all var(--transition-fast);
    line-height: 1.4;
}

.form-select:focus,
.form-input:focus,
select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="date"]:focus {
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-select::placeholder,
.form-input::placeholder,
input::placeholder {
    color: var(--input-placeholder);
}

/* Select arrow */
select.form-select {
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386868B' d='M6 8.825L1.175 4 2.238 2.938 6 6.7 9.763 2.937 10.825 4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.form-select-sm {
    padding: 5px 28px 5px 10px;
    font-size: 12px;
}

/* Filter group in topbar */
.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    white-space: nowrap;
}

/* Multi-select (custom styled) */
.multi-select-wrapper {
    position: relative;
}

.multi-select-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background-color: var(--input-bg);
    font-size: 13px;
    font-weight: 500;
    color: var(--input-text);
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    min-width: 140px;
}

.multi-select-trigger:hover {
    border-color: var(--color-text-tertiary);
}

.multi-select-trigger .count-badge {
    background-color: var(--color-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 200px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 200;
    display: none;
}

.multi-select-dropdown.open {
    display: block;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
}

.multi-select-option:hover {
    background-color: var(--sidebar-item-hover);
}

.multi-select-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    color: #FFFFFF;
}

.btn-secondary {
    background-color: var(--color-border-light);
    color: var(--color-text);
}

.btn-secondary:hover {
    background-color: var(--color-border);
}

.btn-ghost {
    background-color: transparent;
    color: var(--color-text-secondary);
}

.btn-ghost:hover {
    background-color: var(--sidebar-item-hover);
    color: var(--color-text);
}

.btn-sm {
    font-size: 12px;
    padding: 5px 12px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    overflow: hidden;
}

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

.card-body {
    padding: 20px;
}

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

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

.card-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--color-border-light);
    background: transparent;
}

/* Stat Cards */
.stat-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

.stat-card .stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.stat-card .stat-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-top: 6px;
}

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

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

.stat-card .stat-change.neutral {
    color: var(--color-text-tertiary);
}

/* ==========================================================================
   Analysis Summary Widgets
   ========================================================================== */

.analysis-widget {
    min-height: 120px;
    min-width: 0;
}

.analysis-widget-body {
    display: flex;
    gap: 16px;
    padding: 12px 16px 16px;
    align-items: center;
}

.widget-chart {
    flex: 2;
    height: 56px;
    position: relative;
}

.widget-stat {
    flex: 1;
    text-align: center;
    min-width: 70px;
}

.widget-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.widget-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.2;
}

.widget-stat-change {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    color: var(--color-text-tertiary);
}

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

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

.widget-detail-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    color: var(--color-text-tertiary);
    transition: all var(--transition-fast);
}

.widget-detail-link:hover {
    background: var(--color-bg-secondary);
    color: var(--color-primary);
}

.widget-no-data {
    color: var(--color-text-tertiary);
    font-size: 12px;
    text-align: center;
    padding: 8px 0;
}

.widget-divider {
    width: 1px;
    height: 40px;
    background: var(--color-border);
    flex-shrink: 0;
}

/* Ranking widget — chip & dropdown */
.w-rank-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 14px;
    font-size: 11px;
    font-weight: 500;
    background: var(--color-bg-secondary, #F2F2F7);
    color: var(--color-text);
    white-space: nowrap;
}

.w-rank-chip--own {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.w-rank-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.w-rank-chip-x {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    color: var(--color-text-tertiary);
    padding: 0 0 0 2px;
}

.w-rank-chip-x:hover {
    color: var(--color-danger);
}

.w-rank-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 360px;
    max-width: calc(100vw - var(--sidebar-width) - 96px);
    max-height: 220px;
    overflow-y: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    margin-top: 4px;
}

.w-rank-dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.w-rank-dropdown-item:hover {
    background: var(--color-surface-hover);
}

/* ==========================================================================
   Grid Layout Utilities
   ========================================================================== */
.grid {
    display: grid;
    gap: 20px;
    min-width: 0;
}

.grid > * {
    min-width: 0;
}

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

.grid-auto-fit {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }

/* ==========================================================================
   Charts
   ========================================================================== */
.chart-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 300px;
    padding: 4px;
}

.chart-container-sm {
    height: 200px;
}

.chart-container-lg {
    height: 400px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.data-table thead th {
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background-color: var(--color-surface);
    z-index: 5;
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--color-surface-hover);
}

.data-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text);
    vertical-align: middle;
}

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

/* Ranking-specific table styles */
.table-rankings th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-tertiary);
}

.table-rankings td {
    vertical-align: middle;
}

/* ==========================================================================
   Badges & Tags
   ========================================================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    line-height: 1.4;
}

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

.badge-success {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

.badge-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
}

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

.badge-info {
    background-color: var(--color-info-bg);
    color: var(--color-info);
}

.badge-neutral {
    background-color: var(--color-border-light);
    color: var(--color-text-tertiary);
}

/* Platform badges */
.badge-platform {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    color: #FFFFFF;
}

.badge-yemeksepeti { background-color: var(--platform-yemeksepeti); }
.badge-trendyolgo { background-color: var(--platform-trendyolgo); }
.badge-getiryemek { background-color: var(--platform-getiryemek); }
.badge-migrosyemek { background-color: var(--platform-migrosyemek); }

/* Platform text colors */
.platform-yemeksepeti { color: var(--platform-yemeksepeti); }
.platform-trendyolgo { color: var(--platform-trendyolgo); }
.platform-getiryemek { color: var(--platform-getiryemek); }
.platform-migrosyemek { color: var(--platform-migrosyemek); }

/* Platform background colors */
.bg-yemeksepeti { background-color: var(--platform-yemeksepeti) !important; }
.bg-trendyolgo { background-color: var(--platform-trendyolgo) !important; }
.bg-getiryemek { background-color: var(--platform-getiryemek) !important; }
.bg-migrosyemek { background-color: var(--platform-migrosyemek) !important; }

/* ==========================================================================
   Ranking Change Indicators
   ========================================================================== */
.rank-up {
    color: var(--color-success);
    font-weight: 600;
}

.rank-down {
    color: var(--color-danger);
    font-weight: 600;
}

.rank-same {
    color: var(--color-text-tertiary);
}

.rank-change {
    font-weight: 600;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

/* ==========================================================================
   Page Header
   ========================================================================== */
.page-header {
    margin-bottom: 28px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

/* ==========================================================================
   Section Headers
   ========================================================================== */
.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
    letter-spacing: -0.01em;
}

/* ==========================================================================
   HTMX Loading States
   ========================================================================== */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-flex;
    align-items: center;
}

.htmx-request.htmx-indicator {
    display: inline-flex;
    align-items: center;
}

/* Subtle loading shimmer on content areas */
.htmx-request .htmx-loading-target {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity var(--transition-fast);
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg,
        var(--color-border-light) 25%,
        var(--color-surface-hover) 50%,
        var(--color-border-light) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   Alert / Messages
   ========================================================================== */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.alert-info {
    background-color: var(--color-info-bg);
    color: var(--color-text);
    border: 1px solid transparent;
}

.alert-success {
    background-color: var(--color-success-bg);
    color: var(--color-text);
    border: 1px solid transparent;
}

.alert-warning {
    background-color: var(--color-warning-bg);
    color: var(--color-text);
    border: 1px solid transparent;
}

.alert-danger {
    background-color: var(--color-danger-bg);
    color: var(--color-text);
    border: 1px solid transparent;
}

/* ==========================================================================
   Empty States
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-tertiary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 8px;
}

.empty-state-text {
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* ==========================================================================
   Login Page
   ========================================================================== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-bg);
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 40px;
}

.login-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 32px;
}

.login-logo-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

.login-logo-text {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.login-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    text-align: center;
    margin-bottom: 24px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.login-form .form-group input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
}

.login-form .btn-login {
    width: 100%;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    margin-top: 8px;
}

.login-error {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 16px;
    text-align: center;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */

/* Text */
.text-primary { color: var(--color-primary) !important; }
.text-success { color: var(--color-success) !important; }
.text-warning { color: var(--color-warning) !important; }
.text-danger { color: var(--color-danger) !important; }
.text-info { color: var(--color-info) !important; }
.text-muted { color: var(--color-text-tertiary) !important; }
.text-secondary { color: var(--color-text-secondary) !important; }

.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 16px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-right { text-align: right; }

/* Spacing */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mr-1 { margin-right: 8px; }
.ml-1 { margin-left: 8px; }
.ml-auto { margin-left: auto; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }

/* Display */
.d-none { display: none !important; }
.d-flex { display: flex; }
.d-block { display: block; }
.d-inline-flex { display: inline-flex; }

/* Misc */
.w-full { width: 100%; }
.h-full { height: 100%; }
.overflow-hidden { overflow: hidden; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================================================
   Transitions
   ========================================================================== */
.fade-in {
    animation: fadeIn var(--transition-normal) ease-out;
}

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

/* ==========================================================================
   Filter Bar (inline in pages, below topbar)
   ========================================================================== */
.filter-bar {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* ==========================================================================
   Restaurant Card (existing dashboard)
   ========================================================================== */
.restaurant-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.restaurant-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card-hover);
}

/* ==========================================================================
   Brand Card Grid
   ========================================================================== */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.brand-card {
    display: block;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: all var(--transition-normal);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    padding: 20px;
}

.brand-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--color-primary);
    text-decoration: none;
    color: inherit;
}

.brand-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.brand-card-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-card-platforms {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.brand-card-platform-tag {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: var(--color-border-light);
    color: var(--color-text-secondary);
}

.brand-card-stats {
    display: flex;
    gap: 24px;
}

.brand-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.brand-stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

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

.brand-stat-info {
    color: var(--color-primary);
}

.brand-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.empty-state-hint {
    font-size: 12px;
    color: var(--color-text-tertiary);
    margin-top: 4px;
}

/* ==========================================================================
   Badge overrides for existing templates
   ========================================================================== */
.badge-promoted {
    background-color: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge-discount {
    background-color: var(--color-success-bg);
    color: var(--color-success);
}

/* ==========================================================================
   List group (for existing templates)
   ========================================================================== */
.list-group {
    list-style: none;
    padding: 0;
    margin: 0;
}

.list-group-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

/* ==========================================================================
   Table responsive wrapper
   ========================================================================== */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled) {
    color: var(--color-primary);
    border-color: var(--color-primary);
    background-color: var(--color-primary-light);
}

.pagination-btn.disabled {
    opacity: 0.4;
    cursor: default;
    pointer-events: none;
}

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 2px;
}

.pagination-page {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination-page:hover {
    background-color: var(--color-surface-hover);
    color: var(--color-text);
}

.pagination-page.active {
    background-color: var(--color-primary);
    color: #fff;
    font-weight: 600;
}

.pagination-ellipsis {
    width: 34px;
    text-align: center;
    color: var(--color-text-tertiary);
    font-size: 13px;
}

/* Clickable table rows */
.brand-row {
    cursor: pointer;
}

/* ==========================================================================
   SVG Icons inline (for sidebar nav)
   ========================================================================== */
.icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.icon svg {
    width: 100%;
    height: 100%;
}

/* ==========================================================================
   Comparison View - Search, Chips, Table
   ========================================================================== */

/* Search wrapper */
/* Comparison selection card body */
.comparison-selection-body {
    display: flex;
    flex-direction: column;
}

.comparison-search-input-group {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    flex-shrink: 0;
}

.comparison-search-icon {
    position: absolute;
    left: 16px;
    color: var(--color-text-placeholder);
    pointer-events: none;
    flex-shrink: 0;
}

input[type="text"].comparison-search-input {
    width: 100%;
    padding: 12px 44px 12px 44px;
    font-size: 15px;
    font-weight: 500;
    color: var(--input-text);
    background-color: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-md);
    outline: none;
    transition: all var(--transition-fast);
    font-family: inherit;
}

input[type="text"].comparison-search-input:focus {
    border-color: var(--input-border-focus);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

input[type="text"].comparison-search-input::placeholder {
    color: var(--input-placeholder);
    font-weight: 400;
}

.comparison-search-spinner {
    position: absolute;
    right: 16px;
    display: flex;
    align-items: center;
}

/* Search results — inline within card (not a floating dropdown) */
.comparison-search-results {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background-color: var(--color-bg);
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 12px;
    flex-shrink: 0;
    animation: compResultsIn 0.15s ease-out;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.comparison-search-results::-webkit-scrollbar {
    width: 6px;
}
.comparison-search-results::-webkit-scrollbar-track {
    background: transparent;
}
.comparison-search-results::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

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

/* Group headers */
.search-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg);
    position: sticky;
    top: 0;
    z-index: 1;
}
.search-group-header:first-child {
    border-top: none;
}
.search-group-header svg {
    opacity: 0.5;
    flex-shrink: 0;
}
.search-group-count {
    font-weight: 500;
    color: var(--color-text-quaternary);
    font-size: 10px;
    background: var(--color-border-light);
    padding: 0 5px;
    border-radius: 8px;
    line-height: 16px;
}

/* Result items */
.search-result-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    gap: 10px;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: var(--color-primary-light);
}

.search-result-item.disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.search-result-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}

.search-result-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-result-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-meta {
    font-size: 11px;
    color: var(--color-text-tertiary);
    white-space: nowrap;
    flex-shrink: 0;
}

.search-result-bottom {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.search-result-detail {
    font-size: 11px;
    color: var(--color-text-tertiary);
}

/* Highlight matching text */
.search-highlight {
    background-color: rgba(0, 102, 255, 0.12);
    color: var(--color-primary);
    border-radius: 2px;
    padding: 0 1px;
}

/* Small platform badges in search */
.badge-sm {
    font-size: 10px;
    padding: 1px 6px;
    line-height: 16px;
}
.search-badge-count {
    opacity: 0.6;
    margin-left: 2px;
}

/* Add / check icons */
.search-result-add,
.search-result-check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}
.search-result-add {
    color: var(--color-text-quaternary);
}
.search-result-item:hover .search-result-add {
    color: var(--color-primary);
    background: var(--color-primary-light);
}
.search-result-check {
    background: var(--color-primary-light);
}

/* Footer keyboard hints */
.search-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 11px;
    color: var(--color-text-quaternary);
    border-top: 1px solid var(--color-border-light);
    background: var(--color-bg);
    position: sticky;
    bottom: 0;
}
.search-footer kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 500;
    color: var(--color-text-tertiary);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 3px;
    box-shadow: 0 1px 0 var(--color-border);
}

/* Empty state */
.search-result-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 24px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--color-text-tertiary);
}

/* Chips */
.comparison-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.comparison-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px 5px 8px;
    border-radius: 20px;
    border: 1.5px solid;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    transition: all var(--transition-fast);
    animation: chipIn 0.2s ease-out;
}

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

.comparison-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.comparison-chip-name {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comparison-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--color-text-tertiary);
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.comparison-chip-remove:hover {
    background-color: var(--color-danger-bg);
    color: var(--color-danger);
}

/* Empty state */
.comparison-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 24px;
    color: var(--color-text-tertiary);
}
.comparison-empty-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-secondary);
}
.comparison-empty-hint {
    font-size: 12px;
    color: var(--color-text-quaternary);
}

/* Comparison table dot */
.comparison-table-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    vertical-align: middle;
}

/* Loading overlay */
.comparison-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px;
    color: var(--color-text-tertiary);
    font-size: 13px;
}

/* ==========================================================================
   Period Info Banner
   ========================================================================== */
.period-info-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    margin-bottom: 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    font-size: 12px;
}

.period-info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.period-info-label {
    color: var(--color-text-tertiary);
    font-weight: 500;
}

.period-info-value {
    color: var(--color-text-primary);
    font-weight: 600;
}

.period-info-badge {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 11px;
    font-weight: 600;
}

/* ==========================================================================
   Brand Dashboard Components
   ========================================================================== */

/* Small platform badge (for tables) */
.platform-badge-sm {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

/* Trend badge (percentage indicators) */
.trend-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.trend-badge-success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.trend-badge-warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.trend-badge-danger {
    background: var(--color-danger-bg);
    color: var(--color-danger);
}

.trend-badge-neutral {
    background: var(--color-border-light);
    color: var(--color-text-tertiary);
}

/* Performer items (best/worst lists) */
.performer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
    text-decoration: none;
    color: var(--color-text);
    transition: background var(--transition-fast);
}

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

.performer-item:hover {
    background: var(--color-surface-hover);
}

.performer-rank {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-success);
    min-width: 24px;
    text-align: center;
}

.performer-info {
    flex: 1;
    min-width: 0;
}

.performer-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.performer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
    font-size: 11px;
    color: var(--color-text-tertiary);
}

.performer-value {
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

/* Cross-platform section in restaurant detail */
.cross-platform-section {
    border-top: 1px solid var(--color-border-light);
    margin-top: 24px;
    padding-top: 24px;
}

.cross-platform-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.cross-platform-link:hover {
    opacity: 0.8;
}
