:root {
    --bg: #0b0e14;
    --card-bg: #151a21;
    --border: rgba(255, 255, 255, 0.08);
    --primary: #7b2cbf;
    --primary-glow: #7b2cbf33;
    --text: #ffffff;
    --text-dim: #94a3b8;
    --success: #25d366;
    --error: #ef4444;
    --warning: #facc15;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', system-ui, -apple-system, sans-serif; }

body {
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 240px;
    min-height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid var(--border);
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
}

.sidebar-brand {
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--primary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
    padding: 0 0.75rem;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-item {
    display: block;
    padding: 0.75rem;
    border-radius: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    transition: 0.2s;
}

.nav-item:hover {
    background: rgba(123, 44, 191, 0.1);
    color: var(--text);
}

.main-content {
    margin-left: 240px;
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 { font-size: 1.8rem; }
.header-actions { display: flex; gap: 0.5rem; }
.subtitle { color: var(--text-dim); font-size: 0.9rem; margin-top: 0.25rem; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card h3 { margin-bottom: 1rem; font-size: 1rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
}

.btn:hover { background: rgba(255, 255, 255, 0.05); }

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover { background: #6a25a8; }

.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.8rem; }

label { display: block; font-size: 0.75rem; color: var(--text-dim); margin-bottom: 0.5rem; text-transform: uppercase; }

input, select, textarea {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    padding: 0.75rem;
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

textarea { font-family: monospace; font-size: 0.85rem; resize: vertical; }

.test-result { margin-left: 0.5rem; font-size: 0.85rem; }
.preview-box {
    background: #000;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
}

.login-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    width: 380px;
    text-align: center;
}

.login-card h2 { margin-bottom: 0.5rem; }
.login-card p { color: var(--text-dim); margin-bottom: 2rem; }

.config-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.config-grid .card { grid-column: span 1; }
.config-grid .card:first-child { grid-column: span 2; }

.modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2rem;
    width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.close {
    float: right;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-dim);
}

.prompt-grid { display: flex; flex-direction: column; gap: 1rem; }
.stage-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }
.service-list { margin-top: 0.5rem; }
.service-item { font-size: 0.8rem; color: var(--text-dim); padding: 0.25rem 0; }

.status-container { display: flex; flex-direction: column; gap: 1rem; }
.client-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
}
.client-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.client-header h3 { font-size: 1.1rem; }
.badge { font-size: 0.8rem; padding: 0.25rem 0.75rem; border-radius: 20px; background: rgba(255,255,255,0.05); }
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}
.table th { text-align: left; color: var(--text-dim); padding: 0.5rem; border-bottom: 1px solid var(--border); }
.table td { padding: 0.5rem; border-bottom: 1px solid var(--border); }
.log-ok { }
.log-err { background: rgba(255,60,60,0.08); }
.log-err td:last-child { color: var(--error); }
.status-pending { color: var(--warning); }
.status-overdue { color: var(--error); }
.status-paid { color: var(--success); }
.client-actions { display: flex; gap: 0.5rem; }
.btn-danger { background: var(--error); border-color: var(--error); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #1da851; }

@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; padding: 1rem; }
    .config-grid { grid-template-columns: 1fr; }
}
