/* ==========================================================================
   APEIRO ENTERPRISE EMAIL DISPATCHER - MODERN UI DESIGN SYSTEM
   ========================================================================== */

:root {
    /* Primary & Brand Colors */
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-active: #1e40af;
    --primary-light: #eff6ff;
    --primary-subtle: #dbeafe;
    --primary-border: #bfdbfe;
    --primary-gradient: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
    --primary-gradient-hover: linear-gradient(135deg, #1d4ed8 0%, #4338ca 100%);
    
    /* Semantic Status Colors */
    --success: #10b981;
    --success-bg: #ecfdf5;
    --success-border: #a7f3d0;
    --success-text: #065f46;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);

    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    --warning-border: #fde68a;
    --warning-text: #92400e;

    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --danger-border: #fecaca;
    --danger-text: #991b1b;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

    --blocked: #ea580c;
    --blocked-bg: #fff7ed;
    --blocked-border: #fed7aa;
    --blocked-text: #9a3412;

    --info: #0284c7;
    --info-bg: #f0f9ff;
    --info-border: #bae6fd;
    --info-text: #0369a1;

    /* Neutrals & Dark Text */
    --bg: #f8fafc;
    --bg-mesh-1: rgba(37, 99, 235, 0.05);
    --bg-mesh-2: rgba(99, 102, 241, 0.05);
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --card-border-hover: #cbd5e1;
    
    --text-dark: #0f172a;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-subtle: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;

    /* Elevation & Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

    /* Radii */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
}

/* ==========================================================================
   RESET & CORE BASE
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    background-image: 
        radial-gradient(at 0% 0%, var(--bg-mesh-1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, var(--bg-mesh-2) 0px, transparent 50%),
        radial-gradient(at 50% 100%, rgba(241, 245, 249, 0.8) 0px, transparent 60%);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 8px;
    border: 2px solid #f1f5f9;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   LAYOUT & CONTAINER
   ========================================================================== */

/* Auth Protection: Dashboard container hidden until authenticated */
body.not-authenticated .container,
body:not(.authenticated) .container {
    display: none !important;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
    min-height: 100vh;
    padding: 1.5rem 1.25rem 3.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

header {
    margin-bottom: 1.5rem;
}

.app-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    justify-content: center;
}

.header-center {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.header-center h1 {
    font-size: 2.15rem;
    font-weight: 800;
    margin: 0;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.header-center p {
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 500;
    margin: 0.2rem 0 0 0;
    letter-spacing: -0.01em;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.time-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.25rem 0.65rem;
    border-radius: 8px;
    box-shadow: var(--shadow-xs);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    user-select: none;
    height: 32px;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.time-chip:hover {
    border-color: #94a3b8;
    box-shadow: var(--shadow-sm);
}

.time-clock {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum';
    font-weight: 700;
    color: #1e293b;
    letter-spacing: 0.2px;
    display: inline-block;
}

.header-user-card {
    display: none;
    position: relative;
    box-sizing: border-box;
}

.user-profile-wrapper {
    position: relative;
    display: inline-block;
}

.header-user-trigger-btn {
    height: 40px;
    padding: 0.3rem 0.8rem 0.3rem 0.4rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
    user-select: none;
}

.header-user-trigger-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.header-user-trigger-btn.open {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
    background: #ffffff;
}

.header-user-trigger-btn.has-active-child {
    border-color: var(--primary);
    background: #eff6ff;
}

.user-avatar-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.user-trigger-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 1px;
}

.user-trigger-name {
    font-weight: 700;
    font-size: 0.8rem;
    color: #1e293b;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}

.user-trigger-badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.06rem 0.4rem;
    border-radius: 9999px;
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    line-height: 1.2;
}

.user-trigger-chevron {
    font-size: 0.72rem;
    color: #64748b;
    margin-left: 0.1rem;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.header-user-trigger-btn.open .user-trigger-chevron {
    transform: rotate(180deg);
}

/* User Profile Dropdown Card */
.user-profile-dropdown-card {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    max-width: 92vw;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: userDropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes userDropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.user-dropdown-header {
    padding: 1rem 1.15rem;
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.user-dropdown-avatar-lg {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
    flex-shrink: 0;
}

.user-dropdown-meta {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-dropdown-name {
    font-size: 0.92rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown-email {
    font-size: 0.76rem;
    color: #64748b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

.user-dropdown-divider {
    height: 1px;
    background: #f1f5f9;
    margin: 0.35rem 0.5rem;
}

.user-dropdown-section-title {
    padding: 0.45rem 1rem 0.25rem 1rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.user-dropdown-nav {
    padding: 0 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-dropdown-item {
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    padding: 0.48rem 0.65rem;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    font-family: inherit;
    color: #334155;
    outline: none;
    box-sizing: border-box;
}

.user-dropdown-item:hover {
    background: #f8fafc;
    color: #0f172a;
    transform: translateX(2px);
}

.user-dropdown-item.active {
    background: #eff6ff !important;
    border-color: #bfdbfe !important;
    color: var(--primary) !important;
}

.user-dropdown-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.user-dropdown-item:hover .user-dropdown-item-icon {
    background: #e2e8f0;
    transform: scale(1.05);
}

.user-dropdown-item.active .user-dropdown-item-icon {
    background: rgba(37, 99, 235, 0.15);
}

.user-dropdown-item-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
}

.user-dropdown-item-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: inherit;
    line-height: 1.25;
}

.user-dropdown-item-desc {
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1.25;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-item.item-logout:hover {
    background: #fef2f2;
}

.user-dropdown-item.item-logout:hover .icon-logout {
    background: #fee2e2;
}

.user-dropdown-item .icon-logout {
    background: #fee2e2;
    color: #dc2626;
}

.user-dropdown-item .label-logout {
    color: #dc2626;
    font-weight: 700;
}

.nav-bar-row {
    display: none !important;
}

/* Home Sub-navigation Tabs */
.btn-sub-tab {
    padding: 0.45rem 1rem;
    font-size: 0.83rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.btn-sub-tab:hover {
    color: var(--primary);
    background: rgba(255, 255, 255, 0.7);
}

.btn-sub-tab.active {
    background: #ffffff;
    color: var(--primary);
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Bundle List Item Card */
.bundle-list-item-card {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.15rem 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}

.bundle-list-item-card:hover {
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(37, 99, 235, 0.09);
    transform: translateY(-1px);
}

#bundle-search-filter {
    margin: 0 !important;
    box-sizing: border-box !important;
    height: 36px !important;
}

.nav-bar-container {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
    background: #ffffff;
    border: 1px solid var(--border);
    padding: 0.35rem 0.45rem;
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    width: fit-content;
    margin: 0 auto;
}

.nav-tab-btn {
    margin: 0;
    width: auto;
    font-weight: 700;
    background: transparent;
    color: #475569;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1.4rem;
    border-radius: 10px;
    font-size: 0.86rem;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    outline: none;
}

.nav-tab-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.nav-tab-btn.active,
.nav-tab-btn.nav-tab-active {
    background: var(--primary) !important;
    color: #ffffff !important;
    border-color: var(--primary) !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}

@media (max-width: 1100px) {
    .app-header {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1rem;
    }
    .header-left, .header-right {
        justify-content: center;
    }
}

/* ==========================================================================
   GLASS CARDS & PANELS
   ========================================================================== */

.glass-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--card-border);
    padding: 1.85rem;
    box-shadow: var(--shadow);
    transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
    margin-bottom: 1.5rem;
    position: relative;
}

.panel-view {
    flex: 1;
    min-height: 0;
    margin-bottom: 0 !important;
    animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--card-border-hover);
}

.glass-card h2 {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.85rem;
    color: var(--text-dark);
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.glass-card h3 {
    color: var(--text-dark);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 1.75rem;
}

@media (max-width: 992px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   FORM CONTROLS & INPUTS
   ========================================================================== */

label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 650;
    font-size: 0.86rem;
    color: var(--text);
    letter-spacing: -0.01em;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="datetime-local"],
input[type="date"],
input[type="time"],
input[type="password"],
select,
textarea {
    width: 100%;
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.7rem 0.95rem;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    box-sizing: border-box;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="number"]::placeholder,
input[type="password"]::placeholder,
textarea::placeholder {
    color: var(--text-subtle);
    font-weight: 400;
}

input:focus,
select:focus,
textarea:focus {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15);
}

textarea {
    height: 170px;
    resize: vertical;
    line-height: 1.6;
}

select {
    cursor: pointer;
}

.inline-controls {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.inline-controls label {
    margin-bottom: 0 !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.inline-controls select {
    width: auto !important;
    min-width: 140px;
    height: 38px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
}

.inline-controls input {
    width: auto !important;
    height: 38px !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
}

.inline-controls .btn {
    height: 38px !important;
    margin-bottom: 0 !important;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==========================================================================
   FILE UPLOAD DROP ZONE
   ========================================================================== */

.file-upload {
    position: relative;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-lg);
    padding: 2.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #f8fafc;
}

.file-upload:hover {
    background: #eff6ff;
    border-color: var(--primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.06);
}

.file-upload input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-upload strong {
    color: var(--text-dark);
    display: block;
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.file-upload p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.btn {
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 650;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.88rem;
    text-decoration: none;
    box-sizing: border-box;
    user-select: none;
    letter-spacing: -0.01em;
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.25);
    border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-gradient-hover);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
    background: #f1f5f9;
    border-color: var(--border-hover);
    color: var(--text-dark);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(239, 68, 68, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
}

.btn-success:hover:not(:disabled) {
    box-shadow: 0 5px 15px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   METRIC TILES & STATS GRID
   ========================================================================== */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.stat-card {
    background: #ffffff;
    padding: 1.25rem 1rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--card-border);
    box-shadow: var(--shadow-xs);
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
    margin-top: 0.5rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
    color: var(--text-muted);
}

/* ==========================================================================
   PROGRESS BAR & STATUS
   ========================================================================== */

.progress-container {
    margin-bottom: 1.5rem;
}

.progress-bar-wrapper {
    background: #e2e8f0;
    border-radius: var(--radius-full);
    height: 10px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.progress-bar {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--radius-full);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* ==========================================================================
   DATA TABLES
   ========================================================================== */

.table-container {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #ffffff;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    background: #f8fafc;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.74rem;
    letter-spacing: 0.06em;
    padding: 0.85rem 1rem;
    border-bottom: 1.5px solid var(--border);
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.88rem;
    text-align: left;
    color: var(--text);
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: #f8fafc;
}

td small {
    color: var(--text-muted);
    display: block;
    font-size: 0.78rem;
    margin-top: 2px;
}

/* Status Badges */
.status-badge {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.74rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    letter-spacing: 0.02em;
}

.status-sent {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}

.status-invalid {
    background: var(--warning-bg);
    color: var(--warning-text);
    border: 1px solid var(--warning-border);
}

.status-failed {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.status-blocked {
    background: var(--blocked-bg);
    color: var(--blocked-text);
    border: 1px solid var(--blocked-border);
}

.status-pending {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

/* ==========================================================================
   TAGS, CHIPS & PLACEHOLDERS
   ========================================================================== */

.placeholder-hint {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.placeholder-tag {
    background: #eff6ff;
    color: var(--primary);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.78rem;
    transition: all 0.15s ease;
    border: 1px solid var(--primary-border);
    user-select: none;
}

.placeholder-tag:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.placeholder-tag:active {
    transform: scale(0.95);
}

.step-label {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.82rem;
    margin-bottom: 1rem;
    border: 1px solid var(--primary-border);
}

/* ==========================================================================
   TABS & MODE SWITCHER
   ========================================================================== */

.tabs {
    display: flex;
    background: #f1f5f9;
    padding: 0.3rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    gap: 0.25rem;
}

.tab-btn {
    flex: 1;
    padding: 0.55rem 0.85rem;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 650;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.tab-btn.active {
    background: #ffffff;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.tab-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.6);
    color: var(--text);
}

/* Switch Toggle */
.mode-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text);
    margin-bottom: 1rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 22px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: 0.3s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

input:checked + .slider {
    background-color: var(--primary);
}

input:checked + .slider:before {
    transform: translateX(16px);
}

/* ==========================================================================
   MODAL WINDOWS & DIALOGS
   ========================================================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.modal.show,
.modal[style*="display: flex"] {
    display: flex !important;
    opacity: 1 !important;
}

#auth-login-overlay {
    background-color: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 99999;
}

#forgot-password-modal {
    background-color: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 100000;
}

#insert-link-modal,
#insert-image-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 100050 !important;
    background-color: rgba(15, 23, 42, 0.72) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    align-items: center !important;
    justify-content: center !important;
}

#insert-link-modal.show,
#insert-image-modal.show,
#insert-link-modal[style*="display: flex"],
#insert-image-modal[style*="display: flex"] {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

#insert-link-modal .modal-content,
#insert-image-modal .modal-content {
    position: relative !important;
    z-index: 100051 !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

.modal-content {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 520px;
    box-shadow: var(--shadow-xl);
    transform: scale(1);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 2rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal.show .modal-content,
.modal[style*="display: flex"] .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 1rem;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-dark);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.15s ease, transform 0.15s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-dark);
    transform: scale(1.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.75rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

/* ==========================================================================
   QUEUE ITEMS & CAMPAIGN CARDS
   ========================================================================== */

.queue-item {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-xs);
}

.queue-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.queue-item-info strong {
    display: inline;
    color: inherit;
    font-weight: 700;
}

.queue-item-info > span {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    display: block;
}

.queue-item-timer {
    font-weight: 700;
    color: var(--primary);
    background: #eff6ff;
    padding: 0.45rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--primary-border);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Courier New', monospace;
    font-size: 0.88rem;
}

/* ==========================================================================
   KEYFRAME ANIMATIONS
   ========================================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulseGreen {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes pulseWave {
    0% {
        transform: scale(0.2);
        opacity: 0;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes rocketFloat {
    0% {
        transform: translateY(0) rotate(0deg);
    }
    100% {
        transform: translateY(-12px) rotate(4deg);
    }
}

/* Launch Animation Styles */
.launch-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(254, 252, 232, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.launch-overlay.show {
    opacity: 1;
}

.launch-card {
    background: #ffffff;
    padding: 2.75rem 2.5rem;
    border-radius: var(--radius-xl);
    box-shadow: 0 20px 40px rgba(234, 179, 8, 0.15);
    border: 2px solid #fef08a;
    text-align: center;
    max-width: 440px;
    width: 90%;
    transform: scale(0.85);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}

.launch-overlay.show .launch-card {
    transform: scale(1);
}

.launch-rocket {
    font-size: 4.5rem;
    margin-bottom: 1.5rem;
    display: inline-block;
    animation: rocketFloat 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 2;
}

.launch-waves {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 1;
}

.wave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: rgba(254, 240, 138, 0.4);
    animation: pulseWave 2s infinite linear;
    opacity: 0;
}

.wave2 {
    animation-delay: 0.6s;
}

.wave3 {
    animation-delay: 1.2s;
}

.launch-title {
    font-size: 1.7rem;
    color: #854d0e;
    font-weight: 800;
    margin-bottom: 0.4rem;
    position: relative;
    z-index: 2;
    letter-spacing: -0.02em;
}

.launch-subtitle {
    color: #a16207;
    font-size: 0.92rem;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

/* ==========================================================================
   CUSTOM ALERT & NOTIFICATION SYSTEM
   ========================================================================== */

.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, visibility 0.22s ease;
    padding: 1.25rem;
    box-sizing: border-box;
}

.custom-alert-overlay.show {
    opacity: 1;
    visibility: visible;
}

.custom-alert-card {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(226, 232, 240, 0.8);
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
    position: relative;
    transform: scale(0.9) translateY(16px);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

.custom-alert-overlay.show .custom-alert-card {
    transform: scale(1) translateY(0);
}

.custom-alert-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1.15rem;
    position: relative;
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
}

.custom-alert-icon-wrap.success {
    background: #ecfdf5;
    color: #059669;
    border: 2px solid #a7f3d0;
}

.custom-alert-icon-wrap.error {
    background: #fef2f2;
    color: #dc2626;
    border: 2px solid #fecaca;
}

.custom-alert-icon-wrap.warning {
    background: #fffbeb;
    color: #d97706;
    border: 2px solid #fde68a;
}

.custom-alert-icon-wrap.info {
    background: #eff6ff;
    color: #2563eb;
    border: 2px solid #bfdbfe;
}

.custom-alert-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 0.5rem 0;
    line-height: 1.35;
    word-break: break-word;
}

.custom-alert-message {
    font-size: 0.9rem;
    color: #475569;
    line-height: 1.55;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 240px;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
    padding: 0 0.5rem;
}

.custom-alert-actions {
    width: 100%;
    display: flex;
    gap: 0.75rem;
}

.custom-alert-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 0.92rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: var(--primary-gradient, linear-gradient(135deg, #2563eb 0%, #4f46e5 100%));
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.custom-alert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.38);
}

.custom-alert-btn:active {
    transform: translateY(0);
}

.custom-alert-btn.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.custom-alert-btn.error, .custom-alert-btn.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.custom-alert-btn.cancel {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
    box-shadow: none;
}

.custom-alert-btn.cancel:hover {
    background: #e2e8f0;
    color: #0f172a;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* ==========================================================================
   CAMPAIGN ENHANCEMENTS: WYSIWYG TOOLBAR, CC, ATTACHMENTS & STATUS BADGES
   ========================================================================== */

/* WYSIWYG Editor Container */
.wysiwyg-container {
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-xs);
}

.wysiwyg-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* WYSIWYG Toolbar */
.wysiwyg-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 0.35rem;
    padding: 0.4rem 0.6rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    user-select: none;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f8fafc;
    min-height: 44px;
    box-sizing: border-box;
}

.wysiwyg-toolbar::-webkit-scrollbar {
    height: 4px;
}

.wysiwyg-toolbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.wysiwyg-btn-group {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    gap: 3px;
    padding-right: 0.45rem;
    margin-right: 0.2rem;
    border-right: 1px solid #e2e8f0;
    height: 30px;
    box-sizing: border-box;
}

.wysiwyg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #334155;
    font-size: 0.85rem;
    line-height: 1;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    vertical-align: middle;
}

.wysiwyg-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
    border-color: #cbd5e1;
}

.wysiwyg-btn:active, .wysiwyg-btn.active {
    background: var(--primary-light);
    color: var(--primary);
    border-color: var(--primary-border);
}

.wysiwyg-select {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    height: 30px;
    line-height: 28px;
    padding: 0 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    background: white;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    margin: 0;
    box-sizing: border-box;
    vertical-align: middle;
    max-width: 110px;
}

.wysiwyg-select:hover {
    border-color: #94a3b8;
}

.wysiwyg-color-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    box-sizing: border-box;
    padding: 0;
    line-height: 1;
    font-size: 0.85rem;
    cursor: pointer;
}

.wysiwyg-color-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

/* Rich Editable Canvas */
.wysiwyg-editor {
    min-height: 160px;
    max-height: 480px;
    overflow-y: auto;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: #1e293b;
    outline: none;
    word-break: break-word;
}

.wysiwyg-editor p {
    margin: 0 0 0.85rem 0;
}

.wysiwyg-editor p:last-child {
    margin-bottom: 0;
}

.wysiwyg-editor blockquote {
    border-left: 3px solid var(--primary);
    margin: 0.5rem 0;
    padding: 0.35rem 0.75rem;
    color: #475569;
    background: #f8fafc;
    border-radius: 0 6px 6px 0;
}

.wysiwyg-editor ul, .wysiwyg-editor ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
}

.wysiwyg-editor:empty:before {
    content: attr(placeholder);
    color: #94a3b8;
    pointer-events: none;
    display: block;
}

/* Attachment Dropzone & Attachment Pill */
.attachment-dropzone {
    border: 1.5px dashed #cbd5e1;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    transition: all 0.2s;
    cursor: pointer;
}

.attachment-dropzone:hover, .attachment-dropzone.dragover {
    background: #eff6ff;
    border-color: var(--primary);
}

.attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
    margin-top: 0.5rem;
}

.attachment-pill.success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.attachment-pill .remove-att-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.attachment-pill .remove-att-btn:hover {
    background: #ef4444;
    color: white;
}

/* Status Paused Badge */
.status-badge.paused {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

/* ==========================================================
   CAMPAIGN CREATOR & SEQUENCE BUILDER MODERN STYLES
   ========================================================== */

.campaign-step-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.03);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.campaign-step-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.step-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
}

.step-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.step-number-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.step-title-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.step-subtitle-text {
    font-size: 0.8rem;
    color: #64748b;
    margin: 0.15rem 0 0 0;
}

/* Schedule Stage Cards */
.schedule-stage-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
    position: relative;
    transition: all 0.2s ease;
}

.schedule-stage-card.primary-stage {
    border-left: 5px solid #2563eb;
}

.schedule-stage-card.followup-stage {
    border-left: 5px solid #6366f1;
    background: #fafafa;
}

.stage-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.stage-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.stage-badge.primary {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.stage-badge.followup {
    background: #eef2ff;
    color: #4338ca;
    border: 1px solid #c7d2fe;
}

/* Stage Sequence Connector */
.stage-sequence-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: -0.5rem 0 1rem 0;
    color: #6366f1;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.stage-sequence-connector::before,
.stage-sequence-connector::after {
    content: '';
    flex: 1;
    height: 2px;
    background: repeating-linear-gradient(to right, #cbd5e1 0, #cbd5e1 6px, transparent 6px, transparent 12px);
}

/* Modern Form Group & Labels */
.form-group-block {
    margin-bottom: 1.25rem;
}

.form-group-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #334155;
    margin-bottom: 0.4rem;
}

.form-group-sublabel {
    font-size: 0.75rem;
    font-weight: normal;
    color: #64748b;
}

.form-text-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #cbd5e1;
    border-radius: 9px;
    font-size: 0.88rem;
    color: #0f172a;
    background: #ffffff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 0;
}

.form-text-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    outline: none;
}

/* Placeholder Chips Bar */
.placeholder-tags-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.45rem;
    padding: 0.45rem 0.65rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.placeholder-tags-bar .bar-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.2rem;
}

.chip-tag-btn {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #2563eb;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.chip-tag-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.1);
}

/* Config Bars (SMTP & Signature) */
.config-card-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    flex-wrap: wrap;
    box-sizing: border-box;
}

.config-card-bar.smtp-bar {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

.config-card-bar.signature-bar {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

/* Schedule Timing Grid */
.schedule-timing-grid {
    display: grid;
    grid-template-columns: 1.35fr 1fr 1fr;
    gap: 0.85rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.9rem 1.1rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
    box-sizing: border-box;
    align-items: start;
}

.delay-input-group {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 9px;
    padding: 0.25rem 0.5rem;
    height: 42px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.delay-input-group:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.delay-num-input::-webkit-outer-spin-button,
.delay-num-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.delay-num-input {
    -moz-appearance: textfield;
}

@media (max-width: 900px) {
    .schedule-timing-grid {
        grid-template-columns: 1fr;
        gap: 0.85rem;
    }
}

/* Stage Actions Footer */
.stage-actions-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f1f5f9;
    padding-top: 1.25rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.stage-actions-right {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ==========================================================================
   LIVE NOTIFICATION CENTER & REAL-TIME ALERTS
   ========================================================================== */

.header-notif-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.header-notif-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

.notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9999px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.4);
    border: 1.5px solid #ffffff;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.notif-dropdown-card {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-width: 90vw;
    max-height: 480px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: fadeInDown 0.2s ease-out;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.notif-dropdown-header {
    padding: 0.9rem 1.1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notif-icon-btn {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0.25rem 0.45rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.notif-icon-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.notif-text-btn {
    background: transparent;
    border: none;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
}

.notif-text-btn:hover {
    text-decoration: underline;
}

.notif-items-list {
    overflow-y: auto;
    max-height: 380px;
    display: flex;
    flex-direction: column;
}

.notif-item-row {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.notif-item-row:hover {
    background: #f8fafc;
}

.notif-item-row.unread {
    background: #f0fdf4;
}

.notif-item-row.unread:hover {
    background: #dcfce7;
}

.notif-item-unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #16a34a;
    display: inline-block;
    flex-shrink: 0;
}

.notif-item-row:last-child {
    border-bottom: none;
}

.notif-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.notif-item-body {
    flex: 1;
    min-width: 0;
}

.notif-item-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.notif-item-email {
    font-size: 0.82rem;
    color: #1e293b;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.notif-item-time {
    font-size: 0.72rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.notif-item-sub {
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
}

.notif-item-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
}

.notif-item-camp {
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

/* Real-Time Slide-in Toast Container */
.live-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 400px;
    width: 90vw;
}

.live-toast-item {
    pointer-events: auto;
    background: #ffffff;
    border: 1px solid #bfdbfe;
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    padding: 0.85rem 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    opacity: 0;
    transform: translateX(50px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.live-toast-item.show {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.live-toast-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.live-toast-content {
    flex: 1;
    min-width: 0;
}

.live-toast-title {
    font-size: 0.84rem;
    font-weight: 800;
    color: #1e293b;
}

.live-toast-body {
    font-size: 0.78rem;
    color: #64748b;
    margin-top: 0.15rem;
    line-height: 1.35;
    word-break: break-word;
}

.live-toast-action-btn {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.live-toast-action-btn:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.live-toast-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.1rem;
    line-height: 1;
    flex-shrink: 0;
}

.live-toast-close-btn:hover {
    color: #475569;
}



