/* ===== ydeer Global Styles ===== */
:root {
    --bg: #fafaf8;
    --bg-warm: #f5f3ee;
    --bg-white: #ffffff;
    --text: #1a1a2e;
    --text-2: #6b7280;
    --text-3: #9ca3af;
    --accent: #6366f1;
    --accent-2: #8b5cf6;
    --accent-light: #eef2ff;
    --cyan: #06b6d4;
    --green: #10b981;
    --red: #ef4444;
    --orange: #f59e0b;
    --border: #e8e8e4;
    --border-2: #d4d4cf;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.08);
    --font: 'Inter', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }

/* Toast Notifications */
.toast {
    position: fixed; top: 20px; right: 20px; z-index: 9999;
    padding: 14px 20px; border-radius: var(--radius); font-size: 14px; font-weight: 500;
    box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease;
    display: flex; align-items: center; gap: 12px; max-width: 400px;
}
.toast button { background: none; border: none; font-size: 18px; cursor: pointer; opacity: 0.6; }
.toast-success { background: #ecfdf5; color: #065f46; border-left: 4px solid var(--green); }
.toast-error { background: #fef2f2; color: #991b1b; border-left: 4px solid var(--red); }

/* Alerts */
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: 14px; margin-bottom: 1rem; }
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border: none; border-radius: var(--radius);
    font-family: var(--font); font-size: 14px; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all 0.2s;
    line-height: 1.4;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.35); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-white { background: #fff; color: var(--accent); }
.btn-full { width: 100%; justify-content: center; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-icon { background: none; border: 1px solid var(--border); border-radius: 6px; width: 32px; height: 32px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.btn-icon:hover { border-color: var(--red); color: var(--red); }
.btn-group { display: flex; gap: 8px; align-items: center; }
.btn-upgrade { display: block; text-align: center; padding: 8px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; border-radius: var(--radius); font-size: 13px; font-weight: 600; text-decoration: none; margin-top: 8px; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 10px 14px; border: 1px solid var(--border);
    border-radius: 8px; font-family: var(--font); font-size: 14px;
    background: var(--bg-white); transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 1rem; font-size: 13px; color: var(--text-2); }
.form-check input { margin-top: 3px; }
.form-check a { color: var(--accent); }
.form-link { font-size: 12px; color: var(--accent); text-decoration: none; display: inline-block; margin-top: 4px; }
.form-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 1.5rem; }
.input-sm { padding: 6px 10px !important; font-size: 13px !important; }
.select-sm { padding: 4px 8px; font-size: 12px; border: 1px solid var(--border); border-radius: 6px; }
.text-muted { color: var(--text-2); }
.text-sm { font-size: 13px; }
.text-green { color: var(--green); }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Cards */
.card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); margin-bottom: 1.5rem; overflow: hidden; }
.card-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-header h3 { font-size: 16px; font-weight: 600; }
.card-body { padding: 20px; }
.card-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 12px; }
.card-link { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 500; }

/* Badges */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-draft { background: #f3f4f6; color: #6b7280; }
.badge-sent { background: #dbeafe; color: #1d4ed8; }
.badge-paid, .badge-active, .badge-succeeded, .badge-converted { background: #ecfdf5; color: #065f46; }
.badge-overdue, .badge-past_due, .badge-failed { background: #fef2f2; color: #991b1b; }
.badge-cancelled, .badge-lost { background: #f3f4f6; color: #9ca3af; }
.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-contacted { background: #fef3c7; color: #92400e; }
.badge-qualified { background: #ede9fe; color: #6d28d9; }
.badge-trial { background: #fef3c7; color: #92400e; }
.badge-solo { background: #dbeafe; color: #1d4ed8; }
.badge-pro { background: #ede9fe; color: #6d28d9; }
.badge-business { background: #ecfdf5; color: #065f46; }
.badge-source { background: #f3f4f6; color: #6b7280; }
.badge-unread { background: #fef3c7; color: #92400e; }
.badge-read { background: #f3f4f6; color: #6b7280; }
.badge-suspended { background: #fef2f2; color: #991b1b; }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 600; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px; font-size: 14px; border-bottom: 1px solid #f3f4f6; }
.data-table tr.clickable { cursor: pointer; }
.data-table tr.clickable:hover { background: #f9fafb; }
.data-table-compact td { padding: 8px 12px; font-size: 13px; }
.detail-row td { padding: 8px 12px; font-size: 13px; background: #fafafa; }

/* Filters */
.filters { display: flex; gap: 8px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-btn { padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--text-2); background: var(--bg-white); border: 1px solid var(--border); transition: all 0.2s; }
.filter-btn:hover, .filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Empty states */
.empty-state { text-align: center; padding: 2rem; color: var(--text-2); }
.empty-state p { margin-bottom: 1rem; }
.empty-state-large { text-align: center; padding: 4rem 2rem; }
.empty-state-large svg { margin-bottom: 1rem; }
.empty-state-large h3 { margin-bottom: 0.5rem; }
.empty-state-large p { color: var(--text-2); margin-bottom: 1.5rem; }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 768px) {
    .form-row { grid-template-columns: 1fr; }
    .filters { overflow-x: auto; flex-wrap: nowrap; }
}
