Backend: real endpoints for role-permission overview, MQTT broker settings (with live reachability check), and SQLite backup download/restore (new system.manage permission, super-admin only; restore validates the SQLite file header and keeps a pre-restore safety copy). Desktop frontend: Roles (read-only permissions view), MQTT Settings, Backup & Restore wired to those endpoints; plus static AdminLTE-matching shells for Profile, Settings (embeds the real 2FA flow in its Security tab), Invoice, Calendar (FullCalendar), Chat, File Manager, and Projects. Mobile frontend: new frontend/src/styles/mobile.css, a from-scratch design system (purple theme, cards, slide-out sidebar, bottom tab bar) scoped entirely under a .mob-app root and mob- prefixed classes so it can never collide with the desktop Bootstrap/AdminLTE styling. Rebuilt TopBar/ BottomNav, added a new SlideOutNav, and reskinned the Dashboard and Users pages to it with real data.
477 lines
10 KiB
CSS
477 lines
10 KiB
CSS
/*
|
|
* Mobile design system — entirely separate from the desktop AdminLTE/
|
|
* Bootstrap styling (frontend/src/index.css). Every selector is scoped
|
|
* under `.mob-app` and every class is prefixed `mob-` so it can never
|
|
* collide with or be affected by AdminLTE's global classes (e.g. both
|
|
* define an "app-sidebar" concept, but under different names/rules).
|
|
* Adapted from a provided reference design (purple theme, card system,
|
|
* slide-out sidebar, bottom tab bar).
|
|
*/
|
|
|
|
.mob-app {
|
|
--mob-primary: #6c63ff;
|
|
--mob-primary-light: #8a84ff;
|
|
--mob-bg: #f5f5f9;
|
|
--mob-white: #ffffff;
|
|
--mob-text-dark: #333333;
|
|
--mob-text-medium: #555555;
|
|
--mob-text-light: #999999;
|
|
--mob-border: #eeeeee;
|
|
--mob-light-gray-bg: #f7f7f7;
|
|
--mob-success: #4caf50;
|
|
--mob-warning: #ff9800;
|
|
--mob-danger: #f44336;
|
|
--mob-tab-bar-height: 62px;
|
|
--mob-padding: 16px;
|
|
|
|
margin: 0;
|
|
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
background-color: var(--mob-bg);
|
|
color: var(--mob-text-dark);
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.mob-app * {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
/* Header */
|
|
.mob-header {
|
|
flex-shrink: 0;
|
|
padding: 10px var(--mob-padding);
|
|
padding-top: 14px;
|
|
background: var(--mob-white);
|
|
border-bottom: 1px solid var(--mob-border);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 10;
|
|
}
|
|
.mob-header-left {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
}
|
|
.mob-menu-btn {
|
|
border: none;
|
|
background: var(--mob-light-gray-bg);
|
|
width: 40px;
|
|
height: 40px;
|
|
border-radius: 12px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 18px;
|
|
color: var(--mob-text-medium);
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
.mob-menu-btn:hover {
|
|
background: var(--mob-primary);
|
|
color: var(--mob-white);
|
|
}
|
|
.mob-title {
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.mob-title span:first-child {
|
|
font-size: 10px;
|
|
color: var(--mob-text-light);
|
|
font-weight: 500;
|
|
}
|
|
.mob-title span:last-child {
|
|
font-size: 17px;
|
|
font-weight: 800;
|
|
color: var(--mob-primary);
|
|
}
|
|
.mob-header-actions {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 8px;
|
|
}
|
|
.mob-icon-btn {
|
|
border: none;
|
|
background: var(--mob-light-gray-bg);
|
|
width: 38px;
|
|
height: 38px;
|
|
border-radius: 12px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-size: 17px;
|
|
color: var(--mob-text-medium);
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
position: relative;
|
|
}
|
|
.mob-icon-btn:hover {
|
|
background: var(--mob-primary);
|
|
color: var(--mob-white);
|
|
}
|
|
.mob-badge-dot {
|
|
position: absolute;
|
|
top: 6px;
|
|
right: 6px;
|
|
width: 9px;
|
|
height: 9px;
|
|
background: var(--mob-danger);
|
|
border-radius: 50%;
|
|
border: 2px solid var(--mob-white);
|
|
}
|
|
|
|
/* Slide-out sidebar */
|
|
.mob-sidebar {
|
|
position: fixed;
|
|
top: 0;
|
|
left: -280px;
|
|
width: 280px;
|
|
height: 100vh;
|
|
background: var(--mob-white);
|
|
box-shadow: 2px 0 12px rgba(0, 0, 0, 0.12);
|
|
z-index: 60;
|
|
display: flex;
|
|
flex-direction: column;
|
|
padding: 14px;
|
|
transition: left 0.25s ease-out;
|
|
overflow-y: auto;
|
|
}
|
|
.mob-sidebar.mob-open {
|
|
left: 0;
|
|
}
|
|
.mob-sidebar-backdrop {
|
|
position: fixed;
|
|
inset: 0;
|
|
background: rgba(0, 0, 0, 0.4);
|
|
z-index: 55;
|
|
display: none;
|
|
backdrop-filter: blur(2px);
|
|
}
|
|
.mob-sidebar-backdrop.mob-show {
|
|
display: block;
|
|
}
|
|
.mob-sidebar-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 12px;
|
|
padding-bottom: 12px;
|
|
border-bottom: 2px solid var(--mob-border);
|
|
}
|
|
.mob-sidebar-title {
|
|
font-weight: 800;
|
|
color: var(--mob-primary);
|
|
font-size: 17px;
|
|
}
|
|
.mob-sidebar-close {
|
|
border: none;
|
|
background: var(--mob-light-gray-bg);
|
|
font-size: 18px;
|
|
width: 32px;
|
|
height: 32px;
|
|
border-radius: 8px;
|
|
color: var(--mob-text-medium);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
.mob-sidebar-close:hover {
|
|
background: var(--mob-danger);
|
|
color: var(--mob-white);
|
|
}
|
|
.mob-sidebar-section-label {
|
|
font-size: 10px;
|
|
text-transform: uppercase;
|
|
color: var(--mob-text-light);
|
|
margin-top: 14px;
|
|
margin-bottom: 6px;
|
|
font-weight: 700;
|
|
letter-spacing: 0.5px;
|
|
padding-left: 4px;
|
|
}
|
|
.mob-sidebar-link {
|
|
width: 100%;
|
|
border: none;
|
|
background: transparent;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 11px 10px;
|
|
border-radius: 10px;
|
|
font-size: 14px;
|
|
color: var(--mob-text-medium);
|
|
text-align: left;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
font-weight: 500;
|
|
text-decoration: none;
|
|
}
|
|
.mob-sidebar-link .mob-nav-icon {
|
|
font-size: 18px;
|
|
width: 24px;
|
|
text-align: center;
|
|
}
|
|
.mob-sidebar-link:hover {
|
|
background: linear-gradient(135deg, rgba(108, 99, 255, 0.1), rgba(108, 99, 255, 0.05));
|
|
transform: translateX(3px);
|
|
}
|
|
.mob-sidebar-link.mob-active {
|
|
background: linear-gradient(135deg, var(--mob-primary), var(--mob-primary-light));
|
|
color: var(--mob-white);
|
|
box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
|
|
}
|
|
|
|
/* Content */
|
|
.mob-content {
|
|
flex: 1;
|
|
overflow-y: auto;
|
|
padding: 14px var(--mob-padding);
|
|
padding-bottom: calc(var(--mob-tab-bar-height) + 14px);
|
|
}
|
|
|
|
/* Bottom tab bar */
|
|
.mob-tab-bar {
|
|
position: fixed;
|
|
left: 0;
|
|
right: 0;
|
|
bottom: 0;
|
|
height: var(--mob-tab-bar-height);
|
|
background: var(--mob-white);
|
|
border-top: 1px solid var(--mob-border);
|
|
display: flex;
|
|
justify-content: space-around;
|
|
align-items: center;
|
|
z-index: 20;
|
|
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
|
|
}
|
|
.mob-tab-item {
|
|
flex: 1;
|
|
text-align: center;
|
|
font-size: 10px;
|
|
color: var(--mob-text-light);
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
gap: 4px;
|
|
cursor: pointer;
|
|
padding: 6px 0;
|
|
transition: all 0.2s;
|
|
text-decoration: none;
|
|
}
|
|
.mob-tab-item .mob-nav-icon {
|
|
font-size: 20px;
|
|
}
|
|
.mob-tab-item.mob-active {
|
|
color: var(--mob-primary);
|
|
font-weight: 700;
|
|
}
|
|
|
|
/* KPI cards */
|
|
.mob-kpi-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
gap: 12px;
|
|
margin-bottom: 16px;
|
|
}
|
|
@media (min-width: 540px) {
|
|
.mob-kpi-grid {
|
|
grid-template-columns: repeat(4, minmax(0, 1fr));
|
|
}
|
|
}
|
|
.mob-kpi-card {
|
|
background: var(--mob-white);
|
|
padding: 16px;
|
|
border-radius: 14px;
|
|
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
|
|
border-left: 5px solid var(--mob-primary);
|
|
}
|
|
.mob-kpi-label {
|
|
font-size: 11px;
|
|
color: var(--mob-text-light);
|
|
margin-bottom: 8px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.5px;
|
|
font-weight: 600;
|
|
}
|
|
.mob-kpi-value {
|
|
font-size: 22px;
|
|
font-weight: 800;
|
|
}
|
|
.mob-kpi-change {
|
|
font-size: 11px;
|
|
margin-top: 8px;
|
|
font-weight: 600;
|
|
}
|
|
.mob-kpi-change.mob-positive {
|
|
color: var(--mob-success);
|
|
}
|
|
.mob-kpi-change.mob-negative {
|
|
color: var(--mob-danger);
|
|
}
|
|
|
|
/* Section / generic cards */
|
|
.mob-section-card {
|
|
background: var(--mob-white);
|
|
border-radius: 16px;
|
|
padding: 18px;
|
|
box-shadow: 0 3px 15px rgba(0, 0, 0, 0.06);
|
|
margin-bottom: 16px;
|
|
}
|
|
.mob-section-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
margin-bottom: 14px;
|
|
flex-wrap: wrap;
|
|
gap: 10px;
|
|
}
|
|
.mob-section-header h4 {
|
|
font-size: 16px;
|
|
margin: 0;
|
|
color: var(--mob-primary);
|
|
font-weight: 700;
|
|
}
|
|
.mob-section-header small {
|
|
font-size: 12px;
|
|
color: var(--mob-text-light);
|
|
font-weight: 500;
|
|
}
|
|
|
|
.mob-card {
|
|
background: var(--mob-white);
|
|
border-radius: 14px;
|
|
padding: 14px 16px;
|
|
margin-bottom: 12px;
|
|
box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
|
|
}
|
|
|
|
/* List rows (users, activity, etc.) */
|
|
.mob-list-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 12px;
|
|
padding: 10px 0;
|
|
border-bottom: 1px dashed var(--mob-border);
|
|
}
|
|
.mob-list-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
.mob-avatar {
|
|
width: 42px;
|
|
height: 42px;
|
|
border-radius: 50%;
|
|
background: linear-gradient(135deg, var(--mob-primary), var(--mob-primary-light));
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
font-weight: 700;
|
|
color: white;
|
|
font-size: 13px;
|
|
flex-shrink: 0;
|
|
box-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
|
|
}
|
|
|
|
/* Badges */
|
|
.mob-status-badge {
|
|
padding: 4px 12px;
|
|
border-radius: 999px;
|
|
font-size: 11px;
|
|
font-weight: 700;
|
|
display: inline-block;
|
|
}
|
|
.mob-status-badge.mob-success {
|
|
background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
|
|
color: #2e7d32;
|
|
}
|
|
.mob-status-badge.mob-warning {
|
|
background: linear-gradient(135deg, #fff3e0, #ffe0b2);
|
|
color: #ef6c00;
|
|
}
|
|
.mob-status-badge.mob-danger {
|
|
background: linear-gradient(135deg, #ffebee, #ffcdd2);
|
|
color: #c62828;
|
|
}
|
|
.mob-status-badge.mob-neutral {
|
|
background: var(--mob-light-gray-bg);
|
|
color: var(--mob-text-medium);
|
|
}
|
|
|
|
/* Search + filters */
|
|
.mob-search-bar {
|
|
display: flex;
|
|
gap: 10px;
|
|
margin-bottom: 16px;
|
|
flex-wrap: wrap;
|
|
}
|
|
.mob-search-input {
|
|
flex: 1;
|
|
min-width: 160px;
|
|
padding: 11px 16px;
|
|
border: 2px solid var(--mob-border);
|
|
border-radius: 12px;
|
|
font-size: 14px;
|
|
background: white;
|
|
font-weight: 500;
|
|
}
|
|
.mob-search-input:focus {
|
|
outline: none;
|
|
border-color: var(--mob-primary);
|
|
box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.15);
|
|
}
|
|
|
|
/* Buttons */
|
|
.mob-pill-btn {
|
|
border-radius: 999px;
|
|
padding: 9px 18px;
|
|
font-size: 13px;
|
|
border: none;
|
|
background: linear-gradient(135deg, var(--mob-primary), var(--mob-primary-light));
|
|
color: var(--mob-white);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 7px;
|
|
font-weight: 700;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
|
|
}
|
|
.mob-pill-btn:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 16px rgba(108, 99, 255, 0.4);
|
|
}
|
|
.mob-pill-btn:disabled {
|
|
opacity: 0.5;
|
|
cursor: not-allowed;
|
|
transform: none;
|
|
}
|
|
.mob-text-btn {
|
|
border: none;
|
|
background: none;
|
|
color: var(--mob-primary);
|
|
font-weight: 600;
|
|
font-size: 13px;
|
|
cursor: pointer;
|
|
padding: 4px 8px;
|
|
}
|
|
.mob-text-btn.mob-danger {
|
|
color: var(--mob-danger);
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
.mob-app {
|
|
--mob-bg: #17181f;
|
|
--mob-white: #23242e;
|
|
--mob-text-dark: #e6e6f0;
|
|
--mob-text-medium: #b7b7c7;
|
|
--mob-text-light: #7d7d8f;
|
|
--mob-border: #33343f;
|
|
--mob-light-gray-bg: #2b2c37;
|
|
}
|
|
}
|