/*
 * Stil comun StudioDent — admin.php, chat.php, leads_panel.php.
 * Un singur fișier, ca aspectul să rămână coerent peste tot; fiecare pagină
 * adaugă doar câteva reguli proprii pentru layout-ul ei specific.
 */

:root {
    --teal: #0d9488;
    --teal-dark: #0f766e;
    --teal-light: #ccfbf1;
    --ink: #1f2937;
    --ink-soft: #6b7280;
    --bg: #f3f5f7;
    --card: #ffffff;
    --border: #e5e7eb;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--ink);
    margin: 0;
    line-height: 1.5;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { margin: 0 0 .5rem; font-weight: 600; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.05rem; }

p { margin: 0 0 .6rem; }

.hint { color: var(--ink-soft); font-size: .87rem; margin-bottom: 1rem; }

/* ---------- layout: sidebar + main ---------- */

.app { display: flex; min-height: 100vh; }

.sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #ffffff;
    border-right: 1px solid var(--border);
    padding: 1.2rem 0;
    position: sticky;
    top: 0;
    height: 100vh;
}

.sidebar .brand {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: 0 1.2rem 1rem;
    margin-bottom: .5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar .brand .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--teal);
}

.sidebar .brand strong { font-size: .95rem; }

.sidebar nav { display: flex; flex-direction: column; padding: .6rem 0; }

.sidebar nav a {
    color: var(--ink);
    padding: .6rem 1.2rem;
    font-size: .9rem;
    border-left: 3px solid transparent;
}

.sidebar nav a:hover { background: #f8fafc; text-decoration: none; }

.sidebar nav a.active {
    border-left-color: var(--teal);
    background: var(--teal-light);
    color: var(--teal-dark);
    font-weight: 600;
}

.sidebar .sidebar-footer {
    margin-top: auto;
    padding: 1rem 1.2rem 0;
    font-size: .78rem;
    color: var(--ink-soft);
}

.main { flex: 1; padding: 1.6rem 2rem; max-width: 1100px; }

/* ---------- cards / forms / buttons ---------- */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.3rem 1.4rem;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .3rem;
}

label { display: block; font-weight: 600; font-size: .85rem; margin: .8rem 0 .3rem; }

input[type=text], input[type=tel], input[type=datetime-local], textarea, select {
    width: 100%;
    padding: .55rem .7rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: .9rem;
    font-family: inherit;
    background: #fff;
    color: var(--ink);
}

textarea { min-height: 100px; resize: vertical; }
textarea.mono { font-family: 'Cascadia Code', Consolas, monospace; font-size: .82rem; min-height: 160px; }

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px var(--teal-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--ink);
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    margin: .8rem .5rem 0 0;
}

.btn:hover { background: #f8fafc; text-decoration: none; }
.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-danger { color: var(--danger); border-color: #fecaca; }
.btn-danger:hover { background: var(--danger-light); }
.btn-sm { padding: .3rem .6rem; font-size: .78rem; margin: 0; }

.msg-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #047857;
    padding: .7rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-size: .9rem;
}

/* ---------- tables ---------- */

table { border-collapse: collapse; width: 100%; font-size: .87rem; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--ink-soft); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .02em; }
tr:last-child td { border-bottom: none; }

.gol { color: var(--ink-soft); text-align: center; padding: 1.6rem; font-size: .9rem; }

/* ---------- badges ---------- */

.badge {
    display: inline-block;
    padding: .15rem .55rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-builtin { background: #eef2ff; color: #4338ca; }
.badge-custom { background: var(--teal-light); color: var(--teal-dark); }
.badge-active { background: #ecfdf5; color: #047857; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }

/* ---------- conversation bubbles (admin transcript view) ---------- */

.bubble-user, .bubble-assistant {
    max-width: 80%;
    padding: .6rem .8rem;
    border-radius: 10px;
    margin-bottom: .6rem;
    font-size: .88rem;
    white-space: pre-wrap;
}

.bubble-user { background: #eef2ff; margin-right: auto; }
.bubble-assistant { background: var(--teal-light); margin-left: auto; }

@media (max-width: 780px) {
    .app { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; }
    .main { padding: 1.2rem; }
}
