/* ===================================================================
   Dopel Dashboard - Unified Design System v2
   Dark Premium - Glassmorphism - Wide Card-List Pattern
   =================================================================== */

:root {
    --bg-base: #030303;
    --bg-surface: rgba(255, 255, 255, 0.025);
    --bg-elevated: rgba(255, 255, 255, 0.04);
    --bg-hover: rgba(255, 255, 255, 0.06);
    --bg-glass: rgba(10, 10, 14, 0.65);
    --accent: #7c5cfc;
    --accent-light: #9b82fc;
    --accent-dim: rgba(124, 92, 252, 0.12);
    --accent-glow: rgba(124, 92, 252, 0.3);
    --success: #34d399;
    --success-dim: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-dim: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-dim: rgba(248, 113, 113, 0.1);
    --info: #60a5fa;
    --info-dim: rgba(96, 165, 250, 0.1);
    --text-primary: #e4e4e7;
    --text-secondary: rgba(255, 255, 255, 0.5);
    --text-muted: rgba(255, 255, 255, 0.25);
    --border: rgba(255, 255, 255, 0.05);
    --border-hover: rgba(255, 255, 255, 0.12);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 24px var(--accent-glow);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --sidebar-width: 240px;
    --transition-fast: 150ms cubic-bezier(0.22, 1, 0.36, 1);
    --transition-base: 250ms cubic-bezier(0.22, 1, 0.36, 1);
    --transition-slow: 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
/* ── Tooltips ── */
.tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    margin-left: 6px;
    cursor: help;
}

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    font-family: monospace;
    transition: all 0.2s ease;
}

.tooltip-wrapper:hover .tooltip-icon {
    color: var(--accent);
}

.tooltip-text {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #18181b; /* strict dark background */
    color: #e4e4e7;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 400;
    line-height: 1.4;
    white-space: normal;
    text-align: center;
    width: max-content;
    max-width: 260px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 9999;
    
    /* Animation & Visibility */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Crucial to prevent flicker when mouse leaves icon */
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #18181b transparent transparent transparent;
}

/* Hover activates the tooltip */
.tooltip-wrapper:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ── Service Editor ── */
.service-row {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    transition: border-color 0.2s;
}
.service-row:hover {
    border-color: var(--border-hover);
}

/* ── FOOTER ───────────────────────────────────────────────────────── */

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

html {
    font-size: 14px;
    -webkit-font-smoothing: antialiased
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden
}

#dashboardApp {
    width: 100%;
    display: flex;
}

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

button {
    cursor: pointer;
    font-family: inherit
}

input,
select,
textarea {
    font-family: inherit
}

::-webkit-scrollbar {
    width: 5px
}

::-webkit-scrollbar-track {
    background: transparent
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15)
}

@keyframes widgetFadeIn {
    from {
        opacity: 0;
        transform: translateY(12px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.content>* {
    animation: widgetFadeIn .4s cubic-bezier(.22, 1, .36, 1) both
}

.content>*:nth-child(1) {
    animation-delay: 0s
}

.content>*:nth-child(2) {
    animation-delay: .05s
}

.content>*:nth-child(3) {
    animation-delay: .1s
}

.content>*:nth-child(4) {
    animation-delay: .15s
}

.content>*:nth-child(5) {
    animation-delay: .2s
}

/* =============== SIDEBAR =============== */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: rgba(3, 3, 3, 0.5);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-right: 0.5px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: width var(--transition-base)
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 10px
}

.logo-icon {
    font-size: 1.5rem;
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow))
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent
}

#dashboardApp .sidebar-header .logo .logo-text {
    display: block;
    background: none;
    color: var(--text-primary);
    -webkit-text-fill-color: initial;
}

#dashboardApp .sidebar-header .logo .logo-brand-word {
    display: inline-block;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: #8b5cf6;
    -webkit-text-fill-color: #8b5cf6;
}

#dashboardApp .sidebar-header .logo .logo-lockup-svg {
    display: inline-block;
    line-height: 1;
}

#dashboardApp .sidebar-header .logo .logo-lockup-svg svg {
    display: block;
    width: 100%;
    height: 1em;
    overflow: visible;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: none
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary)
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.45);
    font-weight: 500;
    font-size: 0.93rem;
    transition: all var(--transition-fast);
    position: relative
}

.nav-item:hover {
    background: var(--bg-hover);
    color: rgba(255, 255, 255, 0.8)
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(124, 92, 252, 0.12), rgba(124, 92, 252, 0.04));
    color: var(--accent-light);
    box-shadow: inset 0 0 20px rgba(124, 92, 252, 0.06)
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 3px 3px 0;
    box-shadow: 0 0 8px var(--accent-glow)
}

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

.nav-item.active .nav-icon {
    opacity: 1
}

.sidebar-footer {
    padding: 16px;
    border-top: 0.5px solid var(--border)
}

.bot-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4)
}

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

.status-dot.online {
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse-dot 2s infinite
}

.status-dot.offline {
    background: rgba(255, 255, 255, 0.2)
}

@keyframes pulse-dot {

    0%,
    100% {
        opacity: 1
    }

    50% {
        opacity: 0.4
    }
}

/* =============== MAIN CONTENT - FULL WIDTH =============== */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    min-width: 0;
    width: calc(100% - var(--sidebar-width));
    display: flex;
    flex-direction: column;
    transition: margin-left var(--transition-base);
}

.top-bar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    padding: 16px 32px;
    background: rgba(3, 3, 3, 0.6);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border-bottom: 0.5px solid var(--border)
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 4px;
    margin-right: 12px
}

.page-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #fff
}

.top-bar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px
}

.date-display {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35)
}

.content {
    flex: 1;
    padding: 28px 32px 48px;
    width: 100%
}

/* =============== CARDS GRID - 3 cols =============== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px
}

.metric-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    backdrop-filter: blur(12px)
}

.metric-card:hover {
    border-color: rgba(124, 92, 252, 0.15);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.03)
}

.metric-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0;
    transition: opacity var(--transition-base)
}

.metric-card:hover::after {
    opacity: 0.5
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 80%;
    height: 60%;
    transform: translateX(-50%);
    background: radial-gradient(ellipse at center top, rgba(124, 92, 252, 0.05), transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-base)
}

.metric-card:hover::before {
    opacity: 1
}

.metric-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-dim);
    color: var(--accent-light);
    font-size: 1.1rem;
    margin-bottom: 14px;
    box-shadow: 0 0 15px var(--accent-dim)
}

.metric-label {
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
    font-weight: 500
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
    line-height: 1.1;
    color: #fff
}

.metric-value.accent {
    color: var(--accent-light)
}

.metric-value.success {
    color: var(--success)
}

.metric-value.danger {
    color: var(--danger)
}

.metric-value.warning {
    color: var(--warning)
}

.metric-value.info {
    color: var(--info)
}

/* =============== CHARTS =============== */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px
}

.chart-panel {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    backdrop-filter: blur(12px);
    transition: border-color var(--transition-base)
}

.chart-panel:hover {
    border-color: var(--border-hover)
}

.chart-panel.wide {
    grid-column: 1/-1
}

.chart-panel h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.7);
    letter-spacing: -0.01em
}

.chart-container {
    position: relative;
    width: 100%;
    height: 350px
}

.chart-container.small {
    height: 280px
}

/* =============== SEARCH BAR =============== */
.search-bar {
    width: 100%;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    padding: 14px 20px 14px 44px;
    font-size: 0.92rem;
    outline: none;
    transition: all var(--transition-fast);
    backdrop-filter: blur(12px);
    margin-bottom: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.25)' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 14px center
}

.search-bar::placeholder {
    color: var(--text-muted)
}

.search-bar:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim)
}

/* =============== EXPANDABLE LIST =============== */
.expandable-list {
    display: flex;
    flex-direction: column;
    gap: 4px
}

.list-item {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all var(--transition-base);
    backdrop-filter: blur(12px)
}

.list-item:hover {
    border-color: var(--border-hover)
}

.list-item.expanded {
    border-color: rgba(124, 92, 252, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3)
}

.list-item-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    cursor: pointer;
    transition: background var(--transition-fast)
}

.list-item-header:hover {
    background: var(--bg-hover)
}

.list-item-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    box-shadow: 0 0 12px rgba(124, 92, 252, 0.15)
}

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

.list-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px
}

.list-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    gap: 12px;
    flex-wrap: wrap
}

.list-item-meta span {
    white-space: nowrap
}

.list-item-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0
}

.list-item-chevron {
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform var(--transition-fast)
}

.list-item.expanded .list-item-chevron {
    transform: rotate(180deg)
}

.list-item-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.22, 1, 0.36, 1)
}

.list-item.expanded .list-item-body {
    max-height: 600px
}

.list-item-body-inner {
    padding: 0 20px 20px;
    border-top: 0.5px solid var(--border)
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
    padding-top: 16px
}

.detail-item {
    font-size: 0.85rem
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 3px
}

.detail-value {
    color: var(--text-primary)
}

.detail-value a {
    color: var(--accent-light)
}

/* =============== EVENT ITEM =============== */
.event-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    backdrop-filter: blur(12px)
}

.event-item:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm)
}

.event-item-badge {
    flex-shrink: 0
}

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

.event-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px
}

.event-item-sub {
    font-size: 0.8rem;
    color: var(--text-muted)
}

.event-item-time {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0
}

@keyframes newEventGlow {
    0% {
        background: rgba(124, 92, 252, 0.1)
    }

    100% {
        background: var(--bg-surface)
    }
}

.new-event-glow {
    animation: newEventGlow 1.5s ease-out
}

/* =============== CALENDAR =============== */
.calendar-container {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    height: calc(100vh - 180px);
    min-height: 500px;
    backdrop-filter: blur(12px)
}

.calendar-top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-bottom: 16px
}

/* =============== TABLE =============== */
.table-panel {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    backdrop-filter: blur(12px)
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 0.5px solid var(--border);
    flex-wrap: wrap;
    gap: 12px
}

.table-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8)
}

.table-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap
}

.filter-select,
.filter-input {
    background: var(--bg-elevated);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 14px;
    font-size: 0.85rem;
    outline: none;
    transition: all var(--transition-fast);
    color-scheme: dark
}

.filter-select:focus,
.filter-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim)
}

.filter-input {
    width: 200px
}

.filter-input::placeholder {
    color: var(--text-muted)
}

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

.data-table th {
    text-align: left;
    padding: 12px 22px;
    font-size: 0.76rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 0.5px solid var(--border);
    font-weight: 600;
    white-space: nowrap
}

.data-table td {
    padding: 14px 22px;
    font-size: 0.9rem;
    border-bottom: 0.5px solid var(--border);
    color: rgba(255, 255, 255, 0.55)
}

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

.data-table tbody tr {
    transition: all var(--transition-fast)
}

.data-table tbody tr:hover {
    background: var(--bg-hover)
}

.data-table tbody tr.clickable {
    cursor: pointer
}

/*  Badges  */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase
}

.badge-confirmed,
.badge-active {
    background: var(--success-dim);
    color: var(--success)
}

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

.badge-cancelled,
.badge-banned {
    background: var(--danger-dim);
    color: var(--danger)
}

.badge-upsell {
    background: var(--warning-dim);
    color: var(--warning);
    margin-left: 6px
}

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

.pagination-btn {
    background: var(--bg-elevated);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 6px 14px;
    font-size: 0.85rem;
    transition: all var(--transition-fast)
}

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

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed
}

.pagination-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 8px
}

/* =============== BUTTONS =============== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    border: none;
    transition: all var(--transition-fast);
    letter-spacing: -0.01em
}

.btn-primary {
    background: linear-gradient(135deg, #6366f1, var(--accent));
    color: #fff;
    border: 0.5px solid rgba(124, 92, 252, 0.3);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1)
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 0 24px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.15)
}

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border: 0.5px solid rgba(248, 113, 113, 0.2)
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.15)
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border)
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--border-hover)
}

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

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center
}

/* =============== SETTINGS =============== */
.settings-stack {
    display: flex;
    flex-direction: column;
    gap: 20px
}

.settings-section {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    backdrop-filter: blur(12px)
}

.settings-section h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.8)
}

.form-group {
    margin-bottom: 18px
}

.form-group:last-child {
    margin-bottom: 0
}

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

.form-input,
.form-select {
    width: 100%;
    background: var(--bg-elevated);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 0.92rem;
    outline: none;
    transition: all var(--transition-fast);
    color-scheme: dark
}

.form-input:focus,
.form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim)
}

.form-select {
    background-color: #1a1a1a
}

.form-select option {
    background-color: #1a1a1a;
    color: var(--text-primary)
}

.form-input[readonly] {
    opacity: 0.5;
    cursor: not-allowed
}

.toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 0.5px solid var(--border)
}

.toggle-row:last-child {
    border-bottom: none
}

.toggle-label {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.7)
}

.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0
}

.toggle-track {
    position: absolute;
    inset: 0;
    background: var(--bg-hover);
    border-radius: 13px;
    transition: var(--transition-fast);
    border: 0.5px solid var(--border)
}

.toggle input:checked+.toggle-track {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow)
}

.toggle-track::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    top: 2px;
    left: 2px;
    transition: var(--transition-fast)
}

.toggle input:checked+.toggle-track::after {
    transform: translateX(22px)
}

.webhook-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    border: 0.5px solid var(--border)
}

.webhook-status .status-dot {
    width: 10px;
    height: 10px
}

.webhook-status-text {
    font-size: 0.92rem
}

.settings-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px
}

.settings-actions .btn {
    flex: 1;
    padding: 14px;
    font-size: 0.92rem;
    justify-content: center
}

/* =============== PAYMENTS =============== */
.payments-page .payment-plans {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px
}

.payments-page .pricing-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    text-align: center;
    transition: all var(--transition-base);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column
}

.payments-page .pricing-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md)
}

.payments-page .pricing-card.featured {
    border-color: rgba(124, 92, 252, 0.4);
    background: rgba(124, 92, 252, 0.04);
    box-shadow: 0 0 40px rgba(124, 92, 252, 0.08), 0 0 80px rgba(124, 92, 252, 0.04);
    position: relative
}

.payments-page .pricing-card.current-plan {
    border-color: rgba(56, 189, 248, 0.34);
    box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12), 0 24px 60px rgba(56, 189, 248, 0.08);
}

.payments-page .pricing-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6366f1, var(--accent));
    color: #fff;
    padding: 4px 16px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em
}

.payments-page .pricing-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.7)
}

.payments-page .pricing-price {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
    letter-spacing: -0.04em
}

.payments-page .pricing-price span {
    font-size: 0.85rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.35)
}

.payments-page .pricing-current-plan {
    display: flex !important;
    align-items: center;
    justify-content: center !important;
    width: 100%;
    margin-top: auto;
    padding: 12px;
    font-size: 0.95rem;
    border-radius: 12px;
    text-align: center !important;
    text-transform: none;
    letter-spacing: 0.01em;
}

/* Убрали конфликтующие стили для списков тарифов (они теперь наследуются из landing.css) */
/* =============== MODAL =============== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px) saturate(1.2);
    -webkit-backdrop-filter: blur(8px) saturate(1.2);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn var(--transition-fast) ease
}

.modal-backdrop.open {
    display: flex
}

.modal {
    background: rgba(10, 10, 14, 0.85);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 40px rgba(124, 92, 252, 0.04);
    animation: slideUp var(--transition-base) ease
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px;
    border-bottom: 0.5px solid var(--border)
}

.modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: -0.01em
}

.modal-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.4rem;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast)
}

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

.modal-body {
    padding: 22px 28px
}

@keyframes fadeIn {
    from {
        opacity: 0
    }

    to {
        opacity: 1
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

/* =============== TOAST =============== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.toast {
    background: rgba(10, 10, 14, 0.75);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 0.5px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 14px 22px;
    font-size: 0.88rem;
    color: var(--text-primary);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: toastIn var(--transition-base) ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px
}

.toast.success {
    border-left: 2px solid var(--success)
}

.toast.error {
    border-left: 2px solid var(--danger)
}

.toast.info {
    border-left: 2px solid var(--info)
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(24px)
    }

    to {
        opacity: 1;
        transform: translateX(0)
    }
}

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

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

    100% {
        background-position: -200% 0
    }
}

.skeleton-card {
    height: 110px
}

.skeleton-chart {
    height: 350px
}

.skeleton-row {
    height: 56px;
    margin-bottom: 4px
}

/*  Empty State  */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted)
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.4
}

.empty-state-text {
    font-size: 0.95rem;
    color: var(--text-secondary)
}

/*  Period Selector  */
.period-selector {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    width: fit-content;
    backdrop-filter: blur(12px)
}

.period-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast)
}

.period-btn:hover {
    color: rgba(255, 255, 255, 0.7);
    background: var(--bg-hover)
}

.period-btn.active {
    background: linear-gradient(135deg, #6366f1, var(--accent));
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow)
}

/*  Client profile  */
.client-profile-header {
    display: flex;
    align-items: center;
    gap: 16px
}

.client-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 0 16px rgba(124, 92, 252, 0.2)
}

/* =============== FULLCALENDAR DARK =============== */
.fc {
    --fc-border-color: var(--border);
    --fc-button-bg-color: var(--bg-elevated);
    --fc-button-border-color: var(--border);
    --fc-button-text-color: var(--text-secondary);
    --fc-button-hover-bg-color: var(--bg-hover);
    --fc-button-hover-border-color: var(--border-hover);
    --fc-button-active-bg-color: var(--accent);
    --fc-button-active-border-color: var(--accent);
    --fc-today-bg-color: var(--accent-dim);
    --fc-neutral-bg-color: var(--bg-surface);
    --fc-page-bg-color: transparent;
    --fc-event-bg-color: var(--accent);
    --fc-event-border-color: var(--accent);
    --fc-event-text-color: #fff;
    --fc-list-event-hover-bg-color: var(--bg-hover);
    --fc-highlight-color: var(--accent-dim);
    --fc-non-business-color: rgba(0, 0, 0, 0.15)
}

.fc .fc-col-header-cell-cushion,
.fc .fc-daygrid-day-number,
.fc .fc-list-day-text,
.fc .fc-list-day-side-text {
    color: var(--text-secondary)
}

.fc .fc-toolbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary)
}

.fc .fc-button {
    font-size: 0.82rem;
    border-radius: var(--radius-sm) !important
}

.fc .fc-daygrid-event {
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer
}

.fc .fc-list-event-title a {
    color: var(--text-primary)
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
    border-color: var(--border)
}

.modal.fullscreen {
    width: 95vw;
    height: 95vh;
    max-width: none;
    max-height: none;
    display: flex;
    flex-direction: column;
}

.modal.fullscreen .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.modal.fullscreen .modal-header {
    border-bottom: 1px solid var(--border);
    padding: 20px 24px;
}

/* =============== RESPONSIVE =============== */

/* Large desktop 1440 - slightly tighten spacing */
@media(max-width:1440px) {
    .content {
        padding: 24px 28px 40px;
    }

    .metric-value {
        font-size: 1.75rem;
    }
}

/* Tablet landscape 1024 */
@media(max-width:1024px) {
    .charts-row {
        grid-template-columns: 1fr;
    }

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

    .payments-page .payment-plans {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .content {
        padding: 20px;
    }

    .chart-container {
        height: 280px;
    }

    .calendar-container {
        height: calc(100vh - 160px);
    }
}

/* Tablet portrait / mobile 768 */
/* Botconfig sidebar-checklist — desktop */
.sidebar-checklist {
    flex: 0 0 280px;
    position: sticky;
    top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
        width: 280px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    #dashboardApp {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

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

    .content {
        padding: 16px;
    }

    /* Botconfig: sidebar сверху на мобиле */
    .sidebar-checklist {
        flex: 1 1 100% !important;
        position: static !important;
        order: -1;
        max-width: 100% !important;
    }

    .settings-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .settings-tabs .tab-btn {
        flex: 0 0 auto !important;
        white-space: nowrap;
        font-size: 0.8rem !important;
        padding: 6px 10px !important;
    }

    /* Botconfig form sections */
    .settings-section .form-group {
        flex-direction: column !important;
    }

    .settings-section textarea,
    .settings-section input,
    .settings-section select {
        width: 100% !important;
        max-width: 100% !important;
    }

    .top-bar {
        padding: 12px 16px;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .metric-card {
        padding: 16px;
    }

    .metric-value {
        font-size: 1.5rem;
    }

    .metric-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .payments-page .payment-plans {
        grid-template-columns: 1fr;
    }

    .data-table th,
    .data-table td {
        padding: 10px 14px;
        font-size: 0.82rem;
    }

    .list-item-header {
        padding: 12px 14px;
        gap: 10px;
    }

    .list-item-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }

    .list-item-meta {
        flex-direction: column;
        gap: 2px;
    }

    .list-item-body-inner {
        padding: 0 14px 14px;
    }

    .event-item {
        padding: 12px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }

    .event-item-time {
        width: 100%;
        text-align: right;
    }

    .search-bar {
        padding: 12px 16px 12px 40px;
        font-size: 0.85rem;
    }

    .chart-container {
        height: 240px;
    }

    .calendar-container {
        height: calc(100vh - 140px);
        min-height: 400px;
    }

    .settings-section {
        padding: 20px;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions .btn {
        width: 100%;
    }

    .modal {
        width: 95%;
        max-width: none;
        max-height: 90vh;
    }

    .toast-container {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    .period-selector {
        width: 100%;
    }

    .period-btn {
        flex: 1;
        text-align: center;
        padding: 8px 8px;
        font-size: 0.8rem;
    }
}

/* Small phone 480 */
@media(max-width:480px) {
    .cards-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .metric-card {
        padding: 14px;
    }

    .metric-value {
        font-size: 1.3rem;
    }

    .metric-label {
        font-size: 0.7rem;
    }

    .top-bar {
        flex-wrap: wrap;
        gap: 8px;
    }

    .date-display {
        display: none;
    }

    .chart-container {
        height: 200px;
    }

    .list-item-name {
        font-size: 0.88rem;
    }

    .event-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .event-item-time {
        align-self: flex-end;
    }

    .payments-page .pricing-price {
        font-size: 1.8rem;
    }

    .calendar-container {
        height: calc(100vh - 120px);
        min-height: 350px;
        padding: 12px;
    }

    .fc .fc-toolbar {
        flex-direction: column;
        gap: 8px;
    }

    .fc .fc-toolbar-title {
        font-size: 0.95rem;
    }
}
