/* =========================================================================
   Chiprr Dashboard — Liquid Glass OS (Apple macOS UI Style)
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
    /* Base Colors */
    --bg-light: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --text-tertiary: #a1a1a6;

    /* Accents */
    --accent-color: #0066cc;
    --accent-gradient: linear-gradient(135deg, #007aff 0%, #005bb5 100%);
    --accent-blur: rgba(0, 102, 204, 0.15);

    /* Variables for Icon backgrounds */
    --blue-glow: rgba(0, 122, 255, 0.15);
    --blue-color: #007aff;
    --purple-glow: rgba(175, 82, 222, 0.15);
    --purple-color: #af52de;
    --orange-glow: rgba(255, 149, 0, 0.15);
    --orange-color: #ff9500;
    --green-glow: rgba(52, 199, 89, 0.15);
    --green-color: #34c759;
    --red-glow: rgba(255, 59, 48, 0.15);
    --red-color: #ff3b30;

    /* Glass Panels */
    --glass-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 10px 40px rgba(0, 0, 0, 0.04);
    --glass-shadow-hover: 0 12px 50px rgba(0, 0, 0, 0.08);

    /* Glass Controls */
    --button-glass-bg: rgba(255, 255, 255, 0.5);
    --button-glass-hover: rgba(255, 255, 255, 0.9);

    /* Specs */
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 10px;
    --sidebar-w: 260px;

    /* Apple Spring Easing */
    --spring: cubic-bezier(0.2, 0.8, 0.2, 1);

    /* Legacy vars alias */
    --text: var(--text-primary);
    --text-muted: var(--text-tertiary);
    --accent: var(--accent-color);
    --accent-hover: #005bb5;
    --accent-light: var(--blue-glow);
    --canvas: transparent;
    --card: var(--glass-bg);
    --radius: var(--radius-lg);
    --radius-xs: var(--radius-sm);
    --success: var(--green-color);
    --success-light: var(--green-glow);
    --danger: var(--red-color);
    --danger-light: var(--red-glow);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.4;
    background: #e8ebf2;
}

/* =========================================================================
   MESH BACKGROUND & NOISE
   ========================================================================= */

.mesh-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: #e8ebf2;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.6;
    animation: moveShapes 30s infinite alternate cubic-bezier(0.4, 0.0, 0.2, 1);
}

.shape-1 {
    left: -10%;
    top: -10%;
    width: 50vw;
    height: 50vw;
    background: #e0f0ff;
    animation-delay: 0s;
}

.shape-2 {
    right: -10%;
    top: 10%;
    width: 40vw;
    height: 40vw;
    background: #fdf0f8;
    animation-delay: -5s;
}

.shape-3 {
    bottom: -10%;
    left: 20%;
    width: 60vw;
    height: 40vw;
    background: #f0f4ff;
    animation-delay: -10s;
}

.shape-4 {
    bottom: 10%;
    right: -5%;
    width: 35vw;
    height: 35vw;
    background: #f2fce0;
    opacity: 0.4;
    animation-delay: -15s;
}

@keyframes moveShapes {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(5%, 10%) scale(1.1);
    }

    100% {
        transform: translate(-5%, -5%) scale(0.95);
    }
}

.noise {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    mix-blend-mode: overlay;
    pointer-events: none;
}

/* =========================================================================
   GLASS PANELS (Core Component)
   ========================================================================= */

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.glass-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    border: 1px solid #ffffff;
    opacity: 0.5;
    pointer-events: none;
    z-index: 10;
}

.glass-button {
    background: var(--button-glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border-radius: var(--radius-sm);
    transition: all 0.3s var(--spring);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.glass-button:hover {
    background: var(--button-glass-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    border-color: #ffffff;
}

.glass-button:active {
    transform: scale(0.97);
}

.fill-button {
    background: var(--text-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s var(--spring);
}

.fill-button:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* =========================================================================
   AUTH PAGES & FORMS (Re-styled for liquid glass)
   ========================================================================= */

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    text-align: center;
    box-shadow: var(--glass-shadow);
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    border: 1px solid #ffffff;
    opacity: 0.5;
    pointer-events: none;
    z-index: 10;
}

.auth-logo {
    font-size: 48px;
    margin-bottom: 12px;
}

.auth-card h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 15px;
}

.setup-card {
    max-width: 500px;
    text-align: left;
}

.setup-card h1,
.setup-card .auth-subtitle {
    text-align: center;
}

.telegram-login-section {
    margin: 32px 0 24px;
}

.login-instruction {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

#telegram-login-container {
    display: flex;
    justify-content: center;
    min-height: 46px;
    align-items: center;
}

.login-info {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.login-info p {
    font-size: 13px;
    color: var(--text-tertiary);
    margin: 4px 0;
}

.setup-steps {
    margin: 28px 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.setup-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-color);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* INPUTS */
.input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04), inset 0 2px 4px rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    margin-bottom: 14px;
    transition: all 0.3s var(--spring);
}

.input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.85);
    border-color: var(--blue-color);
    box-shadow: 0 0 0 4px var(--blue-glow), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.input::placeholder {
    color: var(--text-tertiary);
}

.textarea {
    min-height: 80px;
    resize: vertical;
}

.input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    text-align: left;
}

/* BUTTONS */
.primary-btn {
    width: 100%;
    padding: 14px;
    background: var(--blue-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.3s var(--spring);
    font-family: inherit;
    box-shadow: 0 4px 12px var(--blue-glow);
}

.primary-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.3);
}

.primary-btn:active {
    transform: scale(0.98);
}

.primary-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.secondary-btn {
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.secondary-btn:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.08);
}

.error-msg,
.success-msg {
    font-size: 14px;
    padding: 12px 16px;
    margin-top: 12px;
    border-radius: var(--radius-sm);
}

.error-msg {
    color: #d70015;
    background: var(--red-glow);
}

.success-msg {
    color: #248a3d;
    background: var(--green-glow);
}

/* =========================================================================
   APP LAYOUT
   ========================================================================= */

.app-container {
    display: flex;
    height: 100vh;
    padding: 12px;
    gap: 12px;
}

/* =========================================================================
   SIDEBAR
   ========================================================================= */

.sidebar {
    width: var(--sidebar-w);
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    flex-shrink: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 12px 32px;
}

.sidebar-header .logo {
    width: 36px;
    height: 36px;
    background: var(--accent-gradient);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-blur);
}

.sidebar-header .logo svg {
    width: 20px;
    height: 20px;
}

.sidebar-header .brand {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.nav-menu::-webkit-scrollbar {
    display: none;
}

.nav-menu {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-section {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 20px 12px 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    background: none;
    border: none;
    font-family: inherit;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.nav-item .icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 2.2px;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.new-badge {
    background: var(--blue-color);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
}

.sidebar-footer {
    padding-top: 20px;
}

.user-profile {
    width: 100%;
    padding: 10px;
    justify-content: flex-start;
    gap: 12px;
    border-radius: 14px;
}

.user-profile .avatar-img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    object-fit: cover;
}

.user-avatar-placeholder {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blue-glow);
    color: var(--blue-color);
    font-weight: 700;
}

.user-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

.user-info .name {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.2;
}

.user-info .role {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* =========================================================================
   MAIN CONTENT AREA
   ========================================================================= */

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: var(--radius-lg);
    position: relative;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 16px 32px 32px;
}

.greeting h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.greeting p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    height: 44px;
    border-radius: 14px;
    min-width: 260px;
    transition: all 0.3s var(--spring);
}

.search-bar:focus-within {
    box-shadow: 0 0 0 3px var(--blue-glow);
    border-color: var(--blue-color);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
}

.search-bar input {
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    width: 100%;
}

.search-bar input:focus {
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-tertiary);
}

.notif-btn {
    width: 44px;
    height: 44px;
    position: relative;
    border-radius: 14px;
}

.notif-btn svg {
    width: 20px;
    height: 20px;
}

.notif-dot {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 6px;
    height: 6px;
    background: var(--red-color);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0 32px 32px;
    padding-right: 24px;
    margin-right: 8px;
}

.content-scroll::-webkit-scrollbar {
    width: 6px;
}

.content-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.content-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.content-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* =========================================================================
   KPI CARDS
   ========================================================================= */

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.kpi-card {
    padding: 24px;
    transition: all 0.3s var(--spring);
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--glass-shadow-hover);
}

.kpi-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kpi-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.kpi-icon-wrap svg {
    width: 20px;
    height: 20px;
}

.var-blue {
    background: var(--blue-glow);
    color: var(--blue-color);
}

.var-purple {
    background: var(--purple-glow);
    color: var(--purple-color);
}

.var-orange {
    background: var(--orange-glow);
    color: var(--orange-color);
}

.var-green {
    background: var(--green-glow);
    color: var(--green-color);
}

.kpi-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.kpi-badge.positive {
    background: var(--green-glow);
    color: #248a3d;
}

.kpi-badge.negative {
    background: var(--red-glow);
    color: #d70015;
}

.kpi-badge.neutral {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
}

.kpi-title {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* =========================================================================
   DASHBOARD GRID (Charts & Lists)
   ========================================================================= */

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.grid-col-span-2 {
    grid-column: span 2;
}

.card {
    padding: 28px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.filter-dropdown {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    gap: 6px;
}

.filter-dropdown svg {
    width: 14px;
    height: 14px;
    color: var(--text-secondary);
}

.text-btn {
    border: none;
    background: none;
    color: var(--blue-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.text-btn:hover {
    text-decoration: underline;
}

.chart-area {
    height: 240px;
    display: flex;
    align-items: flex-end;
}

.chart-bars {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    padding-top: 20px;
}

.chart-bar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.bar-track {
    width: 32px;
    height: 100%;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: flex-end;
}

.bar-fill {
    width: 100%;
    background: #c7c7cc;
    border-radius: 8px;
    transition: all 0.5s var(--spring);
}

.chart-bar-group:hover .bar-fill {
    transform: scaleY(1.05);
    transform-origin: bottom;
    background: var(--blue-color);
}

.bar-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.orders-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: 14px;
    transition: background 0.2s;
}

.order-item:hover {
    background: rgba(255, 255, 255, 0.4);
}

.order-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    pointer-events: none;
    padding: 0;
    overflow: hidden;
}

.order-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.order-info {
    flex: 1;
    min-width: 0;
}

.order-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.order-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.top-product-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.top-product-item:last-child {
    border-bottom: none;
}

.top-product-thumb {
    width: 46px;
    height: 46px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.top-product-info {
    flex: 1;
    min-width: 0;
}

.top-product-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.top-product-sales {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.top-product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* =========================================================================
   TABLES & LISTS (Orders)
   ========================================================================= */

.orders-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.orders-table th {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.orders-table td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    vertical-align: middle;
}

.orders-table tbody tr {
    transition: background 0.2s;
}

.orders-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.order-id-cell {
    font-family: monospace;
    font-size: 13px;
    color: var(--text-secondary);
}

.order-client-name {
    font-weight: 600;
    color: var(--text-primary);
}

.order-client-handle {
    color: var(--blue-color);
    font-weight: 400;
    font-size: 13px;
}

.order-client-contact {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.status-badge.pending {
    background: var(--orange-glow);
    color: var(--orange-color);
}

.status-badge.confirmed {
    background: var(--blue-glow);
    color: var(--blue-color);
}

.status-badge.in-progress {
    background: var(--purple-glow);
    color: var(--purple-color);
}

.status-badge.paid {
    background: var(--green-glow);
    color: var(--green-color);
}

.status-badge.cancelled {
    background: var(--red-glow);
    color: var(--red-color);
}

.order-action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    margin-right: 4px;
}

.order-action-btn.confirm {
    background: var(--green-glow);
    color: var(--green-color);
}

.order-action-btn.confirm:hover {
    background: var(--green-color);
    color: white;
}

.order-action-btn.reject {
    background: var(--red-glow);
    color: var(--red-color);
}

.order-action-btn.reject:hover {
    background: var(--red-color);
    color: white;
}

.order-action-btn.complete {
    width: auto;
    padding: 0 12px;
    font-weight: 600;
    background: var(--text-primary);
    color: white;
}

.order-action-btn.complete:hover {
    background: #000;
}

.order-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.order-filter-tab {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.order-filter-tab:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
}

.order-filter-tab.active {
    background: var(--blue-color);
    color: white;
    border-color: var(--blue-color);
    box-shadow: 0 4px 12px var(--blue-glow);
}

.order-filter-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.order-filter-tab.active .order-filter-count {
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================================================
   PRODUCTS GRID & FORMS
   ========================================================================= */

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--glass-border);
    padding: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s;
    position: relative;
    backdrop-filter: blur(20px);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--glass-shadow-hover);
}

.product-card.inactive {
    opacity: 0.6;
}

.product-card-image {
    width: 100%;
    height: 160px;
    border-radius: 12px;
    object-fit: cover;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.04);
}

.product-card-emoji {
    width: 100%;
    height: 160px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    margin-bottom: 16px;
}

.product-card-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.product-card-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.product-card-variants {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.product-variant-tag {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    border-radius: 6px;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.product-card-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.product-card-actions {
    display: flex;
    gap: 8px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.icon-btn.danger:hover {
    background: var(--red-glow);
    color: var(--red-color);
}

/* Form Elements inside content */
.form-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(20px);
    margin-bottom: 24px;
}

.form-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    font-family: inherit;
}

.form-card h4 {
    font-size: 16px;
    font-weight: 600;
    margin: 24px 0 16px;
}

.form-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {

    .form-two-col,
    .form-row {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.image-preview-wrap {
    margin-bottom: 16px;
    display: inline-block;
}

.image-preview {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1), 0 0 0 4px rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.image-preview-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 1px dashed rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: var(--text-tertiary);
}

.variant-builder {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 16px;
    padding: 16px;
    border: 1px dashed rgba(0, 0, 0, 0.1);
}

.variant-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.variant-price-input {
    width: 120px;
}

.variant-remove-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--red-glow);
    color: var(--red-color);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.variant-remove-btn:hover {
    background: var(--red-color);
    color: white;
}

.add-variant-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 8px;
    font-size: 14px;
}

.add-variant-btn:hover {
    border-color: var(--blue-color);
    color: var(--blue-color);
    background: var(--blue-glow);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.form-actions .primary-btn,
.form-actions .secondary-btn {
    width: auto;
    min-width: 140px;
    margin-top: 0;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.empty-state {
    padding: 60px 20px;
    text-align: center;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin: 0 auto;
}

.auth-page .spinner {
    border-color: rgba(0, 122, 255, 0.2);
    border-top-color: var(--blue-color);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* =========================================================================
   SETTINGS & MISC
   ========================================================================= */

.layout-selector {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.layout-option {
    flex: 1;
    padding: 16px;
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
    position: relative;
    background: var(--glass-bg);
}

.layout-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.layout-option:hover {
    border-color: rgba(0, 0, 0, 0.2);
}

.layout-option.selected {
    border-color: var(--blue-color);
    background: var(--blue-glow);
}

.layout-option span {
    font-size: 14px;
    font-weight: 600;
    display: block;
    margin-top: 12px;
}

.layout-option-preview {
    width: 100%;
    height: 60px;
    display: flex;
    gap: 6px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 10px;
}

.layout-preview-list {
    flex-direction: column;
}

.lp-row {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.layout-preview-grid {
    flex-wrap: wrap;
}

.lp-tile {
    width: calc(50% - 3px);
    height: 16px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.info-card {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 16px;
    padding: 24px;
    margin-top: 24px;
}

.info-card p {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.6;
}

.plan-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    background: var(--blue-color);
    color: white;
    letter-spacing: 0.5px;
}

/* =========================================================================
   BROADCAST NOTIFICATIONS
   ========================================================================= */

.notifications-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 900px) {
    .notifications-layout {
        grid-template-columns: 1fr;
    }
}

.notifications-history-col {
    display: flex;
    flex-direction: column;
}

.notifications-compose-col {
    display: flex;
    flex-direction: column;
}

.tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 2px;
}

.tab-btn {
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 8px 12px;
    margin-bottom: -2px;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--blue-color);
    border-bottom-color: var(--blue-color);
}

.broadcast-history {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    max-height: 500px;
    padding-right: 8px;
}

.broadcast-history::-webkit-scrollbar {
    width: 6px;
}

.broadcast-history::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.broadcast-item {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid var(--blue-color);
}

.broadcast-item--deleted {
    border-left-color: var(--text-tertiary);
    opacity: 0.7;
}

.broadcast-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.broadcast-date {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.broadcast-sent-badge {
    font-size: 11px;
    background: rgba(0, 0, 0, 0.06);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 600;
}

.broadcast-delete-btn {
    background: var(--red-glow);
    color: var(--red-color);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    cursor: pointer;
}

.broadcast-item-msg {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-word;
}

.broadcast-deleted-date {
    margin-top: 12px;
    font-size: 11px;
    color: var(--red-color);
    font-weight: 600;
}

.broadcast-header {
    margin-bottom: 20px;
}

.broadcast-audience {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audience-badge {
    background: var(--purple-glow);
    color: var(--purple-color);
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
}

.broadcast-textarea {
    min-height: 200px;
    font-size: 15px;
}

.broadcast-hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 12px 0 24px;
}

.broadcast-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.char-counter {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
}

.broadcast-send-btn {
    width: auto;
    min-width: 160px;
    margin: 0;
}

.broadcast-result {
    margin-top: 20px;
    padding: 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
}

.broadcast-result--success {
    background: var(--green-glow);
    color: #248a3d;
}

.broadcast-result--error {
    background: var(--red-glow);
    color: #d70015;
}

/* =========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================= */

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        padding: 0;
        gap: 0;
        height: 100dvh;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        padding: 12px;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        border-radius: 24px 24px 0 0;
        backdrop-filter: blur(40px);
        -webkit-backdrop-filter: blur(40px);
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-bottom: none;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.08);
    }

    .sidebar-header,
    .sidebar-footer {
        display: none;
    }

    .nav-menu {
        flex-direction: row;
        width: 100%;
        justify-content: space-around;
        gap: 4px;
        overflow-x: auto;
        padding: 8px 0;
        padding-bottom: env(safe-area-inset-bottom, 8px);
    }

    .nav-section {
        display: none;
    }

    .nav-item {
        flex-direction: column;
        padding: 8px 4px;
        border-radius: 12px;
        font-size: 10px;
        gap: 4px;
        justify-content: center;
        align-items: center;
        flex: 1;
        text-align: center;
        min-width: 54px;
    }

    .nav-item .icon {
        margin: 0;
        width: 24px;
        height: 24px;
    }

    .nav-item.active {
        background: transparent;
        box-shadow: none;
        border: none;
        color: var(--blue-color);
    }

    .nav-item:hover {
        background: transparent;
    }

    .main-content {
        padding-bottom: 100px;
        border-radius: 0;
    }

    .topbar {
        padding: 20px 20px 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .topbar .actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-bar {
        flex: 1;
        min-width: 0;
    }

    .content-scroll {
        padding: 0 20px 20px;
        margin-right: 0;
    }

    .kpi-grid {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .card.grid-col-span-2 {
        grid-column: span 1;
    }

    .form-two-col {
        grid-template-columns: 1fr;
    }

    .orders-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .orders-table th,
    .orders-table td {
        padding: 12px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .products-grid {
        grid-template-columns: 1fr;
    }
}