/* ==========================================
   AGENTE A — Design System
   Paleta: Dark Mode Premium (Linear/Vercel style)
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* === TOKENS === */
:root {
    --bg: #f8fafc;
    --bg-surface: #ffffff;
    --bg-elevated: #ffffff;
    --bg-hover: #f1f5f9;
    --bg-active: #e2e8f0;

    --primary: #ffffff;
    --secondary: #f8fafc;
    --accent: #e2e8f0;
    --highlight: #e94560;
    --highlight-hover: #d13350;

    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --border-focus: #cbd5e1;

    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    --success: #059669;
    --success-bg: rgba(5, 150, 105, 0.1);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.1);
    --error: #dc2626;
    --error-bg: rgba(220, 38, 38, 0.1);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.1);

    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.03);
    --shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.08), 0 4px 8px -2px rgba(0,0,0,0.04);
    --shadow-glow: 0 0 20px rgba(233, 69, 96, 0.15);

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);

    --sidebar-width: 260px;
    --sidebar-collapsed: 68px;
    --topbar-height: 64px;
}

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

html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* === LAYOUT === */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: width var(--transition-slow);
    backdrop-filter: blur(20px);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
}

.sidebar-logo {
    width: 32px;
    height: 32px;
    background: var(--highlight);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.sidebar-brand {
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
}

.sidebar-brand span {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 11px;
    margin-left: 6px;
    background: var(--bg-active);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.sidebar.collapsed .sidebar-brand,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-badge,
.sidebar.collapsed .sidebar-footer-info { display: none; }

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    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(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar.collapsed .nav-section-title { text-align: center; padding: 0; font-size: 0; }
.sidebar.collapsed .nav-section-title::after { content: '•'; font-size: 11px; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    position: relative;
    user-select: none;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text);
}

.nav-item.active {
    background: var(--bg-active);
    color: var(--text);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--highlight);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.nav-badge {
    margin-left: auto;
    background: var(--highlight);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    min-width: 18px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-footer-info { flex: 1; min-width: 0; }
.sidebar-footer-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer-email { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.sidebar-toggle:hover { color: var(--text); background: var(--bg-hover); }

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    transition: margin-left var(--transition-slow);
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-collapsed); }

.topbar {
    height: var(--topbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(20px);
}

.topbar-search {
    flex: 1;
    max-width: 400px;
    position: relative;
}

.topbar-search input {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px 8px 36px;
    color: var(--text);
    font-size: 13px;
    transition: all var(--transition);
}

.topbar-search input:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
}

.topbar-search input::placeholder { color: var(--text-muted); }

.topbar-search::before {
    content: '🔍';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topbar-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition);
    font-size: 16px;
    position: relative;
}

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

.topbar-btn .dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    background: var(--highlight);
    border-radius: 50%;
}

.page-content { padding: 24px; max-width: 1280px; margin: 0 auto; }

/* === PAGE HEADER === */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.page-actions { display: flex; gap: 8px; align-items: center; }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border: 1px solid transparent;
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--highlight);
    color: white;
    border-color: var(--highlight);
}
.btn-primary:hover { background: var(--highlight-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow); }

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

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

.btn-danger {
    background: var(--error-bg);
    color: var(--error);
    border-color: transparent;
}
.btn-danger:hover { background: var(--error); color: white; }

.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-icon { padding: 8px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* === CARDS === */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition);
}

.card:hover { border-color: var(--border-light); }
.card-clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); cursor: pointer; }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title { font-size: 15px; font-weight: 600; }
.card-description { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.card-body { }
.card-footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* === STAT CARDS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}

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

.stat-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.stat-card-icon.blue { background: var(--info-bg); }
.stat-card-icon.green { background: var(--success-bg); }
.stat-card-icon.yellow { background: var(--warning-bg); }
.stat-card-icon.red { background: var(--error-bg); }

.stat-card-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card-value { font-size: 28px; font-weight: 700; margin: 4px 0; }
.stat-card-change { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.stat-card-change.positive { color: var(--success); }
.stat-card-change.negative { color: var(--error); }

/* === FORMS === */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: 13px;
    transition: all var(--transition);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--highlight);
    box-shadow: 0 0 0 3px rgba(233, 69, 96, 0.08);
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-muted); }

.form-textarea { min-height: 100px; resize: vertical; }
.form-input.mono, .form-textarea.mono { font-family: var(--font-mono); font-size: 12px; }

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%235c5c78'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 36px;
    cursor: pointer;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-color {
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-color input[type="color"] {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    padding: 2px;
    background: var(--bg);
}

/* Toggle Switch */
.toggle-wrapper { display: flex; align-items: center; gap: 10px; }

.toggle {
    position: relative;
    width: 40px;
    height: 22px;
    background: var(--border-light);
    border-radius: 11px;
    cursor: pointer;
    transition: all var(--transition);
}

.toggle.active { background: var(--highlight); }

.toggle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: all var(--transition);
}

.toggle.active::after { left: 21px; }

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-neutral { background: var(--bg-active); color: var(--text-secondary); }

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}

.badge-dot.green { background: var(--success); }
.badge-dot.yellow { background: var(--warning); }
.badge-dot.red { background: var(--error); }

/* === TABLES === */
.table-wrapper { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }

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

th {
    text-align: left;
    padding: 10px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 12px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-hover); }

.table-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.table-empty-icon { font-size: 48px; margin-bottom: 12px; }
.table-empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 4px; }

/* === CLIENT CARDS GRID === */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.client-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    cursor: pointer;
    transition: all var(--transition);
}

.client-card:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.client-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.client-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--bg-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: var(--highlight);
    flex-shrink: 0;
    overflow: hidden;
}

.client-logo img { width: 100%; height: 100%; object-fit: cover; }

.client-name { font-size: 15px; font-weight: 600; }
.client-industry { font-size: 12px; color: var(--text-muted); }

.client-card-body { margin-bottom: 12px; }
.client-description { font-size: 12px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.client-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.client-stat { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.client-stat strong { color: var(--text); }

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
}

.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(20px) scale(0.95);
    transition: all var(--transition-slow);
    box-shadow: var(--shadow-lg);
}

.modal-overlay.active .modal { transform: translateY(0) scale(1); }

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title { font-size: 17px; font-weight: 600; }

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}
.modal-close:hover { color: var(--text); background: var(--bg-hover); }

.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* === TOAST === */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 300ms ease forwards;
    min-width: 280px;
}

.toast.success { border-left: 4px solid var(--success); background: #f0fdf4; }
.toast.error { border-left: 6px solid var(--error); background: #fef2f2; font-weight: 600; font-size: 14px; min-width: 320px; color: #991b1b; }
.toast.warning { border-left: 4px solid var(--warning); background: #fffbeb; }
.toast.info { border-left: 4px solid var(--info); background: #eff6ff; }

.toast.removing { animation: toastOut 200ms ease forwards; }

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

/* === SKELETON LOADER === */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-active) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 70%; }
.skeleton-title { height: 24px; width: 50%; margin-bottom: 16px; }
.skeleton-card { height: 140px; }
.skeleton-avatar { width: 44px; height: 44px; border-radius: var(--radius-lg); }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* === EMPTY STATE === */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 24px;
    text-align: center;
}

.empty-state-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.5; }
.empty-state-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.empty-state-description { font-size: 13px; color: var(--text-muted); max-width: 360px; margin-bottom: 20px; }

/* === TABS === */
.tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.tab {
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--highlight); }

/* === VIEW TOGGLE === */
.view-toggle {
    display: flex;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.view-toggle button {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 6px 10px;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 14px;
}

.view-toggle button.active { background: var(--bg-active); color: var(--text); }

/* === TOOLBAR === */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

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

.toolbar-search input {
    width: 100%;
    padding: 8px 12px 8px 34px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    font-size: 13px;
}

.toolbar-search input:focus { outline: none; border-color: var(--border-focus); }
.toolbar-search input::placeholder { color: var(--text-muted); }
.toolbar-search::before { content: '🔍'; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; }

/* === AUTH PAGE === */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 40px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo-icon {
    width: 56px;
    height: 56px;
    background: var(--highlight);
    border-radius: var(--radius-xl);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 12px;
}

.auth-logo h1 { font-size: 22px; font-weight: 700; }
.auth-logo p { font-size: 13px; color: var(--text-muted); margin-top: 4px; }

.auth-form .form-group { margin-bottom: 16px; }

.auth-submit {
    width: 100%;
    padding: 12px;
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

.auth-footer a { color: var(--highlight); font-weight: 500; }

/* === LOADING SPINNER === */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--highlight);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    flex-direction: column;
    gap: 16px;
}

.loading-overlay .spinner { width: 32px; height: 32px; }

/* === DROPDOWN MENU === */
.dropdown { position: relative; display: inline-block; }

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 4px;
    min-width: 160px;
    box-shadow: var(--shadow-lg);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all var(--transition);
}

.dropdown-menu.active { opacity: 1; visibility: visible; transform: translateY(0); }

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    font-size: 13px;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover { background: var(--bg-hover); }
.dropdown-item.danger { color: var(--error); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* === CODE BLOCK === */
.code-block {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-secondary);
    overflow-x: auto;
    position: relative;
    white-space: pre-wrap;
    word-break: break-all;
}

.code-block .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--bg-active);
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: all var(--transition);
}

.code-block .copy-btn:hover { background: var(--bg-hover); color: var(--text); }

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .sidebar.mobile-open { display: flex; width: 100%; z-index: 200; }
    .main-content { margin-left: 0 !important; }
    .form-row { grid-template-columns: 1fr; }
    .clients-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .page-content { padding: 16px; }
    .topbar { padding: 0 16px; }
    .mobile-menu-btn { display: flex !important; }
}

.mobile-menu-btn { display: none !important; }

/* === UTILS === */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-small { font-size: 12px; }
.text-mono { font-family: var(--font-mono); }
.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; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-center { align-items: center; justify-content: center; }
.flex-between { align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }
.w-full { width: 100%; }
