:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #06b6d4;
    --accent-dark: #0891b2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #263348;
    --bg-sidebar: #1a1f36;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --border-light: rgba(99, 102, 241, 0.2);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* === LANDING PAGE === */
.landing-page {
    background: linear-gradient(135deg, #0f172a 0%, #1a1f3a 30%, #0f172a 60%, #162032 100%);
    min-height: 100vh;
}

.landing-nav {
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: var(--transition);
    background: transparent;
}

.landing-nav.scrolled {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
}

.nav-brand span { color: var(--primary); }

.hero-section {
    padding: 160px 0 100px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, -20px); }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.85rem;
    color: var(--primary-light);
    margin-bottom: 30px;
    position: relative;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 24px;
    position: relative;
}

.hero-title .gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
    line-height: 1.7;
    position: relative;
}

.hero-buttons { position: relative; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn-hero {
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-hero-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-hero-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
    color: #fff;
}

.btn-hero-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-hero-outline:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    transform: translateY(-3px);
}

/* Features Section */
.features-section {
    padding: 80px 0;
    position: relative;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 60px;
}

.feature-card {
    background: rgba(30, 41, 59, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15);
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.feature-icon.word { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.feature-icon.excel { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.feature-icon.pdf { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.feature-icon.manage { background: rgba(99, 102, 241, 0.15); color: #6366f1; }
.feature-icon.download { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.feature-icon.secure { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }

.feature-card h5 { font-weight: 600; margin-bottom: 12px; font-size: 1.1rem; }
.feature-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; margin: 0; }

/* Stats Section */
.stats-section {
    padding: 60px 0;
    background: rgba(99, 102, 241, 0.03);
    border-top: 1px solid rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
}

.stat-item { text-align: center; padding: 20px; }
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.stat-label { color: var(--text-secondary); font-size: 0.95rem; margin-top: 5px; }

/* CTA Section */
.cta-section {
    padding: 80px 0;
    text-align: center;
}

/* === AUTH PAGES === */
.auth-page {
    background: linear-gradient(135deg, #0f172a, #1e293b, #0f172a);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-card {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.auth-card h2 { font-weight: 700; font-size: 1.6rem; }
.auth-card .brand { color: var(--primary); }

.form-label { color: var(--text-secondary); font-weight: 500; font-size: 0.88rem; }

.form-control, .form-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.95rem;
}

.form-control:focus {
    background: rgba(15, 23, 42, 0.8);
    border-color: var(--primary);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 24px;
    font-weight: 600;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

/* === APP LAYOUT === */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: var(--transition);
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #fff;
}

.sidebar-brand h5 {
    margin: 0;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.sidebar-brand h5 span { color: var(--primary-light); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }

.nav-section-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 16px 8px;
}

.nav-item-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 2px;
}

.nav-item-link:hover {
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-primary);
}

.nav-item-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    font-weight: 600;
}

.nav-item-link i { width: 20px; text-align: center; font-size: 1rem; }

.nav-item-link .badge-count {
    margin-left: auto;
    background: var(--primary);
    color: #fff;
    border-radius: 50px;
    padding: 2px 8px;
    font-size: 0.72rem;
}

.sidebar-user {
    padding: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.sidebar-user-info { flex: 1; overflow: hidden; }
.sidebar-user-info .name { font-size: 0.88rem; font-weight: 600; color: var(--text-primary); }
.sidebar-user-info .role { font-size: 0.75rem; color: var(--text-muted); text-transform: capitalize; }

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    padding: 16px 32px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title h4 { font-weight: 600; margin: 0; font-size: 1.15rem; }
.topbar-title p { color: var(--text-muted); font-size: 0.85rem; margin: 2px 0 0; }

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

.topbar-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    cursor: pointer;
}

.topbar-btn:hover { border-color: var(--primary); color: var(--primary-light); }

.content-area {
    padding: 32px;
    flex: 1;
}

/* === DASHBOARD === */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.card-primary::before { background: var(--primary); }
.stat-card.card-success::before { background: var(--success); }
.stat-card.card-accent::before { background: var(--accent); }
.stat-card.card-warning::before { background: var(--warning); }

.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }

.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.stat-card .stat-value { font-size: 1.8rem; font-weight: 700; margin: 12px 0 4px; }
.stat-card .stat-label { color: var(--text-muted); font-size: 0.85rem; }

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
}

.chart-card h6 { font-weight: 600; margin-bottom: 20px; }

/* === OFFICE MANAGEMENT === */
.office-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.office-tab {
    padding: 12px 24px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.office-tab.active {
    color: var(--primary-light);
}

.office-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    border-radius: 2px 2px 0 0;
}

.doc-editor-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.doc-toolbar {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(30, 41, 59, 0.5);
    flex-wrap: wrap;
}

.toolbar-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.toolbar-btn:hover { background: rgba(99, 102, 241, 0.15); color: var(--primary-light); }
.toolbar-btn.active { background: rgba(99, 102, 241, 0.2); color: var(--primary-light); }

.toolbar-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 6px;
}

.editor-content {
    min-height: 400px;
    padding: 24px;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.editor-content:focus { background: rgba(15, 23, 42, 0.3); }

.editor-content[contenteditable] h1 { font-size: 1.8rem; font-weight: 700; margin: 16px 0 8px; }
.editor-content[contenteditable] h2 { font-size: 1.4rem; font-weight: 600; margin: 14px 0 6px; }
.editor-content[contenteditable] h3 { font-size: 1.2rem; font-weight: 600; margin: 12px 0 4px; }

/* Excel Grid */
.excel-container {
    overflow: auto;
    padding: 16px;
}

.excel-grid {
    border-collapse: collapse;
    width: 100%;
    min-width: 800px;
}

.excel-grid th {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-align: center;
    min-width: 100px;
    position: sticky;
    top: 0;
}

.excel-grid td {
    border: 1px solid var(--border-color);
    padding: 0;
}

.excel-cell {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    font-size: 0.9rem;
    outline: none;
    font-family: 'Inter', monospace;
}

.excel-cell:focus {
    background: rgba(99, 102, 241, 0.08);
    box-shadow: inset 0 0 0 2px var(--primary);
}

.row-number {
    background: rgba(30, 41, 59, 0.5) !important;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-align: center !important;
    min-width: 50px !important;
    padding: 8px !important;
    font-weight: 500;
}

/* === DOCUMENT LIST === */
.doc-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 16px;
}

.doc-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.doc-type-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

.doc-type-icon.word { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.doc-type-icon.excel { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.doc-type-icon.pdf { background: rgba(239, 68, 68, 0.15); color: #ef4444; }

.doc-info { flex: 1; }
.doc-info h6 { font-weight: 600; margin-bottom: 4px; font-size: 0.95rem; }
.doc-info small { color: var(--text-muted); }

.doc-actions { display: flex; gap: 8px; }

.doc-action-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-secondary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
}

.doc-action-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.doc-action-btn.delete:hover { border-color: var(--danger); color: var(--danger); }

/* === ACCOUNT SETTINGS === */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 24px;
}

.settings-card h6 { font-weight: 600; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.settings-card h6 i { color: var(--primary-light); }

/* === ADMIN PANEL === */
.admin-stat {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
}

.admin-table {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.admin-table table {
    margin: 0;
    color: var(--text-primary);
}

.admin-table thead th {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.85rem;
    padding: 12px 16px;
}

.admin-table tbody td {
    border-color: var(--border-color);
    padding: 12px 16px;
    font-size: 0.9rem;
    vertical-align: middle;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
}

.status-badge.active { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-badge.inactive { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.status-badge.suspended { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-badge.admin { background: rgba(99, 102, 241, 0.15); color: #818cf8; }
.status-badge.user { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }

/* === RESPONSIVE === */
@media (max-width: 991px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .hero-title { font-size: 2.5rem; }
}

@media (max-width: 576px) {
    .hero-title { font-size: 2rem; }
    .content-area { padding: 16px; }
    .topbar { padding: 12px 16px; }
}

/* === UTILITY === */
.text-primary-light { color: var(--primary-light) !important; }
.text-accent { color: var(--accent) !important; }
.bg-card { background: var(--bg-card); }
.border-custom { border-color: var(--border-color) !important; }

.fade-in { animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.toast-container { z-index: 9999; }

/* Checkbox style for bulk select */
.doc-select {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}
