/* QSystem Shared Styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; background: #f1f5f9; color: #1e293b; min-height: 100vh; }

/* Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #0f172a; flex-shrink: 0; display: flex; flex-direction: column; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { background: #fff; border-bottom: 1px solid #e2e8f0; padding: 0 24px; height: 60px; display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.content { flex: 1; overflow-y: auto; padding: 28px 28px; }

/* Sidebar */
.sidebar-logo { padding: 20px 20px 14px; border-bottom: 1px solid #1e293b; }
.sidebar-logo .logo-name { font-size: 1.2rem; font-weight: 800; color: #f8fafc; letter-spacing: -0.3px; }
.sidebar-logo .logo-tag { font-size: 0.65rem; color: #64748b; text-transform: uppercase; letter-spacing: 1px; margin-top: 1px; }
.sidebar-nav { padding: 14px 10px; flex: 1; }
.nav-section { font-size: 0.62rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 1.2px; padding: 10px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; cursor: pointer; color: #94a3b8; font-size: 0.875rem; font-weight: 500; text-decoration: none; margin-bottom: 1px; transition: all 0.15s; }
.nav-item:hover { background: #1e293b; color: #e2e8f0; }
.nav-item.active { background: #1d4ed8; color: #fff; }
.nav-item .icon { width: 18px; text-align: center; font-size: 0.95rem; }
.nav-badge { margin-left: auto; background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700; padding: 2px 6px; border-radius: 99px; }
.sidebar-user { padding: 16px 14px; border-top: 1px solid #1e293b; }
.sidebar-user .user-name { font-size: 0.82rem; font-weight: 600; color: #e2e8f0; }
.sidebar-user .user-role { font-size: 0.72rem; color: #64748b; margin-top: 2px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #3b82f6, #8b5cf6); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }
.user-info { display: flex; align-items: center; gap: 10px; }

/* Topbar */
.page-title { font-size: 1.05rem; font-weight: 700; color: #1e293b; }
.breadcrumb { font-size: 0.78rem; color: #94a3b8; margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar-icon { width: 36px; height: 36px; border-radius: 8px; border: 1px solid #e2e8f0; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 1rem; position: relative; }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; background: #ef4444; border-radius: 50%; border: 1.5px solid #fff; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; text-decoration: none; }
.btn-primary { background: #1d4ed8; color: #fff; }
.btn-primary:hover { background: #1e40af; }
.btn-secondary { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.btn-secondary:hover { background: #e2e8f0; }
.btn-success { background: #059669; color: #fff; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-warning { background: #d97706; color: #fff; }
.btn-ghost { background: transparent; color: #64748b; border: 1px solid #e2e8f0; }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-lg { padding: 11px 22px; font-size: 0.95rem; }
.btn-outline-primary { background: transparent; color: #1d4ed8; border: 1.5px solid #1d4ed8; }

/* Cards */
.card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.card-header { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; display: flex; align-items: center; justify-content: space-between; }
.card-header h3 { font-size: 0.95rem; font-weight: 700; color: #1e293b; }
.card-body { padding: 20px; }

/* Stat cards */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 18px 20px; }
.stat-label { font-size: 0.75rem; color: #64748b; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-value { font-size: 1.9rem; font-weight: 800; color: #1e293b; margin: 4px 0; }
.stat-change { font-size: 0.78rem; color: #64748b; }
.stat-change.up { color: #059669; }
.stat-icon { font-size: 1.6rem; }

/* Status badges */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; font-weight: 600; padding: 3px 9px; border-radius: 99px; }
.badge-draft { background: #f1f5f9; color: #475569; }
.badge-pending { background: #fef9c3; color: #854d0e; }
.badge-approved { background: #dcfce7; color: #166534; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.badge-quoted { background: #ede9fe; color: #5b21b6; }
.badge-blue { background: #dbeafe; color: #1e40af; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead th { background: #f8fafc; padding: 10px 14px; text-align: left; font-size: 0.72rem; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid #e2e8f0; }
tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; color: #374151; vertical-align: middle; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: none; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 5px; }
.form-control { width: 100%; padding: 9px 12px; border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 0.875rem; color: #1e293b; outline: none; transition: border 0.15s; background: #fff; }
.form-control:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-control[readonly] { background: #f8fafc; color: #64748b; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-row-4 { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }

/* Section headers */
.section-title { font-size: 1.1rem; font-weight: 700; color: #1e293b; margin-bottom: 6px; }
.section-sub { font-size: 0.82rem; color: #64748b; margin-bottom: 20px; }
.divider { border: none; border-top: 1px solid #e2e8f0; margin: 20px 0; }

/* Tabs */
.tabs { display: flex; gap: 0; border-bottom: 2px solid #e2e8f0; margin-bottom: 20px; }
.tab { padding: 10px 18px; font-size: 0.85rem; font-weight: 600; color: #64748b; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.tab.active { color: #1d4ed8; border-bottom-color: #1d4ed8; }

/* Alert/Info boxes */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 16px; display: flex; align-items: flex-start; gap: 10px; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Back to mockups */
.mockup-nav { position: fixed; bottom: 20px; right: 20px; z-index: 999; }
.mockup-nav a { display: block; background: #0f172a; color: #f1f5f9; padding: 10px 16px; border-radius: 10px; font-size: 0.8rem; font-weight: 600; text-decoration: none; border: 1px solid #334155; }
.mockup-nav a:hover { background: #1e293b; }

/* Utility */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.mr-2 { margin-right: 8px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.w-full { width: 100%; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.75rem; }
.text-lg { font-size: 1.1rem; }
.text-xl { font-size: 1.3rem; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-gray { color: #64748b; }
.text-dark { color: #1e293b; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.rounded { border-radius: 8px; }
.rounded-lg { border-radius: 12px; }
.shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.07); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
