/* Developed by Rameez Scripts | WhatsApp: wa.me/923224083545 | YouTube: @rameezimdad */

:root { --navy-primary: #001f3f; --navy-dark: #001529; --navy-light: #003366; --navy-accent: #0074D9; --navy-hover: #002a52; --success: #34a853; --warning: #fbbc04; --danger: #ea4335; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -moz-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: #f5f5f5; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
input, select, textarea { font-size: 16px !important; touch-action: manipulation; }

/* Login */
.login-container { display: flex; justify-content: center; align-items: center; min-height: 100vh; padding: 20px; background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%); }
.login-box { background: white; padding: 50px 40px; border-radius: 4px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); width: 100%; max-width: 420px; text-align: center; }
.login-logo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; margin-bottom: 25px; border: 3px solid var(--navy-primary); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.login-box h2 { margin-bottom: 35px; color: var(--navy-primary); font-size: 26px; font-weight: 600; }

/* Layout */
.app-container { display: flex; height: 100vh; overflow: hidden; position: relative; }

/* Sidebar */
.sidebar { width: 260px; background: linear-gradient(180deg, var(--navy-primary) 0%, var(--navy-dark) 100%); color: white; overflow-y: auto; overflow-x: hidden; height: 100vh; display: flex; flex-direction: column; box-shadow: 2px 0 10px rgba(0,0,0,0.1); transition: transform 0.3s ease, width 0.3s ease; z-index: 1000; flex-shrink: 0; }

/* ultra-thin scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }
.sidebar::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }
.sidebar { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }

/* hide horizontal scrollbar globally */
body { overflow-x: hidden; }
.main-content { overflow-x: hidden; }
.app-container { overflow-x: hidden; }

/* Hamburger toggle */
.hamburger-btn { display: none; position: fixed; top: 14px; left: 14px; z-index: 1100; width: 42px; height: 42px; border-radius: 4px; border: none; background: var(--navy-primary); color: white; font-size: 20px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.2); align-items: center; justify-content: center; transition: all 0.3s; }
.hamburger-btn:hover { background: var(--navy-hover); }

/* Mobile overlay */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 999; opacity: 0; transition: opacity 0.3s ease; }
.sidebar-overlay.visible { display: block; opacity: 1; }
.sidebar-user-info { padding: 24px 20px; background: rgba(0,0,0,0.2); border-bottom: 1px solid rgba(255,255,255,0.1); text-align: center; }
.sidebar-user-name { font-weight: 600; font-size: 18px; margin-bottom: 8px; }
.sidebar-user-role { font-size: 13px; color: rgba(255,255,255,0.8); padding: 5px 12px; background: rgba(0,116,217,0.3); border-radius: 4px; display: inline-block; text-transform: capitalize; }
.sidebar-menu-section { flex: 1; padding: 20px 16px; }
.sidebar-menu-title { margin-bottom: 12px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: rgba(255,255,255,0.5); padding: 0 12px; }
.sidebar-menu { list-style: none; }
.sidebar-menu li { margin-bottom: 4px; }
.sidebar-menu button { width: 100%; text-align: left; padding: 14px 16px; background: transparent; border: none; color: rgba(255,255,255,0.9); cursor: pointer; border-radius: 3px; font-size: 15px; transition: all 0.3s; display: flex; align-items: center; gap: 14px; font-weight: 500; }
.sidebar-menu button:hover { background: rgba(255,255,255,0.1); color: white; transform: translateX(4px); }
.sidebar-menu button.active { background: var(--navy-accent); color: white; box-shadow: 0 4px 12px rgba(0,116,217,0.3); }
.sidebar-menu i { width: 20px; text-align: center; font-size: 18px; }
.sidebar-logout { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); background: rgba(0,0,0,0.15); }
.sidebar-logout button { width: 100%; padding: 14px 16px; background: linear-gradient(135deg, rgba(234,67,53,0.2) 0%, rgba(234,67,53,0.3) 100%); border: 1px solid rgba(234,67,53,0.4); color: white; cursor: pointer; border-radius: 3px; font-size: 15px; transition: all 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 600; }
.sidebar-logout button:hover { background: linear-gradient(135deg, rgba(234,67,53,0.4) 0%, rgba(234,67,53,0.5) 100%); transform: translateY(-2px); }

/* Main Content */
.main-content { flex: 1; padding: 20px; overflow-y: auto; background: #f5f5f5; min-width: 0; transition: margin-left 0.3s ease; }
.breadcrumb { padding: 12px 20px; background: white; border-radius: 3px; margin-bottom: 15px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); font-size: 14px; display: flex; align-items: center; gap: 8px; color: #666; }
.breadcrumb a { color: var(--navy-primary); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.breadcrumb a:hover { color: var(--navy-accent); }
.breadcrumb-sep { color: #ccc; font-size: 12px; }
.header { background: white; padding: 20px; border-radius: 3px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); display: flex; justify-content: space-between; align-items: center; }
.header h1 { font-size: 24px; color: #333; display: flex; align-items: center; gap: 10px; }

/* Data Section */
.data-section { background: white; padding: 20px; border-radius: 3px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h2 { font-size: 20px; color: #333; display: flex; align-items: center; gap: 10px; }

/* Skeleton Loaders */
.skeleton { background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s ease-in-out infinite; border-radius: 3px; }
@keyframes skeleton-loading { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-table { width: 100%; background: white; padding: 20px; border-radius: 3px; }
.skeleton-table-row { display: flex; gap: 15px; padding: 15px 0; border-bottom: 1px solid #f5f5f5; }
.skeleton-table-cell { height: 20px; border-radius: 3px; }
.skeleton-card { background: white; padding: 24px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border: 1px solid #e0e0e0; border-left: 4px solid var(--navy-primary); }
.skeleton-icon { width: 60px; height: 60px; border-radius: 4px; margin-bottom: 16px; }
.skeleton-text { height: 16px; margin-bottom: 12px; border-radius: 3px; }
.skeleton-text-large { height: 32px; margin-bottom: 8px; border-radius: 3px; }
.skeleton-chart { width: 100%; height: 300px; border-radius: 3px; }

/* Stat Cards */
.stat-card { background: white; padding: 24px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); border: 1px solid #e0e0e0; border-left: 4px solid var(--navy-primary); transition: all 0.3s; }
.stat-card:hover { transform: translateY(-4px); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.stat-card-icon { width: 60px; height: 60px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 16px; background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%); color: white; }
.stat-card-value { font-size: 32px; font-weight: 700; color: var(--navy-primary); margin-bottom: 8px; }
.stat-card-label { font-size: 14px; color: #666; font-weight: 500; text-transform: uppercase; }

/* Charts */
.chart-card { background: white; padding: 24px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.chart-card h3 { color: var(--navy-primary); font-size: 18px; margin-bottom: 20px; font-weight: 600; }
.chart-container { position: relative; height: 300px; }
.dashboard-grid-4 .chart-card { padding: 18px; }
.dashboard-grid-4 .chart-card h3 { font-size: 14px; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.dashboard-grid-4 .chart-container { height: 230px; }

/* Grids */
.dashboard-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.dashboard-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 30px; }
.dashboard-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }

/* DataTable */
table.dataTable { width: 100% !important; border-collapse: collapse; background: white; }
table.dataTable thead th { background: var(--navy-primary) !important; color: white !important; padding: 14px !important; text-align: left; font-weight: 600; font-size: 14px; }
table.dataTable tbody td { padding: 12px 14px !important; font-size: 14px; color: #555; }
table.dataTable tbody tr:hover { background: #f9f9f9 !important; }
table.dataTable tfoot th { background: var(--navy-primary) !important; color: white !important; padding: 12px 14px !important; font-weight: 700; font-size: 14px; border-top: 2px solid var(--navy-accent); text-align: right; }

/* Row conditional coloring */
table.dataTable tbody tr.row-overdue td { background: #fef2f2 !important; border-left: 3px solid #ea4335; }
table.dataTable tbody tr.row-overdue:hover td { background: #fee2e2 !important; }
table.dataTable tbody tr.row-today td { background: #fefce8 !important; border-left: 3px solid #fbbc04; }
table.dataTable tbody tr.row-today:hover td { background: #fef9c3 !important; }
table.dataTable tbody tr.row-paid td { background: #f0fdf4 !important; border-left: 3px solid #34a853; }
table.dataTable tbody tr.row-paid:hover td { background: #dcfce7 !important; }
table.dataTable tbody tr.row-partial td { background: #fffbeb !important; border-left: 3px solid #fbbc04; }
table.dataTable tbody tr.row-cancelled td { background: #f5f5f5 !important; color: #999 !important; border-left: 3px solid #9ca3af; }
table.dataTable tbody tr.row-cancelled td * { color: #999 !important; }
table.dataTable tbody tr.row-expired td { background: #fef2f2 !important; border-left: 3px solid #ea4335; }
table.dataTable tbody tr.row-draft td { background: #f9fafb !important; border-left: 3px solid #6c757d; }
table.dataTable tbody tr.row-confirmed td { background: #eff6ff !important; border-left: 3px solid #0074D9; }
table.dataTable tbody tr.row-delivered td { background: #f0fdf4 !important; border-left: 3px solid #34a853; }
table.dataTable tbody tr.row-urgent td { background: #fef2f2 !important; border-left: 3px solid #ea4335; font-weight: 600; }
.dt-buttons { margin-bottom: 15px; }
.dt-button { background: var(--navy-primary) !important; color: white !important; border: none !important; padding: 8px 16px !important; border-radius: 3px !important; font-size: 14px !important; margin-right: 8px !important; cursor: pointer !important; }
.dt-button:hover { background: var(--navy-hover) !important; }

/* Action Icons */
.action-icon { background: transparent; border: none; cursor: pointer; font-size: 18px; padding: 6px 10px; margin: 0 4px; border-radius: 2px; transition: all 0.3s; }
.action-icon.edit-icon { color: #fbbc04; }
.action-icon.edit-icon:hover { background: rgba(251,188,4,0.1); transform: scale(1.15); }
.action-icon.delete-icon { color: #ea4335; }
.action-icon.delete-icon:hover { background: rgba(234,67,53,0.1); transform: scale(1.15); }

/* Status Badge */
.status-badge { padding: 6px 14px; border-radius: 3px; font-size: 13px; font-weight: 600; display: inline-block; }
.status-active { background: #d4edda; color: #155724; }
.status-inactive { background: #f8d7da; color: #721c24; }

/* Buttons */
.btn { padding: 10px 20px; border: none; border-radius: 2px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.3s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.btn-primary { background: var(--navy-primary); color: white; }
.btn-primary:hover { background: var(--navy-hover); transform: translateY(-2px); }
.btn-success { background: #34a853; color: white; }
.btn-danger { background: #ea4335; color: white; }
.btn-secondary { background: #6c757d; color: white; }
.btn:disabled { background: #ccc; cursor: not-allowed; }
.btn-sm { padding: 8px 16px; font-size: 13px; font-weight: 600; }

/* Forms */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; color: #555; font-weight: 500; font-size: 14px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 14px 16px; border: 1px solid #d0d0d0; border-radius: 2px; font-size: 16px; transition: all 0.3s; font-family: inherit; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 2px rgba(0,116,217,0.1); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.form-actions { display: flex; gap: 10px; margin-top: 30px; }
.error { margin-top: 15px; color: #ea4335; font-size: 14px; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; padding: 20px; }
.modal { background: white; border-radius: 4px; width: 80%; max-width: 800px; max-height: 90vh; overflow-y: auto; box-shadow: 0 4px 24px rgba(0,0,0,0.2); }
.modal-header { padding: 24px 30px; background: var(--navy-primary); color: white; display: flex; justify-content: space-between; align-items: center; border-radius: 4px 4px 0 0; }
.modal-header h3 { font-size: 20px; font-weight: 600; display: flex; align-items: center; gap: 10px; margin: 0; }
.close-btn { background: transparent; border: none; color: white; font-size: 28px; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.close-btn:hover { background: rgba(255,255,255,0.2); transform: rotate(90deg); }
.modal-body { padding: 30px; }

/* Filters */
.filters-section { background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%); border: 1px solid #dee2e6; border-radius: 4px; padding: 20px; margin-bottom: 25px; }
.filters-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px solid var(--navy-primary); }
.filters-header h3 { font-size: 18px; color: var(--navy-primary); font-weight: 600; display: flex; align-items: center; gap: 10px; margin: 0; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.filter-group { display: flex; flex-direction: column; gap: 8px; }
.filter-group label { font-size: 13px; font-weight: 600; color: var(--navy-primary); text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 6px; }
.filter-input { width: 100%; padding: 10px 12px; border: 2px solid #ced4da; border-radius: 3px; font-size: 16px; transition: all 0.3s; font-family: inherit; background: white; touch-action: manipulation; }
.filter-input:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(0,116,217,0.15); }

/* Searchable Dropdown */
.searchable-dropdown { position: relative; width: 100%; }
.searchable-dropdown-input { width: 100%; padding: 10px 36px 10px 12px; border: 2px solid #ced4da; border-radius: 3px; font-size: 16px; transition: all 0.3s; font-family: inherit; background: white; cursor: pointer; touch-action: manipulation; }
.searchable-dropdown-input:focus { outline: none; border-color: var(--navy-accent); box-shadow: 0 0 0 3px rgba(0,116,217,0.15); }
.searchable-dropdown-arrow { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: #666; font-size: 12px; transition: transform 0.3s; }
.searchable-dropdown-arrow.open { transform: translateY(-50%) rotate(180deg); }
.searchable-dropdown-list { position: absolute; top: 100%; left: 0; right: 0; background: white; border: 2px solid var(--navy-accent); border-top: none; border-radius: 0 0 3px 3px; max-height: 250px; overflow-y: auto; z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.searchable-dropdown-item { padding: 10px 14px; cursor: pointer; font-size: 14px; transition: background 0.2s; border-bottom: 1px solid #f0f0f0; }
.searchable-dropdown-item:hover { background: rgba(0,116,217,0.1); }
.searchable-dropdown-item.selected { background: var(--navy-primary); color: white; }
.searchable-dropdown-item.no-results { color: #999; font-style: italic; cursor: default; }
.searchable-dropdown-item.no-results:hover { background: transparent; }

/* Multi-select tags */
.searchable-multi-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.searchable-multi-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: var(--navy-primary); color: white; border-radius: 3px; font-size: 12px; font-weight: 600; }
.searchable-multi-tag-remove { background: none; border: none; color: white; cursor: pointer; font-size: 14px; padding: 0 2px; opacity: 0.7; transition: opacity 0.2s; }
.searchable-multi-tag-remove:hover { opacity: 1; }
.searchable-dropdown-item.checked { background: rgba(0,116,217,0.1); }
.searchable-dropdown-item.checked::before { content: '\f00c'; font-family: 'Font Awesome 6 Free'; font-weight: 900; margin-right: 8px; color: var(--navy-primary); font-size: 12px; }

/* About Section */
.about-section { max-width: 900px; margin: 0 auto; padding: 20px; }
.about-header { display: flex; align-items: center; gap: 20px; margin-bottom: 30px; padding: 25px; background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%); border-radius: 4px; color: white; }
.about-logo img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.3); object-fit: cover; }
.about-title h1 { font-size: 24px; margin-bottom: 8px; font-weight: 700; }
.about-dev { font-size: 14px; opacity: 0.9; }
.about-card { background: white; border-radius: 4px; padding: 25px; margin-bottom: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-left: 4px solid var(--navy-primary); }
.about-card h2 { color: var(--navy-primary); font-size: 20px; margin-bottom: 15px; display: flex; align-items: center; gap: 10px; }
.about-card p { color: #555; line-height: 1.7; font-size: 15px; }
.about-features { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.about-features li { padding: 14px 16px; background: #f8f9fa; border-radius: 8px; color: #333; font-size: 14px; font-weight: 600; display: flex; align-items: center; }
.about-features li i { color: var(--navy-primary); margin-right: 10px; font-size: 16px; flex-shrink: 0; }
.about-table-wrapper { overflow-x: auto; margin: 15px 0; }
.about-roles-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.about-roles-table th, .about-roles-table td { padding: 12px 15px; text-align: center; border: 1px solid #e0e0e0; }
.about-roles-table th { background: var(--navy-primary); color: white; font-weight: 600; }
.about-roles-table th:first-child { text-align: left; }
.about-roles-table td:first-child { text-align: left; font-weight: 500; background: #f8f9fa; }
.role-badge { display: inline-block; padding: 4px 10px; border-radius: 3px; font-size: 12px; font-weight: 600; }
.role-admin { background: #d4edda; color: #155724; }
.role-sales-manager { background: #cce5ff; color: #004085; }
.role-sales-exec { background: #fff3e0; color: #e65100; }
.role-production { background: #e0f2f1; color: #00695c; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.about-developer { border-left-color: var(--navy-accent); }
.developer-info { display: flex; gap: 20px; align-items: flex-start; }
.developer-avatar { width: 100px; height: 100px; border-radius: 50%; object-fit: cover; border: 3px solid var(--navy-primary); flex-shrink: 0; }
.developer-details h3 { color: var(--navy-primary); font-size: 20px; margin-bottom: 5px; }
.developer-brand { color: var(--navy-accent); font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.developer-details p { margin-bottom: 15px; }
.developer-links { display: flex; gap: 12px; flex-wrap: wrap; }
.dev-link { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 4px; text-decoration: none; font-weight: 600; font-size: 14px; transition: all 0.3s; }
.dev-link.whatsapp { background: #25D366; color: white; }
.dev-link.whatsapp:hover { background: #128C7E; transform: translateY(-2px); }
.dev-link.youtube { background: #FF0000; color: white; }
.dev-link.youtube:hover { background: #CC0000; transform: translateY(-2px); }
.about-footer { text-align: center; padding: 25px; color: #666; font-size: 14px; }
.about-version { font-size: 12px; color: #999; margin-top: 5px; }

/* Toggle Switch - DaisyUI style */
.toggle { appearance: none; width: 44px; height: 24px; border-radius: 24px; background: #ccc; position: relative; cursor: pointer; transition: background .3s; border: none; outline: none; vertical-align: middle; }
.toggle:checked { background: #0074D9; }
.toggle::before { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .3s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle:checked::before { transform: translateX(20px); }

/* Loading Popup */
.loading-ov { position: fixed; inset: 0; display: flex; justify-content: center; align-items: center; z-index: 10001; }
.loading-popup { background: white; padding: 30px 40px; border-radius: 4px; box-shadow: 0 4px 24px rgba(0,0,0,0.18); display: flex; flex-direction: column; align-items: center; min-width: 240px; }
.loading-progress { width: 200px; height: 6px; border-radius: 2px; background: #e0e0e0; overflow: hidden; margin-bottom: 16px; }
.loading-progress-bar { width: 100%; height: 100%; background: var(--navy-accent); border-radius: 2px; animation: progressIndeterminate 1.5s ease-in-out infinite; transform-origin: left; }
@keyframes progressIndeterminate { 0% { transform: translateX(-100%) scaleX(0.4); } 50% { transform: translateX(20%) scaleX(0.5); } 100% { transform: translateX(100%) scaleX(0.4); } }
.loading-txt { font-size: 15px; color: #555; font-weight: 500; }

/* Config key badge */
.config-key-badge { display: inline-block; padding: 4px 10px; border-radius: 3px; font-size: 12px; font-weight: 600; background: #e8eef4; color: var(--navy-primary); text-transform: capitalize; }

/* Account section */
.account-section { max-width: 700px; margin: 0 auto; }
.account-card { background: white; padding: 30px; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); margin-bottom: 20px; border-left: 4px solid var(--navy-primary); }
.account-card h2 { color: var(--navy-primary); font-size: 20px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }
.profile-info { display: grid; grid-template-columns: 120px 1fr; gap: 12px; font-size: 15px; }
.profile-info .label { color: #888; font-weight: 500; }
.profile-info .value { color: #333; font-weight: 600; }
.mb-24 { margin-bottom: 24px; }

/* Pipeline Chevron Tabs */
.pipeline-stages { display: flex; width: 100%; margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pipeline-stages::-webkit-scrollbar { display: none; }
.pipeline-stage { flex: 1 1 0; min-width: 0; position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 14px 20px 14px 28px; cursor: pointer; transition: filter 0.2s, opacity 0.2s; color: #fff; -webkit-clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); -webkit-tap-highlight-color: transparent; }
.pipeline-stage:first-child { -webkit-clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); padding-left: 16px; border-radius: 4px 0 0 4px; }
.pipeline-stage:last-child { -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); border-radius: 0 4px 4px 0; }
.pipeline-stage:hover { filter: brightness(1.15); }
.pipeline-stage.active { filter: brightness(1.25); box-shadow: inset 0 0 0 100px rgba(255,255,255,0.15); }
.pipeline-stage-name { font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: uppercase; letter-spacing: 0.3px; }
.pipeline-stage-count { font-size: 14px; font-weight: 800; white-space: nowrap; }
.pipeline-stage.pipeline-empty { opacity: 0.6; }
.pipeline-stage.pipeline-empty:hover { opacity: 0.85; }

/* Bottom nav - hidden on desktop */
.bottom-nav { display: none; }
.bottom-sheet-overlay { display: none; }
.bottom-sheet { display: none; }

/* Desktop collapse */
@media (min-width: 769px) {
  .sidebar.collapsed { width: 70px; }
  .sidebar.collapsed .sidebar-user-info,
  .sidebar.collapsed .sidebar-menu-title,
  .sidebar.collapsed .sidebar-menu span,
  .sidebar.collapsed .sidebar-logout span { display: none; }
  .sidebar.collapsed .sidebar-menu button { justify-content: center; padding: 14px 0; }
  .sidebar.collapsed .sidebar-menu i { margin: 0; font-size: 20px; }
  .sidebar.collapsed .sidebar-logout button { justify-content: center; padding: 14px 0; }
  .sidebar.collapsed .sidebar-logo-text { display: none; }
  .sidebar.collapsed .sidebar-logo-icon { font-size: 24px; }

  .sidebar-toggle-desk { position: absolute; top: 18px; right: -14px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.3); background: var(--navy-primary); color: white; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; transition: all 0.3s; box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
  .sidebar-toggle-desk:hover { background: var(--navy-accent); border-color: var(--navy-accent); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  /* kill sidebar + hamburger on mobile — use bottom nav instead */
  .sidebar { display: none !important; }
  .sidebar-overlay { display: none !important; }
  .hamburger-btn { display: none !important; }

  /* override desktop display:none */
  .bottom-sheet-overlay { display: block; }
  .bottom-sheet { display: block; }

  /* fix blank page: simple block layout */
  .app-container { display: block; height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
  .main-content { padding: 10px 10px 80px 10px; height: auto; min-height: 100vh; min-height: 100dvh; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; width: 100%; }

  /* bottom nav */
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: white; border-top: 1px solid #e0e0e0; box-shadow: 0 -2px 10px rgba(0,0,0,0.08); z-index: 1000; align-items: center; justify-content: space-around; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bottom-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: none; color: #999; font-size: 10px; font-weight: 600; cursor: pointer; padding: 6px 0; min-width: 56px; transition: color 0.2s; -webkit-tap-highlight-color: transparent; }
  .bottom-nav-item i { font-size: 19px; transition: color 0.2s; }
  .bottom-nav-item.active { color: var(--navy-accent); }

  /* bottom sheet (More menu) */
  .bottom-sheet-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 1100; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
  .bottom-sheet-overlay.show { opacity: 1; pointer-events: auto; }
  .bottom-sheet { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-radius: 16px 16px 0 0; z-index: 1101; transform: translateY(100%); transition: transform 0.3s ease; max-height: 80vh; max-height: 80dvh; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .bottom-sheet.show { transform: translateY(0); }
  .bottom-sheet-handle { width: 40px; height: 4px; background: #ddd; border-radius: 2px; margin: 12px auto 8px; }
  .bottom-sheet-user { padding: 12px 20px 16px; border-bottom: 1px solid #f0f0f0; text-align: center; }
  .bottom-sheet-user-name { font-weight: 700; font-size: 16px; color: var(--navy-primary); }
  .bottom-sheet-user-role { font-size: 12px; color: #888; margin-top: 2px; }
  .bottom-sheet-menu { list-style: none; padding: 8px 12px 12px; }
  .bottom-sheet-menu li { margin-bottom: 2px; }
  .bottom-sheet-menu button { width: 100%; text-align: left; padding: 13px 16px; background: transparent; border: none; color: #333; cursor: pointer; border-radius: 10px; font-size: 15px; display: flex; align-items: center; gap: 14px; font-weight: 500; transition: background 0.2s; -webkit-tap-highlight-color: transparent; }
  .bottom-sheet-menu button:active { background: #f0f4ff; }
  .bottom-sheet-menu button.active { background: #e8f0fe; color: var(--navy-accent); }
  .bottom-sheet-menu i { width: 22px; text-align: center; font-size: 17px; color: var(--navy-primary); }
  .bottom-sheet-menu button.active i { color: var(--navy-accent); }
  .bottom-sheet-menu .logout-btn { color: #ea4335; margin-top: 8px; border-top: 1px solid #f0f0f0; padding-top: 16px; border-radius: 0 0 10px 10px; }
  .bottom-sheet-menu .logout-btn i { color: #ea4335; }

  /* hide desktop-only elements */
  .breadcrumb { display: none; }

  /* layout fixes */
  .header { padding: 14px; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
  .header h1 { font-size: 17px; gap: 8px; }
  .section-header { flex-direction: column; gap: 10px; align-items: flex-start; margin-bottom: 12px; }
  .section-header h2 { font-size: 16px; }
  .section-header .btn { width: 100%; }

  /* cards */
  .data-section { padding: 12px; border-radius: 8px; }
  .stat-card { padding: 14px; border-radius: 8px; }
  .stat-card-value { font-size: 22px; }
  .stat-card-icon { width: 42px; height: 42px; font-size: 18px; margin-bottom: 10px; border-radius: 8px; }
  .stat-card-label { font-size: 11px; }

  /* grids */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .dashboard-grid-3 { grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
  .dashboard-grid-2 { grid-template-columns: 1fr; gap: 10px; margin-bottom: 14px; }
  .dashboard-grid-4 { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }

  /* charts */
  .chart-card { padding: 14px; border-radius: 8px; }
  .chart-card h3 { font-size: 14px; margin-bottom: 10px; }
  .chart-container { height: 200px; }
  .dashboard-grid-4 .chart-container { height: 180px; }

  /* modal — override inline maxWidth on mobile */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal { width: 100% !important; max-width: 100% !important; max-height: 92vh; max-height: 92dvh; border-radius: 16px 16px 0 0; margin: 0; }
  .modal-header { padding: 16px 18px; border-radius: 16px 16px 0 0; }
  .modal-header h3 { font-size: 16px; }
  .modal-body { padding: 16px; }
  .form-actions { flex-direction: column; gap: 8px; }
  .form-actions .btn { width: 100%; }

  /* filters */
  .filters-section { padding: 12px; margin-bottom: 12px; border-radius: 8px; }
  .filters-header { flex-direction: column; gap: 8px; align-items: flex-start; padding-bottom: 10px; margin-bottom: 10px; }
  .filters-header h3 { font-size: 14px; }
  .filters-grid { grid-template-columns: 1fr; gap: 10px; }

  /* pipeline mobile */
  .pipeline-stages { margin-bottom: 12px; }
  .pipeline-stage { min-width: 90px; flex-shrink: 0; flex-grow: 0; padding: 10px 14px 10px 22px; }
  .pipeline-stage:first-child { padding-left: 12px; }
  .pipeline-stage-name { font-size: 9px; }
  .pipeline-stage-count { font-size: 11px; }

  /* DataTable */
  .dt-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
  .dt-button { padding: 5px 8px !important; font-size: 11px !important; margin-right: 0 !important; border-radius: 6px !important; }
  table.dataTable { font-size: 12px; }
  table.dataTable thead th { padding: 8px 6px !important; font-size: 11px; white-space: nowrap; }
  table.dataTable tbody td { padding: 7px 6px !important; font-size: 12px; }
  .action-icon { font-size: 15px; padding: 4px 6px; margin: 0 2px; }
  .status-badge { padding: 3px 8px; font-size: 11px; }
  .role-badge { padding: 3px 7px; font-size: 10px; }
  .config-key-badge { padding: 3px 7px; font-size: 10px; }
  div.dataTables_wrapper div.dataTables_filter input { width: 140px; }

  /* prevent iOS auto-zoom on input focus — 16px minimum everywhere */
  input, select, textarea, button { font-size: 16px !important; touch-action: manipulation; }
  .form-group input, .form-group select, .form-group textarea { font-size: 16px !important; padding: 12px 14px; border-radius: 8px; }
  .filter-input { font-size: 16px !important; border-radius: 8px; }
  .searchable-dropdown-input { font-size: 16px !important; border-radius: 8px; }
  .searchable-dropdown-list { max-height: 200px; border-radius: 0 0 8px 8px; }
  div.dataTables_filter input { font-size: 16px !important; padding: 8px 12px !important; border-radius: 8px; }
  div.dataTables_length select { font-size: 16px !important; padding: 6px 10px !important; border-radius: 8px; }
  div.dataTables_wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  div.dataTables_info { font-size: 12px; }
  div.dataTables_paginate { font-size: 12px; }
  div.dataTables_paginate .paginate_button { padding: 6px 10px !important; min-width: 36px; min-height: 36px; }

  /* inline table th/td width overrides */
  .modal-body table th, .modal-body table td { min-width: 0 !important; width: auto !important; }
  .modal-body table input { font-size: 16px !important; padding: 10px 8px !important; }

  /* line-items card layout on small screens */
  .line-items-mobile td { display: block !important; width: 100% !important; padding: 4px 8px !important; text-align: left !important; border-bottom: none !important; }
  .line-items-mobile tr { display: block !important; padding: 10px 0 !important; border-bottom: 1px solid #e0e0e0 !important; }
  .line-items-mobile thead { display: none !important; }

  /* totals section */
  .totals-mobile { min-width: 0 !important; width: 100% !important; }

  /* about */
  .about-section { padding: 8px; }
  .about-header { flex-direction: column; text-align: center; padding: 16px; border-radius: 8px; }
  .about-title h1 { font-size: 18px; }
  .about-card { padding: 16px; border-radius: 8px; }
  .about-card h2 { font-size: 16px; }
  .about-features { grid-template-columns: 1fr 1fr; gap: 8px; }
  .about-features li { padding: 10px 12px; font-size: 12px; border-radius: 8px; }
  .developer-info { flex-direction: column; align-items: center; text-align: center; }
  .developer-avatar { width: 70px; height: 70px; }
  .developer-links { justify-content: center; }
  .dev-link { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
  .profile-info { grid-template-columns: 1fr; }

  /* account */
  .account-section { max-width: 100%; }
  .account-card { padding: 16px; border-radius: 8px; }

  /* loading */
  .loading-popup { padding: 20px 24px; min-width: 180px; border-radius: 12px; }

  /* toggle */
  .toggle { width: 38px; height: 20px; }
  .toggle::before { width: 16px; height: 16px; }
  .toggle:checked::before { transform: translateX(18px); }

  /* login mobile */
  .login-box { padding: 30px 24px; border-radius: 12px; }
  .login-logo { width: 90px; height: 90px; }
  .login-box h2 { font-size: 22px; margin-bottom: 24px; }

  /* SweetAlert2 mobile */
  .swal2-popup { font-size: 14px !important; width: 90vw !important; max-width: 340px !important; padding: 20px 16px !important; }
  .swal2-title { font-size: 18px !important; }
  .swal2-html-container { font-size: 14px !important; }
}
