/* =========================================================
   Reply SChat — Base Design System
   Mobile-first, responsif, tanpa framework berat.
   ========================================================= */

:root {
    --color-primary: #4f46e5;
    --color-primary-dark: #4338ca;
    --color-primary-light: #eef2ff;
    --color-success: #16a34a;
    --color-danger: #dc2626;
    --color-warning: #d97706;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-border: #e2e8f0;
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 700; }
p { margin: 0 0 1em; color: var(--color-text-muted); }

.container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    font-size: 14px;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
    min-height: 44px; /* target sentuh mobile yang layak */
    line-height: 1;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; }
.btn-secondary { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }
.btn-secondary:hover { background: var(--color-bg); text-decoration: none; }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; min-height: 36px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 6px;
}
.form-hint { font-size: 12.5px; color: var(--color-text-muted); margin-top: 4px; }
.form-control {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 44px;
}
.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}
textarea.form-control { min-height: 110px; resize: vertical; }

/* ---------- Cards / Surfaces ---------- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card-body { padding: 28px; }
@media (max-width: 560px) {
    .card-body { padding: 20px; }
}

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 13px 16px;
    border-radius: var(--radius-md);
    font-size: 13.5px;
    margin-bottom: 18px;
}
.alert-danger { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.alert-info { background: var(--color-primary-light); color: #3730a3; border: 1px solid #c7d2fe; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
}
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-neutral { background: #f1f5f9; color: var(--color-text-muted); }

/* ---------- Icon sizing (inline SVG) ---------- */
.icon { width: 20px; height: 20px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; }
.icon-sm { width: 16px; height: 16px; }

/* ---------- Installer Wizard ---------- */
.wizard-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
}
.wizard-box { width: 100%; max-width: 640px; }
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 28px;
    gap: 4px;
}
.wizard-step {
    flex: 1;
    text-align: center;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--color-text-muted);
    position: relative;
    padding-top: 28px;
}
.wizard-step::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--color-border);
}
.wizard-step.active::before { background: var(--color-primary); }
.wizard-step.done::before { background: var(--color-success); }
@media (max-width: 480px) {
    .wizard-step span { display: none; }
}

/* ---------- Table (responsive -> card list di mobile) ---------- */
.table-responsive { width: 100%; overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.data-table th, .data-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--color-border); }
.data-table th { font-weight: 600; color: var(--color-text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; }

/* ---------- Empty state ---------- */
.empty-state { text-align: center; padding: 60px 20px; color: var(--color-text-muted); }
.empty-state .icon { width: 40px; height: 40px; margin: 0 auto 14px; opacity: 0.5; }

/* ---------- Footer ---------- */
.site-footer {
    padding: 28px 0;
    text-align: center;
    font-size: 12.5px;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
}
.site-footer a { color: var(--color-text-muted); font-weight: 600; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 20px; }
.mb-0 { margin-bottom: 0; }
