/* ============================================================
   DocGen Pro – Main Stylesheet
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --bg: #0f0f15;
    --surface: #16161f;
    --surface2: #1d1d28;
    --border: #2a2a3d;
    --accent: #6C63FF;
    --accent2: #9B93FF;
    --gold: #E1C500;
    --red: #e63946;
    --green: #2cb67d;
    --text: #e8e8f0;
    --text2: #8888a8;
    --sidebar-w: 230px;
    --radius: 12px;
}

html, body { height: 100%; font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); }

/* ── App Layout ── */
.app-wrapper { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.sidebar-header { padding: 24px 20px; border-bottom: 1px solid var(--border); }
.sidebar-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--text); }
.sidebar-nav { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 8px;
    color: var(--text2); text-decoration: none;
    font-size: 14px; font-weight: 500;
    transition: all 0.2s;
}
.nav-item:hover { background: var(--surface2); color: var(--text); }
.nav-item.active { background: rgba(108, 99, 255, 0.15); color: var(--accent2); }

/* ── Main Content ── */
.main-content { margin-left: var(--sidebar-w); flex: 1; padding: 0; }

/* ── Topbar ── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 24px 36px; border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.page-title { font-size: 22px; font-weight: 700; color: var(--text); }
.badge { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 20px; }
.badge-live { background: rgba(44, 182, 125, 0.15); color: var(--green); }

/* ── Dashboard Grid ── */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 36px; }

/* ── Doc Card ── */
.doc-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
    cursor: pointer; display: flex; align-items: flex-start; gap: 20px;
    transition: all 0.25s; position: relative; overflow: hidden;
}
.doc-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(108,99,255,0.04), transparent);
    opacity: 0; transition: opacity 0.25s;
}
.doc-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 32px rgba(108,99,255,0.15); }
.doc-card:hover::before { opacity: 1; }

.doc-card-icon {
    width: 64px; height: 64px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.doc-card-icon.boc { background: linear-gradient(135deg, #B8860B, #E1C500); }
.doc-card-icon.dialog { background: linear-gradient(135deg, #c0392b, #e74c3c); }

.doc-card-body { flex: 1; }
.doc-card-body h2 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.doc-card-body p { font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 14px; }

.doc-card-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; background: var(--surface2); color: var(--text2); border: 1px solid var(--border); }

.doc-card-arrow { color: var(--text2); margin-top: 4px; transition: transform 0.2s; }
.doc-card:hover .doc-card-arrow { color: var(--accent); transform: translateX(4px); }

/* ── Info Section ── */
.info-section { padding: 0 36px 36px; }
.info-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 20px; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.step-num { width: 32px; height: 32px; border-radius: 8px; background: rgba(108,99,255,0.15); color: var(--accent2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.step-text strong { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.step-text p { font-size: 13px; color: var(--text2); line-height: 1.5; }

/* ── Form Page Layout ── */
.form-page { padding: 36px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.form-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.form-panel-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.form-panel-header h3 { font-size: 16px; font-weight: 600; }
.form-panel-body { padding: 24px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 500; color: var(--text2); margin-bottom: 7px; }
.form-group input, .form-group textarea, .form-group select {
    width: 100%; padding: 10px 14px; border-radius: 8px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text); font-family: 'Inter', sans-serif; font-size: 14px;
    outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { border-color: var(--accent); }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ── Transaction Table (Form) ── */
.txn-table-wrap { overflow-x: auto; margin-bottom: 14px; }
.txn-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.txn-table th { background: var(--surface2); padding: 9px 10px; text-align: left; font-weight: 600; color: var(--text2); border-bottom: 1px solid var(--border); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.txn-table td { padding: 6px 4px; vertical-align: middle; border-bottom: 1px solid rgba(255,255,255,0.04); }
.txn-table td input, .txn-table td select {
    width: 100%; padding: 7px 9px; border-radius: 6px;
    background: var(--surface2); border: 1px solid var(--border);
    color: var(--text); font-size: 13px; outline: none;
}
.txn-table td input:focus { border-color: var(--accent); }
.btn-del { background: rgba(230,57,70,0.12); border: none; color: var(--red); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; transition: background 0.2s; }
.btn-del:hover { background: rgba(230,57,70,0.25); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 22px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s; font-family: 'Inter', sans-serif; text-decoration: none; }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); box-shadow: 0 4px 20px rgba(108,99,255,0.4); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-add { background: rgba(44,182,125,0.12); color: var(--green); border: 1px solid rgba(44,182,125,0.3); font-size: 13px; padding: 8px 16px; border-radius: 7px; }
.btn-add:hover { background: rgba(44,182,125,0.2); }
.btn-group { display: flex; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

/* ── Preview Panel ── */
.preview-outer { position: sticky; top: 36px; }
.preview-panel { background: white; border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.preview-controls { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; }
.preview-label { font-size: 13px; font-weight: 600; color: var(--text2); }

/* ── Responsive ── */
@media (max-width: 1100px) {
    .form-page { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    :root { --sidebar-w: 0px; }
    .sidebar { display: none; }
    .topbar { padding: 16px 20px; }
    .dashboard-grid, .form-page { padding: 20px; }
    .steps-grid { grid-template-columns: 1fr; }
}

/* ── Alert/Flash ── */
.alert { padding: 12px 20px; border-radius: 8px; font-size: 14px; font-weight: 500; margin: 0 36px 24px; }
.alert-success { background: rgba(44,182,125,0.1); border: 1px solid rgba(44,182,125,0.3); color: var(--green); }
.alert-error { background: rgba(230,57,70,0.1); border: 1px solid rgba(230,57,70,0.3); color: var(--red); }

/* ── Section divider ── */
.section-divider { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text2); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
