/* ============================================================
   Ideah - Sistema de Indicações | Estilos Globais
   ============================================================ */

:root {
    --primary: #FF6B35;
    --primary-dark: #E85A20;
    --primary-light: #FFB088;
    --secondary: #FFD23F;
    --gradient: linear-gradient(135deg, #FF6B35 0%, #FFD23F 100%);
    --success: #48bb78;
    --success-bg: #f0fff4;
    --warning: #ecc94b;
    --warning-bg: #fffff0;
    --danger: #f56565;
    --danger-bg: #fff5f5;
    --info: #4299e1;
    --info-bg: #ebf8ff;
    --dark: #2d3748;
    --gray-900: #1a202c;
    --gray-800: #2d3748;
    --gray-700: #4a5568;
    --gray-600: #718096;
    --gray-500: #a0aec0;
    --gray-400: #cbd5e0;
    --gray-300: #e2e8f0;
    --gray-200: #edf2f7;
    --gray-100: #f7fafc;
    --white: #ffffff;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 10px 15px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 20px 25px rgba(0,0,0,0.06);
    --transition: all 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--gray-900);
    color: var(--white);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header .logo {
    width: 40px; height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.sidebar-header h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-500);
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--gray-400);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--white);
}

.nav-item.active {
    background: rgba(255,107,53,0.15);    color: var(--primary-light);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.sidebar-footer .user-info:hover {
    background: rgba(255,255,255,0.06);
}

.sidebar-footer .user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

.sidebar-footer .user-name {
    font-size: 13px;
    font-weight: 600;
}

.sidebar-footer .user-role {
    font-size: 11px;
    color: var(--gray-500);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: margin 0.3s ease;
}

.page-header {
    background: var(--white);
    padding: 20px 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--gray-900);
}

.page-header .subtitle {
    font-size: 13px;
    color: var(--gray-600);
    margin-top: 2px;
}

.page-body {
    padding: 24px 32px;
}

/* ===== CARDS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card .stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 12px;
}

.stat-card .stat-icon.primary { background: rgba(255,107,53,0.12); color: var(--primary); }
.stat-card .stat-icon.success { background: rgba(72,187,120,0.12); color: var(--success); }
.stat-card .stat-icon.warning { background: rgba(236,201,75,0.12); color: var(--warning); }
.stat-card .stat-icon.danger { background: rgba(245,101,101,0.12); color: var(--danger); }
.stat-card .stat-icon.info { background: rgba(66,153,225,0.12); color: var(--info); }
.stat-card .stat-icon.secondary { background: rgba(118,75,162,0.12); color: var(--secondary); }

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--gray-600);
    font-weight: 500;
}

/* ===== CARD CONTAINERS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-900);
}

.card-body { padding: 24px; }
.card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== TABLES ===== */
.table-wrapper { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

table thead th {
    background: var(--gray-100);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-200);
    font-size: 14px;
    vertical-align: middle;
}

table tbody tr:hover {
    background: var(--gray-100);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ===== BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-primary { background: rgba(255,107,53,0.12); color: var(--primary-dark); }
.badge-success { background: var(--success-bg); color: #276749; }
.badge-warning { background: var(--warning-bg); color: #975a16; }
.badge-danger { background: var(--danger-bg); color: #c53030; }
.badge-info { background: var(--info-bg); color: #2b6cb0; }
.badge-secondary { background: var(--gray-200); color: var(--gray-700); }

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    font-family: inherit;
}

.btn i { font-size: 14px; }

.btn-primary {
    background: var(--gradient);
    color: var(--white);
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #38a169; }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #e53e3e; }

.btn-warning { background: var(--warning); color: var(--gray-900); }
.btn-warning:hover { background: #d69e2e; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: rgba(255,107,53,0.04); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-icon { padding: 8px; width: 36px; height: 36px; justify-content: center; }

.btn-group { display: flex; gap: 8px; }

/* ===== FORMS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--white);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}

.form-control::placeholder { color: var(--gray-400); }

.form-control.error { border-color: var(--danger); }
.form-control.success { border-color: var(--success); }

textarea.form-control { min-height: 100px; resize: vertical; }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234a5568' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.form-hint {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 4px;
}

.form-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 4px;
}

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .form-control {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.input-group .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

.modal-lg { max-width: 900px; }
.modal-xl { max-width: 1100px; }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 32px; height: 32px;
    border: none;
    background: var(--gray-100);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-600);
    transition: var(--transition);
}

.modal-close:hover { background: var(--gray-200); color: var(--gray-800); }

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 420px;
    animation: toastIn 0.3s ease;
    border-left: 4px solid var(--gray-400);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.info { border-left-color: var(--info); }

.toast i { font-size: 18px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--info); }

.toast .toast-msg { flex: 1; font-size: 14px; }
.toast .toast-close {
    background: none; border: none;
    color: var(--gray-400); cursor: pointer;
    padding: 4px; font-size: 16px;
}

@keyframes toastIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ===== SEARCH BAR ===== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-input-wrap {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-input-wrap input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
}

.search-input-wrap input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.15);
}

/* ===== PAGINATION ===== */
.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    width: 36px; height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: var(--white); border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* ===== TAB SYSTEM ===== */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--gray-200);
    margin-bottom: 20px;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-500);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
    font-family: inherit;
}

.tab-btn:hover { color: var(--gray-700); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== CHAT INTERFACE ===== */
.chat-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    height: calc(100vh - var(--header-height) - 48px);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--white);
}

.chat-contacts {
    border-right: 1px solid var(--gray-200);
    display: flex;
    flex-direction: column;
    background: var(--gray-100);
}

.chat-contacts-header {
    padding: 16px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--white);
}

.chat-contacts-list {
    flex: 1;
    overflow-y: auto;
}

.chat-contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--gray-200);
}

.chat-contact:hover { background: var(--white); }
.chat-contact.active { background: var(--white); border-left: 3px solid var(--primary); }

.chat-contact-avatar {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-contact-info { flex: 1; min-width: 0; }
.chat-contact-name { font-weight: 600; font-size: 14px; }
.chat-contact-preview {
    font-size: 12px;
    color: var(--gray-500);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-contact-time { font-size: 11px; color: var(--gray-500); }
.chat-contact-unread {
    background: var(--primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.chat-main {
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #e8eaf6;
}

.chat-msg {
    max-width: 65%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.chat-msg.incoming {
    background: var(--white);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.chat-msg.outgoing {
    background: #dcf8c6;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg.ia {
    background: #e8d5ff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg .msg-time {
    font-size: 11px;
    color: var(--gray-500);
    text-align: right;
    margin-top: 4px;
}

.chat-msg .msg-tag {
    font-size: 10px;
    font-weight: 600;
    color: var(--secondary);
    margin-bottom: 2px;
}

.chat-input-area {
    padding: 12px 20px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--gray-100);
}

.chat-input-area textarea {
    flex: 1;
    border: 1.5px solid var(--gray-300);
    border-radius: 20px;
    padding: 10px 16px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    max-height: 100px;
    outline: none;
    transition: var(--transition);
}

.chat-input-area textarea:focus { border-color: var(--primary); }

.chat-input-area .send-btn {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
    flex-shrink: 0;
}

.chat-input-area .send-btn:hover { opacity: 0.9; transform: scale(1.05); }

/* ===== EMAIL EDITOR ===== */
.email-editor {
    border: 1.5px solid var(--gray-300);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.email-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: var(--gray-100);
    border-bottom: 1px solid var(--gray-300);
    flex-wrap: wrap;
}

.email-toolbar button {
    width: 32px; height: 32px;
    border: none;
    background: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--gray-700);
    font-size: 14px;
    transition: var(--transition);
}

.email-toolbar button:hover { background: var(--gray-200); }
.email-toolbar button.active { background: var(--gray-300); color: var(--primary); }

.email-body {
    min-height: 300px;
    padding: 16px;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== TOGGLE ===== */
.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    display: inline-block;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--gray-300);
    border-radius: 13px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--white);
    top: 3px; left: 3px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider { background: var(--primary); }
.toggle input:checked + .toggle-slider::before { left: 25px; }

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 56px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h4 {
    color: var(--gray-600);
    font-size: 18px;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* ===== LOADING ===== */
.spinner {
    width: 36px; height: 36px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ===== DROPDOWN ===== */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    padding: 6px;
    z-index: 100;
    display: none;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 13px;
    color: var(--gray-700);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.dropdown-item:hover { background: var(--gray-100); }
.dropdown-item.danger { color: var(--danger); }

/* ===== MOBILE TOGGLE ===== */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 12px; left: 12px;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--gradient);
    color: white;
    border: none;
    box-shadow: var(--shadow-lg);
    font-size: 20px;
    cursor: pointer;
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .mobile-toggle { display: flex; }
    .page-header { padding: 16px 20px; padding-left: 64px; }
    .page-body { padding: 16px 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .chat-container { grid-template-columns: 1fr; }
    .chat-contacts { display: none; }
    .modal { width: 95%; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .stat-card { padding: 16px; }
    .page-header h2 { font-size: 18px; }
    .search-bar { flex-direction: column; }
    .search-input-wrap { min-width: 100%; }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 12px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hidden { display: none !important; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ===== LOGIN PAGE ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    padding: 40px;
}

.login-card .logo-area {
    text-align: center;
    margin-bottom: 32px;
}

.login-card .logo-area .logo-icon {
    width: 64px; height: 64px;
    background: var(--gradient);
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
}

.login-card .logo-area h2 {
    font-size: 24px;
    color: var(--gray-900);
}

.login-card .logo-area p {
    font-size: 14px;
    color: var(--gray-500);
    margin-top: 4px;
}

/* ===== SCHEDULER ===== */
.scheduler-card {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.scheduler-card:hover {
    border-color: var(--primary);
    background: rgba(255,107,53,0.03);
}

/* ===== CONFIG SECTIONS ===== */
.config-section {
    margin-bottom: 32px;
}

.config-section h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--gray-200);
}

/* ===== TIMELINE ===== */
.timeline {
    position: relative;
    padding-left: 28px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--white);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item.success::before { background: var(--success); box-shadow: 0 0 0 2px var(--success); }
.timeline-item.warning::before { background: var(--warning); box-shadow: 0 0 0 2px var(--warning); }
.timeline-item.danger::before { background: var(--danger); box-shadow: 0 0 0 2px var(--danger); }

.timeline-item .time { font-size: 12px; color: var(--gray-500); }
.timeline-item .content { font-size: 14px; color: var(--gray-700); }
