/* ==========================================================================
   App.css - Shared application styles
   ========================================================================== */

/* ==========================================================================
   1. FILTERS
   ========================================================================== */

.filters-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    overflow: visible;
}

.filters-row--dates {
    justify-content: space-between;
    flex-wrap: wrap;
}

.filters-row--custom-dates {
    background: #f9fafb;
    gap: 16px;
}

.filters-row--selects {
    gap: 24px;
    overflow: visible;
    position: relative;
    z-index: 10;
}

.filters-row--selects .filter-group {
    flex: 1;
    min-width: 0;
}

/* Quick Filters */
.quick-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.quick-filter-btn {
    padding: 6px 12px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.15s;
}

.quick-filter-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.quick-filter-btn.active {
    background: #7c3aed;
    border-color: #7c3aed;
    color: white;
}

.quick-filter-btn--custom {
    background: white;
    border-style: dashed;
}

.quick-filter-btn--custom.active {
    background: #7c3aed;
    border-style: solid;
}

/* Date Range Display */
.date-range-display {
    font-size: 13px;
    color: #6b7280;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.15s;
}

.date-range-display:hover {
    background: #f3f4f6;
}

.date-range-text {
    font-weight: 500;
    color: #374151;
}

/* Custom Date Pickers */
.date-picker-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-picker-group label {
    font-size: 13px;
    color: #6b7280;
    white-space: nowrap;
}

.apply-dates-btn {
    padding: 8px 16px;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.apply-dates-btn:hover {
    background: #6d28d9;
}

/* Filter Groups */
.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
    position: relative;
}

.filter-group--checkbox {
    flex: 0 0 auto;
    justify-content: flex-end;
    padding-bottom: 2px;
}

.filter-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.filter-checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #7c3aed;
    cursor: pointer;
}

.filter-checkbox-label span {
    font-weight: 500;
}

.filter-checkbox-label .filter-hint {
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    margin-left: 4px;
}

.filter-label {
    font-size: 11px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.filter-select,
.filter-input {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #111827;
    background: white;
    min-width: 140px;
    width: 100%;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #7c3aed;
}

/* Choices.js Integration */
.choices {
    overflow: visible !important;
    margin-bottom: 0;
    width: 100%;
}

.filters-row--selects .choices {
    flex: 1;
}

.choices__inner {
    min-height: 38px;
    padding: 4px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    font-size: 13px;
}

.choices__list--single {
    padding: 4px 16px 4px 4px;
}

.choices__list--dropdown {
    max-height: 300px !important;
    overflow-y: auto !important;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.choices__list--dropdown .choices__list {
    max-height: none !important;
    overflow: visible !important;
}

.choices__list--dropdown .choices__item {
    padding: 10px 12px;
    font-size: 13px;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: #f5f3ff;
    color: #7c3aed;
}

.choices__input {
    padding: 8px 12px !important;
    font-size: 13px !important;
    border-bottom: 1px solid #e5e7eb !important;
    margin-bottom: 0 !important;
}

.choices[data-type*="select-one"]::after {
    border-color: #6b7280 transparent transparent transparent;
}

.choices__placeholder {
    opacity: 0.6;
}

/* ==========================================================================
   2. DATA TABLES
   ========================================================================== */

/* Toolbar */
.data-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}

.data-toolbar-left,
.data-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.data-toolbar-select {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: white;
    min-width: 150px;
}

.data-toolbar-select:focus {
    outline: none;
    border-color: #7c3aed;
}

.data-toolbar-input {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    color: #374151;
    background: white;
    min-width: 160px;
}

.data-toolbar-input:focus {
    outline: none;
    border-color: #7c3aed;
}

.data-toolbar-btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid transparent;
}

.data-toolbar-btn--primary {
    background: #7c3aed;
    color: white;
    text-decoration: none;
}

.data-toolbar-btn--primary:hover {
    background: #6d28d9;
    color: white;
}

.data-toolbar-btn--secondary {
    background: white;
    border-color: #e5e7eb;
    color: #374151;
}

.data-toolbar-btn--secondary:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.data-toolbar-btn--danger {
    background: white;
    border-color: #fecaca;
    color: #dc2626;
}

.data-toolbar-btn--danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

.data-toolbar-btn--disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Table */
.data-table-wrapper {
    position: relative;
}

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

.data-table-th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.data-table-th--checkbox {
    width: 48px;
    text-align: center;
}

.data-table-th--actions {
    width: 140px;
    text-align: center;
}

.data-table-th--stats {
    text-align: right;
}

/* Row */
.data-row {
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.15s;
    position: relative;
}

.data-row:hover {
    background: #f9fafb;
    z-index: 1;
}

.data-row--selected {
    background: #f5f3ff;
}

.data-row--selected:hover {
    background: #ede9fe;
}

/* Cell */
.data-td {
    padding: 12px 16px;
    font-size: 13px;
    color: #374151;
    vertical-align: middle;
}

.data-td--checkbox {
    width: 48px;
    text-align: center;
}

.data-td--actions {
    width: 120px;
    text-align: right;
    overflow: visible;
    position: relative;
}

.data-td--stats {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.data-td--date {
    white-space: nowrap;
}

.data-td--empty {
    padding: 40px 16px;
    text-align: center;
}

/* Checkbox */
.data-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #7c3aed;
    cursor: pointer;
}

/* Name link */
.data-name-link {
    color: #111827;
    font-weight: 500;
    text-decoration: none;
}

.data-name-link:hover {
    color: #7c3aed;
}

/* Secondary link */
.data-secondary-link {
    color: #6b7280;
    font-size: 13px;
    text-decoration: none;
}

.data-secondary-link:hover {
    color: #7c3aed;
    text-decoration: underline;
}

/* Status badge */
.data-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.data-status-badge--new { background: #dbeafe; color: #1d4ed8; }
.data-status-badge--contacted { background: #fef3c7; color: #b45309; }
.data-status-badge--qualified { background: #ede9fe; color: #7c3aed; }
.data-status-badge--converted { background: #dcfce7; color: #166534; }
.data-status-badge--lost { background: #fee2e2; color: #dc2626; }
.data-status-badge--active { background: #dcfce7; color: #166534; }
.data-status-badge--draft { background: #f3f4f6; color: #6b7280; }
.data-status-badge--inactive { background: #fee2e2; color: #dc2626; }

/* Clickable status badge */
.data-status-badge--clickable {
    cursor: pointer;
    transition: all 0.15s;
    border: none;
    background: inherit;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.data-status-badge--clickable:hover {
    filter: brightness(0.95);
}

.data-status-badge--clickable .status-arrow {
    font-size: 9px;
    opacity: 0.7;
}

/* Status dropdown */
.data-td--status {
    position: relative;
    overflow: visible;
}

.status-dropdown {
    position: relative;
    display: inline-block;
}

.status-dropdown > .dropdown-menu {
    display: none;
}

.status-dropdown > .dropdown-menu.show {
    display: block;
}

.status-menu {
    min-width: 180px;
    padding: 8px;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border: none;
}

.status-form {
    margin: 0;
}

.status-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    text-align: left;
}

.status-option:hover {
    background: #f3f4f6;
}

.status-option--active {
    background: #f5f3ff;
}

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

.status-dot--1 { background: #3b82f6; }
.status-dot--2 { background: #f59e0b; }
.status-dot--3 { background: #8b5cf6; }
.status-dot--4 { background: #10b981; }
.status-dot--5 { background: #ef4444; }

/* Status button (inline variant for lead entry) */
.status-btn-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.status-btn-inline:hover {
    filter: brightness(0.95);
}

.status-btn--1, .status-btn-inline.status-btn--1 { background: #dbeafe; color: #1d4ed8; }
.status-btn--2, .status-btn-inline.status-btn--2 { background: #fef3c7; color: #b45309; }
.status-btn--3, .status-btn-inline.status-btn--3 { background: #ede9fe; color: #7c3aed; }
.status-btn--4, .status-btn-inline.status-btn--4 { background: #dcfce7; color: #166534; }
.status-btn--5, .status-btn-inline.status-btn--5 { background: #fee2e2; color: #dc2626; }

.status-arrow {
    font-size: 9px;
    opacity: 0.7;
}

/* Dropdown (minimal for JS - excludes nav dropdowns which are styled in output.css) */
.dropdown:not(.nav-item) { position: relative; display: inline-block; }
.dropdown:not(.nav-item) > .dropdown-menu { display: none; }
.dropdown:not(.nav-item) > .dropdown-menu.show { display: block; }

.dropdown-divider {
    height: 0;
    margin: 8px 0;
    border: 0;
    border-top: 1px solid #e5e7eb;
}

/* Data dropdown menu */
.data-dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 4px;
    min-width: 160px;
    padding: 8px 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 50;
}

.data-dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    font-size: 13px;
    text-align: left;
    color: #374151;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none;
}

.data-dropdown-item:hover {
    background: #f3f4f6;
}

.data-dropdown-item--danger {
    color: #dc2626;
}

.data-dropdown-item--danger:hover {
    background: #fef2f2;
}

.data-dropdown-divider {
    height: 1px;
    margin: 4px 0;
    background: #e5e7eb;
}

.data-dropdown-header {
    padding: 8px 16px;
}

.data-dropdown-header small {
    display: block;
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 6px;
}

.data-dropdown-select {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
}

.data-dropdown-select:focus {
    outline: none;
    border-color: #7c3aed;
}

.data-dropdown-item--warning {
    color: #d97706;
}

.data-dropdown-item--warning:hover {
    background: #fffbeb;
}

/* Action dots button */
.data-action-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 18px;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.data-action-dots:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Time label */
.data-time {
    color: #9ca3af;
    margin-left: 4px;
}

/* Actions */
.data-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.data-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.data-action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.data-action-btn--danger {
    border-color: #fecaca;
    color: #dc2626;
}

.data-action-btn--danger:hover {
    background: #fef2f2;
    border-color: #fca5a5;
}

/* Empty state */
.data-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.data-empty-title {
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.data-empty-desc {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* Paginator */
.data-paginator {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-top: 1px solid #f3f4f6;
}

.data-paginator-info {
    font-size: 13px;
    color: #6b7280;
}

.data-paginator-current {
    font-weight: 600;
    color: #7c3aed;
}

.data-paginator-total {
    font-weight: 500;
    color: #374151;
}

.data-paginator-nav {
    display: flex;
    gap: 8px;
}

.data-paginator-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.data-paginator-btn:hover:not(.data-paginator-btn--disabled) {
    background: #f9fafb;
    border-color: #d1d5db;
}

.data-paginator-btn--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* ==========================================================================
   3. HELP TOOLTIPS
   ========================================================================== */

.metric-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: help;
    text-transform: none;
    letter-spacing: 0;
    flex-shrink: 0;
}

.metric-help:hover {
    color: #6b7280;
    background: #e5e7eb;
}

.metric-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.metric-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.metric-help:hover .metric-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Tooltip aligned to the left (for elements near left edge) */
.metric-tooltip--left {
    left: 0;
    transform: translateX(0);
}

.metric-tooltip--left::after {
    left: 12px;
    transform: translateX(0);
}

/* ==========================================================================
   4. LEADS - Notes Timeline
   ========================================================================== */

.notes-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.note-item {
    display: flex;
    gap: 12px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.note-dot {
    width: 8px;
    height: 8px;
    background: #7c3aed;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.note-content {
    flex: 1;
    min-width: 0;
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.note-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin: 0;
}

.note-date {
    font-size: 12px;
    color: #9ca3af;
}

.note-text {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 0;
}

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

/* Add Note Form */
.add-note-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 16px;
}

.note-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.note-input:focus {
    outline: none;
    border-color: #7c3aed;
}

/* ==========================================================================
   5. LEADS - Tasks
   ========================================================================== */

.tasks-list {
    display: flex;
    flex-direction: column;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

.task-item--done .task-text {
    text-decoration: line-through;
    color: #9ca3af;
}

.task-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #7c3aed;
    cursor: pointer;
    margin-top: 2px;
}

.task-text {
    flex: 1;
    font-size: 14px;
    color: #374151;
}

.task-actions {
    display: flex;
    gap: 4px;
}

/* ==========================================================================
   6. LEADS - Attachments
   ========================================================================== */

.attachments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.attachment-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.15s;
}

.attachment-item:hover {
    border-color: #d1d5db;
}

.attachment-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.attachment-name {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-size {
    font-size: 12px;
    color: #9ca3af;
    flex-shrink: 0;
}

.attachment-actions {
    display: flex;
    gap: 4px;
}

/* ==========================================================================
   7. LEADS - CRM Sync
   ========================================================================== */

.sync-cell {
    min-width: 140px;
}

.sync-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.sync-badge--success {
    background-color: #d1fae5;
    color: #065f46;
}

.sync-badge--error {
    background-color: #fee2e2;
    color: #991b1b;
    cursor: help;
}

.sync-badge--pending {
    background-color: #fef3c7;
    color: #92400e;
}

.sync-badge--none {
    background-color: #f3f4f6;
    color: #6b7280;
}

/* Tooltips */
.has-tooltip {
    position: relative;
    cursor: help;
}

.has-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1000;
    pointer-events: none;
    white-space: nowrap;
    text-align: left;
}

.has-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #1f2937;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s, visibility 0.15s;
    z-index: 1000;
}

.has-tooltip:hover::after,
.has-tooltip:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Sync Chips (Lead Detail) */
.sync-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.sync-chip--success {
    background: #ecfdf5;
    color: #065f46;
}

.sync-chip--error {
    background: #fef2f2;
    color: #991b1b;
}

.sync-chip--pending {
    background: #fffbeb;
    color: #92400e;
}

.sync-chip-provider {
    font-weight: 600;
}

/* Sync Info Section (Lead Entry) */
.sync-info-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.sync-info-header {
    margin-bottom: 12px;
}

.sync-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-info-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 8px;
    background: #f9fafb;
    border-left: 3px solid #d1d5db;
}

.sync-info-item--success {
    background: #f0fdf4;
    border-left-color: #22c55e;
}

.sync-info-item--error {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.sync-info-item--pending {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.sync-info-provider {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.sync-info-details {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.sync-info-status {
    font-weight: 500;
    color: #6b7280;
}

.sync-info-item--success .sync-info-status {
    color: #16a34a;
}

.sync-info-item--error .sync-info-status {
    color: #dc2626;
}

.sync-info-item--pending .sync-info-status {
    color: #d97706;
}

.sync-info-date {
    color: #6b7280;
}

.sync-info-id {
    color: #9ca3af;
    font-family: monospace;
    font-size: 12px;
}

.sync-info-error {
    color: #dc2626;
    font-size: 12px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sync-chip-date {
    font-size: 11px;
    opacity: 0.8;
}

.sync-chip-error {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 50%;
    font-size: 11px;
    cursor: help;
}

/* Sync Section */
.sync-section {
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.sync-header {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.sync-status-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sync-entry-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.sync-empty {
    font-size: 13px;
    color: #9ca3af;
    text-align: center;
    padding: 12px;
}

/* Sync Dropdown Menu */
.sync-dropdown-menu {
    min-width: 280px;
}

.sync-dropdown-menu .dropdown-header {
    padding: 12px 16px;
    background: #f9fafb;
}

.sync-mode-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    cursor: pointer;
}

.sync-mode-item:hover {
    background: #f5f3ff;
}

/* ==========================================================================
   8. LEADS - Detail Page
   ========================================================================== */

.lead-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.lead-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.lead-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.lead-detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lead-detail-label {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.lead-detail-value {
    font-size: 14px;
    color: #111827;
    word-break: break-word;
}

/* Primary Fields */
.primary-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.primary-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.field-value {
    position: relative;
    padding: 12px 14px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #111827;
    cursor: pointer;
    transition: all 0.15s;
}

.field-value:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.field-value.copied {
    background: #dbeafe;
    border-color: #3b82f6;
}

.copy-hint {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #9ca3af;
    opacity: 0;
    transition: opacity 0.15s;
}

.field-value:hover .copy-hint {
    opacity: 1;
}

.primary-field a {
    color: #7c3aed;
    text-decoration: none;
}

.primary-field a:hover {
    text-decoration: underline;
}

/* Tags */
.tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #f3f4f6;
    border-radius: 4px;
    font-size: 12px;
    color: #374151;
}

.tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
}

.tag-remove:hover {
    color: #dc2626;
}

/* ==========================================================================
   9. RESPONSIVE
   ========================================================================== */

@media (max-width: 1024px) {
    .data-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .data-toolbar-left,
    .data-toolbar-right {
        flex-wrap: wrap;
    }

    .data-toolbar-select {
        width: 100%;
    }

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

@media (max-width: 768px) {
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-row--dates {
        gap: 12px;
    }

    .quick-filters {
        justify-content: flex-start;
    }

    .filters-row--custom-dates {
        flex-direction: column;
    }

    .date-picker-group {
        width: 100%;
    }

    .date-picker-group input {
        flex: 1;
    }

    .apply-dates-btn {
        width: 100%;
    }

    .filters-row--selects {
        gap: 12px;
    }

    .filter-group {
        width: 100%;
    }

    .data-toolbar {
        padding: 12px 16px;
    }

    .data-paginator {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    .data-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

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

@media (max-width: 480px) {
    .data-table-th,
    .data-td {
        padding: 8px 10px;
    }

    .data-action-btn {
        padding: 8px 6px;
        font-size: 10px;
    }

    .data-paginator-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* ==========================================================================
   MODALS
   ========================================================================== */
/* ==========================================================================
   Modals - Shared styles for all modal dialogs
   Tailwind-based modal system (replaces Bootstrap modals)
   ========================================================================== */

/* Modal backdrop */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal dialog container */
.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 1rem;
    pointer-events: none;
}

.modal-dialog-centered {
    min-height: calc(100% - 2rem);
    display: flex;
    align-items: center;
}

.modal-dialog-scrollable {
    max-height: calc(100% - 2rem);
}

.modal-dialog-scrollable .modal-content {
    max-height: calc(100vh - 4rem);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-dialog-scrollable .modal-body {
    overflow-y: auto;
}

/* Modal sizes */
.modal-sm .modal-dialog {
    max-width: 380px;
}

.modal-lg .modal-dialog,
.modal-dialog.modal-lg {
    max-width: 800px;
}

.modal-xl .modal-dialog {
    max-width: 1140px;
}

/* Modal content */
.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 20px 24px;
    background: white;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

/* Close button - replaces Bootstrap btn-close */
.btn-close, .modal-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 22px;
    font-family: Arial, sans-serif;
    font-weight: 400;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    padding-bottom: 2px;
}

.btn-close:empty::before {
    content: "×";
}

/* Don't show × if button has an image inside */
.btn-close:has(img)::before,
.btn-close:has(svg)::before {
    content: none;
}

.btn-close:hover, .modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Body scroll lock when modal is open */
body.modal-open {
    overflow: hidden;
    padding-right: var(--scrollbar-width, 0);
}

/* Modal buttons */
.modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: #7c3aed;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.modal-btn:hover {
    background: #6d28d9;
}

.modal-btn:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.btn.btn-outline,
.modal-footer .btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn.btn-outline:hover,
.modal-footer .btn-outline:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

/* Export mode cards (radio selection) */
.export-mode-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.export-mode-card {
    display: block;
    padding: 16px 20px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.export-mode-card:hover {
    border-color: #c4b5fd;
    background: #faf5ff;
}

.export-mode-radio:checked + .export-mode-card {
    border-color: #7c3aed;
    background: #faf5ff;
}

.export-mode-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.export-mode-card-description {
    font-size: 13px;
    color: #6b7280;
}

/* Spinner (loading indicator) */
.spinner-border {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}

/* Screen reader only (accessibility) */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Color utilities */
.text-success {
    color: #16a34a;
}

.text-danger {
    color: #dc2626;
}

/* Layout utilities */
.flex-fill {
    flex: 1 1 auto;
}

.position-relative {
    position: relative;
}

/* ==========================================================================
   Legacy .modal-custom styles (for backwards compatibility)
   ========================================================================== */

.modal-custom {
    max-width: 420px;
    width: 100%;
    margin: 1.75rem auto;
}

.modal-custom[style*="max-width"] {
    max-width: none;
}

.modal-custom.modal-custom--wide {
    max-width: 900px;
}

.modal-custom .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-custom .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: white;
}

.modal-custom .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.modal-custom .modal-close {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    font-size: 22px;
    font-family: Arial, sans-serif;
    font-weight: 400;
    color: #6b7280;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    padding-bottom: 2px;
}

.modal-custom .modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.modal-custom .modal-body {
    padding: 20px 24px;
    background: white;
}

.modal-custom .modal-body p {
    margin: 0;
}

.modal-custom .modal-text {
    font-size: 15px;
    color: #374151;
    margin: 0 0 12px !important;
}

.modal-custom .modal-subtext {
    font-size: 14px;
    color: #6b7280;
    padding: 12px 14px;
    background: #f9fafb;
    border-radius: 8px;
    word-break: break-word;
}

.modal-custom .modal-warning {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: #fef3c7;
    border-radius: 8px;
    margin-top: 12px;
}

.modal-custom .modal-warning-icon {
    color: #b45309;
    font-size: 20px;
    flex-shrink: 0;
}

.modal-custom .modal-warning-text {
    font-size: 13px;
    color: #92400e;
    margin: 0;
}

/* Form fields */
.modal-custom .modal-body label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.modal-custom .modal-body input[type="text"],
.modal-custom .modal-body input[type="email"],
.modal-custom .modal-body input[type="number"],
.modal-custom .modal-body textarea,
.modal-custom .modal-body select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: border-color 0.15s;
}

.modal-custom .modal-body input:focus,
.modal-custom .modal-body textarea:focus,
.modal-custom .modal-body select:focus {
    outline: none;
    border-color: #7c3aed;
}

.modal-custom .modal-body input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #f9fafb;
    cursor: pointer;
}

.modal-custom .modal-body input[type="file"]:hover {
    border-color: #7c3aed;
    background: #f5f3ff;
}

.modal-custom .modal-body .form-group,
.modal-custom .modal-body .mb-3 {
    margin-bottom: 16px;
}

.modal-custom .modal-body .form-group:last-child,
.modal-custom .modal-body .mb-3:last-child {
    margin-bottom: 0;
}

/* Form-check styling in modals */
.modal-custom .modal-body .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 0;
}

.modal-custom .modal-body .form-check-input {
    margin: 0;
    flex-shrink: 0;
}

.modal-custom .modal-body .form-check-label {
    display: inline;
    margin-bottom: 0;
}

/* Hide crispy asterisks */
.modal-custom .asteriskField {
    display: none;
}

/* Crispy forms fix */
.modal-custom .modal-body .textinput,
.modal-custom .modal-body .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
    transition: border-color 0.15s;
}

.modal-custom .modal-body .textinput:focus,
.modal-custom .modal-body .form-control:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: none;
}

.modal-custom .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 20px;
    border-top: 1px solid #e5e7eb;
    background: white;
}

.modal-custom .btn-cancel {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #f3f4f6;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.modal-custom .btn-cancel:hover {
    background: #e5e7eb;
}

.modal-custom .btn-primary {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: #7c3aed;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.modal-custom .btn-primary:hover {
    background: #6d28d9;
}

.modal-custom .btn-danger {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: white;
    background: #dc2626;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.modal-custom .btn-danger:hover {
    background: #b91c1c;
}

@media (max-width: 480px) {
    .modal-custom {
        max-width: calc(100% - 32px);
        margin: 16px;
    }
}

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
/* ==========================================================================
   Dashboard Page Styles
   ========================================================================== */

/* Welcome */
.dash-welcome {
    margin-bottom: 20px;
}

.dash-welcome h1 {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.dash-welcome p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Metrics - like usage-stats in billing */
.dash-metrics {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 900px) {
    .dash-metrics {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .dash-metrics {
        grid-template-columns: 1fr;
    }
}

.dash-metric {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
    cursor: default;
}

.dash-metric-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

/* Help tooltip - same style as analytics */
.metric-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: help;
    text-transform: none;
    letter-spacing: 0;
}

.metric-help:hover {
    color: #6b7280;
    background: #e5e7eb;
}

.metric-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.metric-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.metric-help:hover .metric-tooltip {
    opacity: 1;
    visibility: visible;
}

.dash-metric-value {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

.dash-metric-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.dash-trend {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.dash-trend.up {
    background: #d1fae5;
    color: #065f46;
}

.dash-trend.down {
    background: #fee2e2;
    color: #991b1b;
}

.dash-trend.neutral {
    color: #9ca3af;
}

.dash-trend.new {
    background: #dbeafe;
    color: #1d4ed8;
}

/* Card - like page-card */
.dash-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 20px;
}

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.dash-card-header h2 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.dash-link {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    text-decoration: none;
}

.dash-link:hover {
    color: #7c3aed;
}

/* Table */
.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table th {
    text-align: left;
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #f3f4f6;
}

.dash-table th .metric-help {
    width: 14px;
    height: 14px;
    font-size: 10px;
    margin-left: 4px;
    vertical-align: middle;
}

.dash-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

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

.dash-table tbody tr:hover {
    background: #f9fafb;
}

.dash-table th:not(:first-child),
.dash-table td:not(:first-child) {
    text-align: right;
}

.dash-table th.text-center,
.dash-table td.text-center {
    text-align: center;
}

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

a.dash-channel {
    text-decoration: none;
    color: inherit;
}

a.dash-channel:hover {
    color: #7c3aed;
}

.dash-channel .material-icons-round {
    font-size: 18px;
}

/* Coming Soon Channels */
.dash-channel-coming {
    opacity: 0.5;
}

.dash-channel-coming:hover {
    background: transparent !important;
}

.dash-coming-badge {
    font-size: 10px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.dash-channel-toggle td {
    padding: 8px 20px !important;
    border-bottom: none !important;
}

.dash-coming-toggle {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.dash-coming-toggle:hover {
    color: #7c3aed;
}

/* Grid */
.dash-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 800px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }
}

.dash-grid .dash-card {
    margin-bottom: 0;
}

/* Events */
.dash-events {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    background: #e5e7eb;
}

@media (max-width: 600px) {
    .dash-events {
        grid-template-columns: 1fr;
    }
}

.dash-event {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: white;
}

.dash-event-date {
    text-align: center;
    flex-shrink: 0;
    min-width: 36px;
}

.dash-event-day {
    display: block;
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    line-height: 1;
}

.dash-event-month {
    display: block;
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
}

.dash-event-content {
    flex: 1;
    min-width: 0;
}

.dash-event-title {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-event-action {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
    text-decoration: none;
}

.dash-event-action:hover {
    color: #7c3aed;
}

/* List */
.dash-list {
    padding: 8px 0;
}

.dash-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
}

.dash-list-item:hover {
    background: #f9fafb;
}

.dash-list-content {
    flex: 1;
    min-width: 0;
}

.dash-list-title {
    display: block;
    font-size: 14px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.dash-list-title {
    color: #111827;
    font-weight: 500;
    text-decoration: none;
}

a.dash-list-title:hover {
    color: #7c3aed;
}

.dash-list-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.dash-empty {
    padding: 32px 20px;
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
}

.dash-rank {
    width: 24px;
    height: 24px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.dash-ctr {
    font-size: 14px;
    font-weight: 600;
    color: #10b981;
}

/* Alert icon */
.dash-alert-icon {
    font-size: 18px;
    color: #f59e0b;
    flex-shrink: 0;
}

/* Button */
.dash-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: #7c3aed;
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.dash-btn:hover {
    background: #6d28d9;
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .dash-welcome h1 {
        font-size: 18px;
    }

    .dash-card-header {
        padding: 12px 16px;
    }

    .dash-card-header h2 {
        font-size: 13px;
    }

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

    .dash-table th,
    .dash-table td {
        padding: 10px 12px;
        font-size: 12px;
        white-space: nowrap;
    }

    .dash-table th:first-child,
    .dash-table td:first-child {
        position: sticky;
        left: 0;
        background: white;
        z-index: 1;
    }

    .dash-table thead th:first-child {
        background: #f9fafb;
    }

    .dash-channel {
        gap: 8px;
    }

    .dash-channel .material-icons-round {
        font-size: 16px;
    }

    .dash-event {
        padding: 12px 16px;
        gap: 10px;
    }

    .dash-event-day {
        font-size: 18px;
    }

    .dash-event-title {
        font-size: 13px;
    }

    .dash-list-item {
        padding: 10px 16px;
    }

    .dash-list-title {
        font-size: 13px;
    }

    .dash-empty {
        padding: 24px 16px;
    }
}

@media (max-width: 480px) {
    .dash-metric {
        padding: 12px 16px;
    }

    .dash-metric-value {
        font-size: 20px;
    }

    .dash-metric-label {
        font-size: 11px;
    }
}

/* ==========================================================================
   ANALYTICS
   ========================================================================== */
/* ==========================================================================
   Analytics Styles - Shared for all analytics views
   ========================================================================== */

/* Empty State */
.analytics-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.analytics-empty-state-icon {
    color: #d1d5db;
    margin-bottom: 16px;
}

.analytics-empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px 0;
}

.analytics-empty-state-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    max-width: 360px;
}

/* Metrics Grid */
.analytics-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px;
    padding-bottom: 0;
}

@media (max-width: 768px) {
    .analytics-metrics {
        grid-template-columns: 1fr;
    }
}

.analytics-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    cursor: default;
}

.analytics-metric-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.analytics-metric-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.analytics-metric-value {
    font-size: 28px;
    font-weight: 600;
    color: #111827;
}

.analytics-trend {
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.analytics-trend.up {
    color: #10b981;
}

.analytics-trend.down {
    color: #ef4444;
}

/* Help Tooltip */
.metric-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: help;
    text-transform: none;
    letter-spacing: 0;
}

.metric-help:hover {
    color: #6b7280;
    background: #e5e7eb;
}

.metric-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s;
    z-index: 100;
}

.metric-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.metric-help:hover .metric-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Chart Card */
.analytics-chart-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin: 20px;
    margin-bottom: 0;
}

.analytics-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.analytics-chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.chart-legend {
    display: flex;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.legend-item .metric-help {
    width: 14px;
    height: 14px;
    font-size: 10px;
}

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

.analytics-chart-body {
    padding: 20px;
    height: 320px;
}

#analytics-chart {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 640px) {
    .analytics-chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chart-legend {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* Device, Browser, OS & Country Breakdown Grid */
.analytics-breakdown-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 20px;
}

.analytics-breakdown-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.analytics-breakdown-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.analytics-breakdown-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.analytics-breakdown-body {
    display: flex;
    align-items: center;
    padding: 20px;
    gap: 30px;
}

.breakdown-chart-container {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
}

.breakdown-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

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

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

.breakdown-label {
    font-size: 13px;
    color: #6b7280;
    min-width: 60px;
}

.breakdown-value {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    min-width: 40px;
    text-align: right;
}

.breakdown-percent {
    font-size: 12px;
    color: #9ca3af;
    min-width: 45px;
    text-align: right;
}

.referrer-name {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 700px) {
    .analytics-breakdown-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .analytics-breakdown-body {
        flex-direction: column;
        gap: 20px;
    }

    .breakdown-chart-container {
        width: 100px;
        height: 100px;
    }

    .breakdown-stats {
        width: 100%;
    }
}

/* Table Card */
.analytics-table-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin: 20px;
}

.analytics-table-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-table-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.analytics-badge-new {
    font-size: 10px;
    font-weight: 600;
    color: #059669;
    background: #d1fae5;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.analytics-breakdown-note {
    grid-column: 1 / -1;
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 4px 0;
}

.analytics-breakdown-row .analytics-table-card {
    margin: 0;
}

.analytics-table-body {
    padding: 0;
}

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

.analytics-table th {
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid #f3f4f6;
}

.analytics-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

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

.analytics-table tbody tr:hover {
    background: #f9fafb;
}

.analytics-table .text-left {
    text-align: left;
}

.analytics-table .text-right {
    text-align: right;
}

.analytics-table .text-center {
    text-align: center;
}

.analytics-table .row-number {
    color: #9ca3af;
    font-size: 12px;
    width: 40px;
}

.analytics-table .campaign-name {
    font-weight: 500;
}

.analytics-table .campaign-name a {
    color: #111827;
    text-decoration: none;
}

.analytics-table .campaign-name a:hover {
    color: #7c3aed;
    text-decoration: underline;
}

.analytics-table .ctr-cell {
    color: #10b981;
    font-weight: 500;
}

.analytics-empty {
    padding: 32px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .analytics-metrics {
        padding: 16px;
        gap: 10px;
    }

    .analytics-metric {
        padding: 14px 16px;
    }

    .analytics-metric-value {
        font-size: 22px;
    }

    .analytics-chart-card,
    .analytics-table-card,
    .analytics-device-card {
        margin: 16px;
    }

    .analytics-breakdown-row {
        margin: 16px;
        gap: 16px;
    }

    .analytics-chart-header,
    .analytics-table-header,
    .analytics-device-header,
    .analytics-breakdown-header {
        padding: 12px 16px;
    }

    .analytics-chart-body {
        padding: 12px;
        height: 280px;
    }

    /* Tooltip mobile fix */
    .metric-tooltip {
        white-space: normal;
        max-width: 180px;
        text-align: center;
        left: 0;
        transform: translateX(0);
    }

    .metric-tooltip::after {
        left: 12px;
        transform: none;
    }

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

    .analytics-table {
        min-width: 500px;
    }

    .analytics-table th,
    .analytics-table td {
        padding: 10px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .analytics-metrics {
        padding: 12px;
    }

    .analytics-metric {
        padding: 12px 14px;
    }

    .analytics-metric-value {
        font-size: 20px;
    }

    .analytics-chart-card,
    .analytics-table-card,
    .analytics-device-card {
        margin: 12px;
    }

    .analytics-breakdown-row {
        margin: 12px;
        gap: 12px;
    }

    .analytics-chart-body {
        height: 240px;
    }

    .legend-item {
        font-size: 11px;
    }

    .legend-dot {
        width: 6px;
        height: 6px;
    }
}

/* ==========================================================================
   BILLING
   ========================================================================== */
/* ==========================================================================
   Billing Page Styles
   ========================================================================== */

/* Usage Stats Grid */
.usage-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
}

.usage-stat {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 20px;
}

.usage-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.usage-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.usage-stat-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
}

.usage-stat-badge--ok {
    background: #d1fae5;
    color: #065f46;
}

.usage-stat-badge--warning {
    background: #fef3c7;
    color: #92400e;
}

.usage-stat-badge--danger {
    background: #fee2e2;
    color: #991b1b;
}

.usage-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.usage-stat-limit {
    font-size: 13px;
    color: #6b7280;
}

.usage-stat-limit strong {
    color: #374151;
}

.usage-stat-bar {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    margin-top: 12px;
    overflow: hidden;
}

.usage-stat-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.usage-stat-bar-fill--ok {
    background: #10b981;
}

.usage-stat-bar-fill--warning {
    background: #f59e0b;
}

.usage-stat-bar-fill--danger {
    background: #ef4444;
}

/* Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-action--primary {
    background: #7c3aed;
    color: white;
}

.btn-action--primary:hover {
    background: #6d28d9;
    color: white;
}

/* Plan Card */
.plan-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.plan-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.plan-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: capitalize;
}

.plan-badge--free {
    background: #f3f4f6;
    color: #374151;
}

.plan-badge--starter {
    background: #f3f4f6;
    color: #374151;
}

.plan-badge--start {
    background: #dbeafe;
    color: #1d4ed8;
}

.plan-badge--growth {
    background: #d1fae5;
    color: #065f46;
}

.plan-badge--business {
    background: #ede9fe;
    color: #6d28d9;
}

.plan-badge--idosell {
    background: #fef3c7;
    color: #92400e;
}

.plan-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.plan-name {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.plan-period {
    font-size: 13px;
    color: #6b7280;
}

.plan-actions {
    display: flex;
    gap: 8px;
}

/* Billing Period */
.billing-period {
    padding: 16px 20px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    color: #6b7280;
}

.billing-period strong {
    color: #374151;
}

/* Chart Section */
.usage-chart {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.usage-chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
}

#area-chart {
    height: 280px;
}

/* Invoice Section */
.invoice-section {
    margin-top: 24px;
}

.invoice-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.invoice-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

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

.invoice-table th {
    padding: 12px 20px;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.invoice-table td {
    padding: 14px 20px;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

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

.invoice-table tbody tr:hover {
    background: #f9fafb;
}

.invoice-status {
    display: inline-block;
    padding: 3px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 10px;
}

.invoice-status--paid {
    background: #d1fae5;
    color: #065f46;
}

.invoice-status--pending {
    background: #fef3c7;
    color: #92400e;
}

.invoice-status--failed {
    background: #fee2e2;
    color: #991b1b;
}

.invoice-link {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 500;
}

.invoice-link:hover {
    text-decoration: underline;
}

.invoice-number {
    font-weight: 500;
    color: #111827;
}

.invoice-amount {
    font-weight: 600;
    color: #111827;
}

.invoice-table-actions {
    text-align: center;
    width: 100px;
}

.invoice-download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #6b7280;
    border-radius: 6px;
    transition: all 0.15s;
}

.invoice-download-btn:hover {
    background: #f3f4f6;
    color: #7c3aed;
}

.invoice-download-btn .material-icons-round {
    font-size: 20px;
}

.invoice-list-container {
    min-height: 100px;
}

.invoice-pagination {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

/* Empty States */
.billing-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #9ca3af;
    font-size: 14px;
}

.billing-empty p {
    margin: 0;
}

/* IdoSell Notice */
.idosell-notice {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
}

.idosell-notice-icon {
    color: #b45309;
    font-size: 20px;
    flex-shrink: 0;
}

.idosell-notice-text {
    font-size: 14px;
    color: #92400e;
    margin: 0;
}

/* Subscription Section */
.subscription-section {
    margin-top: 24px;
}

.subscription-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.subscription-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.subscription-content {
    padding: 20px;
}

.subscription-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cancel-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #fef2f2;
    border-radius: 8px;
    font-size: 13px;
    color: #991b1b;
}

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

.cancel-btn:hover {
    background: #dc2626;
    color: white;
}

/* Responsive */
@media (max-width: 900px) {
    .usage-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .plan-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .plan-actions {
        width: 100%;
    }

    .subscription-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .usage-stats {
        grid-template-columns: 1fr;
    }

    .invoice-table th,
    .invoice-table td {
        padding: 12px 16px;
    }

    .invoice-table th:nth-child(3),
    .invoice-table td:nth-child(3) {
        display: none;
    }
}

/* ==========================================================================
   SETTINGS
   ========================================================================== */
/* ==========================================================================
   Settings Page Styles
   ========================================================================== */

/* Danger tab variant */
.page-tab-danger:hover {
    color: #dc2626 !important;
}
.page-tab-danger.active {
    color: #dc2626 !important;
}
.page-tab-danger.active::after {
    background: #dc2626 !important;
}

/* Tab content */
.tab-content {
    padding: 24px;
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Form styles */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.form-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}
.form-group {
    display: flex;
    flex-direction: column;
}
.form-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.form-error {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
}
.form-static {
    padding: 10px 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    color: #6b7280;
}
.form-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}
.form-success-message {
    padding: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Avatar */
.avatar-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}
.avatar-upload {
    cursor: pointer;
}
.avatar-upload input[type="file"] {
    display: none;
}
.avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
}
.avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 18px;
    font-weight: 600;
}
.avatar-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.avatar-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}
.btn-upload {
    padding: 6px 12px;
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-upload:hover {
    border-color: #7c3aed;
    color: #7c3aed;
}
.remove-avatar {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
}
.remove-avatar input {
    accent-color: #dc2626;
}

/* Notifications */
.notification-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.notification-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.15s;
}
.notification-item:hover {
    border-color: #d1d5db;
}
.notification-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.notification-title {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}
.notification-desc {
    font-size: 13px;
    color: #6b7280;
}
input.toggle-checkbox,
input.toggle-checkbox[type="checkbox"] {
    width: 44px !important;
    min-width: 44px !important;
    height: 24px !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background: #d1d5db !important;
    background-image: none !important;
    border-radius: 12px !important;
    position: relative !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
    flex-shrink: 0 !important;
    border: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
input.toggle-checkbox::before,
input.toggle-checkbox[type="checkbox"]::before {
    content: '' !important;
    position: absolute !important;
    width: 18px !important;
    height: 18px !important;
    background: white !important;
    border-radius: 50% !important;
    top: 3px !important;
    left: 3px !important;
    transition: transform 0.2s !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    border: none !important;
}
input.toggle-checkbox:checked,
input.toggle-checkbox[type="checkbox"]:checked {
    background: #7c3aed !important;
    background-color: #7c3aed !important;
}
input.toggle-checkbox:checked::before,
input.toggle-checkbox[type="checkbox"]:checked::before {
    transform: translateX(20px) !important;
}

/* Buttons */
.btn-save {
    padding: 10px 20px;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-save:hover {
    background: #6d28d9;
}
.btn-cancel {
    padding: 10px 20px;
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.btn-cancel:hover {
    background: #f9fafb;
}
.btn-delete {
    padding: 10px 20px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}
.btn-delete:hover {
    background: #b91c1c;
}
.btn-delete:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

/* Danger zone */
.danger-zone {
    max-width: 400px;
}
.danger-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.modal-container {
    background: white;
    border-radius: 10px;
    max-width: 400px;
    width: 100%;
}
.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}
.modal-body {
    padding: 20px;
}
.modal-body p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
}
.modal-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}
.modal-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
}
.modal-input:focus {
    outline: none;
    border-color: #7c3aed;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 10px 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .form-grid, .form-grid-3 {
        grid-template-columns: 1fr;
    }
    .avatar-section {
        flex-direction: column;
        align-items: flex-start;
    }
    .notification-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    input.toggle-checkbox {
        align-self: flex-end;
    }
}

/* ==========================================================================
   PLANS
   ========================================================================== */
/* ==========================================================================
   Plans Page Styles
   ========================================================================== */

/* Billing Toggle - like plan-card in billing */
.billing-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.billing-toggle-label {
    font-size: 13px;
    color: #6b7280;
}

.billing-toggle-inner {
    display: inline-flex;
    background: #f3f4f6;
    padding: 3px;
    border-radius: 6px;
}

.billing-toggle-btn {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.billing-toggle-btn.active {
    background: white;
    color: #111827;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.billing-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    background: #d1fae5;
    color: #065f46;
    margin-left: 4px;
}

/* Plans Grid - like usage-stats */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 20px;
}

@media (max-width: 900px) {
    .plans-grid {
        grid-template-columns: 1fr;
    }
}

/* Plan Card - like usage-stat box */
.plan-card-main {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.plan-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.plan-card-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 2px 0;
}

.plan-card-info p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.plan-card-price {
    text-align: right;
}

.plan-price-value {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 2px;
}

.plan-price-currency {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.plan-price-amount {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    transition: all 0.2s;
}

.plan-price-period {
    font-size: 12px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Slider - like usage-stat-bar */
.plan-slider {
    margin-bottom: 20px;
}

.plan-slider-track {
    position: relative;
    height: 36px;
    display: flex;
    align-items: center;
}

.plan-slider-bg {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    transform: translateY(-50%);
}

.plan-slider-progress {
    position: absolute;
    top: 50%;
    left: 0;
    height: 6px;
    background: #7c3aed;
    border-radius: 3px;
    transform: translateY(-50%);
    transition: width 0.2s ease;
}

.plan-slider-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 20;
}

.plan-slider-dots {
    position: absolute;
    width: 100%;
    display: flex;
    justify-content: space-between;
    z-index: 10;
    pointer-events: none;
}

.plan-slider-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
    border: 3px solid #e5e7eb;
    transition: all 0.2s ease;
}

.plan-slider-dot.active {
    border-color: #7c3aed;
}

.plan-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
}

.plan-slider-label {
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    transition: color 0.2s;
}

.plan-slider-label.active {
    color: #7c3aed;
    font-weight: 600;
}

.plan-slider-caption {
    text-align: center;
    font-size: 11px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 6px;
}

/* Features - like usage-stat details */
.plan-features {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

@media (max-width: 600px) {
    .plan-features {
        grid-template-columns: 1fr;
    }
}

.plan-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #374151;
}

.plan-feature-icon {
    width: 16px;
    height: 16px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plan-feature-icon .material-icons-round {
    font-size: 10px;
    color: #065f46;
}

/* CTA Button - like btn-action--primary */
.plan-cta-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    background: #7c3aed;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.plan-cta-btn:hover {
    background: #6d28d9;
}

.plan-cta-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Enterprise Card */
.plan-card-enterprise {
    background: #111827;
    border: 1px solid #111827;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.plan-card-enterprise h3 {
    font-size: 16px;
    font-weight: 600;
    color: white;
    margin: 0 0 2px 0;
}

.plan-card-enterprise > p {
    font-size: 13px;
    color: #9ca3af;
    margin: 0 0 16px 0;
}

.enterprise-features {
    list-style: none;
    padding: 0;
    margin: 0 0 auto 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.enterprise-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #d1d5db;
}

.enterprise-feature-icon {
    width: 16px;
    height: 16px;
    background: rgba(124, 58, 237, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.enterprise-feature-icon .material-icons-round {
    font-size: 10px;
    color: #a78bfa;
}

.enterprise-cta-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 16px;
    text-decoration: none;
    text-align: center;
    display: block;
}

.enterprise-cta-btn:hover {
    background: white;
    color: #111827;
}

/* Footer - like billing-empty style */
.plans-footer {
    padding: 16px 20px;
    border-top: 1px solid #e5e7eb;
}

.plans-footer p {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.plans-footer a {
    color: #7c3aed;
    font-weight: 500;
    text-decoration: none;
}

.plans-footer a:hover {
    text-decoration: underline;
}

/* IdoSell Notice - same as billing */
.idosell-plan-notice {
    display: flex;
    gap: 12px;
    padding: 16px 20px;
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
}

.idosell-plan-notice-icon {
    color: #b45309;
    font-size: 20px;
    flex-shrink: 0;
}

.idosell-plan-notice h3 {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    margin: 0 0 4px 0;
}

.idosell-plan-notice p {
    font-size: 13px;
    color: #a16207;
    margin: 0;
    line-height: 1.5;
}

/* Success Dialog */
.checkout-complete-dialog {
    display: none;
}

.checkout-success {
    text-align: center;
    padding: 32px;
}

.checkout-success-icon {
    width: 56px;
    height: 56px;
    background: #d1fae5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.checkout-success-icon .material-icons-round {
    font-size: 28px;
    color: #065f46;
}

.checkout-success h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px 0;
}

.checkout-success p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

.checkout-success-btn {
    display: inline-block;
    padding: 8px 14px;
    background: #7c3aed;
    color: white;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.15s;
}

.checkout-success-btn:hover {
    background: #6d28d9;
    color: white;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.15s ease-out;
}

/* Slider thumb */
input[type=range]::-webkit-slider-thumb {
    pointer-events: auto;
    width: 28px;
    height: 28px;
    -webkit-appearance: none;
    background: transparent;
}

input[type=range]::-moz-range-thumb {
    pointer-events: auto;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
}

/* ==========================================================================
   CAMPAIGNS
   ========================================================================== */
  /* Zmienne CSS dla łatwej modyfikacji */
    :root {
      /* Podstawowy kolor fioletowy */
      --primary: rgb(147, 51, 234);
      --primary-light: rgba(147, 51, 234, 0.1);
      --primary-lighter: rgba(147, 51, 234, 0.05);
      --primary-medium: rgba(147, 51, 234, 0.6);
      --primary-dark: rgb(126, 34, 206);
      
      --accent: #FFC43D; /* Żółty akcent */
      --accent-light: #FFF4D9;
      --accent-dark: #E8A412;
      
      --neutral-50: #F9FAFB;
      --neutral-100: #F3F4F6;
      --neutral-200: #E5E7EB;
      --neutral-300: #D1D5DB;
      --neutral-400: #9CA3AF;
      --neutral-500: #6B7280;
      --neutral-600: #4B5563;
      --neutral-700: #374151;
      --neutral-800: #1F2937;
      --neutral-900: #111827;
      
      --success: #10B981;
      --success-light: rgba(16, 185, 129, 0.1);
      --danger: #EF4444;
      --danger-light: rgba(239, 68, 68, 0.1);
      --warning: #F59E0B;
      --warning-light: rgba(245, 158, 11, 0.1);
      --info: #3B82F6;
      --info-light: rgba(59, 130, 246, 0.1);
      
      /* Zmienne projektowe */
      --card-radius: 16px;
      --button-radius: 8px;
      --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
      --card-shadow-hover: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    }
    
    /* Style bazowe */
    body {
      font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    }
    
    /* Main content */
    .main-content {
      display: flex;
      flex-direction: column;
      gap: 24px;
    }

    /* Nowy nagłówek kampanii */
    .campaigns-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background-color: white;
      padding: 24px;
    }

    .page-title {
      font-size: 24px;
      font-weight: 700;
      color: var(--neutral-800);
      margin: 0;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .page-title .icon {
      color: var(--primary);
      font-size: 28px;
    }

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

    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 10px 16px;
      border-radius: var(--button-radius);
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      border: none;
      position: relative;
      overflow: hidden;
    }

    .btn-primary {
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: white;
      box-shadow: 0 2px 5px rgba(147, 51, 234, 0.3);
    }

    .btn-primary:hover {
      box-shadow: 0 4px 10px rgba(147, 51, 234, 0.4);
      transform: translateY(-1px);
    }

    .btn-outline {
      background-color: transparent;
      color: var(--neutral-700);
      border: 1px solid var(--neutral-300);
    }

    .btn-outline:hover {
      background-color: var(--neutral-50);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
      border: 1px solid var(--neutral-300) !important;
    }

    .btn-sm {
      padding: 6px 10px;
      font-size: 12px;
    }
    
    /* Stats Cards - Nowa sekcja */
    .stats-cards {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-bottom: 20px;
    }

    .stat-card {
      background-color: white;
      border-radius: var(--card-radius);
      padding: 24px;
      box-shadow: var(--card-shadow);
      transition: all 0.3s ease;
    }

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

    .stat-title {
      font-size: 14px;
      font-weight: 500;
      color: var(--neutral-600);
    }

    .stat-icon {
      width: 40px;
      height: 40px;
      border-radius: 10px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: transform 0.3s ease;
    }

    .stat-icon.purple {
      background-color: var(--primary-light);
      color: var(--primary);
    }

    .stat-icon.green {
      background-color: var(--success-light);
      color: var(--success);
    }

    .stat-icon.blue {
      background-color: var(--info-light);
      color: var(--info);
    }

    .stat-icon.orange {
      background-color: var(--warning-light);
      color: var(--warning);
    }

    .stat-value {
      font-size: 28px;
      font-weight: 700;
      color: var(--neutral-800);
      margin-bottom: 4px;
    }

    .stat-change {
      display: flex;
      align-items: center;
      gap: 4px;
      font-size: 13px;
    }

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

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

    /* Kontrolki filtrowania i wyszukiwania */
    .controls-section {
      background-color: white;
      border-radius: var(--card-radius);
        border: 1px solid var(--neutral-200);
      box-shadow: var(--card-shadow);
      padding: 24px;
      transition: all 0.3s ease;
    }

    .search-filters {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
    }

    .search-box {
      flex: 1;
      min-width: 200px;
      position: relative;
    }

    .search-input {
      width: 100%;
      padding: 12px 16px 12px 42px;
      border-radius: var(--button-radius);
      border: 1px solid var(--neutral-300);
      font-size: 14px;
      color: var(--neutral-800);
      transition: all 0.2s;
      background-color: var(--neutral-50);
    }

    .search-input:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-lighter);
      background-color: white;
    }

    .search-icon {
      position: absolute;
      left: 14px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--neutral-500);
      font-size: 18px;
    }

    .filter-group-campaign {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }

    .filter-select-list {
      padding: 12px 16px;
      border-radius: var(--button-radius);
      border: 1px solid var(--neutral-300);
      font-size: 14px;
      color: var(--neutral-800);
      background-color: var(--neutral-50);
      min-width: 160px;
      position: relative;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' 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");
      background-repeat: no-repeat;
      background-position: right 12px center;
      background-size: 16px;
      cursor: pointer;
      transition: all 0.2s;
    }

    .filter-select-list:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-lighter);
      background-color: white;
    }

    /* Sekcja folderów - Ulepszona */

    .section-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 12px;
      padding: 0 4px;
    }
    
    .section-actions {
      display: flex;
      gap: 8px;
    }

    .section-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--neutral-800);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .folders-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
      gap: 16px;
    }

    .folder-card {
      background-color: white;
      border-radius: var(--card-radius);
      padding: 16px;
      box-shadow: var(--card-shadow);
      border: 1px solid var(--neutral-200);
      transition: all 0.3s ease;
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .folder-card:hover {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
      transform: translateY(-2px);
      border-color: var(--primary-light);
    }

    .folder-icon {
      width: 40px;
      height: 40px;
      background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
      transition: all 0.2s;
    }

    .folder-card:hover .folder-icon {
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: white;
    }
    
    .primary-folder .folder-icon {
      background: linear-gradient(135deg, var(--accent-light), var(--accent));
      color: var(--accent-dark);
    }
    
    .primary-folder:hover .folder-icon {
      background: linear-gradient(135deg, var(--accent), var(--accent-dark));
      color: white;
    }
    
    .more-folder .folder-icon {
      background: linear-gradient(135deg, var(--neutral-100), var(--neutral-200));
      color: var(--neutral-600);
    }
    
    .more-folder:hover .folder-icon {
      background: linear-gradient(135deg, var(--neutral-300), var(--neutral-400));
      color: var(--neutral-800);
    }

    .folder-details {
      flex: 1;
    }

    .folder-name {
      font-weight: 600;
      color: var(--neutral-800);
      margin-bottom: 2px;
    }

    .folder-meta {
      font-size: 12px;
      color: var(--neutral-500);
    }
    
    /* Menu folderów */
    .folder-menu {
      position: absolute;
      background-color: white;
      border-radius: 8px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
      padding: 8px 0;
      z-index: 1000;
      min-width: 200px;
      animation: menuFadeIn 0.2s ease-out;
    }
    
    @keyframes menuFadeIn {
      from { opacity: 0; transform: translateY(-10px); }
      to { opacity: 1; transform: translateY(0); }
    }
    
    .menu-item {
      padding: 8px 16px;
      font-size: 14px;
      color: var(--neutral-700);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 8px;
      transition: all 0.2s;
    }
    
    .menu-item:hover {
      background-color: var(--neutral-100);
      color: var(--primary);
    }
    
    .menu-item .material-icons-round {
      font-size: 18px;
      color: var(--neutral-500);
    }
    
    .menu-item:hover .material-icons-round {
      color: var(--primary);
    }

    /* Lista kampanii - nowość */
    .campaigns-table-container {
      background-color: white;
      border-radius: var(--card-radius);
      box-shadow: var(--card-shadow);
        border: 1px solid var(--neutral-200);
      overflow: hidden;
      margin-bottom: 24px;
      transition: all 0.3s ease;
    }

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

    .campaigns-table th {
      padding: 16px;
      text-align: left;
      font-size: 12px;
      font-weight: 600;
      color: var(--neutral-500);
      background-color: var(--neutral-50);
      border-bottom: 1px solid var(--neutral-200);
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }

    .campaigns-table td {
      padding: 16px;
      font-size: 14px;
      color: var(--neutral-700);
      border-bottom: 1px solid var(--neutral-100);
      vertical-align: middle;
      transition: all 0.2s;
    }

    .campaigns-table tr {
      transition: all 0.2s ease;
    }

    .campaigns-table tr:hover td {
      background-color: var(--neutral-50);
    }

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

    .cell-checkbox {
      width: 40px;
    }

    .campaign-checkbox {
      border-radius: 3px;
      width: 18px;
      height: 18px;
      accent-color: var(--primary);
      cursor: pointer;
      outline: none;
    }

    .campaign-checkbox:indeterminate {
      accent-color: #7c3aed !important;
      background-color: #7c3aed !important;
    }

    .campaign-checkbox:focus {
      outline: unset !important;
      outline-offset: unset !important;
      --tw-ring-color: unset !important;
      box-shadow: unset !important;
      --tw-ring-shadow: unset !important;
    }

    .cell-campaign {
      min-width: 240px;
    }

    .campaign-info {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .campaign-thumbnail {
      width: 40px;
      height: 40px;
      border-radius: 8px;
      background: var(--primary-lighter);
      display: flex;
      align-items: center;
      justify-content: center;
      color: var(--primary);
      flex-shrink: 0;
      transition: all 0.2s;
    }

    .campaign-name {
      font-weight: 600;
      color: var(--neutral-800);
    }

    .campaign-description {
      font-size: 12px;
      color: var(--neutral-500);
      margin-top: 4px;
    }
    
    .cell-type {
      width: 120px;
    }

    .campaign-type {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: 16px;
      font-size: 12px;
      font-weight: 500;
      background-color: var(--neutral-100);
      color: var(--neutral-600);
      transition: all 0.2s;
    }

    .campaigns-table tr:hover .campaign-type {
      background-color: var(--neutral-200);
    }

    .campaign-type .icon {
      font-size: 14px;
    }

    .cell-status {
      width: 140px;
    }

    .status-badge {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px;
      border-radius: 16px;
      font-size: 12px;
      font-weight: 500;
      transition: all 0.2s;
    }

    .status-badge.active {
      background-color: var(--success-light);
      color: var(--success);
    }

    .status-badge.draft {
      background-color: var(--neutral-100);
      color: var(--neutral-600);
    }

    .status-badge.scheduled {
      background-color: var(--info-light);
      color: var(--info);
    }

    .status-badge.ended {
      background-color: var(--neutral-100);
      color: var(--neutral-700);
    }

    .status-badge .icon {
      font-size: 14px;
    }

    .cell-views, .cell-clicks, .cell-ctr {
      width: 100px;
      text-align: center;
    }

    .metric-value {
      font-weight: 600;
      color: var(--neutral-800);
    }

    .metric-label {
      font-size: 11px;
      color: var(--neutral-500);
      margin-top: 4px;
    }

    .cell-date {
      width: 140px;
      font-size: 13px;
    }

    .date-info {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .date-value {
      color: var(--neutral-700);
        font-weight: 600;
    }

    .date-label {
      font-size: 11px;
      color: var(--neutral-500);
    }

    .cell-actions {
      width: 120px;
      text-align: right;
    }

    .action-buttons {
      display: flex;
      gap: 4px;
      justify-content: flex-end;
    }

    .action-btn {
      width: 32px;
      height: 32px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: none;
      background-color: var(--neutral-100);
      color: var(--neutral-600);
      cursor: pointer;
      transition: all 0.2s;
    }

    .action-btn:hover {
      background-color: var(--neutral-200);
      color: var(--neutral-800);
      transform: translateY(-2px);
    }

    .action-btn.danger:hover {
      background-color: var(--danger-light);
      color: var(--danger);
    }

    .action-btn .icon {
      font-size: 18px;
    }

    /* Progress mini-chart w tabeli */
    .progress-chart {
      width: 60px;
      height: 24px;
      display: flex;
      align-items: flex-end;
      gap: 2px;
      margin: 0 auto;
    }

    .progress-bar {
      flex: 1;
      background-color: var(--primary-light);
      border-radius: 2px;
      position: relative;
      overflow: hidden;
      min-height: 4px;
      transition: all 0.3s ease;
    }

    .progress-bar::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      background-color: var(--primary);
      border-radius: 2px;
    }

    .progress-bar:nth-child(1)::after { height: 30%; }
    .progress-bar:nth-child(2)::after { height: 60%; }
    .progress-bar:nth-child(3)::after { height: 40%; }
    .progress-bar:nth-child(4)::after { height: 75%; }
    .progress-bar:nth-child(5)::after { height: 50%; }

    .campaigns-table tr:hover .progress-bar {
      background-color: var(--primary-lighter);
      min-height: 6px;
    }
    
    .campaigns-table tr:hover .progress-bar::after {
      background-color: var(--primary-dark);
    }

    /* Ripple effect i tooltip */
    .ripple {
      position: absolute;
      border-radius: 50%;
      background-color: rgba(255, 255, 255, 0.4);
      transform: scale(0);
      animation: ripple 0.6s linear;
      pointer-events: none;
    }
    
    @keyframes ripple {
      to {
        transform: scale(2);
        opacity: 0;
      }
    }
    
    .tooltip {
      position: fixed;
      background-color: var(--neutral-800);
      color: white;
      padding: 5px 10px;
      border-radius: 4px;
      font-size: 12px;
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.2s;
      z-index: 1000;
    }
    
    .tooltip::after {
      content: '';
      position: absolute;
      top: 100%;
      left: 50%;
      margin-left: -5px;
      border-width: 5px;
      border-style: solid;
      border-color: var(--neutral-800) transparent transparent transparent;
    }
    
    /* Animacje dla mini-wykresu */
    @keyframes growBar {
      from { height: 0; }
      to { height: var(--target-height); }
    }
    
    .progress-bar::after {
      animation: growBar 1s ease-out forwards;
      --target-height: var(--height, 50%);
    }
    
    .progress-bar:nth-child(1)::after { --height: 30%; animation-delay: 0s; }
    .progress-bar:nth-child(2)::after { --height: 60%; animation-delay: 0.1s; }
    .progress-bar:nth-child(3)::after { --height: 40%; animation-delay: 0.2s; }
    .progress-bar:nth-child(4)::after { --height: 75%; animation-delay: 0.3s; }
    .progress-bar:nth-child(5)::after { --height: 50%; animation-delay: 0.4s; }

    /* Ulepszony paginator */
    .table-footer {
      padding: 24px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-top: 1px solid var(--neutral-200);
    }
    
    .pagination-control {
      display: flex;
      align-items: center;
      gap: 24px;
    }
    
    .rows-per-page {
      display: flex;
      align-items: center;
      gap: 10px;
      color: var(--neutral-600);
      font-size: 14px;
    }
    
    .rows-select {
      padding: 6px 10px;
      border-radius: 6px;
      border: 1px solid var(--neutral-300);
      font-size: 14px;
      color: var(--neutral-800);
      background-color: white;
      transition: all 0.2s;
      min-width: 70px;
    }
    
    .rows-select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 2px var(--primary-lighter);
    }
    
    .pagination {
      display: flex;
      align-items: center;
      gap: 16px;
      padding: unset !important;
      border-top: unset !important;
    }
    
    .pagination-info {
      font-size: 14px;
      color: var(--neutral-600);
      white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 4px;
        justify-content: center;
    }
    
    .pagination-buttons {
      display: flex;
      gap: 6px;
    }
    
    .page-btn {
      width: 36px;
      height: 36px;
      border-radius: 6px;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--neutral-300);
      background-color: white;
      color: var(--neutral-700);
      font-size: 14px;
      cursor: pointer;
      transition: all 0.2s;
    }
    
    .page-btn:hover:not(.active):not(.disabled) {
      background-color: var(--neutral-100);
      border-color: var(--neutral-400);
      transform: translateY(-2px);
    }
    
    .page-btn.active {
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: white;
      border-color: var(--primary);
      box-shadow: 0 2px 5px rgba(147, 51, 234, 0.3);
    }
    
    .page-btn.disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }

    /* Responsywność */
    @media (max-width: 1200px) {
      .campaigns-table th:nth-child(6),
      .campaigns-table td:nth-child(6) {
        display: none;
      }
      
      .stats-cards {
        grid-template-columns: repeat(2, 1fr);
      }
    }
    
    @media (max-width: 992px) {
      .dashboard-grid {
        grid-template-columns: 240px 1fr;
      }
      
      .profile-card {
        max-height: none;
        position: relative;
        top: 0;
        min-height: auto;
      }
      
      .campaigns-table th:nth-child(5),
      .campaigns-table td:nth-child(5) {
        display: none;
      }

      .folders-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }
    
    @media (max-width: 768px) {
      .campaigns-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
      }

      .header-actions {
        width: 100%;
        flex-wrap: wrap;
      }

      .header-actions .btn {
        flex: 1;
      }

      .search-filters {
        flex-direction: column;
      }

      .filter-group-campaign {
        width: 100%;
      }

      .filter-select-list {
        flex: 1;
      }

      .campaigns-table-container {
        overflow-x: auto;
      }

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

      .campaigns-table th:nth-child(4),
      .campaigns-table td:nth-child(4) {
        display: none;
      }

      .folders-grid {
        grid-template-columns: 1fr;
      }
      
      .stats-cards {
        grid-template-columns: 1fr;
      }
      
      .pagination-control {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
      }
      
      .table-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
      }
    }
    
    @media (max-width: 576px) {
      .table-footer {
        flex-direction: column;
        gap: 16px;
      }

      .rows-per-page {
        width: 100%;
        justify-content: space-between;
      }
      
      .pagination {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
      }
    }

    /* Campaign cards */
    .campaign-card {
      background-color: white;
      border-radius: var(--card-radius);
      border: 1px solid var(--neutral-200);
      transition: all 0.2s;
      cursor: pointer;
    }

    .campaign-card:hover {
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
      transform: translateY(-2px);
    }

    .folder-icon {
      font-size: 48px !important;
      color: var(--neutral-700);
    }

    .folder-count {
      font-size: 14px;
      color: var(--neutral-600);
    }

    .entry-title {
      font-size: 16px;
      font-weight: 600;
      color: var(--neutral-800);
      margin: 0 0 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .campaign-badge {
      display: inline-flex;
      align-items: center;
      background-color: var(--neutral-100);
      color: var(--neutral-700);
      font-size: 12px;
      font-weight: 500;
      padding: 4px 8px;
      border-radius: 4px;
      margin-bottom: 8px;
    }

    .campaign-date {
      display: inline-flex;
      align-items: center;
      color: var(--neutral-500);
      font-size: 12px;
      margin-top: 4px;
    }

    /* Empty state */
    .empty-state {
      text-align: center;
      padding: 48px;
      background-color: var(--neutral-50);
      border-radius: var(--card-radius);
      margin-top: 24px;
    }

    .empty-title {
      font-size: 18px;
      font-weight: 600;
      color: var(--neutral-700);
      margin: 0 0 8px;
    }
/* ===== BASE COMPONENTS - SEMANTIC DECOUPLING ===== */
/* These base classes provide shared styling while keeping semantic separation */

/* Base table container - shared visual styling */
.table-container-base {
  background-color: white;
border-radius: 16px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 4px 6px rgba(0, 0, 0, 0.02);
border: 1px solid var(--neutral-200);
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Base table header - shared visual styling */
.table-header-base {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: white;
  border-radius: var(--card-radius);
  padding: 16px;
  box-shadow: var(--card-shadow);
}

/* Base data table - shared visual styling */
.data-table-base {
  width: 100%;
  border-collapse: collapse;
}

.data-table-base th {
  padding: 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-500);
  background-color: var(--neutral-50);
  border-bottom: 1px solid var(--neutral-200);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.data-table-base td {
  padding: 16px;
  font-size: 14px;
  color: var(--neutral-700);
  border-bottom: 1px solid var(--neutral-100);
  vertical-align: middle;
  transition: all 0.2s;
}

table tr td:last-child, table tr th:last-child {
    padding-right: 24px;
}

table tr td:first-child, table tr th:first-child {
    padding-left: 24px;
}

.collaborators-table td:first-child, .collaborators-table th:first-child {
    padding-left: 0.5rem;
}

.collaborators-table td:last-child, .collaborators-table th:last-child {
    padding-right: 0.5rem;
}

.data-table-base tr {
  transition: all 0.2s ease;
}

.data-table-base tr:hover td {
  background-color: var(--neutral-50);
}

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

/* Base data row - shared visual styling */
.data-row-base {
  transition: all 0.2s ease;
}

.data-row-base:hover td {
  background-color: var(--neutral-50);
}

/* Base item info - shared visual styling */
.item-info-base {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Base item thumbnail - shared visual styling */
.item-thumbnail-base {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

/* Base item name - shared visual styling */
.item-name-base {
  font-weight: 600;
  color: var(--neutral-800);
  text-decoration: none;
}

/* ===== SPECIFIC COMPONENT OVERRIDES ===== */


/* Keep the original folder styling intact */
.folders-container.table-container-base {
  /* Inherits all table-container-base styles */
}

.folders-table.data-table-base {
  /* Inherits all data-table-base styles */
}

.folder-row.data-row-base {
  /* Inherits all data-row-base styles */
}

/* Specific folder thumbnail styling */
.folder-thumbnail.item-thumbnail-base {
  background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
  color: #f59e0b !important;
}

/* Maintenance Notice */
.maintenance-notice {
    padding: 24px;
}

.maintenance-notice-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.maintenance-notice-text {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* Campaigns section specific styling */
.campaigns-section {
  /* Any specific campaign section styling */
}

/* Keep original campaigns table styling intact */
.campaigns-table-container.table-container-base {
  /* Inherits all table-container-base styles */
}

.campaigns-table.data-table-base {
  /* Inherits all data-table-base styles */
}

.campaign-row.data-row-base {
  /* Inherits all data-row-base styles */
}

/* Specific campaign thumbnail styling */
.campaign-thumbnail.item-thumbnail-base {
  /* Uses default item-thumbnail-base styles (purple gradient) */
}

/* ===== PRESERVE ALL ORIGINAL STYLING ===== */
/* Make sure these specific cell classes still work */

.cell-checkbox {
  width: 40px;
}

.cell-name, .cell-campaign {
  min-width: 240px;
}

.cell-count, .cell-views, .cell-clicks, .cell-ctr {
  width: 100px;
  text-align: center;
}

.cell-type {
  width: 120px;
}

.cell-status {
  width: 140px;
}

.cell-date {
  width: 140px;
  font-size: 13px;
}

.cell-actions {
  width: 120px;
  text-align: right;
}

/* Ensure campaign-specific elements keep their styling */
.campaign-type {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  background-color: var(--neutral-100);
  color: var(--neutral-600);
  transition: all 0.2s;
}

.data-row-base:hover .campaign-type {
  background-color: var(--neutral-200);
}

.campaign-type .icon {
  font-size: 14px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
}

.status-badge.active {
  background-color: var(--success-light);
  color: var(--success);
}

.status-badge.draft {
  background-color: var(--neutral-100);
  color: var(--neutral-600);
}

.status-badge.scheduled {
  background-color: var(--info-light);
  color: var(--info);
}

.status-badge.ended {
  background-color: var(--neutral-100);
  color: var(--neutral-700);
}

.status-badge .icon {
  font-size: 14px;
}

/* Metric styling */
.metric-value {
  font-weight: 600;
  color: var(--neutral-800);
}

.metric-label {
  font-size: 11px;
  color: var(--neutral-500);
  margin-top: 4px;
}

/* Date info styling */
.date-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Action buttons styling */
.action-buttons {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: var(--neutral-100);
  color: var(--neutral-600);
  cursor: pointer;
  transition: all 0.2s;
}

.action-btn:hover {
  background-color: var(--neutral-200);
  color: var(--neutral-800);
  transform: translateY(-2px);
}

.action-btn.secondary {
  background-color: var(--info-light);
  color: var(--info);
}

.action-btn.secondary:hover {
  background-color: var(--info);
  color: white;
}

.action-btn.danger:hover {
  background-color: var(--danger-light);
  color: var(--danger);
}

.action-btn .icon {
  font-size: 18px;
}

/* Progress chart styling */
.progress-chart {
  width: 60px;
  height: 24px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin: 0 auto;
}

.progress-bar {
  flex: 1;
  background-color: var(--primary-light);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  min-height: 4px;
  transition: all 0.3s ease;
}

.progress-bar::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: var(--primary);
  border-radius: 2px;
}

.progress-bar:nth-child(1)::after { height: 30%; }
.progress-bar:nth-child(2)::after { height: 60%; }
.progress-bar:nth-child(3)::after { height: 40%; }
.progress-bar:nth-child(4)::after { height: 75%; }
.progress-bar:nth-child(5)::after { height: 50%; }

.data-row-base:hover .progress-bar {
  background-color: var(--primary-lighter);
  min-height: 6px;
}

.data-row-base:hover .progress-bar::after {
  background-color: var(--primary-dark);
}

/* No data styling */
.no-data {
  text-align: center;
  padding: 48px;
  color: var(--neutral-500);
  font-style: italic;
}

/* Checkbox styling */
.campaign-checkbox, .folder-checkbox {
  border-radius: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  outline: none;
}

.campaign-checkbox:indeterminate, .folder-checkbox:indeterminate {
  accent-color: #7c3aed !important;
  background-color: #7c3aed !important;
}

.campaign-checkbox:focus, .folder-checkbox:focus {
  outline: unset !important;
  outline-offset: unset !important;
  --tw-ring-color: unset !important;
  box-shadow: unset !important;
  --tw-ring-shadow: unset !important;
}

/* Table footer styling (pagination) */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--neutral-200);
}

.pagination-control {
  display: flex;
  align-items: center;
  gap: 24px;
}

.rows-per-page {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--neutral-600);
  font-size: 14px;
}

.rows-select {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--neutral-300);
  font-size: 14px;
  color: var(--neutral-800);
  background-color: white;
  transition: all 0.2s;
  min-width: 70px;
}

.rows-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-lighter);
}

.pagination {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: unset !important;
  border-top: unset !important;
}

.pagination-buttons {
  display: flex;
  gap: 6px;
}

.page-btn {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--neutral-300);
  background-color: white;
  color: var(--neutral-700);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.page-btn:hover:not(.active):not(.disabled) {
  background-color: var(--neutral-100);
  border-color: var(--neutral-400);
  transform: translateY(-2px);
}

.page-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border-color: var(--primary);
  box-shadow: 0 2px 5px rgba(147, 51, 234, 0.3);
}

.page-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Coming Soon Panel */
.coming-soon-panel {
  background: linear-gradient(135deg, #ffffff 0%, #fefefe 100%);
  border: 1px solid var(--neutral-200);
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  margin: 0 0 40px 0;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.coming-soon-content {
  padding: 48px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.coming-soon-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary-lighter));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.coming-soon-icon .material-icons-round {
  font-size: 36px;
  color: var(--primary);
}

.coming-soon-text {
  max-width: 500px;
}

.coming-soon-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--neutral-800);
  margin: 0 0 12px 0;
  line-height: 1.3;
}

.coming-soon-description {
  font-size: 16px;
  color: var(--neutral-600);
  margin: 0;
  line-height: 1.5;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .coming-soon-content {
    padding: 32px 24px;
    gap: 20px;
  }
  
  .coming-soon-icon {
    width: 64px;
    height: 64px;
  }
  
  .coming-soon-icon .material-icons-round {
    font-size: 28px;
  }
  
  .coming-soon-title {
    font-size: 20px;
  }
  
  .coming-soon-description {
    font-size: 14px;
  }
}

/* ===== ENTRY PAGE ANALYTICS FILTERS ===== */
.panel-content-filters {
  background-color: white;
  border-radius: var(--card-radius);
    border: 1px solid var(--neutral-200);
    box-shadow: var(--card-shadow);
  padding: 24px;
}

.panel-content-filters .filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end; /* Align items to bottom for consistent baseline */
}

/* Make filter groups stretch to fill available space */
.panel-content-filters .filter-group {
  flex: 1; /* Each filter group takes equal space */
  min-width: 200px; /* Minimum width before wrapping */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-content-filters .filter-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--neutral-700);
  margin-bottom: 4px;
}

.panel-content-filters .filter-input,
.panel-content-filters .filter-select {
  width: 100%; /* Fill the container width */
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--neutral-300);
  font-size: 14px;
  color: var(--neutral-800);
  background-color: white;
  font-family: inherit;
  box-sizing: border-box;
  height: 46px; /* Match button height */
}

.panel-content-filters .filter-input:focus,
.panel-content-filters .filter-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-lighter);
}

.panel-content-filters .filter-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-shrink: 0; /* Don't let the actions container shrink */
}

.panel-content-filters .filter-button {
  padding: 10px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 2px 5px rgba(147, 51, 234, 0.3);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap; /* Prevent button text from wrapping */
  height: 46px; /* Match input height */
}

.panel-content-filters .filter-button:hover {
  box-shadow: 0 4px 10px rgba(147, 51, 234, 0.4);
  transform: translateY(-1px);
}

.panel-content-filters .filter-button.btn-outline {
  background: transparent;
  color: var(--neutral-700);
  border: 1px solid var(--neutral-300);
  box-shadow: none;
}

.panel-content-filters .filter-button.btn-outline:hover {
  background-color: var(--neutral-50);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

/* Responsive adjustments for entry filters */
@media (max-width: 1200px) {
  .panel-content-filters .filter-group {
    min-width: 180px;
  }
}

@media (max-width: 992px) {
  .panel-content-filters .filters-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .panel-content-filters .filter-group {
    min-width: auto;
    flex: none;
  }
  
  .panel-content-filters .filter-actions {
    align-self: stretch;
    justify-content: center;
    margin-top: 8px;
  }
  
  .panel-content-filters .filter-button {
    flex: 1;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .panel-content-filters .filter-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .panel-content-filters .filter-button {
    width: 100%;
  }
}

/* Folder action button styling to match folder thumbnails */
.action-btn.folder {
    background-color: var(--neutral-100);
    color: #f59e0b !important;
}

.action-btn.folder .icon {
    color: var(--neutral-600);
}

.action-btn.folder:hover {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
}

.action-btn.folder:hover .icon {
    color: #f59e0b !important;
}

.action-btn.primary {
  background-color: var(--neutral-100);
  color: #f59e0b !important;
}

.action-btn.primary .icon {
  color: var(--neutral-600);
}

.action-btn.primary:hover {
  background-color: var(--primary-light);
}

.action-btn.primary:hover .icon {
  color: var(--primary);
}

.campaign-info-details .entry-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.campaign-info-details .entry-meta .meta-item{
  padding: 12px 0 0 12px;
}
/* ==========================================================================
   CAMPAIGNS ENTRY
   ========================================================================== */
     /* Campaign header container */
    .campaign-header-container {
      background-color: white;
      border-radius: var(--card-radius);
      box-shadow: var(--card-shadow);
      overflow: hidden;
      transition: all 0.3s ease;
    }

    /* Campaign Header & Action Buttons Layout */
    .header-wrapper {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 24px;
      align-items: center;
    }

    .campaign-info-header {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .entry-title {
      font-size: 28px;
      font-weight: 700;
      color: var(--neutral-800);
      margin: 0;
    }
    
    .meta-item {
      display: flex;
      align-items: center;
      gap: 8px;
      color: var(--neutral-600);
      font-size: 14px;
    }
    
    .meta-value {
      font-weight: 500;
      color: var(--neutral-800);
    }
    
    /* Campaign Buttons */
    .campaign-buttons {
      display: flex;
      gap: 12px;
    }
    
    .btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 10px 16px;
      border-radius: var(--button-radius);
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
      border: none;
      position: relative;
      overflow: hidden;
      white-space: nowrap;
    }
    
    .btn-primary {
      background: linear-gradient(135deg, var(--primary), var(--primary-dark));
      color: white;
      box-shadow: 0 2px 5px rgba(147, 51, 234, 0.3);
    }
    
    .btn-primary:hover {
      box-shadow: 0 4px 10px rgba(147, 51, 234, 0.4);
      transform: translateY(-1px);
    }
    
    .btn-outline {
      background-color: transparent;
      color: var(--neutral-700);
      border: 1px solid var(--neutral-300);
    }
    
    .btn-outline:hover {
      background-color: var(--neutral-50);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
      border: 1px solid var(--neutral-300) !important;
    }
    
    .btn-danger {
      background-color: white;
      color: var(--danger);
      border: 1px solid var(--danger);
      transition: all 0.2s ease;
    }

    .btn-danger:hover {
      background-color: var(--danger);
      color: white;
      transform: translateY(-1px);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    }

    /* Campaign Stats Cards */
    .campaign-stats {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 24px;
    }

    .campaign-info-header .material-icons-round {
        font-size: 18px;
    }

    .stat-card {
      border-radius: var(--card-radius);
      padding: 24px;
      transition: all 0.3s ease;
      border: 1px solid var(--neutral-200);
    }

    .stat-title {
      font-size: 14px;
      color: var(--neutral-600);
      margin: 0 0 8px;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .stat-title .icon {
      color: var(--primary);
      font-size: 18px;
    }

    .stat-value {
      font-size: 28px;
      font-weight: 700;
      color: var(--neutral-800);
      margin: 8px 0 0 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    
    .stat-trend {
      font-size: 14px;
      font-weight: 500;
    }
    
    .trend-up {
      color: var(--success);
    }
    
    .trend-down {
      color: var(--danger);
    }

    /* Content Panels Layout */
    .content-panels {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 24px;
    }

    .panel {
      background-color: white;
      border-radius: var(--card-radius);
      box-shadow: var(--card-shadow);
      overflow: hidden;
      transition: all 0.3s ease;
      display: flex;
        padding: 24px;
      flex-direction: column;
      border:  1px solid var(--neutral-200);
    }

    .panel-header {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      gap: 20px;
      padding: 0 0 16px 0;
      border-bottom: 1px solid var(--neutral-200);
      background-color: white;
    }
    
    .panel-title {
      font-size: 18px;
      font-weight: 600;
      color: var(--neutral-800);
      margin: 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .panel-title .icon {
      color: var(--primary);
    }
    
    .panel-content {
      flex: 1;
    }

    .panel-content-filters {
       flex: 1;
    }
    
    .section-description {
      font-size: 14px;
      color: var(--neutral-600);
      margin: 16px 0;
      line-height: 1.5;
    }

    /* Domains Section */
    .domains-table {
      width: 100%;
      border-collapse: collapse;
    }
    
    .domains-table th {
      text-align: left;
      font-size: 13px;
      font-weight: 500;
      color: var(--neutral-600);
      padding: 12px 8px;
      border-bottom: 1px solid var(--neutral-200);
    }
    
    .domains-table td {
      padding: 12px 8px;
      font-size: 14px;
      color: var(--neutral-700);
      border-bottom: 1px solid var(--neutral-100);
    }
    
    .domain-link {
      color: var(--primary);
      text-decoration: none;
      transition: color 0.2s;
    }
    
    .domain-link:hover {
      text-decoration: underline;
      color: var(--primary-dark);
    }
    
    .action-icon {
      color: var(--neutral-500);
      cursor: pointer;
      transition: all 0.2s;
      padding: 4px;
      border-radius: 4px;
    }
    
    .action-icon:hover {
      color: var(--neutral-800);
      background-color: var(--neutral-100);
    }

    /* Analytics Chart Section */
    .panel-full {
      grid-column: 1 / -1;
    }
    
    .chart-legend {
      display: flex;
      justify-content: center;
      gap: 16px;
      margin-top: 16px;
    }
    
    .legend-item {
      display: flex;
      align-items: center;
      gap: 6px;
    }
    
    .legend-dot {
      width: 10px;
      height: 10px;
      border-radius: 50%;
    }
    
    .legend-dot.purple {
      background-color: var(--primary);
    }
    
    .legend-dot.blue {
      background-color: var(--info);
    }
    
    .legend-dot.green {
      background-color: var(--success);
    }
    
    .legend-label {
      font-size: 13px;
      color: var(--neutral-600);
    }

    /* Filter Row */
    .filter-row {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 16px;
      margin-bottom: 16px;
    }
    
    .filter-group {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    
    .filter-label {
      font-size: 13px;
      font-weight: 500;
      color: var(--neutral-700);
    }
    
    .filter-select-wrapper {
      position: relative;
      width: 100%;
    }
    
    .filter-select {
      width: 100%;
      padding: 10px 32px 10px 12px;
      border-radius: var(--button-radius);
      border: 1px solid var(--neutral-300);
      font-size: 14px;
      color: var(--neutral-800);
      background-color: white;
      appearance: none;
      transition: all 0.2s;
    }
    
    .filter-select:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-lighter);
    }
    .select-icon {
      display: none;
    }
    
    .date-input {
      width: 100%;
      padding: 10px 32px 10px 12px;
      border-radius: var(--button-radius);
      border: 1px solid var(--neutral-300);
      font-size: 14px;
      color: var(--neutral-800);
      background-color: white;
      box-sizing: border-box;
      transition: all 0.2s;
    }
    
    .date-input:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px var(--primary-lighter);
    }
    
    .date-input-wrapper {
      position: relative;
    }
    
    .calendar-icon {
      position: absolute;
      right: 10px;
      top: 50%;
      transform: translateY(-50%);
      color: var(--neutral-500);
      pointer-events: none;
    }

    /* Actions button bar */
    .actions-bar {
      display: flex;
      gap: 12px;
      padding: 16px 24px;
      background-color: var(--neutral-50);
      border-radius: 0 0 var(--card-radius) var(--card-radius);
      border-top: 1px solid var(--neutral-200);
      justify-content: flex-end;
    }

    /* Badge styles */
    .badge {
      display: inline-flex;
      align-items: center;
      padding: 4px 8px;
      border-radius: 12px;
      font-size: 12px;
      font-weight: 500;
    }

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

    /* Ripple effect */
    .ripple {
      position: absolute;
      border-radius: 50%;
      background-color: rgba(255, 255, 255, 0.4);
      transform: scale(0);
      animation: ripple 0.6s linear;
      pointer-events: none;
    }
    
    @keyframes ripple {
      to {
        transform: scale(2);
        opacity: 0;
      }
    }

    /* Responsywność */
    @media (max-width: 1200px) {
      .content-panels {
        grid-template-columns: 1fr;
      }
      
      .campaign-stats {
        grid-template-columns: repeat(3, 1fr);
      }
      
      .filter-row {
        grid-template-columns: repeat(2, 1fr);
      }
    }
    
    @media (max-width: 992px) {
      .header-wrapper {
        grid-template-columns: 1fr;
      }
      
      .campaign-stats {
        grid-template-columns: repeat(2, 1fr);
      }
    }
    
    @media (max-width: 768px) {
      .filter-group {
        max-width: 180px;
      }

      .campaign-buttons {
        flex-wrap: wrap;
      }
      
      .campaign-stats {
        grid-template-columns: 1fr;
      }
    }
    
    @media (max-width: 576px) {
      .panel-content {
        padding: 16px;
      }
      
      .header-wrapper {
        padding: 16px;
      }
      
      .campaign-stats {
        padding: 0 16px 16px;
      }
    }

    [type='email'], [type='url'], [type='password'], [type='number'], [type='date'], [type='datetime-local'], [type='month'], [type='search'], [type='tel'], [type='time'], [type='week'], [multiple], textarea, .form-select {
      min-width: 180px !important;
    }
/* ==========================================================================
   CAMPAIGN ENTRY
   ========================================================================== */
/* ==========================================================================
   Campaign Entry Page Styles
   ========================================================================== */

/* Header */
.campaign-header {
    margin-bottom: 24px;
}

.campaign-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.campaign-title {
    font-size: 22px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.campaign-header-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.campaign-owner-notice {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    padding: 12px 16px;
    background: #f9fafb;
    border-radius: 8px;
}

.campaign-disabled-notice {
    font-size: 13px;
    color: #92400e;
    margin: 0 0 16px 0;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

/* Action Buttons */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-action--primary {
    background: #7c3aed;
    color: white;
}

.btn-action--primary:hover {
    background: #6d28d9;
    color: white;
}

.btn-action--secondary {
    background: #f3f4f6;
    color: #374151;
}

.btn-action--secondary:hover {
    background: #e5e7eb;
}

.btn-action--danger {
    background: #fef2f2;
    color: #dc2626;
}

.btn-action--danger:hover {
    background: #fee2e2;
}

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

/* Cards Grid */
.campaign-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .campaign-cards {
        grid-template-columns: 1fr;
    }
}

/* Card */
.campaign-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    cursor: default;
}

.campaign-card--full {
    grid-column: 1 / -1;
}

.campaign-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f3f4f6;
}

.campaign-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.campaign-card-body {
    padding: 20px;
}

/* Details List */
.campaign-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
}

.campaign-detail {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: default;
}

.campaign-detail-label {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.campaign-detail-value {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

/* Code Block */
.code-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.code-block {
    position: relative;
    background: #1f2937;
    border-radius: 8px;
    padding: 16px;
    padding-right: 80px;
}

.code-block code {
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: #e5e7eb;
    word-break: break-all;
}

.code-block .tag,
.code-block span.tag {
    display: inline;
    padding: 0;
    background: transparent;
    border-radius: 0;
    font-size: inherit;
    color: #f472b6;
}

.code-block .attr,
.code-block span.attr {
    color: #a5b4fc;
}

.code-block .value,
.code-block span.value {
    color: #86efac;
}

.code-copy-btn {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.code-copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Copy button alias (for legacy templates) */
.copy-button,
.code-block .copy-button {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.copy-button:hover,
.code-block .copy-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Code block with pre element */
.code-block pre {
    margin: 0;
    padding: 0;
    background: transparent;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    color: #e5e7eb;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-block pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

/* Warning Box */
.warning-box {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    background: #fef3c7;
    border-radius: 8px;
}

.warning-box-icon {
    color: #b45309;
    font-size: 18px;
    flex-shrink: 0;
}

.warning-box-text {
    font-size: 13px;
    color: #92400e;
    margin: 0;
}

/* Domains Table */
.domains-table {
    width: 100%;
    border-collapse: collapse;
}

.domains-table th {
    padding: 10px 0;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.domains-table th:last-child {
    text-align: right;
}

.domains-table td {
    padding: 12px 0;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

.domains-table td:last-child {
    text-align: right;
}

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

.domain-name {
    font-weight: 500;
}

.domain-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.domain-action-btn {
    padding: 4px 8px;
    font-size: 12px;
    color: #6b7280;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.15s;
}

.domain-action-btn:hover {
    color: #111827;
}

.domain-action-btn--danger:hover {
    color: #dc2626;
}

/* Collaborators Table */
.collaborators-table {
    width: 100%;
    border-collapse: collapse;
}

.collaborators-table th {
    padding: 10px 0;
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: left;
    border-bottom: 1px solid #f3f4f6;
}

.collaborators-table td {
    padding: 12px 0;
    font-size: 14px;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

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

.collaborator-name {
    font-weight: 500;
}

.collaborator-email {
    font-size: 13px;
    color: #6b7280;
}

.collaborator-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 10px;
}

.collaborator-badge--owner {
    background: #dbeafe;
    color: #1d4ed8;
}

.collaborator-badge--pending {
    background: #fef3c7;
    color: #92400e;
}

/* Analytics Card */
.analytics-card {
    margin-top: 24px;
    overflow: visible !important;
}

/* Responsive */
@media (max-width: 768px) {
    .campaign-header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .campaign-title {
        font-size: 18px;
    }

    .campaign-header-actions {
        flex-wrap: wrap;
    }

    .btn-action {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }

    .campaign-card-header {
        padding: 12px 16px;
    }

    .campaign-card-body {
        padding: 16px;
    }

    .campaign-details {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .code-block {
        padding: 12px;
        padding-right: 12px;
    }

    .code-block code {
        font-size: 11px;
        display: block;
        margin-bottom: 40px;
    }

    .code-copy-btn {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        width: 100%;
        justify-content: center;
        margin-top: 8px;
    }
}

@media (max-width: 480px) {
    .campaign-details {
        grid-template-columns: 1fr;
    }

    .btn-action {
        font-size: 12px;
        padding: 10px;
    }
}

/* ==========================================================================
   CALENDAR
   ========================================================================== */
/* ==========================================================================
   Marketer's Calendar Styles
   ========================================================================== */

/* Page Layout */
.calendar-page {
    width: 100%;
}

/* Page Header */
.calendar-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}

.calendar-header-content h1 {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 6px 0;
}

.calendar-header-content p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.calendar-year-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #f3f4f6;
    color: #374151;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Months Container */
.calendar-months {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Month Card */
.calendar-month {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.calendar-month:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.calendar-month.is-current {
    border-color: #7c3aed;
    box-shadow: 0 0 0 1px #7c3aed;
}

.calendar-month.is-past {
    opacity: 0.7;
}

.calendar-month.is-past:hover {
    opacity: 1;
}

/* Month Toggle Button */
.calendar-month-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: #f9fafb;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.calendar-month-toggle:hover {
    background: #f3f4f6;
}

.calendar-month.is-current .calendar-month-toggle {
    background: rgba(119, 28, 255, 0.04);
}

.calendar-month-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-month-info h2 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.calendar-month-badge {
    display: inline-flex;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-radius: 20px;
}

.calendar-month-badge.past {
    background: #f3f4f6;
    color: #6b7280;
}

.calendar-month-badge.current {
    background: rgba(119, 28, 255, 0.1);
    color: #7c3aed;
}

.calendar-month-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-event-count {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.calendar-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #9ca3af;
    transition: transform 0.2s, color 0.15s;
}

.calendar-month-toggle:hover .calendar-toggle-icon {
    color: #6b7280;
}

.calendar-month.collapsed .calendar-toggle-icon {
    transform: rotate(-90deg);
}

/* Month Content */
.calendar-month-content {
    border-top: 1px solid #e5e7eb;
}

/* Calendar Grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-weekday {
    padding: 12px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    text-align: center;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    letter-spacing: 0.3px;
}

.calendar-day {
    min-height: 90px;
    padding: 8px;
    border-right: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    background: white;
    transition: background 0.15s;
}

.calendar-day:nth-child(7n) {
    border-right: none;
}

.calendar-day:hover:not(.empty) {
    background: #fafafa;
}

.calendar-day.empty {
    background: #fafafa;
}

.calendar-day.is-past {
    background: #fafafa;
}

.calendar-day.is-past .calendar-day-number {
    color: #d1d5db;
}

.calendar-day-number {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 6px;
}

.calendar-day.is-today .calendar-day-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #7c3aed;
    color: white;
    border-radius: 50%;
    font-weight: 600;
}

.calendar-day.has-event {
    background: rgba(119, 28, 255, 0.03);
}

.calendar-day.has-event:hover {
    background: rgba(119, 28, 255, 0.06);
}

/* Event in Calendar */
.calendar-event {
    display: block;
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%);
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: transform 0.15s, box-shadow 0.15s;
}

.calendar-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(119, 28, 255, 0.3);
    color: white;
}

.calendar-day.is-past .calendar-event {
    opacity: 0.5;
}

/* Mobile Event Dot */
.calendar-event-dot {
    display: none;
    width: 6px;
    height: 6px;
    background: #7c3aed;
    border-radius: 50%;
    margin: 4px auto 0;
}

/* Responsive */
@media (max-width: 768px) {
    .calendar-header {
        flex-direction: column;
        gap: 16px;
    }

    .calendar-day {
        min-height: 52px;
        padding: 6px 4px;
    }

    .calendar-day-number {
        font-size: 12px;
        text-align: center;
        display: block;
    }

    .calendar-day.is-today .calendar-day-number {
        width: 22px;
        height: 22px;
        font-size: 11px;
        margin: 0 auto;
    }

    .calendar-event {
        display: none;
    }

    .calendar-event-dot {
        display: block;
    }

    .calendar-weekday {
        padding: 10px 4px;
        font-size: 10px;
    }

    .calendar-month-toggle {
        padding: 14px 16px;
    }

    .calendar-month-info h2 {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .calendar-day {
        min-height: 44px;
        padding: 4px 2px;
    }

    .calendar-day-number {
        font-size: 11px;
    }

    .calendar-day.is-today .calendar-day-number {
        width: 20px;
        height: 20px;
        font-size: 10px;
    }
}

/* ==========================================================================
   Event Entry Page
   ========================================================================== */

/* Header */
.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.event-header-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

.event-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.event-header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-calendar {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.15s;
}

.btn-calendar:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Metrics */
.event-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: #e5e7eb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 24px;
}

.event-metric {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    background: #f9fafb;
}

.event-metric:first-child {
    border-radius: 9px 0 0 9px;
}

.event-metric:last-child {
    border-radius: 0 9px 9px 0;
}

.event-metric-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Tooltip */
.metric-help {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    border-radius: 50%;
    cursor: help;
    text-transform: none;
    letter-spacing: 0;
}

.metric-help:hover {
    color: #6b7280;
    background: #e5e7eb;
}

.metric-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.15s;
    z-index: 100;
}

.metric-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
}

.metric-help:hover .metric-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Preview Button */
.btn-preview {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-preview:hover {
    background: #f3f4f6;
    color: #374151;
}

/* Preview Modal */
.preview-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.preview-modal.active {
    display: flex;
}

.preview-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}

.preview-modal-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px 0;
}

.preview-modal-content img {
    display: block;
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.preview-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.preview-modal-close:hover {
    background: #e5e7eb;
    color: #374151;
}

.event-metric-value {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

.event-metric-value--small {
    font-size: 18px;
}

.event-metric-sub {
    font-size: 13px;
    color: #6b7280;
}

@media (max-width: 640px) {
    .event-header {
        flex-direction: column;
    }

    .event-header-actions {
        width: 100%;
    }

    .event-title {
        font-size: 20px;
    }

    .btn-calendar {
        flex: 1;
        justify-content: center;
        font-size: 13px;
        padding: 10px 12px;
    }

    .event-metrics {
        grid-template-columns: 1fr;
    }

    .event-metric:first-child {
        border-radius: 9px 9px 0 0;
    }

    .event-metric:last-child {
        border-radius: 0 0 9px 9px;
    }

    .event-metric {
        padding: 14px 16px;
    }

    .event-metric-value {
        font-size: 20px;
    }

    /* Tooltip mobile fix */
    .metric-tooltip {
        white-space: normal;
        max-width: 200px;
        text-align: center;
    }

    .preview-modal-content {
        padding: 16px;
        margin: 16px;
    }

    .btn-preview {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ==========================================================================
   FOLDERS
   ========================================================================== */
/* ==========================================================================
   Folders - Shared styles for folder sections
   ========================================================================== */

.folders-section {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

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

.folders-title {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    margin: 0;
}

.folders-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.folder-card {
    display: inline-flex;
    align-items: center;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.15s;
}

.folder-card:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.folder-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    text-decoration: none;
    color: inherit;
}

.folder-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #7c3aed;
}

.folder-icon svg {
    width: 16px;
    height: 16px;
}

.folder-name {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.folder-count {
    font-size: 11px;
    color: #9ca3af;
    background: #e5e7eb;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

.folder-delete {
    padding: 6px 10px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    opacity: 0;
    transition: all 0.15s;
}

.folder-card:hover .folder-delete {
    opacity: 1;
}

.folder-delete:hover {
    color: #dc2626;
    background: #fef2f2;
}

.folders-empty {
    color: #9ca3af;
    font-size: 13px;
    margin: 0;
}

/* Breadcrumb bar when inside folder */
.folder-breadcrumb-bar {
    padding: 14px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #fafafa;
}

.folder-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #7c3aed;
    text-decoration: none;
}

.folder-back-link:hover {
    text-decoration: underline;
}

.folder-back-link svg {
    width: 14px;
    height: 14px;
}

/* Responsive */
@media (max-width: 640px) {
    .folders-section {
        padding: 12px 16px;
    }

    .folders-grid {
        flex-direction: column;
    }

    .folder-card {
        width: 100%;
    }
}

/* ==========================================================================
   INTEGRATIONS
   ========================================================================== */
/* ==========================================================================
   Integrations Page Styles
   ========================================================================== */

/* Integrations Container */
.integrations-container {
    padding: 20px;
}

/* Integrations Grid */
.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Card wrapper for filtering */
.crm-card-wrapper {
    display: block;
}

.crm-card-wrapper.hidden {
    display: none;
}

/* No results */
.no-results {
    display: none;
    color: #9ca3af;
    text-align: center;
    padding: 48px 24px;
    margin: 0;
    font-size: 14px;
}

/* CRM Card */
.crm-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.15s ease;
}

.crm-card:hover {
    border-color: #d1d5db;
}

.crm-card.connected {
    border-left: 3px solid #10b981;
}

.crm-card.error {
    border-left: 3px solid #f59e0b;
}

.crm-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.crm-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
}

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

.crm-info h3 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.crm-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crm-info-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
}

.crm-info-btn:hover {
    color: #7c3aed;
}

.crm-info-btn .material-icons-round {
    font-size: 16px;
}

.crm-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    margin-top: 2px;
}

.crm-status.connected { color: #10b981; }
.crm-status.disconnected { color: #6b7280; }
.crm-status.error { color: #f59e0b; }

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-dot.connected { background: #10b981; }
.status-dot.disconnected { background: #9ca3af; }
.status-dot.error { background: #f59e0b; }

.crm-account-info {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.crm-card-actions {
    display: flex;
    gap: 8px;
}

.crm-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.crm-btn-primary {
    background: #7c3aed;
    color: white;
}

.crm-btn-primary:hover {
    background: #6d28d9;
}

.crm-btn-secondary {
    background: #e5e7eb;
    color: #374151;
}

.crm-btn-secondary:hover {
    background: #d1d5db;
}

.crm-btn-danger {
    background: #fef2f2;
    color: #dc2626;
}

.crm-btn-danger:hover {
    background: #fee2e2;
}

.crm-btn-disabled {
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.form-actions .crm-btn {
    flex: none;
}

/* Marketplace integrations */
.marketplace-description {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin: 12px 0;
    padding: 0;
}

.crm-status.marketplace {
    color: #7c3aed;
}

.status-dot.marketplace {
    background: #7c3aed;
}

.crm-status.coming-soon {
    color: #9ca3af;
}

.status-dot.coming-soon {
    background: #9ca3af;
}

.coming-soon-card {
    opacity: 0.7;
}

.coming-soon-badge {
    display: inline-block;
    padding: 2px 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 11px;
    font-weight: 500;
    border-radius: 10px;
    margin-left: 8px;
}

/* Responsive */
@media (max-width: 768px) {
    .integrations-grid {
        grid-template-columns: 1fr;
    }

    .crm-card-actions {
        flex-direction: column;
    }
}

/* ==========================================================================
   SYNC STATUS
   ========================================================================== */
/**
 * Sync Status Styles
 * Used in leads table for integration sync status display
 */

.sync-status-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.sync-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.sync-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.sync-badge-success {
    background-color: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.sync-badge-error {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.sync-badge-pending {
    background-color: #fff7ed;
    color: #ea580c;
    border: 1px solid #fed7aa;
}

.sync-badge-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sync-retry-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid #fecaca;
    background-color: #fef2f2;
    color: #dc2626;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sync-retry-btn:hover {
    background-color: #fee2e2;
}

.sync-retry-btn .material-icons-round {
    font-size: 14px;
}

.sync-spinner {
    animation: spin 1s linear infinite;
}

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

.sync-to-crm-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f3f4f6;
    color: #374151;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.sync-to-crm-btn:hover {
    background-color: #e5e7eb;
}

.sync-to-crm-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sync-to-specific {
    background-color: white;
}

.sync-to-specific:hover {
    background-color: #f9fafb;
}

.connect-crm-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
}

.connect-crm-link:hover {
    color: var(--primary, #7c3aed);
}

/* Dropdown styles */
.sync-dropdown {
    position: relative;
    display: inline-block;
}

.sync-dropdown-toggle {
    padding-right: 6px;
}

.sync-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 160px;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 4px;
    margin-top: 4px;
}

.sync-dropdown-menu.hidden {
    display: none;
}

.sync-dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    text-align: left;
}

.sync-dropdown-item:hover {
    background-color: #f3f4f6;
}

.sync-dropdown-divider {
    height: 1px;
    background-color: #e5e7eb;
    margin: 4px 0;
}

/* Error message */
.sync-error-message {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #dc2626;
    font-size: 12px;
    margin-bottom: 6px;
    width: 100%;
}

/* HTMX loading state */
.htmx-request .sync-to-crm-btn,
.htmx-request .sync-retry-btn {
    opacity: 0.7;
    pointer-events: none;
}

.htmx-request .sync-to-crm-btn::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 4px;
}

/* ==========================================================================
   AUTH
   ========================================================================== */
/* ==========================================================================
   Auth Pages (Login, Signup, Password Reset)
   Styled to match dashboard design
   ========================================================================== */

/* Layout */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #f9fafb;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.auth-card--wide {
    max-width: 560px;
}

.auth-header {
    padding: 32px 32px 0;
    text-align: center;
}

.auth-logo {
    display: inline-block;
    margin-bottom: 24px;
    cursor: pointer;
    text-decoration: none;
}

.auth-logo:hover {
    opacity: 0.8;
}

.auth-logo img {
    height: 32px;
    width: auto;
    display: block;
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    color: #050505;
    margin: 0 0 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: #68778C;
    margin: 0;
}

.auth-subtitle a {
    color: #7c3aed;
    text-decoration: none;
    font-weight: 500;
}

.auth-subtitle a:hover {
    text-decoration: underline;
}

/* Form */
.auth-body {
    padding: 32px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 500px) {
    .auth-form-grid {
        grid-template-columns: 1fr;
    }
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field.full-width {
    grid-column: 1 / -1;
}

.auth-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--neutral-700, #374151);
}

.auth-input {
    width: 100%;
    padding: 10px 16px;
    min-height: 46px;
    font-size: 14px;
    color: var(--neutral-800, #1F2937);
    background: white;
    border: 1px solid var(--neutral-300, #D1D5DB);
    border-radius: 8px;
    transition: all 0.15s;
}

.auth-input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: none;
}

.auth-input::placeholder {
    color: #9ca3af;
}

.auth-input.is-invalid {
    border-color: #ef4444;
}

/* Select styling */
.auth-field select.auth-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* Error message */
.auth-error {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

.auth-errors {
    padding: 12px 16px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin-bottom: 16px;
}

.auth-errors ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.auth-errors li {
    font-size: 13px;
    color: #dc2626;
}

/* Success message */
.auth-success {
    padding: 12px 16px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #166534;
}

/* Links */
.auth-link {
    font-size: 13px;
    color: #7c3aed;
    text-decoration: none;
    font-weight: 500;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-remember-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.auth-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    color: #4b5563;
}

.auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #7c3aed;
    cursor: pointer;
}

.auth-forgot {
    text-align: right;
    margin-top: -8px;
}

/* Consent checkboxes */
.auth-consents {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.auth-consent-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.auth-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    color: #4b5563;
    line-height: 1.4;
}

.auth-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    accent-color: #7c3aed;
    cursor: pointer;
    margin-top: 2px;
}

.auth-checkbox a {
    color: #7c3aed;
    text-decoration: none;
}

.auth-checkbox a:hover {
    text-decoration: underline;
}

.auth-field-error {
    color: #dc2626;
    font-size: 12px;
    margin-left: 24px;
}

.auth-oauth-terms {
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    margin-top: 12px;
}

.auth-oauth-terms a {
    color: #7c3aed;
    text-decoration: none;
}

.auth-oauth-terms a:hover {
    text-decoration: underline;
}

/* Buttons */
.auth-btn {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.auth-btn-primary {
    background: #7c3aed;
    color: white;
}

.auth-btn-primary:hover {
    background: #7c3aed;
    opacity: 0.9;
    color: white;
}

.auth-btn-google {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.auth-btn-google:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.auth-btn-google svg {
    width: 20px;
    height: 20px;
}

.auth-btn-spinner {
    animation: spinner-border 0.75s linear infinite;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 16px 0;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.auth-divider span {
    font-size: 12px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Footer */
.auth-footer {
    padding: 20px 32px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.auth-footer p {
    font-size: 12px;
    color: #68778C;
    margin: 0;
}

.auth-footer a {
    color: #7c3aed;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Captcha (hCaptcha / reCAPTCHA) */
.auth-captcha,
.auth-recaptcha {
    display: flex;
    justify-content: center;
    margin: 8px 0;
}

/* Crispy forms override */
.auth-form .form-group {
    margin-bottom: 0;
}

.auth-form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--neutral-700, #374151);
    margin-bottom: 6px;
}

.auth-form .form-control {
    width: 100%;
    padding: 10px 16px;
    min-height: 46px;
    font-size: 14px;
    color: var(--neutral-800, #1F2937);
    background: white;
    border: 1px solid var(--neutral-300, #D1D5DB);
    border-radius: 8px;
    transition: all 0.15s;
    height: auto;
    box-shadow: none !important;
}

.auth-form .form-control:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: none !important;
}

.auth-form .form-control.is-invalid {
    border-color: #ef4444;
}

.auth-form .invalid-feedback {
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

.auth-form select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

/* Password field with toggle */
.auth-password-wrapper {
    position: relative;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #9ca3af;
}

.auth-password-toggle:hover {
    color: #6b7280;
}

/* Responsive */
@media (max-width: 480px) {
    .auth-container {
        padding: 20px 16px;
    }

    .auth-card {
        border-radius: 12px;
    }

    .auth-header {
        padding: 24px 24px 0;
    }

    .auth-body {
        padding: 24px;
    }

    .auth-footer {
        padding: 16px 24px;
    }

    .auth-title {
        font-size: 20px;
    }
}

/* ===== A/B TESTS ===== */

/* List Page - Variants */
.ab-variants {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ab-variant {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ab-variant-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.ab-variant--a .ab-variant-label {
    background: #10b981;
}

.ab-variant--b .ab-variant-label {
    background: #f59e0b;
}

.ab-variant-name {
    font-size: 12px;
    color: #374151;
    text-decoration: none;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ab-variant-name:hover {
    color: #7c3aed;
}

/* Traffic Split */
.ab-traffic-split {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
}

.ab-traffic-bar {
    display: flex;
    height: 6px;
    background: #f3f4f6;
    border-radius: 3px;
    overflow: hidden;
}

.ab-traffic-bar-a {
    background: #10b981;
}

.ab-traffic-bar-b {
    background: #f59e0b;
}

.ab-traffic-labels {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
}

.ab-traffic-label {
    font-weight: 500;
}

.ab-traffic-label--a {
    color: #10b981;
}

.ab-traffic-label--b {
    color: #f59e0b;
}

/* Metrics comparison */
.ab-metrics {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.ab-metric {
    font-weight: 600;
}

.ab-metric--a {
    color: #10b981;
}

.ab-metric--b {
    color: #f59e0b;
}

.ab-metric-vs {
    color: #9ca3af;
    font-size: 10px;
    font-weight: 400;
}

/* Entry Page - Overview Cards */
.ab-overview {
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    align-items: stretch;
}

.ab-overview-card {
    flex: 1;
    background: white;
    border-radius: 12px;
    padding: 24px;
    border: 2px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.ab-overview-card--a {
    border-color: #10b981;
}

.ab-overview-card--b {
    border-color: #f59e0b;
}

.ab-overview-card--winner {
    background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
    border-color: #eab308;
    box-shadow: 0 4px 12px rgba(234, 179, 8, 0.15);
}

.ab-winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ab-winner-badge .material-icons-round {
    font-size: 14px;
}

.ab-overview-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ab-overview-vs span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
}

.ab-overview-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.ab-overview-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    color: white;
}

.ab-overview-badge--a {
    background: #10b981;
}

.ab-overview-badge--b {
    background: #f59e0b;
}

.ab-overview-info {
    flex: 1;
}

.ab-overview-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.ab-overview-traffic {
    font-size: 13px;
    color: #6b7280;
}

.ab-overview-stats {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px;
    background: #f9fafb;
    border-radius: 8px;
}

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

.ab-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.ab-stat-value--highlight {
    color: #7c3aed;
}

.ab-stat-label {
    font-size: 12px;
    color: #6b7280;
}

.ab-overview-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    color: #7c3aed;
    text-decoration: none;
}

.ab-overview-link:hover {
    text-decoration: underline;
}

.ab-overview-link .material-icons-round {
    font-size: 16px;
}

/* Analytics Section */
.ab-analytics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.ab-analytics-column {
    min-width: 0;
}

.ab-analytics-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: white;
    margin-right: 8px;
}

.ab-analytics-badge--a {
    background: #10b981;
}

.ab-analytics-badge--b {
    background: #f59e0b;
}

/* Date Filter */
.ab-date-filter {
    margin-bottom: 20px;
}

.ab-date-inputs {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.ab-date-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ab-date-field label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.ab-date-field input {
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
}

/* Traffic Control (Forms) */
.ab-traffic-control {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
}

.ab-traffic-inputs {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.ab-traffic-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.ab-traffic-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    color: white;
}

.ab-traffic-input-label--a {
    background: #10b981;
}

.ab-traffic-input-label--b {
    background: #f59e0b;
}

.ab-traffic-number {
    width: 80px;
    text-align: center;
    font-weight: 600;
}

.ab-traffic-input-suffix {
    font-size: 14px;
    color: #6b7280;
}

.ab-traffic-slider-container {
    position: relative;
}

.ab-traffic-slider {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #10b981 0%, #10b981 50%, #f59e0b 50%, #f59e0b 100%);
    border-radius: 4px;
    appearance: none;
    cursor: pointer;
}

.ab-traffic-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #7c3aed;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ab-traffic-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: white;
    border: 2px solid #7c3aed;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ab-traffic-slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.ab-traffic-slider-label {
    font-size: 11px;
    font-weight: 600;
}

.ab-traffic-slider-label--a {
    color: #10b981;
}

.ab-traffic-slider-label--b {
    color: #f59e0b;
}

/* Settings Row */
.ab-settings-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

@media (max-width: 1024px) {
    .ab-settings-row {
        grid-template-columns: 1fr;
    }
}

.ab-settings-card,
.ab-install-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.ab-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .ab-settings-grid {
        grid-template-columns: 1fr;
    }
}

.ab-setting-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: #f9fafb;
    border-radius: 8px;
}

.ab-setting-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: white;
    border-radius: 8px;
    flex-shrink: 0;
}

.ab-setting-icon .material-icons-round {
    font-size: 18px;
    color: #7c3aed;
}

.ab-setting-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ab-setting-label {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ab-setting-value {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    word-break: break-word;
}

.ab-setting-value small {
    font-weight: 500;
    color: #6b7280;
}

/* Page Card styles for A/B test entry */
.page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.page-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.page-card-title .material-icons-round {
    font-size: 18px;
    color: #6b7280;
}

.page-card-body {
    padding: 20px;
}

.page-card-desc {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 16px 0;
}

/* Page meta */
.page-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.page-meta-sep {
    color: #d1d5db;
}

.page-meta-date {
    font-size: 13px;
    color: #6b7280;
}

/* Responsive */
@media (max-width: 768px) {
    .ab-overview {
        flex-direction: column;
    }

    .ab-overview-vs {
        display: none;
    }

    .ab-analytics {
        grid-template-columns: 1fr;
    }

    .ab-date-inputs {
        flex-wrap: wrap;
    }

    .ab-traffic-inputs {
        flex-direction: column;
    }
}

/* ==========================================================================
   API KEYS & WEBHOOKS
   ========================================================================== */

/* Section Header */
.api-keys-section,
.webhooks-section {
    padding: 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.section-info {
    flex: 1;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.section-description {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
}

/* API Docs Link */
.api-docs-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.api-docs-link svg {
    color: #0284c7;
}

.api-docs-link a {
    color: #0284c7;
    text-decoration: none;
    font-weight: 500;
}

.api-docs-link a:hover {
    text-decoration: underline;
}

/* API Keys List */
.api-keys-list,
.webhooks-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.api-key-item,
.webhook-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: border-color 0.15s;
}

.api-key-item:hover,
.webhook-item:hover {
    border-color: #d1d5db;
}

.api-key-info,
.webhook-info {
    flex: 1;
    min-width: 0;
}

.api-key-header,
.webhook-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.api-key-name,
.webhook-name {
    font-weight: 600;
    font-size: 15px;
    color: #111827;
}

.api-key-preview {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}

.api-key-meta {
    margin-bottom: 8px;
}

.api-key-scopes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.scope-tag {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    padding: 2px 8px;
    background: #f3f4f6;
    color: #374151;
    border-radius: 4px;
}

.api-key-stats,
.webhook-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: #6b7280;
}

.api-key-actions,
.webhook-actions {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

/* Webhook specific */
.webhook-url {
    margin-bottom: 8px;
}

.webhook-url code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 13px;
    color: #6b7280;
    word-break: break-all;
}

.webhook-events {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.event-tag {
    font-size: 12px;
    padding: 3px 10px;
    background: #ecfdf5;
    color: #059669;
    border-radius: 12px;
    font-weight: 500;
}

.webhook-stats .stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.webhook-stats .stat-value {
    font-weight: 600;
    color: #374151;
}

.webhook-stats .stat-label {
    color: #6b7280;
}

.webhook-stats .stat.muted {
    color: #9ca3af;
    font-style: italic;
}

/* Icon Buttons */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-icon:hover {
    background: #f9fafb;
    color: #374151;
    border-color: #d1d5db;
}

.btn-icon.btn-danger-icon:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    background: #f9fafb;
    border: 2px dashed #e5e7eb;
    border-radius: 12px;
}

.empty-state svg {
    color: #9ca3af;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 4px 0;
}

.empty-state span {
    font-size: 14px;
    color: #6b7280;
}

/* Badge */
.badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}

.badge-secondary {
    background: #f3f4f6;
    color: #6b7280;
}

/* Scopes Grid */
.scopes-grid,
.events-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.scope-checkbox,
.event-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.scope-checkbox:hover,
.event-checkbox:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.scope-checkbox input,
.event-checkbox input {
    margin-top: 2px;
    accent-color: #6366f1;
}

.scope-label,
.event-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scope-label strong,
.event-label strong {
    font-size: 13px;
    color: #111827;
}

.scope-label small,
.event-label small {
    font-size: 12px;
    color: #6b7280;
}

.event-checkbox-all {
    grid-column: span 2;
    background: #f0f9ff;
    border-color: #bae6fd;
}

/* Crispy forms checkbox styling for API Keys and Webhooks */
#div_id_scopes > div,
#div_id_events > div {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

#div_id_scopes .form-check,
#div_id_events .form-check {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin: 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

#div_id_scopes .form-check:hover,
#div_id_events .form-check:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

#div_id_scopes .form-check-input,
#div_id_events .form-check-input {
    margin: 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

#div_id_scopes .form-check-label,
#div_id_events .form-check-label {
    font-size: 13px;
    color: #374151;
    cursor: pointer;
}

/* Invalid state for checkboxes */
#div_id_scopes .form-check.is-invalid,
#div_id_events .form-check.is-invalid {
    border-color: #fecaca;
    background: #fef2f2;
}

/* Toggle checkbox with hint */
.form-check--toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    margin: 0;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
}

.form-check--toggle:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

.form-check--toggle input[type="checkbox"] {
    margin: 2px 0 0 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.form-check-content {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.form-check--toggle .form-check-label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.form-check-hint {
    font-size: 12px;
    color: #6b7280;
}

/* General modal form error styling */
.modal-body .invalid-feedback,
.modal-body .errorlist {
    display: block !important;
    font-size: 12px;
    color: #ef4444;
    margin-top: 4px;
}

.modal-body .errorlist {
    list-style: none;
    padding: 0;
    margin: 4px 0 8px 0;
}

.modal-body .errorlist li {
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    margin-bottom: 4px;
}

.modal-body .form-control.is-invalid,
.modal-body input.is-invalid,
.modal-body select.is-invalid {
    border-color: #ef4444 !important;
}

/* Modal form inputs */
.modal-body .form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.15s;
}

.modal-body .form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.modal-body .form-group,
.modal-body .mb-3 {
    margin-bottom: 16px;
}

.modal-body label:not(.form-check-label) {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.modal-body .form-text {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

/* is_active checkbox styling */
#div_id_is_active {
    margin-top: 16px;
    padding: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

#div_id_is_active .form-check {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0;
}

#div_id_is_active .form-check-input {
    margin: 0;
    width: 18px;
    height: 18px;
}

#div_id_is_active .form-check-label {
    font-size: 13px;
    color: #374151;
}

#div_id_is_active .form-text {
    margin-top: 8px;
    padding-left: 28px;
}

/* API Key Display */
.api-key-display,
.secret-value {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #111827;
    border-radius: 8px;
    margin-top: 16px;
}

.api-key-display code,
.secret-value code {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: #10b981;
    word-break: break-all;
}

.btn-copy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #374151;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-copy:hover {
    background: #4b5563;
}

/* Webhook Security Info */
.webhook-security-info {
    margin-top: 32px;
    padding: 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.webhook-security-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 8px 0;
}

.webhook-security-info p {
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px 0;
}

.webhook-security-info code {
    background: #e5e7eb;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.webhook-security-info pre {
    background: #111827;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 0;
}

.webhook-security-info pre code {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    color: #10b981;
    background: transparent;
    padding: 0;
}

/* Webhook Secret Display */
.webhook-secret-display {
    margin-top: 16px;
}

.webhook-secret-display label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

/* Test Result */
.test-result {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
}

.test-result svg {
    flex-shrink: 0;
}

.test-result strong {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.test-result p {
    margin: 0;
    font-size: 14px;
}

.test-success {
    background: #dcfce7;
    color: #166534;
}

.test-success svg {
    color: #16a34a;
}

.test-failed {
    background: #fee2e2;
    color: #991b1b;
}

.test-failed svg {
    color: #dc2626;
}

/* Form Switch */
.form-switch-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.form-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #d1d5db;
    border-radius: 24px;
    transition: 0.2s;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.form-switch input:checked + .switch-slider {
    background: #10b981;
}

.form-switch input:checked + .switch-slider:before {
    transform: translateX(20px);
}

.switch-label {
    font-size: 14px;
    color: #374151;
}

/* Alert Warning */
.alert-warning {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #92400e;
    font-size: 14px;
}

.alert-warning svg {
    flex-shrink: 0;
    color: #f59e0b;
}

/* Responsive API/Webhooks */
@media (max-width: 768px) {
    .section-header {
        flex-direction: column;
    }

    .scopes-grid,
    .events-grid {
        grid-template-columns: 1fr;
    }

    .event-checkbox-all {
        grid-column: span 1;
    }

    .api-key-item,
    .webhook-item {
        flex-direction: column;
        gap: 16px;
    }

    .api-key-actions,
    .webhook-actions {
        margin-left: 0;
        align-self: flex-start;
    }
}
