qshub / frontend /src /index.css
basel00omar's picture
Fix: Overhaul mobile responsiveness for tables, upload grid, and workflow stepper
f7a12a0
Raw History Blame Contribute Delete
11.9 kB
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Cairo:wght@300;400;500;600;700;800&family=Outfit:wght@300;400;600;800&display=swap');
:root {
--font-main: 'Plus Jakarta Sans', 'Cairo', sans-serif;
--font-display: 'Outfit', 'Cairo', sans-serif;
/* Light Theme Variables */
--bg-primary: #f8fafc;
--bg-secondary: #ffffff;
--bg-card: rgba(255, 255, 255, 0.85);
--border-color: rgba(226, 232, 240, 0.8);
--text-primary: #0f172a;
--text-secondary: #475569;
--text-muted: #94a3b8;
--primary: #3b82f6;
--primary-hover: #2563eb;
--primary-glow: rgba(59, 130, 246, 0.15);
--success: #10b981;
--success-glow: rgba(16, 185, 129, 0.15);
--warning: #f59e0b;
--error: #ef4444;
--shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
--shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
--shadow-premium: 0 20px 25px -5px rgba(0,0,0,0.05), 0 10px 10px -5px rgba(0,0,0,0.03);
--radius-sm: 8px;
--radius-md: 12px;
--radius-lg: 16px;
--radius-xl: 24px;
}
body.dark-mode {
/* Dark Theme Variables */
--bg-primary: #090d16;
--bg-secondary: #111827;
--bg-card: rgba(17, 24, 39, 0.8);
--border-color: rgba(255, 255, 255, 0.07);
--text-primary: #f8fafc;
--text-secondary: #94a3b8;
--text-muted: #64748b;
--primary: #3b82f6;
--primary-hover: #60a5fa;
--primary-glow: rgba(59, 130, 246, 0.3);
--success: #10b981;
--success-glow: rgba(16, 185, 129, 0.3);
--shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
--shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
--shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
--shadow-premium: 0 20px 25px -5px rgba(0,0,0,0.6);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-main);
background-color: var(--bg-primary);
color: var(--text-primary);
overflow-x: hidden;
transition: background-color 0.3s ease, color 0.3s ease;
}
/* Glassmorphism Classes */
.glass-panel {
background: var(--bg-card);
backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(16px);
border: 1px solid var(--border-color);
box-shadow: var(--shadow-lg);
border-radius: var(--radius-lg);
}
.glass-card {
background: var(--bg-secondary);
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
padding: 20px;
box-shadow: var(--shadow-sm);
transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.glass-card:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.pricing-tier-card {
border: 2px solid var(--primary) !important;
}
/* Custom Styled Tables for BOQ and Prices */
.premium-table-container {
overflow-x: auto;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
background-color: var(--bg-secondary);
}
.premium-table {
width: 100%;
border-collapse: collapse;
font-size: 0.95rem;
text-align: left;
}
.premium-table th {
background-color: var(--primary-glow);
color: var(--text-primary);
font-weight: 600;
padding: 14px 16px;
border-bottom: 2px solid var(--border-color);
}
.premium-table td {
padding: 12px 16px;
border-bottom: 1px solid var(--border-color);
color: var(--text-secondary);
}
.premium-table tr.header-row {
background-color: rgba(59, 130, 246, 0.05);
font-weight: 700;
color: var(--primary);
}
.premium-table tr.header-row td {
color: var(--primary);
font-weight: 700;
font-family: var(--font-display);
}
.premium-table tr:hover:not(.header-row) {
background-color: rgba(0, 0, 0, 0.02);
}
body.dark-mode .premium-table tr:hover:not(.header-row) {
background-color: rgba(255, 255, 255, 0.02);
}
/* Custom Scrollbars */
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-track {
background: transparent;
}
::-webkit-scrollbar-thumb {
background: var(--text-muted);
border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
background: var(--text-secondary);
}
/* Buttons */
.btn {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 10px 20px;
border-radius: var(--radius-md);
font-weight: 600;
cursor: pointer;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid transparent;
font-size: 0.95rem;
}
.btn-primary {
background: linear-gradient(135deg, var(--primary), var(--primary-hover));
color: white;
box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
transform: translateY(-1px);
box-shadow: 0 8px 18px var(--primary-glow);
filter: brightness(1.1);
}
.btn-secondary {
background-color: transparent;
border-color: var(--border-color);
color: var(--text-primary);
}
.btn-secondary:hover {
background-color: rgba(0, 0, 0, 0.03);
}
body.dark-mode .btn-secondary:hover {
background-color: rgba(255, 255, 255, 0.03);
}
.btn-success {
background-color: var(--success);
color: white;
box-shadow: 0 4px 12px var(--success-glow);
}
.btn-success:hover {
transform: translateY(-1px);
filter: brightness(1.1);
}
/* Inputs */
.form-input {
width: 100%;
padding: 12px 16px;
border-radius: var(--radius-md);
border: 1px solid var(--border-color);
background-color: var(--bg-secondary);
color: var(--text-primary);
outline: none;
font-size: 0.95rem;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-input:focus {
border-color: var(--primary);
box-shadow: 0 0 0 3px var(--primary-glow);
}
/* Layout Grid */
.dashboard-grid {
display: grid;
grid-template-columns: 240px 1fr;
min-height: 100vh;
}
/* ========================= */
/* Mobile Hamburger Button */
/* ========================= */
.mobile-menu-btn {
display: none;
position: fixed;
top: 12px;
left: 12px;
z-index: 1100;
width: 44px;
height: 44px;
border-radius: 12px;
border: 1px solid var(--border-color);
background: var(--bg-secondary);
color: var(--text-primary);
cursor: pointer;
align-items: center;
justify-content: center;
box-shadow: var(--shadow-md);
transition: all 0.2s ease;
}
.mobile-menu-btn:active {
transform: scale(0.92);
}
/* Mobile Overlay */
.mobile-overlay {
display: none;
position: fixed;
inset: 0;
z-index: 999;
background: rgba(0, 0, 0, 0.45);
backdrop-filter: blur(4px);
-webkit-backdrop-filter: blur(4px);
}
/* ========================= */
/* Sidebar base (for mobile) */
/* ========================= */
.sidebar {
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
/* Utility Classes for Responsive Grids */
.grid-cols-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-cols-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.grid-cols-4 { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; }
.grid-cols-classify { display: grid; grid-template-columns: 1.2fr 1fr; }
/* ========================= */
/* Mobile (768px and below) */
/* ========================= */
@media (max-width: 768px) {
/* Dashboard layout: single column */
.dashboard-grid {
grid-template-columns: 1fr;
}
/* Show hamburger */
.mobile-menu-btn {
display: flex;
}
/* Show overlay when menu open */
.mobile-overlay {
display: block;
}
/* Sidebar: fixed, slide out left by default */
.sidebar {
position: fixed !important;
top: 0 !important;
left: 0;
width: 280px;
height: 100vh !important;
z-index: 1050;
transform: translateX(-100%);
overflow-y: auto;
box-shadow: var(--shadow-premium);
}
.sidebar.sidebar-open {
transform: translateX(0);
}
/* RTL sidebar: slide from right */
[dir="rtl"] .sidebar {
left: auto;
right: 0;
transform: translateX(100%);
}
[dir="rtl"] .sidebar.sidebar-open {
transform: translateX(0);
}
[dir="rtl"] .mobile-menu-btn {
left: auto;
right: 12px;
}
/* Main content: full width, add top padding for hamburger */
.dashboard-grid > main {
padding-top: 60px;
}
/* Auth panel responsive */
.auth-panel {
padding: 28px 18px !important;
margin: 0 4px;
border-radius: 14px !important;
}
.auth-panel h2 {
font-size: 1.3rem !important;
}
.auth-panel h3 {
font-size: 1.1rem !important;
}
/* Landing page hero responsive */
.landing-hero h1 {
font-size: 2rem !important;
}
.landing-hero p {
font-size: 1rem !important;
}
.landing-hero img {
width: 100px !important;
height: 100px !important;
}
/* Fix feature grid to single column */
.features-grid {
grid-template-columns: 1fr !important;
}
/* Pricing grid to 2 cols on small */
.pricing-grid {
grid-template-columns: repeat(2, 1fr) !important;
}
/* Glass panel spacing */
.glass-panel {
padding: 16px;
}
/* Glass card spacing */
.glass-card {
padding: 14px;
}
/* Buttons touch-friendly size */
.btn {
min-height: 44px;
font-size: 0.88rem;
}
/* Form inputs touch-friendly */
.form-input {
min-height: 44px;
font-size: 1rem;
}
/* Dashboard content padding */
.dashboard-content {
padding: 16px !important;
}
.dashboard-content h2 {
font-size: 1.5rem !important;
}
/* Landing page footer links wrap */
footer > div {
flex-wrap: wrap;
gap: 10px !important;
}
/* Responsive Grids */
.grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-classify {
grid-template-columns: 1fr !important;
}
}
/* ========================= */
/* Small phones (480px) */
/* ========================= */
@media (max-width: 480px) {
.pricing-grid {
grid-template-columns: 1fr !important;
}
.auth-panel {
padding: 22px 14px !important;
}
.landing-hero h1 {
font-size: 1.6rem !important;
}
/* Premium table mobile scroll hint */
.premium-table-container {
position: relative;
}
.premium-table {
font-size: 0.82rem;
}
.premium-table th,
.premium-table td {
padding: 8px 10px;
}
.dashboard-content {
padding: 12px !important;
}
.dashboard-content h2 {
font-size: 1.25rem !important;
}
}
/* --- COMPREHENSIVE MOBILE OVERRIDES INJECTED --- */
@media (max-width: 768px) {
/* Prevent horizontal scrolling on body */
body, html {
overflow-x: hidden !important;
width: 100vw !important;
max-width: 100% !important;
}
/* Make all tables scrollable instead of overflowing the page */
.table-container,
div[style*="overflow-x: auto"],
div[style*="overflowX: auto"] {
width: 100% !important;
max-width: 100vw !important;
display: block !important;
overflow-x: auto !important;
-webkit-overflow-scrolling: touch;
margin-bottom: 20px;
}
table {
min-width: 600px !important; /* Force tables to stretch inside their scroll container */
}
/* Fix horizontal Stepper overflowing */
.glass-panel[style*="overflow-x: auto"],
.glass-panel[style*="overflowX: auto"] {
width: calc(100vw - 20px) !important;
margin: 10px auto !important;
padding: 10px !important;
display: flex !important;
overflow-x: auto !important;
scroll-snap-type: x mandatory;
-webkit-overflow-scrolling: touch;
justify-content: flex-start !important;
}
.glass-panel[style*="overflow-x: auto"] > div,
.glass-panel[style*="overflowX: auto"] > div {
min-width: 120px !important;
scroll-snap-align: start;
flex-shrink: 0;
}
/* Fix the content area padding that pushes things out */
.dashboard-grid > main > div[style*="padding: 0 30px"] {
padding: 0 10px 30px !important;
}
/* Make sure the FAB is positioned properly and doesn't block text */
[data-testid="stVerticalBlock"] > div:has(.support-fab-anchor) + div button,
div:has(.support-fab-anchor) + div button {
bottom: 15px !important;
right: 15px !important;
width: 50px !important;
height: 50px !important;
}
}