:root {
    --primary: #0F172A;
    --secondary: #2563EB;
    --accent: #10B981;
    --primary-rgb: 15, 23, 42;
    --secondary-rgb: 37, 99, 235;
    --accent-rgb: 16, 185, 129;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.bg-primary-custom { background-color: var(--primary) !important; }
.text-secondary-custom { color: var(--secondary) !important; }
.text-accent { color: var(--accent) !important; }

.btn-secondary-custom {
    background-color: var(--secondary);
    border-color: var(--secondary);
    color: #fff;
}
.btn-secondary-custom:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

.btn-accent {
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.btn-accent:hover {
    background-color: #059669;
    border-color: #059669;
    color: #fff;
}

/* Hero */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 50%, #0f172a 100%);
    padding: 2rem 0 4rem;
    min-height: 80vh;
}
.min-vh-75 { min-height: 75vh; }

.hero-mockup .mockup-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,.3);
}
.mockup-header {
    background: #f1f5f9;
    padding: 12px 16px;
    display: flex;
    gap: 6px;
}
.mockup-header span {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #cbd5e1;
}
.mockup-body { padding: 1.5rem; }
.stat-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.stat-box {
    flex: 1;
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
}
.stat-box.accent { background: rgba(var(--accent-rgb), .1); }
.stat-box strong { display: block; font-size: 1.25rem; }
.chart-placeholder {
    height: 120px;
    background: linear-gradient(180deg, rgba(var(--secondary-rgb),.2) 0%, transparent 100%);
    border-radius: 8px;
}

.module-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    transition: transform .2s, box-shadow .2s;
    height: 100%;
}
.module-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

/* Auth */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), #1e3a5f);
    padding: 1rem;
}
.auth-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.auth-card-wide { max-width: 560px; }
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    color: #94a3b8;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.divider span { padding: 0 1rem; font-size: .875rem; }

/* Dashboard */
.dashboard-body {
    background: #f8fafc;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--primary);
    color: #e2e8f0;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}
.sidebar-brand {
    padding: 1.25rem 1.5rem;
    font-size: 1.25rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(255,255,255,.1);
}
.sidebar-nav { flex: 1; padding: 1rem 0; overflow-y: auto; }
.sidebar-section {
    padding: .75rem 1.5rem .25rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #64748b;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.5rem;
    color: #cbd5e1;
    text-decoration: none;
    font-size: .9rem;
    transition: background .15s;
}
.sidebar-link:hover, .sidebar-link.active {
    background: rgba(255,255,255,.08);
    color: #fff;
}
.sidebar-footer {
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,.1);
}

.dashboard-main {
    flex: 1;
    margin-left: 0;
}
@media (min-width: 992px) {
    .dashboard-main { margin-left: 260px; }
    .dashboard-body { padding-bottom: 0; }
}

.dashboard-header {
    background: #fff;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 50;
}
.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}
.dashboard-content { padding: 1.5rem; }

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    height: 100%;
}
.stat-icon {
    width: 48px; height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    padding: .5rem 0 calc(.5rem + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,.05);
}
.mobile-bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #64748b;
    font-size: .7rem;
    padding: .5rem .75rem;
    min-width: 56px;
    min-height: 48px;
    justify-content: center;
}
.mobile-bottom-nav .nav-item i { font-size: 1.25rem; }
.mobile-bottom-nav .nav-item.active { color: var(--secondary); }

.admin-menu-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,.1) !important;
}

/* PWA install banner */
.pwa-install-banner {
    position: fixed;
    bottom: 80px;
    left: 1rem; right: 1rem;
    background: var(--primary);
    color: #fff;
    padding: 1rem;
    border-radius: 12px;
    z-index: 999;
    display: none;
}
@media (min-width: 992px) {
    .pwa-install-banner { bottom: 1rem; left: auto; right: 1rem; max-width: 320px; }
}

/* Logo */
.brand-logo { height: 36px; width: auto; }
.brand-logo-sm { height: 28px; }

/* AI Chat */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 180px);
    min-height: 400px;
}
.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: .5rem 0;
}
.ai-msg {
    display: flex;
    gap: .75rem;
    margin-bottom: 1rem;
    align-items: flex-start;
}
.ai-msg.user { flex-direction: row-reverse; }
.ai-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.ai-msg.assistant .ai-avatar { background: rgba(var(--accent-rgb), .15); color: var(--accent); }
.ai-msg.user .ai-avatar { background: rgba(var(--secondary-rgb), .15); color: var(--secondary); }
.ai-bubble {
    background: #fff;
    border-radius: 16px;
    padding: .75rem 1rem;
    max-width: 85%;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    font-size: .95rem;
    line-height: 1.5;
}
.ai-msg.user .ai-bubble {
    background: var(--secondary);
    color: #fff;
}
.ai-input-bar {
    display: flex;
    gap: .5rem;
    padding: .75rem 0;
    position: sticky;
    bottom: 0;
    background: #f8fafc;
}
.ai-input-bar .form-control {
    border-radius: 24px;
    padding: .75rem 1.25rem;
    font-size: 1rem;
}
.ai-input-bar .btn {
    border-radius: 50%;
    width: 48px; height: 48px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Documents */
.doc-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .25rem;
    padding: 1rem .5rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-decoration: none;
    color: var(--primary);
    font-size: .75rem;
    transition: all .15s;
}
.doc-type-btn:hover, .doc-type-btn:active {
    border-color: var(--secondary);
    background: rgba(var(--secondary-rgb), .05);
    color: var(--secondary);
}
.doc-type-btn i { font-size: 1.5rem; color: var(--secondary); }
.doc-list-item { padding: 1rem !important; }

/* POS Mobile */
.pos-product-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: .75rem .5rem;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    height: 100%;
}
.pos-product-card:active, .pos-product.added .pos-product-card {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .08);
    transform: scale(.95);
}
.pos-product-icon { font-size: 1.5rem; color: var(--secondary); margin-bottom: .25rem; }
.pos-product-name { font-size: .7rem; font-weight: 600; }
.pos-product-price { font-size: .8rem; color: var(--accent); font-weight: 700; }
.pos-cart-bar {
    position: fixed;
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    left: 0; right: 0;
    background: var(--primary);
    color: #fff;
    padding: .75rem 1rem;
    z-index: 900;
    box-shadow: 0 -4px 12px rgba(0,0,0,.15);
}

/* Mobile Side Nav (Offcanvas) */
.mobile-side-nav { padding: .5rem 0; }
.mobile-side-section {
    padding: .75rem 1.25rem .25rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #94a3b8;
    font-weight: 600;
}
.mobile-side-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.25rem;
    color: var(--primary);
    text-decoration: none;
    font-size: 1rem;
    min-height: 48px;
}
.mobile-side-link:active { background: #f1f5f9; }
.mobile-side-link i { font-size: 1.25rem; width: 24px; text-align: center; }
@media (min-width: 992px) {
    .pos-cart-bar { bottom: 0; left: 260px; }
}

/* Content Studio */
.content-type-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    padding: 1rem;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all .15s;
    font-size: .85rem;
}
.content-type-btn.active, .content-type-btn:hover {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), .05);
}
.content-type-btn i { font-size: 1.5rem; color: var(--secondary); }
.generated-text {
    white-space: pre-wrap;
    line-height: 1.6;
    font-size: .95rem;
}

/* Dashboard CTA Banner */
.dashboard-cta-banner {
    background: linear-gradient(135deg, var(--secondary), var(--accent));
    color: #fff;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
.dashboard-cta-banner a { color: #fff; font-weight: 600; }

/* Course cards */
.course-card { transition: transform .15s; }
.course-card:active { transform: scale(.98); }

/* Mobile form */
.mobile-form .form-control-lg { font-size: 1rem; }

/* Demo Trial */
.try-hero {
    background: linear-gradient(135deg, var(--primary), #1e3a5f);
    padding: 2.5rem 0;
}
.try-feature-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem;
    height: 100%;
    transition: transform .15s, box-shadow .15s;
}
.try-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
}
.try-feature-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: .75rem;
}
.try-feature-icon-lg {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.try-badge {
    font-size: .7rem;
    padding: .2rem .5rem;
    border-radius: 6px;
    font-weight: 600;
}
.try-badge-ok { background: rgba(var(--accent-rgb), .12); color: var(--accent); }
.try-badge-out { background: #fef3c7; color: #92400e; }
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.try-sticky-cta {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--primary);
    padding: .75rem 0 calc(.75rem + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
    box-shadow: 0 -4px 20px rgba(0,0,0,.2);
}
.try-tabs-section { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
.try-nav-pills .nav-link {
    border-radius: 24px;
    padding: .5rem 1rem;
    font-size: .875rem;
    color: #64748b;
    margin: 0 .15rem;
}
.try-nav-pills .nav-link.active {
    background: var(--secondary);
}
.try-step-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.try-step-num {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.try-step-text { padding-top: .25rem; }
.try-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #64748b;
}
.mock-phone {
    max-width: 280px;
    margin: 0 auto;
    background: var(--primary);
    border-radius: 24px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,.15);
}
.mock-phone-screen {
    background: #f8fafc;
    border-radius: 16px;
    overflow: hidden;
    min-height: 200px;
}
.mock-doc-bar {
    background: var(--secondary);
    color: #fff;
    padding: .5rem 1rem;
    font-size: .85rem;
}
.mock-line {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    margin-bottom: 8px;
}
.mock-line.short { width: 60%; }
.mock-fb-post {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: .75rem;
}
.mock-pos-total {
    background: var(--primary);
    color: #fff;
    text-align: center;
    padding: .5rem;
    border-radius: 8px;
    font-size: .85rem;
    font-weight: 600;
}
.demo-doc-preview {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
}
.demo-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--secondary);
    padding-bottom: .75rem;
    margin-bottom: .75rem;
}
.demo-doc-meta { font-size: .85rem; margin-bottom: 1rem; }
.demo-doc-table { font-size: .85rem; margin-bottom: 0; }
.try-ocr-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 2rem 1rem;
    background: #f8fafc;
}
.try-feature-header .try-feature-icon-lg { margin-top: .25rem; }
