/* APX Deal Flow App - Master Stylesheet */
/* Design system: APX dark theme with gold accents */

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

button {
    font-family: 'Poppins', sans-serif;
    background: transparent;
    border: none;
    cursor: pointer;
    color: inherit;
}

:root {
    --apx-gold: #967138; --apx-gold-dark: #82602f; --apx-cream: #F5F5DC;
    --apx-cream-dark: #E8E8C8; --apx-black: #1a1a1a; --apx-dark-bg: #0f0f0f;
    --apx-dark-card: #1a1a2e;
    --apx-gray: #2a2a2a; --apx-gray-light: #3a3a3a;
    --apx-success: #4ade80; --apx-warning: #facc15; --apx-danger: #ef4444; --apx-info: #60a5fa;
    --radius-sm: 20px; --radius-md: 25px; --radius-lg: 30px; --radius-xl: 40px;
    --z-base: 0; --z-content: 1; --z-floating: 100; --z-nav: 1090; --z-header: 1100;
    --z-modal: 4000; --z-toast: 5000; --z-login: 6000;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--apx-black);
    color: var(--apx-cream);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M769 229L1037 260.9M927 880L731 737 520 660 309 538 40 599 295 764 126.5 879.5 40 599-197 493 102 382-31 229 126.5 79.5-69-63-332-232 102 382 315 309 180 91 520 660 731 737 844 599 1037 260.9 927 880z'/%3E%3Cpath d='M-31 229L237 261 390 382 603 493 731 737z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover; opacity: 0.08; z-index: var(--z-base); pointer-events: none;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100vh;
    z-index: var(--z-login); align-items: center; justify-content: center;
    background: var(--apx-black); overflow: hidden;
}
.login-page::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 800'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='1'%3E%3Cpath d='M769 229L1037 260.9M927 880L731 737 520 660 309 538 40 599 295 764 126.5 879.5 40 599-197 493 102 382-31 229 126.5 79.5-69-63-332-232 102 382 315 309 180 91 520 660 731 737 844 599 1037 260.9 927 880z'/%3E%3C/g%3E%3C/svg%3E");
    background-size: cover; opacity: 0.16; z-index: var(--z-base); pointer-events: none;
}
.login-page.active { display: flex; }
.login-container {
    background: var(--apx-gray); padding: 3rem; border-radius: var(--radius-xl);
    border: 2px solid var(--apx-gold); max-width: 450px; width: 90%;
    box-shadow: 0 10px 40px rgba(150,113,56,0.3); position: relative; z-index: var(--z-content);
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-brand {
    font-size: 2rem; font-weight: 800; letter-spacing: 2px;
    margin-bottom: 0.25rem; text-align: center; color: var(--apx-gold);
}
.login-brand-subtitle {
    font-size: 0.95rem; color: rgba(201,162,39,0.7); letter-spacing: 1px;
    margin-bottom: 2rem; text-align: center; font-weight: 400;
}
.login-form { margin-bottom: 1.5rem; }
.login-error {
    background: var(--apx-danger); color: white; padding: 0.75rem 1rem;
    border-radius: var(--radius-sm); margin-top: 1rem; text-align: center; font-weight: 600;
    display: none;
}
.login-error.show { display: block; }
.login-footer {
    text-align: center; color: var(--apx-cream-dark); font-size: 0.9rem;
    margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--apx-gold);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
    display: block; font-size: 0.85rem; font-weight: 500; color: var(--apx-cream);
    margin-bottom: 0.4rem;
}
.form-input, .form-select, .form-textarea {
    width: 100%; padding: 0.75rem 1rem; background: var(--apx-black);
    border: 1px solid var(--apx-gray-light); border-radius: var(--radius-sm);
    color: var(--apx-cream); font-family: 'Poppins', sans-serif; font-size: 0.9rem;
    transition: border-color 0.2s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none; border-color: var(--apx-gold);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-select { cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23967138' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center;
}
.form-select option { background: var(--apx-gray); color: var(--apx-cream); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.5rem;
    border-radius: var(--radius-sm); font-weight: 600; font-size: 0.85rem;
    transition: all 0.2s; cursor: pointer; border: none;
}
.btn-primary { background: var(--apx-gold); color: var(--apx-black); }
.btn-primary:hover { background: var(--apx-gold-dark); transform: translateY(-1px); }
.btn-secondary { background: var(--apx-gray-light); color: var(--apx-cream); border: 1px solid var(--apx-gold); }
.btn-secondary:hover { background: var(--apx-gray); }
.btn-danger { background: var(--apx-danger); color: white; }
.btn-danger:hover { opacity: 0.9; }
.btn-success { background: var(--apx-success); color: var(--apx-black); }
.btn-ghost { background: transparent; color: var(--apx-cream); border: 1px solid var(--apx-gray-light); }
.btn-ghost:hover { border-color: var(--apx-gold); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.75rem; }
.btn-lg { padding: 1rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
    position: fixed; top: 0; left: 0; width: 100%; height: 70px;
    background: rgba(15,15,15,0.95); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--apx-gold); z-index: var(--z-header);
    display: flex; align-items: center; justify-content: space-between; padding: 0 2rem;
}
.header-brand { display: flex; align-items: center; gap: 1rem; }
.header-logo {
    font-size: 1.3rem; font-weight: 800; letter-spacing: 2px; color: var(--apx-gold);
}
.header-title {
    font-size: 0.85rem; color: var(--apx-cream-dark); border-left: 1px solid var(--apx-gold);
    padding-left: 1rem; line-height: 1.3;
}
.header-user { display: flex; align-items: center; gap: 1rem; }
.header-user-name { font-size: 0.85rem; color: var(--apx-cream); }
.header-user-role {
    font-size: 0.7rem; color: var(--apx-gold); text-transform: uppercase;
    letter-spacing: 1px;
}
.header-logout {
    padding: 0.5rem 1rem; border: 1px solid var(--apx-gold); border-radius: var(--radius-sm);
    color: var(--apx-gold); font-size: 0.8rem; transition: all 0.2s;
}
.header-logout:hover { background: var(--apx-gold); color: var(--apx-black); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.app-nav {
    position: fixed; top: 70px; left: 0; width: 100%; height: 55px;
    background: rgba(15,15,15,0.9); backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(150,113,56,0.3); z-index: var(--z-nav);
    display: flex; align-items: center; padding: 0 2rem; gap: 0.25rem;
    overflow-x: auto;
}
.nav-item {
    padding: 0.5rem 1.2rem; border-radius: var(--radius-sm); color: var(--apx-cream-dark);
    font-size: 0.8rem; font-weight: 500; transition: all 0.2s; white-space: nowrap;
    display: flex; align-items: center; gap: 0.5rem; border: 1px solid transparent;
}
.nav-item:hover { color: var(--apx-cream); background: var(--apx-gray); border-color: rgba(150,113,56,0.3); }
.nav-item.active {
    background: var(--apx-gold); color: var(--apx-black); font-weight: 600;
    border-color: var(--apx-gold);
}
.nav-item i { font-size: 0.9rem; }
.nav-badge {
    background: var(--apx-danger); color: white; font-size: 0.65rem;
    padding: 0.1rem 0.4rem; border-radius: 10px; font-weight: 700; min-width: 18px;
    text-align: center;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-app { padding-top: 140px; min-height: 100vh; position: relative; z-index: var(--z-content); }
.page { display: none; padding: 2rem; max-width: 1400px; margin: 0 auto; }
.page.active { display: block; }
.page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 2rem; flex-wrap: wrap; gap: 1rem;
}
.page-title { font-size: 1.5rem; font-weight: 700; color: var(--apx-cream); }
.page-subtitle { font-size: 0.85rem; color: var(--apx-cream-dark); margin-top: 0.25rem; }

/* ============================================================
   CARDS
   ============================================================ */
.card {
    background: var(--apx-gray); border: 1px solid var(--apx-gray-light);
    border-radius: var(--radius-md); padding: 1.5rem; transition: all 0.2s;
}
.card:hover { border-color: rgba(150,113,56,0.4); }
.card-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--apx-gray-light);
}
.card-title { font-size: 1rem; font-weight: 600; color: var(--apx-cream); }
.card-gold { border-color: var(--apx-gold); }

/* ============================================================
   DASHBOARD - KPI CARDS
   ============================================================ */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.kpi-card {
    background: var(--apx-gray); border: 1px solid var(--apx-gray-light);
    border-radius: var(--radius-md); padding: 1.5rem; text-align: center;
}
.kpi-value { font-size: 2.2rem; font-weight: 700; color: var(--apx-gold); }
.kpi-label { font-size: 0.8rem; color: var(--apx-cream-dark); margin-top: 0.25rem; text-transform: uppercase; letter-spacing: 0.5px; }
.kpi-change { font-size: 0.75rem; margin-top: 0.5rem; }
.kpi-change.up { color: var(--apx-success); }
.kpi-change.down { color: var(--apx-danger); }

/* ============================================================
   PIPELINE BOARD (KANBAN)
   ============================================================ */
.pipeline-board {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem;
    overflow-x: auto; min-height: 500px;
}
.pipeline-column {
    background: var(--apx-dark-bg); border: 1px solid var(--apx-gray-light);
    border-radius: var(--radius-md); padding: 1rem; min-width: 220px;
}
.pipeline-column-header {
    display: flex; align-items: center; justify-content: space-between;
    padding-bottom: 0.75rem; margin-bottom: 0.75rem; border-bottom: 2px solid var(--apx-gray-light);
}
.pipeline-column-title { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.pipeline-column-count {
    background: var(--apx-gray); font-size: 0.7rem; padding: 0.15rem 0.5rem;
    border-radius: 10px; color: var(--apx-cream-dark);
}
.pipeline-column[data-stage="incoming"] .pipeline-column-header { border-bottom-color: var(--apx-info); }
.pipeline-column[data-stage="ai_screening"] .pipeline-column-header { border-bottom-color: #a78bfa; }
.pipeline-column[data-stage="partner_review"] .pipeline-column-header { border-bottom-color: var(--apx-warning); }
.pipeline-column[data-stage="due_diligence"] .pipeline-column-header { border-bottom-color: var(--apx-gold); }
.pipeline-column[data-stage="term_sheet"] .pipeline-column-header { border-bottom-color: var(--apx-success); }
.pipeline-column[data-stage="closed"] .pipeline-column-header { border-bottom-color: var(--apx-cream-dark); }

.deal-card {
    background: var(--apx-gray); border: 1px solid var(--apx-gray-light);
    border-radius: var(--radius-sm); padding: 1rem; margin-bottom: 0.75rem;
    cursor: pointer; transition: all 0.2s;
}
.deal-card:hover { border-color: var(--apx-gold); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.deal-card-name { font-size: 0.85rem; font-weight: 600; color: var(--apx-cream); margin-bottom: 0.4rem; }
.deal-card-type {
    font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--apx-gold); margin-bottom: 0.5rem;
}
.deal-card-broker { font-size: 0.7rem; color: var(--apx-cream-dark); }
.deal-card-score {
    display: flex; gap: 0.5rem; margin-top: 0.5rem; font-size: 0.7rem;
}
.score-badge {
    padding: 0.15rem 0.5rem; border-radius: 8px; font-weight: 600;
}
.score-proceed { background: rgba(74,222,128,0.2); color: var(--apx-success); }
.score-caution { background: rgba(250,204,21,0.2); color: var(--apx-warning); }
.score-pass { background: rgba(239,68,68,0.2); color: var(--apx-danger); }

/* ============================================================
   DEAL DETAIL VIEW
   ============================================================ */
.deal-detail { display: none; }
.deal-detail.active { display: block; }
.deal-detail-header {
    display: flex; align-items: flex-start; justify-content: space-between;
    margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap;
}
.deal-detail-title { font-size: 1.8rem; font-weight: 700; }
.deal-stage-badge {
    padding: 0.4rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}
.stage-incoming { background: rgba(96,165,250,0.2); color: var(--apx-info); border: 1px solid var(--apx-info); }
.stage-ai_screening { background: rgba(167,139,250,0.2); color: #a78bfa; border: 1px solid #a78bfa; }
.stage-partner_review { background: rgba(250,204,21,0.2); color: var(--apx-warning); border: 1px solid var(--apx-warning); }
.stage-due_diligence { background: rgba(150,113,56,0.2); color: var(--apx-gold); border: 1px solid var(--apx-gold); }
.stage-term_sheet { background: rgba(74,222,128,0.2); color: var(--apx-success); border: 1px solid var(--apx-success); }
.stage-closed { background: rgba(245,245,220,0.1); color: var(--apx-cream-dark); border: 1px solid var(--apx-cream-dark); }

.deal-detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.deal-detail-main { display: flex; flex-direction: column; gap: 1.5rem; }
.deal-detail-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

/* AI Screening Results */
.ai-screening-card { border: 1px solid #a78bfa; }
.ai-recommendation {
    font-size: 1.2rem; font-weight: 700; text-align: center;
    padding: 0.75rem; border-radius: var(--radius-sm); margin-bottom: 1rem;
}
.ai-recommendation.proceed { background: rgba(74,222,128,0.15); color: var(--apx-success); }
.ai-recommendation.caution { background: rgba(250,204,21,0.15); color: var(--apx-warning); }
.ai-recommendation.pass { background: rgba(239,68,68,0.15); color: var(--apx-danger); }

.ai-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.ai-score-item { text-align: center; }
.ai-score-value { font-size: 1.5rem; font-weight: 700; }
.ai-score-label { font-size: 0.7rem; color: var(--apx-cream-dark); text-transform: uppercase; }

.ai-findings { margin-top: 1rem; }
.ai-findings h4 { font-size: 0.8rem; color: var(--apx-gold); margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ai-findings ul { list-style: none; padding: 0; }
.ai-findings li {
    padding: 0.4rem 0; font-size: 0.8rem; color: var(--apx-cream-dark);
    border-bottom: 1px solid rgba(58,58,58,0.5); display: flex; align-items: flex-start; gap: 0.5rem;
}
.ai-findings li i { margin-top: 0.2rem; font-size: 0.7rem; }

/* Notes */
.notes-list { max-height: 400px; overflow-y: auto; margin-bottom: 1rem; }
.note-item {
    padding: 0.75rem; background: var(--apx-dark-bg); border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}
.note-meta { font-size: 0.7rem; color: var(--apx-gold); margin-bottom: 0.3rem; }
.note-text { font-size: 0.8rem; color: var(--apx-cream); line-height: 1.5; }
.note-input-area { display: flex; gap: 0.5rem; }
.note-input-area .form-textarea { min-height: 60px; }

/* Documents */
.doc-list { display: flex; flex-direction: column; gap: 0.5rem; }
.doc-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem; background: var(--apx-dark-bg); border-radius: var(--radius-sm);
}
.doc-item-info { display: flex; align-items: center; gap: 0.75rem; }
.doc-icon { color: var(--apx-gold); font-size: 1.2rem; }
.doc-name { font-size: 0.8rem; color: var(--apx-cream); }
.doc-type { font-size: 0.65rem; color: var(--apx-cream-dark); }

/* Stage Timeline */
.stage-timeline { display: flex; flex-direction: column; gap: 0; }
.stage-timeline-item {
    display: flex; gap: 1rem; padding: 0.75rem 0;
    position: relative;
}
.stage-timeline-item::before {
    content: ''; position: absolute; left: 11px; top: 30px;
    width: 2px; height: calc(100% - 10px); background: var(--apx-gray-light);
}
.stage-timeline-item:last-child::before { display: none; }
.stage-timeline-dot {
    width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 0.6rem;
}
.stage-timeline-dot.completed { background: var(--apx-success); color: var(--apx-black); }
.stage-timeline-dot.current { background: var(--apx-gold); color: var(--apx-black); }
.stage-timeline-dot.pending { background: var(--apx-gray-light); color: var(--apx-cream-dark); }
.stage-timeline-info { flex: 1; }
.stage-timeline-name { font-size: 0.8rem; font-weight: 600; }
.stage-timeline-date { font-size: 0.7rem; color: var(--apx-cream-dark); }

/* ============================================================
   DATA TABLE
   ============================================================ */
.data-table-wrapper { overflow-x: auto; }
.data-table {
    width: 100%; border-collapse: collapse; font-size: 0.8rem;
}
.data-table thead th {
    padding: 0.75rem 1rem; text-align: left; font-weight: 600;
    color: var(--apx-gold); border-bottom: 2px solid var(--apx-gold);
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap;
}
.data-table tbody td {
    padding: 0.75rem 1rem; border-bottom: 1px solid var(--apx-gray-light);
    color: var(--apx-cream);
}
.data-table tbody tr { transition: background 0.2s; cursor: pointer; }
.data-table tbody tr:hover { background: rgba(150,113,56,0.1); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7); z-index: var(--z-modal);
    align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
    background: var(--apx-gray); border: 1px solid var(--apx-gold);
    border-radius: var(--radius-lg); max-width: 700px; width: 95%;
    max-height: 85vh; overflow-y: auto; padding: 2rem;
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--apx-gray-light);
}
.modal-title { font-size: 1.2rem; font-weight: 700; }
.modal-close {
    width: 36px; height: 36px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; color: var(--apx-cream-dark);
    transition: all 0.2s; font-size: 1.2rem;
}
.modal-close:hover { background: var(--apx-gray-light); color: var(--apx-cream); }
.modal-footer {
    display: flex; justify-content: flex-end; gap: 0.75rem;
    margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--apx-gray-light);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed; top: 80px; right: 2rem; z-index: var(--z-toast);
    display: flex; flex-direction: column; gap: 0.5rem;
}
.toast {
    padding: 0.75rem 1.25rem; border-radius: var(--radius-sm);
    font-size: 0.8rem; font-weight: 500; min-width: 280px;
    display: flex; align-items: center; gap: 0.75rem;
    animation: slideIn 0.3s ease;
}
.toast-success { background: var(--apx-success); color: var(--apx-black); }
.toast-error { background: var(--apx-danger); color: white; }
.toast-warning { background: var(--apx-warning); color: var(--apx-black); }
.toast-info { background: var(--apx-info); color: white; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ============================================================
   SEARCH / FILTER BAR
   ============================================================ */
.filter-bar {
    display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.search-input-wrapper {
    position: relative; flex: 1; min-width: 250px;
}
.search-input-wrapper i {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--apx-cream-dark);
}
.search-input {
    width: 100%; padding: 0.7rem 1rem 0.7rem 2.5rem; background: var(--apx-dark-bg);
    border: 1px solid var(--apx-gray-light); border-radius: var(--radius-sm);
    color: var(--apx-cream); font-family: 'Poppins', sans-serif; font-size: 0.85rem;
}
.search-input:focus { outline: none; border-color: var(--apx-gold); }
.filter-select {
    padding: 0.7rem 2rem 0.7rem 1rem; background: var(--apx-dark-bg);
    border: 1px solid var(--apx-gray-light); border-radius: var(--radius-sm);
    color: var(--apx-cream); font-family: 'Poppins', sans-serif; font-size: 0.8rem;
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23967138' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.75rem center;
}
.filter-select option { background: var(--apx-gray); color: var(--apx-cream); }

/* ============================================================
   FILE UPLOAD
   ============================================================ */
.file-upload-zone {
    border: 2px dashed var(--apx-gray-light); border-radius: var(--radius-md);
    padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s;
}
.file-upload-zone:hover, .file-upload-zone.dragover {
    border-color: var(--apx-gold); background: rgba(150,113,56,0.05);
}
.file-upload-zone i { font-size: 2rem; color: var(--apx-gold); margin-bottom: 0.75rem; }
.file-upload-zone p { font-size: 0.85rem; color: var(--apx-cream-dark); }
.file-upload-zone .upload-hint { font-size: 0.7rem; margin-top: 0.5rem; }
.file-list { margin-top: 1rem; }
.file-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.75rem; background: var(--apx-dark-bg); border-radius: var(--radius-sm);
    margin-bottom: 0.5rem; font-size: 0.8rem;
}
.file-item-remove { color: var(--apx-danger); cursor: pointer; }

/* ============================================================
   BOOKING IFRAME
   ============================================================ */
.booking-frame {
    width: 100%; height: calc(100vh - 200px); border: none;
    border-radius: var(--radius-md); background: var(--apx-gray);
}

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.spinner {
    width: 40px; height: 40px; border: 3px solid var(--apx-gray-light);
    border-top-color: var(--apx-gold); border-radius: 50%;
    animation: spin 0.8s linear infinite; margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(26,26,26,0.8); display: flex; align-items: center;
    justify-content: center; border-radius: var(--radius-md); z-index: 10;
}

/* ============================================================
   TAGS
   ============================================================ */
.tag {
    display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.2rem 0.6rem;
    border-radius: 8px; font-size: 0.65rem; font-weight: 600;
}
.tag-investment { background: rgba(96,165,250,0.2); color: var(--apx-info); }
.tag-advisory { background: rgba(167,139,250,0.2); color: #a78bfa; }
.tag-token { background: rgba(250,204,21,0.2); color: var(--apx-warning); }
.tag-jv { background: rgba(74,222,128,0.2); color: var(--apx-success); }
.tag-other { background: rgba(245,245,220,0.1); color: var(--apx-cream-dark); }

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
    text-align: center; padding: 3rem; color: var(--apx-cream-dark);
}
.empty-state i { font-size: 3rem; color: var(--apx-gray-light); margin-bottom: 1rem; }
.empty-state h3 { font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--apx-cream); }
.empty-state p { font-size: 0.85rem; }

/* ============================================================
   ACTIVITY FEED
   ============================================================ */
.activity-feed { display: flex; flex-direction: column; gap: 0.5rem; }
.activity-item {
    display: flex; align-items: flex-start; gap: 0.75rem; padding: 0.75rem;
    border-radius: var(--radius-sm); background: var(--apx-dark-bg);
}
.activity-icon {
    width: 32px; height: 32px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 0.75rem; flex-shrink: 0;
}
.activity-icon.stage { background: rgba(150,113,56,0.2); color: var(--apx-gold); }
.activity-icon.note { background: rgba(96,165,250,0.2); color: var(--apx-info); }
.activity-icon.ai { background: rgba(167,139,250,0.2); color: #a78bfa; }
.activity-icon.deal { background: rgba(74,222,128,0.2); color: var(--apx-success); }
.activity-text { font-size: 0.8rem; color: var(--apx-cream); line-height: 1.4; }
.activity-time { font-size: 0.7rem; color: var(--apx-cream-dark); margin-top: 0.2rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1200px) {
    .pipeline-board { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
    .pipeline-board { grid-template-columns: repeat(2, 1fr); }
    .deal-detail-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .pipeline-board { grid-template-columns: 1fr; }
    .app-header { padding: 0 1rem; }
    .app-nav { padding: 0 1rem; }
    .page { padding: 1.5rem 1rem; }
    .kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .header-title { display: none; }
}

/* ============================================================
   AI ASSISTANT
   ============================================================ */
.ai-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.25rem; flex-wrap: wrap; gap: 1rem;
}
.ai-header-left { display: flex; align-items: center; gap: 1rem; }
.ai-header-left .page-title i { color: #a78bfa; }
.ai-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.ai-model-select {
    padding: 0.4rem 2rem 0.4rem 0.75rem; background: var(--apx-dark-bg);
    border: 1px solid var(--apx-gray-light); border-radius: var(--radius-sm);
    color: var(--apx-cream); font-family: 'Poppins', sans-serif; font-size: 0.75rem;
    cursor: pointer; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23967138' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 0.5rem center;
}
.ai-model-select option { background: var(--apx-gray); color: var(--apx-cream); }

.ai-layout {
    display: grid; grid-template-columns: 1.6fr 0.9fr; gap: 1.25rem;
    min-height: calc(100vh - 260px);
}

/* Chat Panel */
.ai-chat {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 1.25rem; display: flex; flex-direction: column;
}
.ai-messages {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem;
    padding-bottom: 0.5rem; min-height: 400px; max-height: calc(100vh - 380px);
}
.ai-msg { display: flex; gap: 0.75rem; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-avatar {
    width: 32px; height: 32px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-size: 0.75rem; flex-shrink: 0;
}
.ai-msg.user .ai-avatar { background: rgba(150,113,56,0.3); color: var(--apx-gold); }
.ai-msg.assistant .ai-avatar { background: rgba(167,139,250,0.2); color: #a78bfa; }
.ai-bubble {
    max-width: 80%; padding: 0.85rem 1rem; border-radius: 14px;
    font-size: 0.84rem; line-height: 1.6; border: 1px solid transparent;
}
.ai-msg.user .ai-bubble {
    background: rgba(150,113,56,0.18); border-color: rgba(150,113,56,0.38);
    color: var(--apx-cream);
}
.ai-msg.assistant .ai-bubble {
    background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.08);
    color: var(--apx-cream-dark);
}
.ai-bubble p { margin-bottom: 0.5rem; }
.ai-bubble p:last-child { margin-bottom: 0; }
.ai-bubble strong { color: var(--apx-cream); }
.ai-bubble ul, .ai-bubble ol { padding-left: 1.25rem; margin: 0.5rem 0; }
.ai-bubble li { margin-bottom: 0.25rem; }
.ai-bubble code {
    background: rgba(255,255,255,0.08); padding: 0.15rem 0.4rem;
    border-radius: 4px; font-size: 0.8rem; font-family: 'Courier New', monospace;
}
.ai-bubble pre {
    background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px; padding: 0.75rem; overflow-x: auto; margin: 0.5rem 0;
}
.ai-bubble pre code { background: none; padding: 0; }
.ai-bubble table { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.8rem; }
.ai-bubble table th, .ai-bubble table td {
    padding: 0.4rem 0.6rem; border: 1px solid rgba(255,255,255,0.1); text-align: left;
}
.ai-bubble table th { background: rgba(150,113,56,0.15); color: var(--apx-gold); font-weight: 600; }
.ai-bubble h1, .ai-bubble h2, .ai-bubble h3, .ai-bubble h4 {
    color: var(--apx-cream); margin: 0.75rem 0 0.4rem 0; font-weight: 600;
}
.ai-bubble h1 { font-size: 1.1rem; } .ai-bubble h2 { font-size: 1rem; }
.ai-bubble h3 { font-size: 0.9rem; } .ai-bubble h4 { font-size: 0.85rem; }
.ai-bubble blockquote {
    border-left: 3px solid var(--apx-gold); padding: 0.5rem 0.75rem;
    margin: 0.5rem 0; background: rgba(150,113,56,0.08); border-radius: 0 8px 8px 0;
}
.ai-typing { display: flex; gap: 4px; padding: 0.5rem 0; }
.ai-typing span {
    width: 6px; height: 6px; background: #a78bfa; border-radius: 50%;
    animation: aiDot 1.4s infinite both;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiDot { 0%,80%,100% { transform: scale(0.6); opacity: 0.4; } 40% { transform: scale(1); opacity: 1; } }

/* Input area */
.ai-input-area {
    display: flex; gap: 0.5rem; margin-top: 0.75rem; padding-top: 0.75rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.ai-input {
    flex: 1; padding: 0.7rem 1rem; background: var(--apx-dark-bg);
    border: 1px solid var(--apx-gray-light); border-radius: var(--radius-sm);
    color: var(--apx-cream); font-family: 'Poppins', sans-serif; font-size: 0.85rem;
    resize: none; min-height: 44px; max-height: 120px;
}
.ai-input:focus { outline: none; border-color: var(--apx-gold); }
.ai-input::placeholder { color: var(--apx-cream-dark); opacity: 0.6; }
.ai-send-btn {
    padding: 0.7rem 1.25rem; background: linear-gradient(135deg, rgba(150,113,56,0.95), rgba(201,162,39,0.85));
    color: var(--apx-black); border: none; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.85rem; cursor: pointer; transition: all 0.2s;
    display: flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.ai-send-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(150,113,56,0.3); }
.ai-send-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Sidebar */
.ai-side { display: flex; flex-direction: column; gap: 1rem; }
.ai-card {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px; padding: 1.25rem;
}
.ai-card-title {
    font-size: 0.8rem; font-weight: 600; color: var(--apx-gold);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.75rem;
    display: flex; align-items: center; gap: 0.5rem;
}
.ai-card-title i { font-size: 0.75rem; }

/* Quick Actions Grid */
.ai-quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ai-quick-btn {
    padding: 0.65rem 0.75rem; background: var(--apx-dark-bg);
    border: 1px solid var(--apx-gray-light); border-radius: 12px;
    color: var(--apx-cream-dark); font-size: 0.75rem; cursor: pointer;
    transition: all 0.2s; text-align: left; display: flex; align-items: center; gap: 0.5rem;
}
.ai-quick-btn:hover {
    border-color: rgba(150,113,56,0.5); color: var(--apx-cream);
    background: rgba(150,113,56,0.08);
}
.ai-quick-btn i { color: var(--apx-gold); font-size: 0.7rem; flex-shrink: 0; }

/* Context info */
.ai-context-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.4rem 0; font-size: 0.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.ai-context-item:last-child { border-bottom: none; }
.ai-context-label { color: var(--apx-cream-dark); }
.ai-context-value { color: var(--apx-cream); font-weight: 500; }

/* Chat history */
.ai-history-item {
    padding: 0.5rem 0.75rem; background: var(--apx-dark-bg);
    border-radius: 10px; margin-bottom: 0.4rem; cursor: pointer;
    font-size: 0.75rem; color: var(--apx-cream-dark); transition: all 0.2s;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-history-item:hover { color: var(--apx-cream); background: rgba(150,113,56,0.1); }

/* Export dropdown */
.ai-export-menu {
    position: absolute; top: 100%; right: 0; background: var(--apx-gray);
    border: 1px solid var(--apx-gray-light); border-radius: 12px;
    padding: 0.4rem; min-width: 160px; z-index: 50; display: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.ai-export-menu.show { display: block; }
.ai-export-item {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.75rem;
    font-size: 0.8rem; color: var(--apx-cream-dark); border-radius: 8px;
    cursor: pointer; transition: all 0.15s; width: 100; background: none; border: none;
}
.ai-export-item:hover { background: rgba(150,113,56,0.12); color: var(--apx-cream); }
.ai-export-item i { width: 16px; text-align: center; color: var(--apx-gold); }

/* Welcome state */
.ai-welcome {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; padding: 2rem;
}
.ai-welcome i { font-size: 3rem; color: #a78bfa; margin-bottom: 1rem; opacity: 0.6; }
.ai-welcome h3 { font-size: 1.1rem; color: var(--apx-cream); margin-bottom: 0.5rem; }
.ai-welcome p { font-size: 0.85rem; color: var(--apx-cream-dark); max-width: 400px; }

/* Dashboard AI Intelligence Panel */
.ai-intel-panel { border-color: rgba(167,139,250,0.3); }
.ai-intel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 1rem; }
.ai-intel-btn {
    padding: 0.75rem; background: var(--apx-dark-bg);
    border: 1px solid var(--apx-gray-light); border-radius: 12px;
    color: var(--apx-cream-dark); font-size: 0.75rem; cursor: pointer;
    transition: all 0.2s; text-align: center;
}
.ai-intel-btn:hover { border-color: rgba(167,139,250,0.5); color: var(--apx-cream); background: rgba(167,139,250,0.08); }
.ai-intel-btn i { display: block; font-size: 1.1rem; color: #a78bfa; margin-bottom: 0.4rem; }

/* Deal Detail - Ask AI */
.ai-deal-panel { border-color: rgba(167,139,250,0.3); }
.ai-deal-input-area { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.ai-deal-messages {
    max-height: 300px; overflow-y: auto; display: flex; flex-direction: column;
    gap: 0.5rem; margin-top: 0.75rem;
}

/* Responsive AI */
@media (max-width: 900px) {
    .ai-layout { grid-template-columns: 1fr; }
    .ai-side { order: -1; }
    .ai-quick-grid { grid-template-columns: 1fr 1fr; }
    .ai-intel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
    .ai-quick-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   GOOGLE DRIVE
   ============================================================ */
.drive-breadcrumb {
    display: flex; align-items: center; gap: 0.25rem; padding: 0.75rem 1rem;
    background: var(--apx-dark-card); border-radius: var(--radius-md);
    margin-bottom: 1rem; flex-wrap: wrap; font-size: 0.8rem;
}
.drive-breadcrumb-item {
    color: var(--apx-cream-dark); cursor: pointer; transition: color 0.2s;
    display: flex; align-items: center; gap: 0.3rem;
}
.drive-breadcrumb-item:hover { color: var(--apx-gold); }
.drive-breadcrumb-item.active { color: var(--apx-cream); font-weight: 500; cursor: default; }
.drive-breadcrumb-sep { color: var(--apx-gray-light); font-size: 0.7rem; margin: 0 0.15rem; }

.drive-search { margin-bottom: 1rem; }
.drive-search-box {
    position: relative; max-width: 500px;
}
.drive-search-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--apx-cream-dark); font-size: 0.85rem;
}
.drive-search-input { padding-left: 2.5rem !important; padding-right: 5rem !important; }

.drive-upload-area {
    background: var(--apx-dark-card); border-radius: var(--radius-md);
    padding: 1.25rem; margin-bottom: 1rem; border: 1px solid var(--apx-gray-light);
}
.drive-upload-zone {
    border: 2px dashed var(--apx-gray-light); border-radius: var(--radius-md);
    padding: 2rem; text-align: center; cursor: pointer; transition: all 0.2s;
}
.drive-upload-zone:hover, .drive-upload-zone.dragover {
    border-color: var(--apx-gold); background: rgba(150, 113, 56, 0.05);
}
.drive-upload-list {
    display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem;
}
.drive-upload-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--apx-dark-bg); border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem; font-size: 0.8rem;
}
.drive-upload-item-info {
    display: flex; align-items: center; gap: 0.5rem; color: var(--apx-cream);
    overflow: hidden;
}
.drive-upload-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.drive-upload-item-size { color: var(--apx-cream-dark); font-size: 0.7rem; }
.drive-upload-item-remove {
    background: none; border: none; color: var(--apx-danger); cursor: pointer;
    font-size: 0.85rem; padding: 0.25rem;
}
.drive-upload-progress {
    height: 3px; background: var(--apx-gray-light); border-radius: 2px;
    margin-top: 0.4rem; overflow: hidden;
}
.drive-upload-progress-bar {
    height: 100%; background: var(--apx-gold); border-radius: 2px;
    transition: width 0.3s; width: 0%;
}

.drive-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}
.drive-item {
    background: var(--apx-dark-card); border-radius: var(--radius-md);
    padding: 1rem; cursor: pointer; transition: all 0.2s;
    border: 1px solid transparent; position: relative;
}
.drive-item:hover {
    border-color: var(--apx-gold); transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.drive-item-icon {
    font-size: 2rem; margin-bottom: 0.75rem; text-align: center;
}
.drive-item-icon.folder { color: var(--apx-gold); }
.drive-item-icon.file { color: var(--apx-info); }
.drive-item-icon.pdf { color: var(--apx-danger); }
.drive-item-icon.image { color: var(--apx-success); }
.drive-item-icon.spreadsheet { color: #34a853; }
.drive-item-icon.presentation { color: #fbbc04; }
.drive-item-icon.doc { color: #4285f4; }
.drive-item-name {
    font-size: 0.8rem; font-weight: 500; color: var(--apx-cream);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    text-align: center;
}
.drive-item-meta {
    font-size: 0.65rem; color: var(--apx-cream-dark); text-align: center;
    margin-top: 0.3rem;
}
.drive-item-actions {
    position: absolute; top: 0.5rem; right: 0.5rem; display: none;
}
.drive-item:hover .drive-item-actions { display: flex; gap: 0.25rem; }
.drive-item-action {
    background: var(--apx-dark-bg); border: none; color: var(--apx-cream-dark);
    width: 24px; height: 24px; border-radius: 4px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; font-size: 0.65rem;
    transition: all 0.15s;
}
.drive-item-action:hover { color: var(--apx-gold); background: var(--apx-dark-card); }
.drive-item-action.delete:hover { color: var(--apx-danger); }

.drive-loading, .drive-empty {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 3rem; grid-column: 1 / -1;
}

/* Drive in Deal Detail */
.drive-deal-files {
    display: flex; flex-direction: column; gap: 0.5rem;
}
.drive-deal-file {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.75rem; background: var(--apx-dark-bg);
    border-radius: var(--radius-sm); font-size: 0.8rem;
}
.drive-deal-file-info {
    display: flex; align-items: center; gap: 0.5rem; color: var(--apx-cream);
    overflow: hidden;
}
.drive-deal-file-name {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px;
}
.drive-deal-file-icon { color: var(--apx-gold); font-size: 0.9rem; }
.drive-deal-upload {
    margin-top: 0.75rem; display: flex; gap: 0.5rem;
}

/* Responsive Drive */
@media (max-width: 768px) {
    .drive-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (max-width: 480px) {
    .drive-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   AI ANALYSIS MODAL
   ============================================================ */
.ai-analysis-modal {
    max-width: 700px; max-height: 80vh; display: flex; flex-direction: column;
}
.ai-modal-body {
    flex: 1; overflow-y: auto; padding: 1.25rem; min-height: 200px;
}
.ai-modal-loading {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 3rem; min-height: 200px;
}
.ai-modal-content {
    font-size: 0.85rem; line-height: 1.6; color: var(--apx-cream);
}
.ai-modal-content h1, .ai-modal-content h2, .ai-modal-content h3, .ai-modal-content h4 {
    color: var(--apx-gold); margin: 1rem 0 0.5rem;
}
.ai-modal-content h2 { font-size: 1.05rem; }
.ai-modal-content h3 { font-size: 0.95rem; }
.ai-modal-content ul, .ai-modal-content ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.ai-modal-content li { margin: 0.3rem 0; }
.ai-modal-content strong { color: var(--apx-cream); }
.ai-modal-content code {
    background: rgba(167, 139, 250, 0.15); padding: 0.15rem 0.4rem;
    border-radius: 4px; font-size: 0.8rem; color: #c4b5fd;
}
.ai-modal-content pre {
    background: var(--apx-dark-bg); border-radius: var(--radius-sm);
    padding: 0.75rem; overflow-x: auto; margin: 0.5rem 0;
}
.ai-modal-content blockquote {
    border-left: 3px solid var(--apx-gold); padding-left: 0.75rem;
    color: var(--apx-cream-dark); margin: 0.5rem 0;
}
.ai-modal-content hr {
    border: none; border-top: 1px solid var(--apx-gray-light); margin: 1rem 0;
}

/* ============================================================
   AI PROACTIVE INSIGHTS (Dashboard)
   ============================================================ */
.ai-insights-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem;
}
.ai-insight-card {
    background: var(--apx-gray); border-radius: var(--radius-md);
    padding: 1rem 1.25rem; position: relative; cursor: pointer;
    transition: all 0.2s; border: 1px solid transparent; overflow: hidden;
}
.ai-insight-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.ai-insight-card.warning { border-color: rgba(250, 204, 21, 0.3); }
.ai-insight-card.warning:hover { border-color: var(--apx-warning); }
.ai-insight-card.danger { border-color: rgba(239, 68, 68, 0.3); }
.ai-insight-card.danger:hover { border-color: var(--apx-danger); }
.ai-insight-card.info { border-color: rgba(167, 139, 250, 0.3); }
.ai-insight-card.info:hover { border-color: #a78bfa; }
.ai-insight-card.success { border-color: rgba(74, 222, 128, 0.3); }
.ai-insight-card.success:hover { border-color: var(--apx-success); }
.ai-insight-value { font-size: 1.5rem; font-weight: 700; color: var(--apx-cream); }
.ai-insight-label { font-size: 0.7rem; color: var(--apx-cream-dark); margin-top: 0.15rem; }
.ai-insight-icon {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    font-size: 1.3rem; opacity: 0.15;
}
.ai-insight-card.warning .ai-insight-icon { color: var(--apx-warning); }
.ai-insight-card.danger .ai-insight-icon { color: var(--apx-danger); }
.ai-insight-card.info .ai-insight-icon { color: #a78bfa; }
.ai-insight-card.success .ai-insight-icon { color: var(--apx-success); }

/* ============================================================
   AI PAGE PANELS (Pipeline, Deals, Catalog, Drive, Booking)
   ============================================================ */
.ai-page-panel {
    background: rgba(167, 139, 250, 0.05); border: 1px solid rgba(167, 139, 250, 0.15);
    border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-bottom: 1.25rem;
}
.ai-page-panel-header {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem;
}
.ai-page-panel-title {
    font-size: 0.85rem; font-weight: 600; color: var(--apx-cream);
    display: flex; align-items: center; gap: 0.5rem;
}

/* AI Panel Ask Section (presets + input) */
.ai-panel-ask { margin-top: 0.75rem; }
.ai-panel-presets {
    display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem;
}
.ai-preset-btn {
    background: rgba(167, 139, 250, 0.1); border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 20px; padding: 0.3rem 0.75rem; font-size: 0.7rem;
    color: #c4b5fd; cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.ai-preset-btn:hover {
    background: rgba(167, 139, 250, 0.2); border-color: #a78bfa; color: #e0d4fd;
}
.ai-panel-input-row {
    display: flex; gap: 0.5rem; align-items: center;
}
.ai-panel-input {
    flex: 1; font-size: 0.8rem !important; padding: 0.5rem 0.75rem !important;
    border-radius: 20px !important;
}

/* ============================================================
   AI TABS (AI Assistant Page)
   ============================================================ */
.ai-tabs {
    display: flex; gap: 0; margin-bottom: 1rem; border-bottom: 1px solid var(--apx-gray-light);
}
.ai-tab {
    padding: 0.6rem 1.25rem; font-size: 0.85rem; color: var(--apx-cream-dark);
    border: none; background: none; cursor: pointer; position: relative;
    transition: all 0.2s; display: flex; align-items: center; gap: 0.4rem;
}
.ai-tab:hover { color: var(--apx-cream); }
.ai-tab.active {
    color: #a78bfa; font-weight: 600;
}
.ai-tab.active::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0;
    height: 2px; background: #a78bfa; border-radius: 2px 2px 0 0;
}

/* ============================================================
   AI REPORTS GRID
   ============================================================ */
.ai-reports-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem;
}
.ai-report-card {
    background: var(--apx-gray); border-radius: var(--radius-md);
    padding: 1.25rem; cursor: pointer; transition: all 0.2s;
    border: 1px solid transparent; text-align: center;
}
.ai-report-card:hover {
    border-color: #a78bfa; transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.ai-report-card i {
    font-size: 1.5rem; color: #a78bfa; margin-bottom: 0.75rem; display: block;
}
.ai-report-title {
    font-size: 0.85rem; font-weight: 600; color: var(--apx-cream); margin-bottom: 0.3rem;
}
.ai-report-desc {
    font-size: 0.7rem; color: var(--apx-cream-dark); line-height: 1.4;
}

/* ============================================================
   AI SLASH COMMANDS
   ============================================================ */
.ai-slash-commands {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
}
.ai-slash-item {
    background: rgba(167, 139, 250, 0.1); border-radius: 4px;
    padding: 0.2rem 0.5rem; font-size: 0.7rem; font-family: monospace;
    color: #c4b5fd; cursor: pointer; transition: all 0.15s;
}
.ai-slash-item:hover { background: rgba(167, 139, 250, 0.25); color: #e0d4fd; }

/* ============================================================
   AI HELP BUTTON (Submit Deal)
   ============================================================ */
.ai-help-btn {
    font-size: 0.7rem !important; padding: 0.15rem 0.5rem !important;
    color: #a78bfa !important; border: 1px solid rgba(167, 139, 250, 0.3) !important;
    border-radius: 12px !important; margin-left: 0.5rem; vertical-align: middle;
}
.ai-help-btn:hover { background: rgba(167, 139, 250, 0.15) !important; }

/* ============================================================
   AI ACCESS TOGGLE (Settings)
   ============================================================ */
.ai-toggle {
    position: relative; display: inline-block; width: 36px; height: 20px; vertical-align: middle;
}
.ai-toggle input { opacity: 0; width: 0; height: 0; }
.ai-toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--apx-gray-light); border-radius: 20px; transition: 0.3s;
}
.ai-toggle-slider::before {
    content: ''; position: absolute; height: 14px; width: 14px;
    left: 3px; bottom: 3px; background: var(--apx-cream-dark);
    border-radius: 50%; transition: 0.3s;
}
.ai-toggle input:checked + .ai-toggle-slider { background: #a78bfa; }
.ai-toggle input:checked + .ai-toggle-slider::before {
    transform: translateX(16px); background: white;
}

/* ============================================================
   ADMIN ACTIVITY PANEL
   ============================================================ */
.admin-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.admin-activity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.presence-status-dot {
    font-size: 1.2rem;
    line-height: 1;
}

.admin-activity-detail {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   RESPONSIVE AI
   ============================================================ */
@media (max-width: 768px) {
    .admin-settings-grid { grid-template-columns: 1fr; }
    .ai-insights-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-reports-grid { grid-template-columns: repeat(2, 1fr); }
    .ai-page-panel .ai-intel-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .ai-insights-grid { grid-template-columns: 1fr 1fr; }
    .ai-reports-grid { grid-template-columns: 1fr; }
    .ai-page-panel .ai-intel-grid { grid-template-columns: 1fr; }
    .ai-analysis-modal { max-width: 95vw; }
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--apx-dark-bg); }
::-webkit-scrollbar-thumb { background: var(--apx-gray-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--apx-gold); }
