@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');


/* ============================================
   BOLTSHIFT DESIGN SYSTEM — meloddyCMS
   Light-first, clean, corporate dashboard
   ============================================ */

:root {
    /* === BACKGROUNDS === */
    --bg-body: #EFEFEF;
    --bg-topbar: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-card-active: #EEF4FF;
    --bg-hover: #F3F4F6;
    --bg-active: #EEF4FF;
    --bg-input: #FFFFFF;
    --bg-input-focus: #FFFFFF;
    --bg-body-rgb: 244, 246, 249;

    /* === BORDERS === */
    --border: rgba(0, 0, 0, 0.05);
    --border-light: rgba(0, 0, 0, 0.02);
    --border-active: rgba(37, 99, 235, 0.2);
    --border-focus: #2563EB;

    /* === TEXT === */
    --text-main: #111827;
    --text-secondary: #374151;
    --text-muted: #6B7280;
    --text-placeholder: #9CA3AF;
    --text-inverse: #FFFFFF;

    /* === PRIMARY (Blue) === */
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EEF4FF;
    --primary-text: #FFFFFF;

    /* === SEMANTIC === */
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.1);

    /* === SHADOWS (Более мягкие, глубокие и объемные) === */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 12px 24px -4px rgba(0, 0, 0, 0.04), 0 4px 12px -2px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 24px 48px -8px rgba(0, 0, 0, 0.06), 0 8px 24px -4px rgba(0, 0, 0, 0.03);
    --shadow-card: 0 8px 20px -2px rgba(0, 0, 0, 0.03), 0 2px 6px -1px rgba(0, 0, 0, 0.02);

    /* === RADII (Более скругленные и современные) === */
    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-pill: 9999px;
}

/* ============================================
   DARK THEME
   ============================================ */
[data-theme="dark"] {
    --bg-body: #0B0C10;
    --bg-topbar: #12131A;
    --bg-card: #171821;
    --bg-card-active: rgba(37, 99, 235, 0.12);
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-active: rgba(37, 99, 235, 0.15);
    --bg-input: #171821;
    --bg-input-focus: #1C1E27;
    --bg-body-rgb: 11, 12, 16;

    --border: rgba(255, 255, 255, 0.06);
    --border-light: rgba(255, 255, 255, 0.03);
    --border-active: rgba(37, 99, 235, 0.4);
    --border-focus: #2563EB;

    --text-main: #F3F4F6;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --text-placeholder: #6B7280;
    --text-inverse: #111827;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 12px 24px -4px rgba(0, 0, 0, 0.45), 0 4px 12px -2px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 24px 48px -8px rgba(0, 0, 0, 0.55), 0 8px 24px -4px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 8px 20px -2px rgba(0, 0, 0, 0.3), 0 2px 6px -1px rgba(0, 0, 0, 0.2);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    letter-spacing: -0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scrollbar-gutter: stable;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 14px;
}

/* ============================================
   LAYOUT — Top-Bar + Content
   ============================================ */
.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 24px 40px 40px 40px;
}

/* ============================================
   TOP-BAR NAVIGATION
   ============================================ */
.topbar {
    height: 64px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 16px;
    margin: 16px 24px 0 24px;
    box-shadow: var(--shadow-md);
    z-index: 1000;
    flex-shrink: 0;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 32px;
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.topbar-logo img {
    width: 28px;
    height: 28px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.topbar-nav-item {
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.topbar-nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.topbar-nav-item.active {
    background: var(--primary);
    color: #FFFFFF;
}

[data-theme="dark"] .topbar-nav-item.active {
    background: var(--primary);
    color: #FFFFFF;
}

[data-theme="dark"] .topbar {
    background: rgba(22, 24, 32, 0.85);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.topbar-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
}

.topbar-icon-btn:hover {
    background: var(--bg-hover);
    color: var(--text-main);
    border-color: var(--border);
}

.topbar-icon-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 12px;
    cursor: pointer;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 4px 16px 4px 4px;
    transition: all 0.2s ease;
}

.topbar-user:hover {
    background: var(--bg-active);
    border-color: var(--border-active);
}

.topbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563EB, #3B82F6);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8rem;
    box-shadow: 0 2px 5px rgba(37, 99, 235, 0.2);
}

.topbar-user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.topbar-user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
}

.topbar-user-email {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Hide old sidebar */
.sidebar { display: none !important; }

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: var(--primary);
    color: var(--primary-text);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.15s ease;
    gap: 8px;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:hover {
    background: var(--primary-hover);
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--bg-hover) !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--bg-hover) !important;
    color: var(--text-main) !important;
    border: 1px solid var(--border) !important;
}

.btn-secondary:hover {
    background: var(--border) !important;
}

.btn-pill {
    border-radius: var(--radius-pill);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: var(--danger) !important;
    color: #ffffff !important;
}

.btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    flex-shrink: 0;
}

/* ============================================
   INPUTS & FORMS
   ============================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 12px 0 !important;
    font-size: 0.9rem !important;
    font-family: inherit;
    color: var(--text-main) !important;
    transition: all 0.15s ease !important;
    outline: none !important;
    box-sizing: border-box !important;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: transparent !important;
    border-bottom-color: #2055E5 !important;
    box-shadow: none !important;
}

select {
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
    padding-right: 36px !important;
}

select option {
    background: var(--bg-card);
    color: var(--text-main);
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 1rem;
}

.form-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.styled-select {
    color-scheme: light;
}
[data-theme="dark"] .styled-select {
    color-scheme: dark;
}

/* ============================================
   CARDS & PANELS
   ============================================ */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 160px;
    position: relative;
}

.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border);
}

.stats-card.highlight-card {
    background: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);
    border: none;
    color: #FFFFFF;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.2);
}

.stats-card.highlight-card:hover {
    box-shadow: 0 15px 30px rgba(37, 99, 235, 0.35);
}

.stats-card.highlight-card .stats-card-title,
.stats-card.highlight-card .stats-card-sublabel {
    color: rgba(255, 255, 255, 0.85);
}

.stats-card.highlight-card .stats-card-value {
    color: #FFFFFF;
}

.stats-card.highlight-card .stats-card-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
}

.stats-card.highlight-card .stats-card-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
}

.stats-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stats-card-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

.stats-card-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-card-icon.dark-circle {
    background: #111827;
    color: #FFFFFF;
}

[data-theme="dark"] .stats-card-icon.dark-circle {
    background: #374151;
    color: #FFFFFF;
}

.stats-card-icon.blue-circle {
    background: rgba(37, 99, 235, 0.1);
    color: #2563EB;
}

[data-theme="dark"] .stats-card-icon.blue-circle {
    background: rgba(37, 99, 235, 0.2);
    color: #60A5FA;
}

.stats-card-icon.green-circle {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

[data-theme="dark"] .stats-card-icon.green-circle {
    background: rgba(16, 185, 129, 0.2);
    color: #34D399;
}

.stats-card-icon svg {
    width: 18px;
    height: 18px;
}

.stats-card-body {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-top: 4px;
}

.stats-card-value {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
    margin: 0;
}

.stats-card-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
}

.stats-card-badge.positive {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.stats-card-badge.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8B5CF6;
}

.stats-card-footer {
    margin-top: auto;
}

.stats-card-sublabel {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Legacy stat classes */
.stat-card-glass {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card);
}

.stat-card-glass::before { display: none; }

.stat-card-glass:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.stat-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    background: var(--primary-light);
    flex-shrink: 0;
}

[data-theme="dark"] .stat-icon {
    background: rgba(37, 99, 235, 0.15);
}

.stat-icon svg {
    width: 20px !important;
    height: 20px !important;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ============================================
   DASHBOARD CONTAINER
   ============================================ */
.dashboard-container {
    width: 100%;
    max-width: 100%;
}

/* ============================================
   SITE CARDS (Projects)
   ============================================ */
.hero-card, .site-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.hero-card:hover, .site-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--border-active);
    z-index: 10;
}

.hero-card.active-dropdown, .site-card.active-dropdown {
    z-index: 50 !important;
}

.hero-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-main);
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: rgba(37, 99, 235, 0.06);
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

[data-theme="dark"] .feature-icon {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.2);
}

.hero-card:hover .feature-icon,
.site-card:hover .feature-icon {
    background: var(--primary);
    color: #FFFFFF;
    transform: scale(1.05);
}

/* Status Badge & Online Dot */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.status-badge.status-online {
    background: rgba(16, 185, 129, 0.08);
    color: #10B981;
}

.status-badge.status-offline {
    background: rgba(239, 68, 68, 0.08);
    color: #EF4444;
}

.status-badge.status-draft {
    background: rgba(245, 158, 11, 0.08);
    color: #F59E0B;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.status-online .status-dot {
    background: #10B981;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse-green 2s infinite;
}

.status-offline .status-dot {
    background: #EF4444;
}

@keyframes pulse-green {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.site-card h3 {
    font-size: 1rem;
    font-weight: 600;
}

.site-card .btn {
    width: 100%;
    margin-top: auto;
}

.site-action-btn:hover {
    color: var(--text-main) !important;
    background: var(--bg-hover) !important;
}

/* ============================================
   TABS
   ============================================ */

/* Pill Tabs */
.client-tabs-container {
    display: flex;
    gap: 4px;
    margin-bottom: 1.5rem;
    padding: 4px;
    background: var(--bg-hover);
    border-radius: var(--radius-pill);
    border: 1px solid var(--border);
    width: fit-content;
}

.client-tab-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    border: none;
    transition: all 0.15s ease;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.85rem;
    font-family: inherit;
}

.client-tab-item.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: var(--shadow-sm);
}

.client-tab-item:hover:not(.active) {
    color: var(--text-main);
}

/* Dev Tab (underline style) */
.dev-tab {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

/* Segmented Tabs (Современный Apple/Boltshift стиль) */
.segmented-tabs {
    display: inline-flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    border: 1px solid var(--border);
}

/* Premium Switch Component */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.switch input:checked + .slider {
    background-color: var(--primary);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}


.segmented-tab {
    padding: 8px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 6px;
}

.segmented-tab:hover {
    color: var(--text-main);
}

.segmented-tab.active {
    color: var(--text-main);
    background: var(--bg-card);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .segmented-tabs {
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .segmented-tab.active {
    background: var(--bg-card);
    color: var(--text-main);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Legacy & Underline Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
    padding-bottom: 2px;
}

.tab-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.tab-item:hover {
    color: var(--text-main);
}

.tab-item.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

/* Site Modal Tabs */
.site-modal-tab {
    padding: 10px 16px;
    background: none !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    color: var(--text-muted) !important;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.site-modal-tab.active {
    border-bottom-color: var(--primary) !important;
    color: var(--text-main) !important;
    font-weight: 600;
}

.site-modal-tab:hover:not(.active) {
    color: var(--text-main) !important;
}

/* ============================================
   GLASS PANEL (Settings & Admin)
   ============================================ */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.glass-panel::before { display: none; }

.glass-panel input[type="text"],
.glass-panel input[type="password"],
.glass-panel input[type="email"],
.glass-panel input[type="number"],
.glass-panel select {
    background: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 10px 14px !important;
    color: var(--text-main) !important;
    font-size: 0.9rem !important;
}

.glass-panel input:focus, .glass-panel select:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease forwards;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 28px;
    width: 540px;
    max-width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    animation: scaleIn 0.2s ease forwards;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============================================
   TOAST NOTIFICATIONS
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 99999;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(100%);
}

.toast.hiding { animation: toastFadeOut 0.3s ease forwards; }
.toast-icon svg { width: 18px; height: 18px; stroke-width: 2.5; }

@keyframes slideIn { to { opacity: 1; transform: translateY(0); } }
@keyframes toastFadeOut { to { opacity: 0; transform: scale(0.95); } }

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 10px;
    border: 2px solid var(--bg-body);
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

.activity-scroll {
    max-height: 350px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

/* ============================================
   SETTINGS
   ============================================ */
.settings-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all 0.15s ease;
}

.settings-section:hover {
    border-color: var(--border);
}

.settings-section-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Profile Dashboard Grid */
.profile-dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.premium-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

.premium-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}

/* Pricing Cards */
.pricing-cards-container {
    display: flex;
    gap: 1rem;
}

.pricing-card {
    flex: 1;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.2s ease;
    position: relative;
}

.pricing-card.active {
    border-color: var(--primary);
    background: var(--primary-light);
}

.pricing-card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    text-transform: uppercase;
}

.pricing-card-title { font-weight: 700; font-size: 1.1rem; color: var(--text-main); margin-bottom: 0.25rem; }
.pricing-card-description { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 1rem; }
.pricing-card-price { font-size: 1.5rem; font-weight: 800; color: var(--text-main); margin-top: auto; }
.pricing-card-price span { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }

/* ============================================
   FILE MANAGER
   ============================================ */
.fm-container {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 160px);
}

.file-list {
    width: 260px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-y: auto;
    padding: 0.5rem 0;
}

.file-item {
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: all 0.1s ease;
}

.file-item:hover { background: var(--bg-hover); color: var(--text-main); }
.file-item.active { background: var(--bg-active); color: var(--text-main); font-weight: 500; }

.file-editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

#fileEditor {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
    resize: none;
}

.path-breadcrumb { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 1rem; }
.path-breadcrumb span:hover { color: var(--text-main); cursor: pointer; }

/* ============================================
   LOGIN
   ============================================ */
.login-container {
    max-width: 400px;
    margin: 12vh auto;
    background: var(--bg-card);
    padding: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

/* ============================================
   TABLES
   ============================================ */
table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.875rem;
    color: var(--text-main);
}

table tr:hover td {
    background: var(--bg-hover);
}

/* ============================================
   CUSTOM DROPDOWN
   ============================================ */
.md_custom_dropdown {
    position: relative;
    user-select: none;
    min-width: 140px;
    font-size: 0.85rem;
}

.md_custom_dropdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.15s ease;
}

.md_custom_dropdown-header:hover {
    border-color: var(--text-placeholder);
}

.md_custom_dropdown-text {
    margin-right: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.md_custom_dropdown-header svg {
    opacity: 0.6;
    transition: transform 0.2s ease;
}

.md_custom_dropdown.open .md_custom_dropdown-header svg {
    transform: rotate(180deg);
}

.md_custom_dropdown-list {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    min-width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.15s ease;
    max-height: 250px;
    overflow-y: auto;
    padding: 4px;
}

.md_custom_dropdown.open .md_custom_dropdown-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.md_custom_dropdown-item {
    padding: 8px 12px;
    color: var(--text-main);
    cursor: pointer;
    border-radius: var(--radius-xs);
    transition: background 0.1s ease;
    white-space: nowrap;
}

.md_custom_dropdown-item:hover {
    background: var(--bg-hover);
}

.md_custom_dropdown-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 500;
}

/* ============================================
   SITE DROPDOWN MENU
   ============================================ */
.site-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 40px;
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
    padding: 4px 0 !important;
    z-index: 9999;
    min-width: 160px;
    box-shadow: var(--shadow-lg) !important;
}

.site-menu-item {
    width: 100%;
    text-align: left;
    background: none !important;
    border: none !important;
    color: var(--text-main) !important;
    padding: 10px 16px !important;
    cursor: pointer;
    transition: all 0.1s ease !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    display: block;
    font-family: inherit;
}

.site-menu-item:hover {
    background: var(--bg-hover) !important;
    transform: none !important;
}

.site-menu-item[data-action="delete"] { color: var(--danger) !important; }
.site-menu-item[data-action="delete"]:hover { background: var(--bg-hover) !important; }

/* ============================================
   TRASH & MISC
   ============================================ */
.trash-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: all 0.1s ease;
}

.trash-item:hover {
    border-color: var(--text-placeholder);
}

.empty-state-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
    text-align: center;
}

.faq-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}
.faq-card h4 { margin-bottom: 0.5rem; color: var(--text-main); }
.faq-card p { color: var(--text-muted); }

.new-site-form {
    margin-top: 2rem;
    background: var(--bg-card);
    padding: 20px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Skeletons */
@keyframes skeleton-loading {
    0% { background-color: var(--bg-hover); }
    50% { background-color: var(--border-light); }
    100% { background-color: var(--bg-hover); }
}

.skeleton { animation: skeleton-loading 1.5s infinite ease-in-out; border-radius: var(--radius-sm); }
.skeleton-text { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; border-radius: 4px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: var(--radius-md); flex-shrink: 0; }

/* Text gradient */
.text-gradient {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

/* Fix hover on client name buttons */
button.client-tab-btn:hover, button.client-name-btn:hover {
    transform: none !important;
}

button.client-delete-btn:hover,
button.btn-danger:hover {
    background: var(--danger) !important;
    color: #ffffff !important;
}

/* ============================================
   MOBILE HEADER & OVERLAY
   ============================================ */
.mobile-header {
    display: none;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Mobile warning */
.mobile-warning-screen { display: none; }

/* Mobile elements hidden on desktop */
.mobile-nav-drawer, .topbar-burger {
    display: none !important;
}

/* ============================================
   RESPONSIVE: TABLETS (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    .topbar {
        padding: 0 16px;
    }

    .topbar-nav {
        display: none;
    }

    .topbar-user-info {
        display: none;
    }

    .mobile-header {
        display: none; /* topbar handles mobile now */
    }

    /* Show burger menu in topbar */
    .topbar-burger {
        display: flex !important;
        width: 36px;
        height: 36px;
        align-items: center;
        justify-content: center;
        border-radius: var(--radius-sm);
        border: 1px solid var(--border);
        background: var(--bg-card);
        color: var(--text-muted);
        cursor: pointer;
        transition: all 0.15s ease;
    }

    .topbar-burger:hover {
        background: var(--bg-hover);
        color: var(--text-main);
    }

    .topbar-burger svg {
        width: 18px;
        height: 18px;
    }

    /* Mobile nav drawer */
    .mobile-nav-drawer {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        background: var(--bg-card);
        border-right: 1px solid var(--border);
        z-index: 10002;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 24px;
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        box-shadow: var(--shadow-lg);
    }

    .mobile-nav-drawer.open {
        transform: translateX(0) !important;
    }

    .mobile-nav-drawer .topbar-nav-item {
        display: flex;
        padding: 12px 16px;
        border-radius: var(--radius-sm);
        font-size: 0.95rem;
    }

    .main-content {
        padding: 24px 16px;
    }

    .profile-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .fm-container {
        flex-direction: column;
        height: auto;
    }

    .file-list {
        width: 100%;
        max-height: 200px;
    }

    /* Mobile warning screen for editor */
    .mobile-warning-screen {
        display: flex !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-body);
        z-index: 9999999;
        justify-content: center;
        align-items: center;
        padding: 24px;
    }

    .mobile-warning-card {
        background: var(--bg-card);
        border: 1px solid var(--border);
        padding: 36px 24px;
        border-radius: var(--radius-lg);
        text-align: center;
        max-width: 380px;
        box-shadow: var(--shadow-lg);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }

    .mobile-warning-icon {
        width: 64px;
        height: 64px;
        border-radius: 50%;
        background: var(--warning-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--warning);
    }

    .mobile-warning-card h2 {
        font-size: 1.25rem !important;
        font-weight: 700;
        color: var(--text-main);
        margin: 0;
    }

    .mobile-warning-card p {
        font-size: 0.88rem;
        color: var(--text-muted);
        line-height: 1.6;
        margin: 0;
    }
}

/* ============================================
   RESPONSIVE: PHONES (≤768px)
   ============================================ */
@media (max-width: 768px) {
    h1 {
        font-size: 1.25rem !important;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .stats-card {
        padding: 14px 16px !important;
        min-height: auto;
    }

    .stats-card-value {
        font-size: 1.5rem !important;
    }

    .stats-card-icon {
        width: 32px;
        height: 32px;
    }

    #sitesContainer {
        grid-template-columns: 1fr !important;
    }

    .site-card {
        padding: 16px !important;
    }

    .new-site-form {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .modal-content {
        padding: 20px !important;
        width: 100% !important;
        max-width: 95% !important;
    }

    .pricing-cards-container {
        flex-direction: column;
    }

    .toast-container {
        bottom: auto !important;
        top: 20px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        width: 90% !important;
    }

    .toast {
        width: 100%;
        justify-content: center;
    }

    table {
        min-width: 600px;
    }

    .glass-panel {
        padding: 16px !important;
        overflow-x: auto;
    }
}

/* ============================================
   RESPONSIVE: WIDE SCREENS (≥1440px)
   ============================================ */
@media (min-width: 1440px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    #sitesContainer {
        grid-template-columns: 1fr !important;
    }
}

/* Force full width for profile grid panels */
.profile-dashboard-grid .glass-panel { width: 100% !important; }

/* Activity Header & Mobile Filters layout */
.activity-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 16px;
}

.activity-filters {
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .activity-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .activity-header h3 {
        margin: 0;
    }
    .activity-filters {
        width: 100%;
    }
    .activity-filters select {
        flex: 1;
        width: 100%;
    }
}

/* ============================================
   COPY CODE BUTTON
   ============================================ */
.copy-code-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-main);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 10;
}

.code-block:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    transform: scale(1.05);
}

.copy-code-btn:active {
    transform: scale(0.95);
}

.code-block {
    cursor: pointer;
    position: relative;
}

/* Dashboard Premium Header */
.dashboard-title-section {
    margin-bottom: 2rem;
}
.dashboard-title-section h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--text-main) 60%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dashboard-title-section p {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Premium Upload Dropzone */
#zipDropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.01);
}
#zipDropzone:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}
#zipDropzone:hover .dropzone-icon-wrapper svg {
    transform: translateY(-4px);
    color: var(--primary);
}
.dropzone-icon-wrapper svg {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s ease;
}

/* ============================================
   BENTO CARDS & PLATES
   ============================================ */
.bento-card {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-sm) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover {
    border-color: var(--border-active) !important;
    box-shadow: var(--shadow-md) !important;
}

/* ============================================
   MODERN FORM SELECTS
   ============================================ */
select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-color: var(--bg-input) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 10px 36px 10px 14px !important;
    color: var(--text-main) !important;
    font-size: 0.95rem !important;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 12px center !important;
    background-size: 16px !important;
}

select:focus {
    border-color: var(--border-focus) !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
    outline: none !important;
}

[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
}

/* Custom Select Stylings */
.custom-select-wrapper {
    display: inline-block;
    position: relative;
    user-select: none;
}

.custom-select-trigger {
    background: transparent !important;
    color: var(--text-main);
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 10px 20px 10px 0 !important;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-width: 140px;
    box-shadow: none !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    position: relative;
}

.custom-select-trigger:hover {
    border-color: transparent !important;
    border-bottom-color: var(--primary) !important;
    background: transparent !important;
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: transparent !important;
    border-bottom-color: var(--primary) !important;
    box-shadow: none !important;
    background: transparent !important;
}

.custom-select-trigger:after {
    content: '';
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: translateY(-60%) rotate(45deg);
    position: absolute;
    right: 0 !important;
    top: 50%;
    pointer-events: none;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.custom-select-wrapper.open .custom-select-trigger:after {
    transform: translateY(-20%) rotate(-135deg);
    border-color: var(--primary);
}

.custom-select-options {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px; /* Скругления 8px */
    box-shadow: var(--shadow-lg);
    margin-top: 6px;
    max-height: 250px;
    overflow-y: auto;
    width: 100%;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
}

.custom-select-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-option {
    padding: 10px 14px;
    font-size: 0.925rem;
    color: var(--text-main);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover {
    background: var(--bg-hover);
}

.custom-select-option.selected {
    background: var(--bg-active);
    color: var(--primary);
    font-weight: 600;
}

/* ============================================
   FIGMA REDESIGN IMPLEMENTATION
   ============================================ */

/* 1. Global layout resets for full-width header */
.app-layout {
    min-height: 100vh;
}
.main-content {
    padding: 30px 40px 40px 40px !important;
    max-width: 1280px !important;
    margin: 0 auto !important;
    width: 100% !important;
}

/* 2. Topbar updates (height 55px, rectangular, border-bottom only) */
.topbar {
    height: 55px !important;
    background: #FFFFFF !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 0 20px 20px !important;
    top: 0 !important;
    margin: 0 auto !important;
    max-width: 1280px !important;
    width: 100% !important;
    padding: 0 40px !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

[data-theme="dark"] .topbar {
    background: #171821 !important;
}

.topbar-logo span {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 16px;
    color: var(--text-main);
    letter-spacing: -0.02em;
}

.topbar-logo .cms-logo-text {
    color: #8B5CF6;
}

/* Navigation items without pill bg, underlined instead */
.topbar-nav {
    display: flex;
    align-items: center;
    gap: 30px !important;
    height: 100%;
}

.topbar-nav-item {
    display: inline-flex;
    align-items: center;
    height: 55px !important;
    padding: 0 !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 15px !important;
    color: var(--text-muted) !important;
    border-bottom: 2px solid transparent !important;
    transition: all 0.15s ease;
}

.topbar-nav-item:hover {
    color: var(--text-main) !important;
    background: transparent !important;
}

.topbar-nav-item.active {
    color: #2055E5 !important;
    border-bottom-color: #2055E5 !important;
    background: transparent !important;
}

/* Profile right section styling */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    cursor: default;
    border-radius: 0 !important;
}
.topbar-user:hover {
    background: transparent !important;
}

.topbar-avatar {
    width: 25px !important;
    height: 25px !important;
    background: #FFFFFF !important;
    border: 1px solid #EFEFEF !important;
    border-radius: 5px !important;
    box-shadow: none !important;
    color: var(--text-muted) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

[data-theme="dark"] .topbar-avatar {
    background: #1C1E27 !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.topbar-avatar svg {
    color: var(--text-muted);
}

.topbar-user-name {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    color: #8F8F8F !important;
}

/* Logout text link */
#logoutBtn {
    background: transparent !important;
    border: none !important;
    color: var(--text-main) !important;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 14px;
    padding: 0 !important;
    text-decoration: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 55px;
    margin-left: 20px;
    border-radius: 0 !important;
}

#logoutBtn svg {
    display: none !important;
}

#logoutBtn::after {
    content: "Выйти";
}

#logoutBtn:hover {
    color: #2055E5 !important;
    background: transparent !important;
}

/* 3. Figma Header Section on Dashboard */
.md_dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    margin-bottom: 31px;
    flex-wrap: wrap;
    gap: 20px;
}

.md_tabs {
    display: flex;
    align-items: center;
    gap: 30px;
}

.md_tab {
    font-family: 'Inter', sans-serif;
    font-size: 18px !important;
    font-weight: 500;
    text-transform: uppercase;
    color: #ADADAD;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s ease;
    outline: none;
}

.md_tab:hover {
    color: var(--text-main);
}

.md_tab.active {
    color: #434343;
    font-weight: 600;
}

[data-theme="dark"] .md_tab.active {
    color: #FFFFFF;
}

.md_header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.md_stats-badge {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 20px;
}

[data-theme="dark"] .md_stats-badge {
    background: #171821;
}

.md_stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
}

.md_stat-label {
    color: #ADADAD;
}

.md_stat-value {
    color: var(--text-main);
    font-weight: 600;
}

/* Figma Upload Site Button */
.md_upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 20px 10px 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 15px !important;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

[data-theme="dark"] .md_upload-btn {
    background: #171821;
}

.md_upload-btn:hover {
    border-color: #2055E5;
    box-shadow: var(--shadow-sm);
}

.md_plus-icon {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1C77E0;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
}

.md_plus-icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 3;
}

/* 4. Figma Card Redesign */
.hero-card.md_card {
    background: #FFFFFF !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    padding: 35px 35px 25px 35px !important;
    display: block !important;
    height: 244px !important;
    min-height: 244px !important;
    box-shadow: var(--shadow-card) !important;
    position: relative;
    cursor: default !important;
    box-sizing: border-box !important;
    overflow: hidden;
}

[data-theme="dark"] .hero-card.md_card {
    background: #171821 !important;
}

.hero-card.md_card:hover {
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
    border-color: var(--border) !important;
}

.md_card-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
}

.md_card-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.md_card-title {
    font-family: 'Inter', sans-serif !important;
    font-size: 34px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    color: var(--text-main) !important;
    margin: 0 !important;
    letter-spacing: -0.03em !important;
    line-height: 1 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

/* Status badge 1:1 figma */
.md_status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 10px;
    border-radius: 100px;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 12px;
    text-transform: lowercase;
}

.md_status-badge.status-online {
    background: rgba(34, 197, 94, 0.15) !important;
    color: #16a34a !important;
}

.md_status-badge.status-offline {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #dc2626 !important;
}

[data-theme="dark"] .md_status-badge.status-offline {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

.md_status-badge.status-draft {
    background: rgba(249, 115, 22, 0.15) !important;
    color: #ea580c !important;
}

[data-theme="dark"] .md_status-badge.status-draft {
    background: rgba(249, 115, 22, 0.2) !important;
    color: #fb923c !important;
}

.md_card-desc {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: var(--text-main);
    margin: 10px 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 60px;
}

.md_card-divider {
    border: none;
    border-top: 1px solid #EFEFEF;
    margin: 15px 0 !important;
    width: 100%;
}

[data-theme="dark"] .md_card-divider {
    border-top-color: rgba(255, 255, 255, 0.05);
}

.md_card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.md_card-meta {
    display: flex;
    gap: 15px;
}

.md_meta-item {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: 12px;
    color: #9E9E9E;
}

.md_card-actions {
    display: flex;
    gap: 20px;
}

.md_action-btn-link {
    background: transparent;
    border: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-main);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    transition: color 0.15s ease;
}

.md_action-btn-link:hover {
    color: #2055E5;
}

.md_action-btn-link svg {
    color: #1C77E0;
    flex-shrink: 0;
}

/* Стильные роли пользователей в шапке */
.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    cursor: pointer;
    transition: all 0.2s ease;
}

.topbar-user.role-developer {
    background: rgba(37, 99, 235, 0.05) !important;
    border: 1px solid rgba(37, 99, 235, 0.15) !important;
}
.topbar-user.role-developer:hover {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
}
.topbar-user.role-developer .topbar-avatar {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border: none !important;
}
.topbar-user.role-developer .topbar-user-name {
    color: #2563EB !important;
}

.topbar-user.role-admin {
    background: rgba(239, 68, 68, 0.05) !important;
    border: 1px solid rgba(239, 68, 68, 0.15) !important;
}
.topbar-user.role-admin:hover {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: rgba(239, 68, 68, 0.3) !important;
}
.topbar-user.role-admin .topbar-avatar {
    background: #EF4444 !important;
    color: #FFFFFF !important;
    border: none !important;
}
.topbar-user.role-admin .topbar-user-name {
    color: #EF4444 !important;
}

.topbar-user.role-client {
    background: rgba(37, 99, 235, 0.05) !important;
    border: 1px solid rgba(37, 99, 235, 0.15) !important;
}
.topbar-user.role-client:hover {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
}
.topbar-user.role-client .topbar-avatar {
    background: #2563EB !important;
    color: #FFFFFF !important;
    border: none !important;
}
.topbar-user.role-client .topbar-user-name {
    color: #2563EB !important;
}

.topbar-avatar {
    width: 22px !important;
    height: 22px !important;
    border-radius: 4px !important;
    box-shadow: none !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.topbar-user-name {
    font-family: 'Inter', sans-serif;
    font-weight: 600 !important;
    font-size: 13px !important;
}


/* Кнопка корзины шрифт */
button#openTrashBinBtn {
    font-size: 15px !important;
}

/* Унифицированный ховер со сдвигом и тенью для кнопок и плашек */
.md_upload-btn:hover,
.md_stats-badge:hover,
button#openTrashBinBtn:hover,
.btn-outline:hover {
    background: var(--bg-hover) !important;
    color: var(--text-main) !important;
    border-color: var(--border) !important;
    box-shadow: var(--shadow-md) !important;
    transform: translateY(-1px) !important;
}

.md_stats-badge {
    transition: all 0.2s ease !important;
    cursor: default;
}

/* Класс для тегов сайтов в ленте активности */
.activity-site-badge {
    --badge-hue: 0;
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: monospace;
    background: hsla(var(--badge-hue), 70%, 40%, 0.15) !important;
    color: hsla(var(--badge-hue), 80%, 25%, 1) !important;
    border: 1px solid hsla(var(--badge-hue), 70%, 40%, 0.3) !important;
    display: inline-block;
}

[data-theme="dark"] .activity-site-badge {
    background: hsla(var(--badge-hue), 70%, 25%, 0.25) !important;
    color: hsla(var(--badge-hue), 90%, 75%, 1) !important;
    border: 1px solid hsla(var(--badge-hue), 70%, 40%, 0.4) !important;
}

/* Заголовок активности по стилю как активный таб Мои сайты */
.md_activity-title {
    font-family: 'Inter', sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    color: #434343 !important;
    margin: 0 !important;
    letter-spacing: -0.01em !important;
}

[data-theme="dark"] .md_activity-title {
    color: #FFFFFF !important;
}

/* Sidebar Layout and Tabs for siteManageContainer */
.site-manage-layout {
    display: flex;
    gap: 32px;
    align-items: start;
    position: relative;
    width: 100%;
}

.site-manage-sidebar {
    width: 240px;
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.sidebar-tab {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 18px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    box-sizing: border-box;
    font-family: inherit;
}

.sidebar-tab svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    transition: all 0.2s ease;
    flex-shrink: 0;
    color: currentColor;
}

.sidebar-tab:hover {
    background: var(--bg-hover);
    color: var(--text-main);
    border-color: var(--border);
}

.sidebar-tab:hover svg {
    opacity: 1;
}

.sidebar-tab.active {
    background: var(--bg-active);
    color: var(--text-main);
    border-color: var(--border-active);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

.sidebar-tab.active svg {
    opacity: 1;
    color: var(--primary);
}

.site-manage-content {
    flex: 1;
    min-width: 0;
}

/* Module Settings Panel styling */
.module-panel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.module-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.module-title-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.module-title-wrap svg {
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.module-title-wrap h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-main);
}

.module-status-badge {
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.module-status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.module-status-badge.disabled {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.module-body-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .module-body-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   FIGMA STYLES FOR SITE SETTINGS (One Column)
   ============================================ */
.figma-input {
    width: 100% !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 10px 0 !important;
    font-size: 0.95rem !important;
    color: var(--text-main) !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease !important;
}

.figma-input:focus {
    border-color: transparent !important;
    border-bottom-color: var(--primary) !important;
    box-shadow: none !important;
}

/* Custom select/dropdown styling matching Figma */
.md_custom_dropdown[data-for="settTimezone"],
.md_custom_dropdown[data-for="settCurrency"],
.md_custom_dropdown[data-for="settBackupFrequency"] {
    min-width: 100% !important;
}

.md_custom_dropdown[data-for="settTimezone"] .md_custom_dropdown-header,
.md_custom_dropdown[data-for="settCurrency"] .md_custom_dropdown-header,
.md_custom_dropdown[data-for="settBackupFrequency"] .md_custom_dropdown-header {
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: 0 !important;
    padding: 10px 0 !important;
    color: var(--text-main) !important;
    font-size: 0.95rem !important;
    box-shadow: none !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.md_custom_dropdown[data-for="settTimezone"].open .md_custom_dropdown-header,
.md_custom_dropdown[data-for="settCurrency"].open .md_custom_dropdown-header,
.md_custom_dropdown[data-for="settBackupFrequency"].open .md_custom_dropdown-header {
    border-bottom-color: var(--primary) !important;
}

.settings-card-one-col {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: 20px !important;
    box-shadow: none !important;
}

