ERP/frontend/assets/dashboard-enhancements.css
2026-01-05 10:27:58 +08:00

425 lines
7.5 KiB
CSS

/* Modern Dashboard Enhancements - Glassmorphism Design */
/* Metrics Card Redesign */
.metrics-card {
background: var(--surface);
backdrop-filter: var(--blur);
-webkit-backdrop-filter: var(--blur);
border: 1px solid var(--border);
border-radius: 20px;
padding: 24px;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
cursor: pointer;
position: relative;
overflow: hidden;
box-shadow: var(--shadow);
height: 180px;
display: flex;
flex-direction: column;
}
.metrics-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 2px;
background: linear-gradient(90deg, transparent, var(--primary), transparent);
opacity: 0;
transition: opacity 0.4s ease;
}
.metrics-card:hover {
transform: translateY(-4px) scale(1.02);
box-shadow: var(--shadow-xl);
border-color: var(--primary);
}
.metrics-card:hover::before {
opacity: 1;
}
/* Card Header */
.metrics-card-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 16px;
z-index: 2;
}
.metrics-card-title {
font-size: 15px;
font-weight: 600;
color: var(--text-2);
letter-spacing: 0.3px;
}
.metrics-card-icon {
width: 44px;
height: 44px;
border-radius: 14px;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
box-shadow: var(--shadow-sm);
}
.metrics-card:hover .metrics-card-icon {
transform: scale(1.1) rotate(5deg);
box-shadow: var(--shadow);
}
/* Card Value */
.metrics-card-value {
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
z-index: 2;
}
.metrics-value-main {
font-size: 36px;
font-weight: 800;
color: var(--text);
letter-spacing: -1.5px;
line-height: 1;
margin-bottom: 8px;
font-family: 'Poppins', sans-serif;
}
.metrics-value-unit {
font-size: 16px;
font-weight: 600;
color: var(--text-4);
margin-left: 8px;
}
/* Card Trend */
.metrics-card-trend {
display: flex;
align-items: center;
gap: 8px;
margin-top: 4px;
}
.trend-value {
font-size: 15px;
font-weight: 700;
display: flex;
align-items: center;
gap: 4px;
}
.trend-value.up {
color: var(--success);
}
.trend-value.down {
color: var(--danger);
}
.trend-label {
font-size: 13px;
color: var(--text-4);
font-weight: 500;
}
/* Background Wave Pattern */
.metrics-card-wave {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 70px;
z-index: 1;
pointer-events: none;
opacity: 0.6;
transition: opacity 0.3s ease;
}
.metrics-card:hover .metrics-card-wave {
opacity: 0.8;
}
/* Chart Container Enhancements */
.chart-container {
background: var(--surface);
backdrop-filter: var(--blur);
-webkit-backdrop-filter: var(--blur);
border: 1px solid var(--border);
border-radius: 20px;
padding: 28px;
box-shadow: var(--shadow);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
}
.chart-container::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
opacity: 0.3;
}
.chart-container:hover {
box-shadow: var(--shadow-lg);
border-color: var(--primary);
}
.chart-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 24px;
}
.chart-title {
font-size: 18px;
font-weight: 600;
color: var(--text);
font-family: 'Poppins', sans-serif;
letter-spacing: -0.3px;
}
.chart-controls {
display: flex;
gap: 8px;
align-items: center;
}
.chart-control-btn {
padding: 8px 16px;
border-radius: 8px;
border: 1px solid var(--border);
background: var(--surface-glass);
color: var(--text-3);
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.chart-control-btn:hover {
background: var(--surface-glass-hover);
color: var(--text);
border-color: var(--primary);
}
.chart-control-btn.active {
background: var(--primary);
color: white;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
/* Data Table Enhancements */
.data-table {
width: 100%;
border-collapse: separate;
border-spacing: 0;
font-size: 14px;
}
.data-table thead {
background: var(--surface-glass);
backdrop-filter: var(--blur);
-webkit-backdrop-filter: var(--blur);
}
.data-table th {
padding: 14px 16px;
text-align: left;
font-weight: 600;
color: var(--text-2);
font-size: 13px;
text-transform: uppercase;
letter-spacing: 0.5px;
border-bottom: 2px solid var(--border);
}
.data-table tbody tr {
transition: all 0.2s ease;
border-bottom: 1px solid var(--border-light);
}
.data-table tbody tr:hover {
background: var(--surface-glass-hover);
transform: scale(1.01);
}
.data-table td {
padding: 14px 16px;
color: var(--text);
font-weight: 500;
}
/* Status Indicators */
.status-indicator {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
border-radius: 8px;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.3px;
}
.status-indicator::before {
content: '';
width: 6px;
height: 6px;
border-radius: 50%;
animation: pulse-dot 2s ease-in-out infinite;
}
.status-indicator.online {
background: var(--success-bg);
color: var(--success);
}
.status-indicator.online::before {
background: var(--success);
}
.status-indicator.offline {
background: var(--danger-bg);
color: var(--danger);
}
.status-indicator.offline::before {
background: var(--danger);
}
.status-indicator.pending {
background: var(--warning-bg);
color: var(--warning);
}
.status-indicator.pending::before {
background: var(--warning);
}
@keyframes pulse-dot {
0%, 100% {
opacity: 1;
transform: scale(1);
}
50% {
opacity: 0.5;
transform: scale(1.2);
}
}
/* Quick Stats Bar */
.quick-stats {
display: flex;
gap: 16px;
padding: 20px;
background: var(--surface);
backdrop-filter: var(--blur);
-webkit-backdrop-filter: var(--blur);
border: 1px solid var(--border);
border-radius: 16px;
margin-bottom: 24px;
box-shadow: var(--shadow-sm);
}
.quick-stat-item {
flex: 1;
display: flex;
flex-direction: column;
gap: 4px;
padding: 12px;
border-right: 1px solid var(--border-light);
}
.quick-stat-item:last-child {
border-right: none;
}
.quick-stat-label {
font-size: 12px;
color: var(--text-3);
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.5px;
}
.quick-stat-value {
font-size: 24px;
font-weight: 700;
color: var(--text);
font-family: 'Poppins', sans-serif;
letter-spacing: -0.5px;
}
/* Loading States */
.skeleton {
background: linear-gradient(90deg, var(--surface) 25%, var(--surface-glass-hover) 50%, var(--surface) 75%);
background-size: 200% 100%;
animation: skeleton-loading 1.5s ease-in-out infinite;
border-radius: 8px;
}
@keyframes skeleton-loading {
0% {
background-position: 200% 0;
}
100% {
background-position: -200% 0;
}
}
/* Responsive Adjustments */
@media (max-width: 1024px) {
.metrics-card {
height: 160px;
padding: 20px;
}
.metrics-value-main {
font-size: 32px;
}
.chart-container {
padding: 24px;
}
}
@media (max-width: 640px) {
.metrics-card {
height: 140px;
padding: 16px;
}
.metrics-value-main {
font-size: 28px;
}
.quick-stats {
flex-direction: column;
gap: 12px;
}
.quick-stat-item {
border-right: none;
border-bottom: 1px solid var(--border-light);
padding-bottom: 12px;
}
.quick-stat-item:last-child {
border-bottom: none;
padding-bottom: 0;
}
}