/* ==========================================================
   Devora Chat Assistant - Design System (Phase 1)
   Palette: "Signal" - a conversational, alert-toned system.
   Accent reads like a chat notification dot, not a generic
   AI-purple or terracotta default.
   ========================================================== */

:root {
    /* Core palette */
    --ink:        #12161C;   /* near-black, warmer than pure black */
    --slate-900:  #1A2029;
    --slate-800:  #232B37;
    --slate-700:  #364152;
    --slate-500:  #6B7688;
    --slate-300:  #C4CBD6;
    --slate-100:  #EDF0F4;
    --paper:      #F6F7FA;
    --white:      #FFFFFF;

    /* Signal accent - a warm coral-red, like an unread badge */
    --signal:      #FF5A5F;
    --signal-dark: #E6484D;
    --signal-tint: #FFF0EF;

    /* Secondary accent - teal, used sparingly for AI/online states */
    --teal:        #17B8A6;
    --teal-tint:   #E7FAF7;

    --success:     #1AA260;
    --success-tint:#E9F9F1;
    --warning:     #D97706;
    --warning-tint:#FEF3E2;
    --danger:      #DC2626;
    --danger-tint: #FDECEC;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(18,22,28,0.06);
    --shadow-md: 0 4px 16px rgba(18,22,28,0.08);
    --shadow-lg: 0 12px 32px rgba(18,22,28,0.14);

    --font-display: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--paper);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

:focus-visible {
    outline: 2px solid var(--signal);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14.5px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-block { width: 100%; }
.btn-primary { background: var(--signal); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--signal-dark); box-shadow: var(--shadow-md); }
.btn-dark { background: var(--ink); color: var(--white); }
.btn-dark:hover { background: var(--slate-900); }
.btn-ghost { background: transparent; color: var(--slate-700); border-color: var(--slate-300); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--slate-700);
    margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 11px 14px;
    font-size: 14.5px;
    font-family: var(--font-body);
    color: var(--ink);
    background: var(--white);
    border: 1.5px solid var(--slate-300);
    border-radius: var(--radius-md);
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--signal);
    box-shadow: 0 0 0 3px var(--signal-tint);
}
.form-hint { font-size: 12.5px; color: var(--slate-500); margin-top: 6px; }
.form-error { font-size: 12.5px; color: var(--danger); margin-top: 6px; font-weight: 500; }
.form-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--slate-700); }

/* ---------------- Alerts ---------------- */
.alert { padding: 13px 16px; border-radius: var(--radius-md); font-size: 14px; margin-bottom: 18px; font-weight: 500; }
.alert-danger { background: var(--danger-tint); color: var(--danger); }
.alert-success { background: var(--success-tint); color: var(--success); }
.alert-warning { background: var(--warning-tint); color: var(--warning); }

/* ---------------- Cards ---------------- */
.card {
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-pad { padding: 28px; }

/* ---------------- Badges ---------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.badge-success { background: var(--success-tint); color: var(--success); }
.badge-warning { background: var(--warning-tint); color: var(--warning); }
.badge-danger { background: var(--danger-tint); color: var(--danger); }
.badge-neutral { background: var(--slate-100); color: var(--slate-700); }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ============================================================
   Auth layout (login / register / password reset)
   ============================================================ */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.auth-visual {
    background: var(--ink);
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 48px;
    position: relative;
    overflow: hidden;
}
.auth-visual::after {
    content: '';
    position: absolute;
    width: 520px; height: 520px;
    right: -180px; bottom: -180px;
    background: radial-gradient(circle, var(--signal) 0%, transparent 70%);
    opacity: 0.35;
}
.auth-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 19px; position: relative; z-index: 1; }
.auth-brand-dot { width: 11px; height: 11px; border-radius: 3px; background: var(--signal); }
.auth-visual-quote { font-family: var(--font-display); font-size: 30px; line-height: 1.35; max-width: 440px; position: relative; z-index: 1; }
.auth-visual-foot { font-size: 13px; color: var(--slate-300); position: relative; z-index: 1; }
.auth-form-side { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-form-box { width: 100%; max-width: 400px; }
.auth-form-box h1 { font-size: 26px; margin-bottom: 8px; }
.auth-form-box .subtitle { color: var(--slate-500); font-size: 14.5px; margin-bottom: 28px; }
.auth-form-footer { text-align: center; margin-top: 22px; font-size: 14px; color: var(--slate-500); }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-visual { display: none; }
}

/* ============================================================
   App shell (dashboard / admin)
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: 248px;
    flex-shrink: 0;
    background: var(--ink);
    color: var(--slate-300);
    display: flex;
    flex-direction: column;
    padding: 22px 16px;
}
.sidebar-brand { display: flex; align-items: center; gap: 9px; padding: 6px 10px 22px; font-family: var(--font-display); font-weight: 800; color: var(--white); font-size: 16.5px; }
.sidebar-brand-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--signal); }
.sidebar-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--slate-500); padding: 16px 12px 6px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-link { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; color: var(--slate-300); }
.sidebar-link:hover { background: var(--slate-900); color: var(--white); }
.sidebar-link.active { background: var(--slate-800); color: var(--white); }
.sidebar-link .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--slate-500); }
.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--slate-800); font-size: 12.5px; color: var(--slate-500); }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    height: 66px;
    flex-shrink: 0;
    background: var(--white);
    border-bottom: 1px solid var(--slate-100);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}
.topbar-title { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.topbar-user { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--signal-tint); color: var(--signal-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.content { padding: 30px 28px; flex: 1; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 26px; }
.stat-card { padding: 20px 22px; }
.stat-label { font-size: 13px; color: var(--slate-500); font-weight: 600; margin-bottom: 8px; }
.stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 800; }
.stat-trend { font-size: 12.5px; margin-top: 6px; font-weight: 600; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--slate-500); }
.empty-state h3 { font-size: 17px; color: var(--ink); margin-bottom: 8px; }

@media (max-width: 860px) {
    .sidebar { display: none; }
    .content { padding: 20px 16px; }
}
