/* ============================================
   VikVek Newsletter - Clean SaaS Design System
   ============================================ */

/* --- CSS Variables --- */
:root {
    --color-primary: #4f46e5;
    --color-primary-hover: #4338ca;
    --color-primary-light: #eef2ff;
    --color-primary-50: #e0e7ff;
    --color-success: #059669;
    --color-success-light: #ecfdf5;
    --color-danger: #dc2626;
    --color-danger-light: #fef2f2;
    --color-warning: #d97706;
    --color-warning-light: #fffbeb;
    --color-info: #2563eb;
    --color-info-light: #eff6ff;
    --color-text: #1e293b;
    --color-text-secondary: #64748b;
    --color-text-muted: #94a3b8;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-border: #e2e8f0;
    --color-border-light: #f1f5f9;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.04), 0 10px 30px rgba(0,0,0,0.06);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
    font-family: var(--font);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; height: auto; }

/* ============================================
   Header & Navigation
   ============================================ */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15em;
    font-weight: 700;
    color: var(--color-text);
    text-decoration: none;
    letter-spacing: -0.3px;
}
.logo:hover { color: var(--color-text); }
.logo span { color: var(--color-text); }

/* Hamburger toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.menu-toggle:hover { background: var(--color-border-light); }
.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--color-text);
    border-radius: 1px;
    transition: all 0.3s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Nav links */
.nav {
    display: flex;
    align-items: center;
    gap: 2px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 14px;
    font-size: 0.875em;
    font-weight: 500;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    white-space: nowrap;
    border: none;
    background: none;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
}
.nav-link:hover { color: var(--color-text); background: var(--color-border-light); }
.nav-link.active { color: var(--color-primary); background: var(--color-primary-light); font-weight: 600; }

.nav-admin { color: var(--color-warning); }
.nav-admin:hover { color: var(--color-warning); background: var(--color-warning-light); }
.nav-admin.active { color: var(--color-warning); background: var(--color-warning-light); }

.nav-btn {
    background: var(--color-primary);
    color: #fff !important;
    padding: 7px 18px;
    font-weight: 600;
}
.nav-btn:hover { background: var(--color-primary-hover); color: #fff !important; }

.nav-btn-outline {
    background: transparent;
    color: var(--color-text-secondary) !important;
    border: 1px solid var(--color-border);
}
.nav-btn-outline:hover { background: var(--color-border-light); color: var(--color-text) !important; }

.nav-divider {
    width: 1px;
    height: 24px;
    background: var(--color-border);
    margin: 0 6px;
}

.nav-lang {
    display: flex;
    gap: 2px;
    padding: 2px;
    background: var(--color-border-light);
    border-radius: var(--radius-sm);
}
.nav-lang a {
    padding: 4px 8px;
    font-size: 0.75em;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: 4px;
    transition: all 0.15s;
    text-decoration: none;
}
.nav-lang a:hover { color: var(--color-text); }
.nav-lang a.active { background: var(--color-surface); color: var(--color-primary); box-shadow: var(--shadow-sm); }

/* Dropdown */
.nav-dropdown { position: relative; }

.dropdown-arrow { transition: transform 0.2s; margin-left: 2px; }

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 4px;
    z-index: 100;
}
.nav-dropdown-menu a {
    display: block;
    padding: 8px 14px;
    font-size: 0.875em;
    color: var(--color-text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    text-decoration: none;
}
.nav-dropdown-menu a:hover { background: var(--color-border-light); color: var(--color-text); }
.nav-dropdown-menu a.active { color: var(--color-primary); background: var(--color-primary-light); }

.nav-dropdown:hover .nav-dropdown-menu { display: block; }
.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }
.nav-dropdown:hover > .nav-dropdown-toggle { color: var(--color-text); background: var(--color-border-light); }

/* ============================================
   Responsive Navigation
   ============================================ */
@media (max-width: 1024px) {
    .menu-toggle { display: flex; }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        box-shadow: var(--shadow-lg);
        flex-direction: column;
        padding: 12px 16px;
        gap: 2px;
    }
    .nav.open { display: flex; }

    .nav-link { width: 100%; justify-content: flex-start; padding: 10px 14px; }
    .nav-btn { text-align: center; justify-content: center; }

    .nav-divider { width: 100%; height: 1px; margin: 6px 0; }

    .nav-dropdown { width: 100%; }
    .nav-dropdown-toggle { width: 100%; justify-content: space-between; }

    .nav-dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 16px;
        min-width: unset;
    }
    .nav-dropdown.open .nav-dropdown-menu { display: block; }
    .nav-dropdown.open .dropdown-arrow { transform: rotate(180deg); }

    .nav-lang { align-self: flex-start; margin: 4px 0; }
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 24px;
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--color-primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0.875em;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.4;
}
.btn:hover { background: var(--color-primary-hover); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }

.btn-secondary { background: var(--color-border-light); color: var(--color-text); }
.btn-secondary:hover { background: var(--color-border); color: var(--color-text); }

.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #b91c1c; color: #fff; }

.btn-success { background: var(--color-success); }
.btn-success:hover { background: #047857; color: #fff; }

.btn-warning { background: var(--color-warning); }
.btn-warning:hover { background: #b45309; color: #fff; }

.btn-outline { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-outline:hover { background: var(--color-primary); color: #fff; }

.btn-small { padding: 5px 12px; font-size: 0.8em; border-radius: var(--radius-sm); }

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
    font-family: inherit;
    font-size: inherit;
}
.btn-text:hover { background: var(--color-border-light); }

.btn-icon { display: inline-flex; align-items: center; gap: 6px; }
.btn-nav { background: var(--color-primary); color: #fff !important; font-weight: 700; }
.btn-manage { background: var(--color-success); }
.btn-manage:hover { background: #047857; color: #fff; }

/* ============================================
   Alerts
   ============================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.875em;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: var(--color-success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: var(--color-danger-light); color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: var(--color-warning-light); color: #92400e; border: 1px solid #fde68a; }
.alert-info { background: var(--color-info-light); color: #1e40af; border: 1px solid #bfdbfe; }

/* ============================================
   Cards
   ============================================ */
.form-card {
    background: var(--color-surface);
    padding: 28px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-top: 20px;
}

.stat-card {
    background: var(--color-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-card h3 {
    font-size: 0.8em;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}
.stat-card.border-blue { border-left: 3px solid var(--color-primary); }
.stat-card.border-green { border-left: 3px solid var(--color-success); }
.stat-card.border-yellow { border-left: 3px solid var(--color-warning); }
.stat-card.border-purple { border-left: 3px solid #7c3aed; }
.stat-card.border-red { border-left: 3px solid var(--color-danger); }

.stat-value { font-size: 2em; color: var(--color-text); font-weight: 700; line-height: 1.2; }
.stat-subtext { font-size: 0.8em; color: var(--color-text-muted); margin-top: 4px; }
.stat-alert { font-size: 0.85em; color: var(--color-danger); font-weight: 600; margin-top: 6px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

/* ============================================
   Tabs
   ============================================ */
.dashboard-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.dashboard-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
    padding: 10px 18px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875em;
    color: var(--color-text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    font-weight: 500;
    white-space: nowrap;
    margin-bottom: -1px;
    font-family: inherit;
}
.tab-btn:hover { color: var(--color-primary); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); font-weight: 600; }

.tab-content { display: none; animation: fadeIn 0.2s ease; }
.tab-content.active { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 20px; }
.form-label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: var(--color-text);
    font-size: 0.875em;
}

.form-input, .form-select {
    width: 100%;
    padding: 9px 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875em;
    transition: border-color 0.15s, box-shadow 0.15s;
    background: var(--color-surface);
    color: var(--color-text);
    font-family: inherit;
}
.form-input:focus, .form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-inline { display: flex; gap: 10px; flex-wrap: wrap; }

.form-textarea {
    min-height: 220px;
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875em;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* ============================================
   Tables
   ============================================ */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    min-width: 600px;
}
.data-table th {
    background: var(--color-bg);
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.875em;
    color: var(--color-text);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--color-bg); }

/* Status Badges */
.status-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
    display: inline-block;
}
.status-completed { background: var(--color-success-light); color: #065f46; }
.status-pending { background: var(--color-warning-light); color: #92400e; }
.status-sending { background: var(--color-info-light); color: #1e40af; }
.status-failed { background: var(--color-danger-light); color: #991b1b; }
.status-paused { background: #fff7ed; color: #9a3412; }
.status-draft { background: var(--color-border-light); color: var(--color-text-secondary); }

/* ============================================
   Plan Card
   ============================================ */
.plan-card {
    background: var(--color-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    position: relative;
    overflow: hidden;
}
.plan-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-primary);
    color: #fff;
    padding: 5px 16px;
    border-bottom-left-radius: var(--radius-md);
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.plan-title { color: var(--color-text-muted); font-size: 0.8em; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }
.plan-name { font-size: 1.6em; color: var(--color-text); font-weight: 700; margin: 8px 0; }
.plan-renewal {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--color-border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ============================================
   Progress Bar
   ============================================ */
.progress-container { background: var(--color-border-light); height: 6px; border-radius: 3px; margin-top: 10px; overflow: hidden; }
.progress-fill { background: var(--color-primary); height: 100%; border-radius: 3px; transition: width 0.5s ease; }

/* ============================================
   API Box
   ============================================ */
.api-box {
    background: var(--color-bg);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.api-code {
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.85em;
    color: var(--color-text);
    flex-grow: 1;
    word-break: break-all;
}

/* ============================================
   Campaign Editor
   ============================================ */
.editor-tabs { display: flex; gap: 2px; }
.editor-tab {
    padding: 8px 16px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-bottom: none;
    cursor: pointer;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: all 0.15s;
    font-family: inherit;
}
.editor-tab.active {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-surface);
    color: var(--color-primary);
    font-weight: 600;
    margin-bottom: -1px;
    z-index: 1;
}

.editor-container {
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
}
.editor-toolbar {
    padding: 8px 12px;
    border-bottom: 1px solid var(--color-border-light);
    background: var(--color-bg);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    align-items: center;
}
.editor-toolbar button {
    padding: 5px 10px;
    cursor: pointer;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    font-size: 0.85em;
    transition: all 0.15s;
    color: var(--color-text);
    font-family: inherit;
}
.editor-toolbar button:hover { background: var(--color-border-light); border-color: var(--color-text-muted); }

.editor-toolbar select {
    padding: 4px 8px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    font-size: 0.82em;
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    height: 30px;
}
.editor-toolbar select:hover { border-color: var(--color-text-muted); }
.editor-toolbar select:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary-light); }

.editor-toolbar input[type="color"] {
    width: 28px;
    height: 28px;
    padding: 1px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.15s;
}
.editor-toolbar input[type="color"]:hover { border-color: var(--color-text-muted); }

.editor-toolbar .toolbar-group {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.visual-content {
    padding: 16px;
    min-height: 250px;
    outline: none;
    overflow-y: auto;
    max-height: 500px;
    line-height: 1.7;
}
.visual-content img { max-width: 100%; height: auto; cursor: pointer; }
.visual-content img:hover { outline: 2px solid var(--color-primary); }

.separator { color: var(--color-border); margin: 0 4px; align-self: center; }

/* ============================================
   Preview Panel
   ============================================ */
.preview-panel {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.preview-header {
    background: var(--color-border-light);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-bottom: 1px solid var(--color-border);
}
.preview-dot { width: 10px; height: 10px; border-radius: 50%; }
.preview-body { padding: 24px; background: var(--color-surface); min-height: 300px; max-height: 500px; overflow-y: auto; }

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}
.modal-content {
    background: var(--color-surface);
    padding: 28px;
    border-radius: var(--radius-xl);
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    max-height: 90vh;
    overflow-y: auto;
}
.modal-content.modal-large { max-width: 900px; }

/* ============================================
   Sender Items
   ============================================ */
.sender-item {
    background: var(--color-surface);
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.15s;
}
.sender-item:hover { border-color: var(--color-primary); }

/* ============================================
   List Cards
   ============================================ */
.list-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 12px;
    transition: border-color 0.15s;
}
.list-card:hover { border-color: var(--color-primary); }
.list-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.list-card-meta { display: flex; gap: 16px; flex-wrap: wrap; }
.list-card-meta span { font-size: 0.8em; color: var(--color-text-secondary); }
.list-category-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.7em;
    font-weight: 600;
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ============================================
   Pricing Grid
   ============================================ */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.plan-card-pricing {
    background: var(--color-surface);
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.2s;
    position: relative;
    border: 1px solid var(--color-border);
}
.plan-card-pricing:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.plan-card-pricing.featured { border: 2px solid var(--color-primary); }
.plan-card-pricing.active-plan {
    border: 2px solid var(--color-success) !important;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.1), var(--shadow-md);
}

.badge-popular {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-primary);
    color: #fff;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.7em;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.price-large { font-size: 2.8em; font-weight: 700; margin: 16px 0; color: var(--color-text); }
.price-large small { font-size: 0.35em; color: var(--color-text-muted); font-weight: 400; }
.price-display { min-height: 80px; }
.price-monthly { display: none; }
.price-yearly { display: block; }

.plan-features { list-style: none; margin: 20px 0; text-align: left; }
.plan-features li {
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.875em;
    color: var(--color-text);
}
.plan-features li:last-child { border-bottom: none; }
.plan-features li:before { content: "\2713 "; color: var(--color-success); font-weight: 700; margin-right: 8px; }

/* ============================================
   Toggle Switch (Billing)
   ============================================ */
.toggle-container { text-align: center; margin-bottom: 36px; }
.toggle-wrapper {
    display: inline-flex;
    background: var(--color-border-light);
    padding: 3px;
    border-radius: 30px;
    position: relative;
    border: 1px solid var(--color-border);
}
.toggle-bg {
    position: absolute;
    left: 3px; top: 3px;
    width: 50%;
    height: calc(100% - 6px);
    background: var(--color-surface);
    border-radius: 25px;
    transition: all 0.3s;
    box-shadow: var(--shadow-sm);
}
.toggle-btn {
    position: relative;
    z-index: 1;
    border: none;
    background: none;
    padding: 8px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: color 0.2s;
    font-size: 0.875em;
    font-family: inherit;
}

/* ============================================
   Calculator / Top-up
   ============================================ */
.calculator-box {
    background: var(--color-surface);
    padding: 40px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    border: 1px solid var(--color-border);
}

.range-slider {
    width: 100%;
    height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
    margin: 24px 0;
    -webkit-appearance: none;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.3);
}

.calc-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    background: var(--color-bg);
    padding: 16px 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

.savings-badge {
    background: var(--color-success-light);
    color: #065f46;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.8em;
    font-weight: 600;
    display: none;
}

/* ============================================
   Quick Actions
   ============================================ */
.quick-actions {
    background: var(--color-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

/* ============================================
   Admin Styles
   ============================================ */
.admin-header { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--color-border); }
.admin-header h1 { font-size: 1.6em; color: var(--color-text); margin-bottom: 4px; }
.admin-header p { color: var(--color-text-secondary); font-size: 0.875em; }

.admin-setting-group {
    background: var(--color-surface);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    margin-bottom: 16px;
}
.admin-setting-group h3 {
    font-size: 1em;
    color: var(--color-text);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-border-light);
}

/* ============================================
   Search Box
   ============================================ */
.search-box { position: relative; }
.search-box .form-input { padding-left: 36px; }

.search-results-dropdown {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    display: none;
}
.search-results-dropdown.active { display: block; }
.search-result-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border-light);
    transition: background 0.15s;
    font-size: 0.875em;
}
.search-result-item:hover { background: var(--color-bg); }
.search-result-item:last-child { border-bottom: none; }

/* ============================================
   Statistics / Charts
   ============================================ */
.stat-chart-card {
    background: var(--color-surface);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}
.stat-chart-card h3 { font-size: 0.95em; color: var(--color-text); margin-bottom: 14px; font-weight: 600; }

.stat-inline { display: flex; align-items: baseline; gap: 8px; }
.stat-inline .stat-value { font-size: 1.5em; }
.stat-inline .stat-unit { font-size: 0.85em; color: var(--color-text-muted); }

/* Statistics overview grid */
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}
@media (max-width: 768px) {
    .stats-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Statistics charts grid */
.stats-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* Campaign performance - mobile cards */
.campaign-perf-list { display: none; }
.campaign-perf-table { display: block; }

@media (max-width: 768px) {
    .campaign-perf-table { display: none !important; }
    .campaign-perf-list { display: block !important; }
}

.campaign-card-item {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
}

.campaign-card-item .campaign-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.campaign-card-item .campaign-card-header h4 {
    font-size: 0.95em;
    margin: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-card-item .campaign-card-details {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.campaign-card-item.open .campaign-card-details {
    display: block;
}

.campaign-card-item .campaign-card-details .stat-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.9em;
}

.campaign-card-item .campaign-card-details .stat-row .label {
    color: #6b7280;
}

.campaign-card-item .toggle-icon {
    transition: transform 0.2s;
    font-size: 0.8em;
    color: #9ca3af;
}

.campaign-card-item.open .toggle-icon {
    transform: rotate(180deg);
}

/* Campaign card summary stats row */
.campaign-card-summary {
    display: flex;
    gap: 12px;
    margin-top: 6px;
    flex-wrap: wrap;
}

/* Campaign detail button wrapper */
.campaign-detail-btn-wrapper {
    margin-top: 12px;
    text-align: center;
}

/* Unsubscribe comments list */
.unsub-comments-list {
    display: grid;
    gap: 12px;
}

/* Unsubscribe comment card */
.unsub-comment-card {
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}
.unsub-comment-card p { margin-bottom: 4px; }

/* Progress bar inline (for table cells) */
.progress-inline {
    width: 80px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
}

/* Modal header flex layout */
.modal-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* Modal body scrollable */
.modal-body-scroll {
    max-height: 70vh;
    overflow-y: auto;
}

/* Stat card with centered text */
.stat-card-centered { text-align: center; }
.stat-card-centered .stat-value { font-size: 2.5em; }
.stat-card-centered .stat-value.color-primary { color: #667eea; }
.stat-card-centered .stat-value.color-success { color: #28a745; }
.stat-card-centered .stat-value.color-warning { color: #ffc107; }

/* Affiliate how-it-works box */
.affiliate-how-works {
    margin-top: 40px;
    background: #e9ecef;
    padding: 20px;
    border-radius: 8px;
}
.affiliate-how-works ul {
    margin-left: 20px;
    margin-top: 10px;
}

/* Form input readonly background */
.form-input-readonly { background: #f8f9fa; }

/* Campaign stat badges */
.campaign-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 600;
}
.campaign-stat.opens { background: var(--color-info-light); color: #1e40af; }
.campaign-stat.clicks { background: var(--color-success-light); color: #166534; }
.campaign-stat.failed { background: var(--color-danger-light); color: #991b1b; }

/* ============================================
   Copy Link Box
   ============================================ */
.copy-link-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--color-bg);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}
.copy-link-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: monospace;
    font-size: 0.85em;
    color: var(--color-text);
    outline: none;
}

/* ============================================
   Invoices / Receipts
   ============================================ */
.invoice-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.7em;
    font-weight: 600;
}
.invoice-paid { background: var(--color-success-light); color: #065f46; }
.invoice-pending { background: var(--color-warning-light); color: #92400e; }
.invoice-overdue { background: var(--color-danger-light); color: #991b1b; }

/* ============================================
   Empty State
   ============================================ */
.empty-state { text-align: center; padding: 48px 24px; color: var(--color-text-muted); }
.empty-state-icon { font-size: 3em; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { color: var(--color-text-secondary); margin-bottom: 8px; }
.empty-state p { font-size: 0.875em; max-width: 400px; margin: 0 auto; }

/* ============================================
   Color & Text Utilities
   ============================================ */
.text-green { color: var(--color-success); }
.text-orange { color: var(--color-warning); }
.text-red { color: var(--color-danger); }
.text-blue { color: var(--color-info); }
.text-purple { color: #7c3aed; }
.text-muted { color: var(--color-text-muted); }
.text-small { font-size: 0.8em; }
.text-right { text-align: right; font-weight: 600; }

/* Spacing */
.mb-10 { margin-bottom: 10px; }
.mb-15 { margin-bottom: 15px; }
.mb-20 { margin-bottom: 20px; }
.mb-30 { margin-bottom: 30px; }
.mb-40 { margin-bottom: 40px; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }

/* Section Title */
.section-title { margin-bottom: 14px; font-size: 1.1em; color: var(--color-text); font-weight: 600; }

/* ============================================
   Homepage Hero (index.php)
   ============================================ */
.hero {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 50%, #f5f3ff 100%);
    padding: 80px 24px;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}
.hero h1 { font-size: 3em; font-weight: 800; color: var(--color-text); line-height: 1.15; margin-bottom: 16px; letter-spacing: -0.5px; }
.hero .hero-tagline { font-size: 1.2em; color: var(--color-primary); font-weight: 600; margin-bottom: 8px; }
.hero .hero-subtitle { font-size: 1.05em; color: var(--color-text-secondary); margin-bottom: 32px; max-width: 500px; margin-left: auto; margin-right: auto; }
.hero .btn { padding: 14px 32px; font-size: 1em; }

.features-section { padding: 64px 24px; max-width: 1200px; margin: 0 auto; }
.features-section h2 { text-align: center; font-size: 2em; margin-bottom: 8px; color: var(--color-text); }
.features-section .subtitle { text-align: center; color: var(--color-text-secondary); margin-bottom: 48px; }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

.feature-card {
    padding: 28px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    transition: all 0.2s;
}
.feature-card:hover { border-color: var(--color-primary-50); box-shadow: var(--shadow-md); }
.feature-card .icon { font-size: 2em; margin-bottom: 12px; }
.feature-card h3 { font-size: 1.1em; margin-bottom: 8px; color: var(--color-text); }
.feature-card p { font-size: 0.9em; color: var(--color-text-secondary); line-height: 1.6; }

/* ============================================
   Auth Pages (Login/Register)
   ============================================ */
.auth-page { min-height: calc(100vh - 60px); display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--color-bg); }
.auth-card {
    background: var(--color-surface);
    padding: 36px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    max-width: 420px;
    width: 100%;
}
.auth-card h1 { font-size: 1.4em; margin-bottom: 6px; color: var(--color-text); }
.auth-card .auth-subtitle { color: var(--color-text-secondary); font-size: 0.9em; margin-bottom: 24px; }

.register-features {
    background: var(--color-primary-light);
    border: 1px solid rgba(79, 70, 229, 0.15);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 24px;
}
.register-features-title {
    font-weight: 600;
    font-size: 0.9em;
    color: var(--color-primary);
    margin-bottom: 8px;
}
.register-features-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.register-features-list li {
    font-size: 0.85em;
    color: var(--color-text);
    padding: 3px 0;
}
.register-features-list li:before {
    content: "\2713";
    color: var(--color-success);
    font-weight: 700;
    margin-right: 8px;
}

.checkbox-group { margin-bottom: 10px; }
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
    gap: 8px;
}
.checkbox-label input[type="checkbox"] { width: auto; margin-top: 4px; }
.checkbox-label a { color: var(--color-primary); }

.btn-full { width: 100%; margin-bottom: 16px; }
.text-center { text-align: center; }
.mt-15 { margin-top: 15px; }

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    padding: 32px 24px;
    margin-top: 48px;
    text-align: center;
    font-size: 0.85em;
    color: var(--color-text-muted);
}
.site-footer a { color: var(--color-text-secondary); }
.site-footer a:hover { color: var(--color-primary); }

/* ============================================
   Affiliate Page
   ============================================ */
.affiliate-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0; }

/* Embedded mode */
.embedded-mode body { background: transparent; padding-top: 0; }
.embedded-mode .container { margin-top: 0; }

/* ============================================
   Template Items
   ============================================ */
.template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .hero { padding: 48px 20px; }
    .hero h1 { font-size: 2em; }

    .stats-grid { grid-template-columns: 1fr !important; }
    .form-grid { grid-template-columns: 1fr !important; }
    .pricing-grid { grid-template-columns: 1fr !important; }
    .features-grid { grid-template-columns: 1fr !important; }
    .affiliate-stats { grid-template-columns: 1fr; }

    .calc-stats {
        flex-direction: column;
        gap: 12px;
        text-align: center !important;
    }
    .calc-stats > div { text-align: center !important; }

    .container { padding: 0 16px; margin: 20px auto; }
    .form-card { padding: 20px; }
}

/* ============================================
   Backwards compatibility (old class names)
   ============================================ */
.header { background: var(--color-surface); border-bottom: 1px solid var(--color-border); position: sticky; top: 0; z-index: 1000; }
.header-content { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; height: 60px; }
.nav-links { display: flex; gap: 2px; align-items: center; }
.nav-links a { display: inline-flex; align-items: center; padding: 7px 14px; font-size: 0.875em; font-weight: 500; color: var(--color-text-secondary); border-radius: var(--radius-sm); transition: all 0.15s; white-space: nowrap; text-decoration: none; }
.nav-links a:hover { color: var(--color-text); background: var(--color-border-light); }
.nav-links a.active { color: var(--color-primary); background: var(--color-primary-light); font-weight: 600; }
.hamburger { display: none; background: none; border: none; font-size: 1.5em; cursor: pointer; padding: 8px; border-radius: var(--radius-sm); color: var(--color-text); }
.hamburger:hover { background: var(--color-border-light); }
.btn-login, .btn-logout { background: var(--color-primary) !important; color: #fff !important; font-weight: 600 !important; border-radius: var(--radius-md) !important; }
.btn-login:hover, .btn-logout:hover { background: var(--color-primary-hover) !important; }
.lang-switch { display: flex; gap: 2px; margin-left: 8px; }
.lang-switch a { font-size: 0.75em; opacity: 0.6; transition: opacity 0.15s; text-decoration: none; }
.lang-switch a:hover, .lang-switch a.active { opacity: 1; }

@media (max-width: 1024px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        padding: 12px 16px;
        gap: 2px;
        box-shadow: var(--shadow-lg);
    }
    .nav-links.active { display: flex; }
    .hamburger { display: block; }
    .nav-links a { width: 100%; text-align: center; padding: 10px; }
}

.mobile-only { display: none; }
.desktop-only { display: block; }
@media (max-width: 768px) {
    .mobile-only { display: block; }
    .desktop-only { display: none; }
}

/* ============================================
   Content Pages (Terms, AUP, Documentation)
   ============================================ */
.content-page {
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
}

.content-page h1 {
    margin-bottom: 16px;
}

.content-page h2 {
    margin-top: 32px;
    margin-bottom: 12px;
}

.content-page h3 {
    margin-top: 20px;
    margin-bottom: 8px;
}

.content-page p {
    margin-bottom: 12px;
}

.content-page ul, .content-page ol {
    margin: 12px 0;
    padding-left: 24px;
}

.content-page li {
    margin-bottom: 4px;
}

.content-page ol {
    line-height: 2;
    margin: 20px 0;
}

.content-subtitle {
    color: var(--color-text-secondary);
    margin-bottom: 40px;
}

.content-divider {
    border: 0;
    border-top: 1px solid var(--color-border);
    margin: 40px 0;
}

/* Issue cards for documentation */
.issue-card {
    padding: 20px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

.issue-card-error {
    background: #fff5f5;
}

.issue-card-error h3 {
    color: #e53e3e;
    margin-bottom: 10px;
}

.issue-card-warning {
    background: #fffaf0;
}

.issue-card-warning h3 {
    color: #dd6b20;
    margin-bottom: 10px;
}

.issue-card-info {
    background: #f7fafc;
}

.issue-card-info h3 {
    color: #4a5568;
    margin-bottom: 10px;
}

.affiliate-highlight {
    background: #f0fff4;
    padding: 20px;
    border-radius: var(--radius-md);
}

.affiliate-highlight h3 {
    color: #2f855a;
    margin-bottom: 15px;
}

.affiliate-highlight ul {
    line-height: 1.8;
}

/* Contact form */
.contact-card {
    max-width: 600px;
    margin: 40px auto;
}

/* Footer CTA */
.content-cta {
    text-align: center;
    margin-top: 60px;
}

.content-cta .btn + .btn {
    margin-left: 10px;
}

/* ============================================
   Buy Page Specific
   ============================================ */
.buy-balance {
    text-align: center;
    padding: 28px;
}

.buy-balance .stat-value {
    font-size: 2.5em;
}

.buy-header {
    text-align: center;
    margin-bottom: 32px;
}

.buy-save-badge {
    font-size: 0.8em;
    color: #059669;
    margin-left: 5px;
}

.plan-title {
    font-size: 1.5em;
    margin-bottom: 8px;
}

.plan-card-pro-bg {
    background: linear-gradient(to bottom right, #fff, #faf5ff);
}

.price-starter { color: #667eea; }
.price-pro { color: #764ba2; }

.btn-pro {
    background: #764ba2;
    color: #fff;
}

.btn-pro:hover {
    background: #633d8b;
    color: #fff;
}

.debrand-box {
    text-align: left;
    background: var(--color-bg);
    padding: 12px;
    border-radius: var(--radius-md);
}

.debrand-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    color: var(--color-text-muted);
    font-size: 0.8em;
}

.calc-stats-left {
    text-align: left;
}

.calc-stats-right {
    text-align: right;
}

/* ============================================
   Modal Improvements
   ============================================ */
.modal-content-sm {
    max-width: 500px;
    text-align: left;
}

.modal-content-md {
    max-width: 600px;
}

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

.modal-section {
    border-top: 1px solid var(--color-border);
    padding-top: 16px;
}

.modal-section h3 {
    font-size: 1em;
    margin-bottom: 12px;
}

.plan-change-grid {
    display: grid;
    gap: 8px;
}

.plan-change-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
}

/* ============================================
   Receipts Mobile Cards
   ============================================ */
.receipt-mobile-card {
    margin-bottom: 12px;
    padding: 16px;
}

.receipt-mobile-card.pending {
    border-left: 4px solid #f59e0b;
}

.receipt-mobile-card.paid {
    border-left: 4px solid #10b981;
    cursor: pointer;
}

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

.receipt-card-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

/* ============================================
   Receipt Detail Modal Rows
   ============================================ */
.receipt-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.receipt-detail-row .value {
    font-weight: 600;
}

.receipt-detail-grid {
    display: grid;
    gap: 12px;
}

/* ============================================
   Pricing Page
   ============================================ */
.pricing-header {
    text-align: center;
    margin-bottom: 40px;
}

.pricing-header h1 {
    font-size: 2.5em;
    margin-bottom: 12px;
}

.pricing-header p {
    font-size: 1.1em;
    color: var(--color-text-secondary);
}

/* ============================================
   Modal Actions Row
   ============================================ */
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Captcha input */
.captcha-input {
    width: 100px;
}

/* Issues grid */
.issues-grid {
    display: grid;
    gap: 20px;
}

/* Textarea height */
.form-textarea-tall {
    height: 150px;
}
