/**
 * MAGIC.AI.VN - Executive Legal Studio Stylesheet (style.css)
 * Tông màu chủ đạo: Deep Midnight Navy (#090D1A, #0B132B, #1C2541), Amber Gold (#F59E0B, #D97706)
 * Thiết kế chuẩn SaaS cao cấp: Glassmorphism, Micro-animations, Không dùng form mặc định của trình duyệt
 */

:root {
    --bg-darkest: #060914;
    --bg-deep: #090D1A;
    --bg-surface: #0E172E;
    --bg-card: #15203B;
    --bg-card-hover: #1C2A4E;
    --bg-glass: rgba(21, 32, 59, 0.85);
    
    --border: #2A3B5C;
    --border-light: rgba(58, 80, 107, 0.4);
    --border-gold: rgba(245, 158, 11, 0.35);
    
    --gold: #F59E0B;
    --gold-hover: #D97706;
    --gold-light: #FDE68A;
    --gold-glow: rgba(245, 158, 11, 0.3);
    
    --text-white: #FFFFFF;
    --text-light: #F8FAFC;
    --text-muted: #94A3B8;
    --text-dim: #64748B;
    --text-dark: #0F172A;

    --danger: #EF4444;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --warning: #F59E0B;
    --warning-bg: rgba(245, 158, 11, 0.12);
    --info: #3B82F6;
    --info-bg: rgba(59, 130, 246, 0.12);
    --success: #10B981;
    --success-bg: rgba(16, 185, 129, 0.12);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-card: 0 20px 40px -15px rgba(0, 0, 0, 0.6), 0 0 25px rgba(245, 158, 11, 0.05);
    --shadow-gold: 0 10px 25px -5px rgba(245, 158, 11, 0.4);
    --shadow-paper: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

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

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-deep);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(245, 158, 11, 0.09) 0%, transparent 45%),
        radial-gradient(circle at 85% 20%, rgba(59, 130, 246, 0.06) 0%, transparent 35%),
        radial-gradient(circle at 15% 40%, rgba(16, 185, 129, 0.04) 0%, transparent 30%);
    background-attachment: fixed;
    color: var(--text-light);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
    background: #25334E;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

/* ==========================================================================
   1. FORM CONTROLS CHUẨN SAAS CAO CẤP (KHÔNG DÙNG FORM MẶC ĐỊNH TRÌNH DUYỆT)
   ========================================================================== */

/* Universal Input & Textarea */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    background: rgba(11, 19, 43, 0.75);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-light);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

input:focus,
textarea:focus {
    border-color: var(--gold);
    background: rgba(14, 23, 46, 0.95);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-dim);
}

/* Custom Select Dropdown (Tuyệt đối không hiện hộp trắng xấu xí) */
select {
    width: 100%;
    background-color: #0E172E;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23F59E0B' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 42px 12px 16px;
    color: var(--text-light);
    font-size: 14px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
    background-color: #121D38;
}

select option {
    background-color: #0E172E;
    color: #FFFFFF;
    padding: 12px;
    font-size: 14px;
}

/* ==========================================================================
   2. INTERACTIVE SEGMENTED CONTROL (DOCUMENT TYPE PILLS)
   ========================================================================== */

.doc-type-selector {
    margin-bottom: 24px;
}

.doc-type-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doc-pills-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.doc-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: rgba(14, 23, 46, 0.6);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    white-space: nowrap;
}

.doc-pill:hover {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(21, 32, 59, 0.8);
    transform: translateY(-1px);
}

.doc-pill.active {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(217, 119, 6, 0.08) 100%);
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.doc-pill-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.doc-pill-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.doc-pill-title {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-light);
    line-height: 1.3;
    white-space: nowrap;
}

.doc-pill.active .doc-pill-title {
    color: var(--gold);
}

.doc-pill-sub {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ==========================================================================
   3. INPUT MODE TABS (UPLOAD FILE VS PASTE TEXT)
   ========================================================================== */

.input-tabs-nav {
    display: flex;
    background: rgba(11, 19, 43, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
    gap: 4px;
}

.input-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.input-tab-btn:hover {
    color: var(--text-light);
}

.input-tab-btn.active {
    background: var(--bg-card);
    color: var(--gold);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

/* ==========================================================================
   4. LUXURY DROPZONE & FILE CHIP
   ========================================================================== */

.dropzone {
    border: 2px dashed rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-lg);
    padding: 42px 24px;
    text-align: center;
    background: radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.04) 0%, rgba(11, 19, 43, 0.6) 100%);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--gold);
    background: rgba(245, 158, 11, 0.06);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.18);
    transform: translateY(-2px);
}

.drop-icon-aura {
    width: 68px;
    height: 68px;
    margin: 0 auto 16px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
    transition: all 0.2s;
}

.dropzone:hover .drop-icon-aura {
    transform: scale(1.08);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.drop-heading {
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 6px;
}

.drop-heading .browse-link {
    color: var(--gold);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.drop-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.ext-badge-row {
    display: inline-flex;
    gap: 8px;
}

.ext-badge {
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

/* File Selected State Chip */
.file-selected-chip {
    display: none;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.35);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-top: 15px;
    align-items: center;
    justify-content: space-between;
}

.file-chip-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.file-chip-icon {
    font-size: 26px;
}

.file-chip-name {
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
}

.file-chip-meta {
    font-size: 12px;
    color: #6EE7B7;
}

.file-chip-remove {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #F87171;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.file-chip-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #EF4444;
}

/* Paste Text Area */
.paste-box-wrap {
    display: none;
}

.paste-box-wrap textarea {
    min-height: 140px;
    resize: vertical;
    line-height: 1.6;
}

/* ==========================================================================
   5. HEADER & NAVBAR
   ========================================================================== */

.navbar {
    background: rgba(9, 13, 26, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 14px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--gold);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #F59E0B, #B45309);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #060914;
    font-weight: 900;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 22px;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--gold);
}

.credits-badge {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.credits-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid var(--gold);
    color: var(--gold);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.credits-pill:hover {
    background: rgba(245, 158, 11, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
}
.pill-plus {
    background: var(--gold);
    color: #060914;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

.btn-nav-workspace {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18) 0%, rgba(217, 119, 6, 0.1) 100%);
    border: 1px solid var(--gold);
    color: #FBBF24;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-nav-workspace:hover {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #060914;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
}

.btn-nav-logout {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-nav-logout:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
}

/* ==========================================================================
   6. BUTTONS & CTAS
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.btn-gold {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: #060914;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-gold:hover {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.5);
    transform: translateY(-2px);
}

.btn-outline {
    background: rgba(14, 23, 46, 0.5);
    border: 1px solid var(--border);
    color: var(--text-light);
}

.btn-outline:hover {
    border-color: var(--gold);
    color: var(--gold);
    background: rgba(245, 158, 11, 0.08);
}

.btn-drive {
    background: rgba(66, 133, 244, 0.15);
    border: 1px solid #4285F4;
    color: #93C5FD;
}

.btn-drive:hover {
    background: rgba(66, 133, 244, 0.25);
    color: #BFDBFE;
}

/* ==========================================================================
   7. HERO & UPLOAD CARD CONTAINER
   ========================================================================== */

.hero-section {
    padding: 70px 20px 50px;
    text-align: center;
    max-width: 1140px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: var(--gold);
    padding: 6px 18px;
    border-radius: var(--radius-full);
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 22px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

.hero-title {
    font-size: 46px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 18px;
    background: linear-gradient(180deg, #FFFFFF 0%, #CBD5E1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 38px;
    max-width: 820px;
    margin-left: auto;
    margin-right: auto;
}

.upload-card {
    background: linear-gradient(180deg, rgba(21, 32, 59, 0.85) 0%, rgba(14, 23, 46, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius-xl);
    padding: 38px 40px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(245, 158, 11, 0.08);
    max-width: 1040px;
    margin: 0 auto 80px;
    text-align: left;
    position: relative;
}

.upload-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #F59E0B, #FBBF24, transparent);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* ==========================================================================
   8. SERVICES GRID & CARDS
   ========================================================================== */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 24px;
    max-width: 1120px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 26px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-card:hover {
    border-color: rgba(245, 158, 11, 0.5);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.service-card h4 {
    color: var(--gold);
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

/* ==========================================================================
   9. PRICING SECTION
   ========================================================================== */

.pricing-section {
    background: rgba(9, 13, 26, 0.75);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 85px 20px;
    text-align: center;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
    gap: 28px;
    max-width: 1040px;
    margin: 45px auto 0;
    text-align: left;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.25s;
    position: relative;
}

.pricing-card.featured {
    border-color: var(--gold);
    background: linear-gradient(180deg, rgba(28, 42, 78, 0.9) 0%, rgba(21, 32, 59, 0.95) 100%);
    box-shadow: 0 15px 35px -5px rgba(245, 158, 11, 0.25);
    transform: scale(1.03);
}

.pricing-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #060914;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-price {
    font-size: 34px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 16px 0 6px;
}

.pricing-credits {
    color: var(--gold);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ==========================================================================
   10. SPLIT-VIEW WORKSPACE (REVIEW.PHP)
   ========================================================================== */

.workspace-container {
    display: grid;
    grid-template-columns: 1fr 480px;
    height: calc(100vh - 65px);
    overflow: hidden;
}

.doc-viewer-panel {
    background: #060914;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    justify-content: center;
}

.paper-sheet {
    background: #FFFFFF;
    color: var(--text-dark);
    width: 100%;
    max-width: 840px;
    min-height: 100%;
    padding: 55px 65px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-paper);
    font-family: 'Times New Roman', Times, serif;
    font-size: 16px;
    line-height: 1.8;
}

.paper-sheet h1,
.paper-sheet h2,
.paper-sheet h3 {
    text-align: center;
    color: #000000;
    margin-bottom: 20px;
    font-weight: 700;
}

/* Highlight Markers on Document */
.hl-marker {
    padding: 2px 4px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}
.hl-danger {
    background: rgba(239, 68, 68, 0.25);
    border-bottom: 2px solid var(--danger);
    color: #991B1B;
}
.hl-warning {
    background: rgba(245, 158, 11, 0.25);
    border-bottom: 2px solid var(--warning);
    color: #92400E;
}
.hl-info {
    background: rgba(59, 130, 246, 0.25);
    border-bottom: 2px solid var(--info);
    color: #1E40AF;
}
.hl-marker:hover,
.hl-marker.active {
    filter: brightness(1.15);
    outline: 2px solid var(--gold);
}

/* Inspector Column */
.inspector-panel {
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.inspector-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: rgba(9, 13, 26, 0.6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.inspector-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Finding Cards */
.finding-card {
    background: rgba(14, 23, 46, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}
.finding-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-2px);
}
.finding-card.active {
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.2);
    background: rgba(21, 32, 59, 0.9);
}
.finding-card.card-danger { border-left: 4px solid var(--danger); }
.finding-card.card-warning { border-left: 4px solid var(--warning); }
.finding-card.card-info { border-left: 4px solid var(--info); }

.legal-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #60A5FA;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}
.legal-link:hover {
    color: var(--gold);
    text-decoration: underline;
}

/* ==========================================================================
   11. MODAL OVERLAY & POPUP
   ========================================================================== */

.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 0 0 30px rgba(245, 158, 11, 0.15);
    overflow: hidden;
}

/* ==========================================================================
   12. FOOTER & DISCLAIMER
   ========================================================================== */

.footer {
    padding: 50px 20px 40px;
    text-align: center;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 13px;
    background: rgba(6, 9, 20, 0.6);
}

.disclaimer-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(58, 80, 107, 0.45);
    border-radius: var(--radius-md);
    padding: 18px 24px;
    max-width: 820px;
    margin: 0 auto 24px;
    font-size: 13px;
    line-height: 1.6;
    color: #CBD5E1;
}

/* ==========================================================================
   13. RESPONSIVE MEDIA QUERIES
   ========================================================================== */

@media (max-width: 1024px) {
    .workspace-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    .inspector-panel {
        height: 600px;
    }
}

@media (max-width: 980px) {
    .doc-pills-container {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 32px;
    }
    .upload-card {
        padding: 24px 20px;
    }
    .nav-links {
        display: none;
    }
}

@media (max-width: 540px) {
    .doc-pills-container {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   14. INSPECTOR TABS & REVIEW CHAT / SUMMARY (REVIEW.PHP)
   ========================================================================== */
.inspector-tab-btn {
    flex: 1;
    padding: 8px 10px;
    border: none;
    background: transparent;
    color: var(--text-muted, #94A3B8);
    border-radius: 6px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}
.inspector-tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.inspector-tab-btn.active {
    background: rgba(245, 158, 11, 0.15);
    color: var(--gold, #F59E0B);
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.chat-msg {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 10px;
    max-width: 90%;
    word-break: break-word;
}
.chat-msg-user {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #FEF3C7;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}
.chat-msg-ai {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--border, #1E293B);
    color: #E2E8F0;
    margin-right: auto;
    border-bottom-left-radius: 2px;
}
.quick-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.15s;
    display: inline-block;
    margin-bottom: 6px;
    margin-right: 4px;
}
.quick-chip:hover {
    border-color: var(--gold, #F59E0B);
    color: var(--gold, #F59E0B);
    background: rgba(245, 158, 11, 0.08);
}
.summary-item-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border, #1E293B);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.summary-item-label {
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--gold, #F59E0B);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.summary-item-val {
    font-size: 13px;
    color: #E2E8F0;
    line-height: 1.5;
}

/* ==========================================================================
   15. STUDIO SYSTEM MODAL (REPLACES BROWSER ALERTS & CONFIRMS)
   ========================================================================== */
.studio-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(6, 9, 20, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}
.studio-modal-overlay.active {
    display: flex;
}
.studio-modal-card {
    background: #0B132B;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.15);
    overflow: hidden;
    animation: studioModalPop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}
@keyframes studioModalPop {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.studio-modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(9, 13, 26, 0.6);
    display: flex;
    align-items: center;
    gap: 12px;
}
.studio-modal-icon-badge {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.studio-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
}
.studio-modal-close {
    background: transparent;
    border: none;
    color: #94A3B8;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}
.studio-modal-close:hover {
    color: #FFFFFF;
}
.studio-modal-body {
    padding: 24px;
    font-size: 14px;
    line-height: 1.6;
    color: #CBD5E1;
}
.studio-modal-footer {
    padding: 14px 24px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(9, 13, 26, 0.4);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================================================
   16. IN-APP A4 WYSIWYG EDITOR TOOLBAR & EXECUTIVE STUDIO WORKSPACE
   ========================================================================== */
.studio-editor-toolbar {
    background: #090E1F;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
}

.studio-editor-toolbar::-webkit-scrollbar {
    height: 3px;
}
.studio-editor-toolbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}

.toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.tb-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #CBD5E1;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}
.tb-btn:hover {
    background: rgba(245, 158, 11, 0.15);
    border-color: var(--gold, #F59E0B);
    color: var(--gold, #F59E0B);
    transform: translateY(-1px);
}
.tb-btn:active, .tb-btn.tb-active {
    background: var(--gold, #F59E0B);
    color: #0F172A;
    border-color: var(--gold, #F59E0B);
}

.tb-btn-text {
    width: auto;
    padding: 0 10px;
    font-size: 11.5px;
    font-weight: 500;
    gap: 4px;
}

select.tb-select,
.tb-select {
    display: inline-block !important;
    width: auto !important;
    height: 32px !important;
    background-color: #0F172A !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394A3B8' stroke-width='2.2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    background-size: 11px 11px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 6px !important;
    color: #F1F5F9 !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    outline: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    padding: 0 26px 0 10px !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
}
select.tb-select:hover,
.tb-select:hover {
    border-color: rgba(245, 158, 11, 0.5) !important;
}
select.tb-select:focus,
.tb-select:focus {
    border-color: var(--gold, #F59E0B) !important;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2) !important;
}
select.tb-select option,
.tb-select option {
    background: #0B132B !important;
    color: #fff !important;
    padding: 6px !important;
}

.tb-select-format {
    width: 142px !important;
    min-width: 142px !important;
}
.tb-select-font {
    width: 155px !important;
    min-width: 155px !important;
}
.tb-select-size {
    width: 95px !important;
    min-width: 95px !important;
}

.tb-divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 4px;
    flex-shrink: 0;
}

.toolbar-right-hint {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.live-edit-pill {
    font-size: 11.5px;
    color: #94A3B8;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Container Giấy A4 & Desk Backdrop */
.paper-sheet-container {
    width: 100%;
    max-width: 840px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    box-sizing: border-box;
}

.paper-canvas[contenteditable="true"] {
    outline: none;
    cursor: text;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    width: 100%;
    min-height: 1100px;
    padding: 70px 80px;
    background: #FFFFFF;
    color: #1E293B;
    font-family: 'Times New Roman', Times, serif;
    font-size: 16px;
    line-height: 1.85;
    text-align: justify;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    box-sizing: border-box;
    white-space: pre-wrap;
    word-break: break-word;
}

.paper-canvas[contenteditable="true"]:focus {
    box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.8), 0 0 0 2px rgba(245, 158, 11, 0.6);
}

.paper-canvas p {
    margin: 0 0 1em 0;
}
.paper-canvas h1, .paper-canvas h2, .paper-canvas h3 {
    text-align: center;
    color: #0F172A;
    margin: 1.2em 0 0.6em;
    font-weight: 700;
}
.paper-canvas h1 { font-size: 20px; text-transform: uppercase; }
.paper-canvas h2 { font-size: 17px; }
.paper-canvas h3 { font-size: 15px; text-align: left; }

.paper-placeholder {
    background: rgba(245, 158, 11, 0.18);
    color: #92400E;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px dashed rgba(245, 158, 11, 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
}
.paper-placeholder:hover {
    background: rgba(245, 158, 11, 0.3);
    color: #78350F;
}

.paper-footer-hint {
    font-size: 11.5px;
    color: #64748B;
    text-align: center;
    padding-bottom: 24px;
}

/* Nút Google Docs Executive */
.btn-google-docs, .btn-google-docs-luxury {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.15), rgba(66, 133, 244, 0.25));
    border: 1px solid rgba(66, 133, 244, 0.5);
    color: #93C5FD;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
    text-decoration: none;
}
.btn-google-docs:hover, .btn-google-docs-luxury:hover {
    background: #4285F4;
    color: #FFFFFF;
    border-color: #4285F4;
    box-shadow: 0 4px 16px rgba(66, 133, 244, 0.45);
    transform: translateY(-1px);
}
.btn-google-docs:disabled, .btn-google-docs-luxury:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-google-docs-luxury:hover .gdocs-svg path {
    fill: #FFFFFF !important;
}

/* Nút Hành Động Ghost & Gold */
.btn-action-ghost {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #CBD5E1;
    font-weight: 600;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-action-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    transform: translateY(-1px);
}

.btn-gold-luxury {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    border: 1px solid #FBBF24;
    color: #0F172A;
    font-weight: 800;
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-gold-luxury:hover {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
    transform: translateY(-1px);
}
.btn-gold-luxury .btn-arrow {
    transition: transform 0.2s ease;
}
.btn-gold-luxury:hover .btn-arrow {
    transform: translateX(3px);
}

/* Nút Toggle Sidebar */
.btn-sidebar-toggle {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94A3B8;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #FFFFFF;
}

/* In ấn tối ưu */
@media print {
    .navbar, .draft-sidebar, .draft-canvas-header, .studio-editor-toolbar, .paper-footer-hint {
        display: none !important;
    }
    body, .draft-layout, .draft-canvas-area, .draft-canvas-body {
        background: #FFFFFF !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
        height: auto !important;
    }
    .paper-canvas[contenteditable="true"] {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}



