SocialShare / frontend /src /components /dashboard /DashboardLayout.css
NitinBot002's picture
Initial commit with all project files
f4854a1
/* ============================================================
Dashboard Layout — Premium Glassmorphism Design
============================================================ */
/* Citizen Greeting */
.citizen-greeting {
padding: 1.25rem 1.5rem;
background: linear-gradient(135deg, #0f1117, #1a2234);
border-radius: 16px;
color: white;
margin-bottom: 0;
}
.citizen-greeting h1 {
font-size: 1.5rem;
font-weight: 800;
color: white;
margin: 0 0 0.3rem;
}
.citizen-greeting p {
font-size: 0.88rem;
color: rgba(255,255,255,0.6);
margin: 0;
}
:root {
--dash-sidebar-width: 260px;
--dash-sidebar-closed: 68px;
--dash-topbar-h: 64px;
--dash-sidebar-bg: #0f1117;
--dash-sidebar-hover: rgba(255,255,255,0.06);
--dash-sidebar-active: rgba(45, 106, 79, 0.25);
--dash-sidebar-active-border: #2D6A4F;
--dash-text-muted: rgba(255,255,255,0.45);
--dash-text: rgba(255,255,255,0.87);
--dash-main-bg: #f5f7fa;
--dash-card-bg: #ffffff;
--dash-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
/* ── Root Container ── */
.dash-root {
min-height: 100vh;
transition: all var(--dash-transition);
}
/* ── Overlay (mobile) ── */
.dash-overlay {
position: fixed;
inset: 0;
background: rgba(0,0,0,0.5);
z-index: 49;
backdrop-filter: blur(2px);
}
/* ── Sidebar ── */
.dash-sidebar {
background: var(--dash-sidebar-bg);
width: var(--dash-sidebar-width);
position: fixed;
top: 0;
left: 0;
height: 100vh;
display: flex;
flex-direction: column;
z-index: 50;
overflow: hidden;
border-right: 1px solid rgba(255,255,255,0.06);
transition: width var(--dash-transition);
}
.dash-root--closed .dash-sidebar {
width: var(--dash-sidebar-closed);
}
/* Sidebar Brand */
.dash-sidebar__brand {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 1.25rem 1rem;
border-bottom: 1px solid rgba(255,255,255,0.07);
min-height: var(--dash-topbar-h);
}
.dash-sidebar__logo {
width: 40px;
height: 40px;
border-radius: 12px;
background: linear-gradient(135deg, #2D6A4F, #40916C);
display: flex;
align-items: center;
justify-content: center;
font-weight: 800;
color: white;
font-size: 0.85rem;
flex-shrink: 0;
letter-spacing: 0.05em;
box-shadow: 0 4px 12px rgba(45, 106, 79, 0.4);
}
.dash-sidebar__brand-text {
display: flex;
flex-direction: column;
overflow: hidden;
white-space: nowrap;
}
.dash-sidebar__brand-name {
font-size: 0.875rem;
font-weight: 700;
color: var(--dash-text);
letter-spacing: -0.01em;
}
.dash-sidebar__brand-role {
font-size: 0.7rem;
color: var(--dash-text-muted);
text-transform: uppercase;
letter-spacing: 0.08em;
}
/* Sidebar Nav */
.dash-sidebar__nav {
flex: 1;
padding: 1rem 0.5rem;
display: flex;
flex-direction: column;
gap: 0.125rem;
overflow-y: auto;
overflow-x: hidden;
scrollbar-width: none;
}
.dash-nav-item {
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.65rem 0.875rem;
border-radius: 10px;
color: var(--dash-text-muted);
text-decoration: none;
font-size: 0.875rem;
font-weight: 500;
cursor: pointer;
border: none;
background: transparent;
width: 100%;
transition: all 0.18s ease;
white-space: nowrap;
position: relative;
}
.dash-nav-item:hover {
background: var(--dash-sidebar-hover);
color: var(--dash-text);
}
.dash-nav-item--active {
background: var(--dash-sidebar-active) !important;
color: #52B788 !important;
border-left: 3px solid var(--dash-sidebar-active-border);
}
.dash-nav-item__icon {
font-size: 1.15rem;
display: flex;
align-items: center;
flex-shrink: 0;
width: 20px;
}
.dash-nav-item__label {
overflow: hidden;
text-overflow: ellipsis;
}
.dash-nav-item__badge {
margin-left: auto;
background: #EF4444;
color: white;
font-size: 0.65rem;
font-weight: 700;
padding: 0.1rem 0.45rem;
border-radius: 999px;
min-width: 18px;
text-align: center;
}
/* Sidebar Footer */
.dash-sidebar__footer {
padding: 0.5rem;
border-top: 1px solid rgba(255,255,255,0.07);
}
.dash-nav-item--logout {
color: rgba(239, 68, 68, 0.7);
}
.dash-nav-item--logout:hover {
background: rgba(239, 68, 68, 0.1);
color: #EF4444;
}
/* Collapse Button */
.dash-sidebar__collapse-btn {
position: absolute;
bottom: 5rem;
right: -12px;
width: 24px;
height: 24px;
background: #1e2430;
border: 1px solid rgba(255,255,255,0.1);
border-radius: 50%;
color: var(--dash-text-muted);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 0.75rem;
z-index: 51;
transition: background 0.2s, color 0.2s;
}
.dash-sidebar__collapse-btn:hover {
background: #2D6A4F;
color: white;
}
/* ── Main Area ── */
.dash-main {
margin-left: var(--dash-sidebar-width);
min-height: 100vh;
display: flex;
flex-direction: column;
background: var(--dash-main-bg);
transition: margin-left var(--dash-transition);
}
.dash-root--closed .dash-main {
margin-left: var(--dash-sidebar-closed);
}
/* ── Top Bar ── */
.dash-topbar {
height: var(--dash-topbar-h);
background: white;
border-bottom: 1px solid #e5e7eb;
display: flex;
align-items: center;
gap: 1rem;
padding: 0 1.5rem;
position: sticky;
top: 0;
z-index: 40;
box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.dash-topbar__hamburger {
display: none;
background: none;
border: none;
font-size: 1.4rem;
color: #374151;
cursor: pointer;
padding: 0.25rem;
}
.dash-topbar__title {
font-size: 1.05rem;
font-weight: 700;
color: #111827;
flex: 1;
}
.dash-topbar__right {
display: flex;
align-items: center;
gap: 1rem;
}
.dash-topbar__bell {
position: relative;
background: none;
border: none;
font-size: 1.3rem;
color: #6B7280;
cursor: pointer;
padding: 0.3rem;
display: flex;
align-items: center;
transition: color 0.2s;
}
.dash-topbar__bell:hover { color: #2D6A4F; }
.dash-topbar__bell-dot {
position: absolute;
top: 0;
right: 0;
width: 8px;
height: 8px;
background: #EF4444;
border-radius: 50%;
border: 1.5px solid white;
}
.dash-topbar__user {
display: flex;
align-items: center;
gap: 0.6rem;
}
.dash-topbar__avatar {
width: 36px;
height: 36px;
border-radius: 50%;
object-fit: cover;
border: 2px solid #e5e7eb;
}
.dash-topbar__avatar--initials {
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #2D6A4F, #40916C);
color: white;
font-size: 0.8rem;
font-weight: 700;
flex-shrink: 0;
}
.dash-topbar__user-info {
display: flex;
flex-direction: column;
}
.dash-topbar__name {
font-size: 0.85rem;
font-weight: 600;
color: #111827;
line-height: 1.2;
}
.dash-topbar__role {
font-size: 0.7rem;
color: #9CA3AF;
text-transform: capitalize;
}
/* ── Dashboard Content ── */
.dash-content {
flex: 1;
padding: 1.75rem;
max-width: 100%;
overflow-x: hidden;
}
/* ── Dashboard Cards (shared) ── */
.dash-card {
background: var(--dash-card-bg);
border-radius: 16px;
border: 1px solid #e5e7eb;
padding: 1.5rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.05);
transition: box-shadow 0.2s;
}
.dash-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.dash-card__header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 1.25rem;
}
.dash-card__title {
font-size: 1rem;
font-weight: 700;
color: #111827;
display: flex;
align-items: center;
gap: 0.5rem;
}
/* KPI Stat Cards */
.dash-kpi-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1rem;
margin-bottom: 1.5rem;
}
.dash-kpi {
background: white;
border-radius: 16px;
border: 1px solid #e5e7eb;
padding: 1.25rem 1.5rem;
display: flex;
align-items: flex-start;
gap: 1rem;
transition: box-shadow 0.2s, transform 0.2s;
}
.dash-kpi:hover {
box-shadow: 0 4px 20px rgba(0,0,0,0.08);
transform: translateY(-1px);
}
.dash-kpi__icon-wrap {
width: 48px;
height: 48px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.3rem;
flex-shrink: 0;
}
.dash-kpi__body { flex: 1; min-width: 0; }
.dash-kpi__value {
font-size: 1.6rem;
font-weight: 800;
color: #111827;
line-height: 1.1;
letter-spacing: -0.02em;
}
.dash-kpi__label {
font-size: 0.78rem;
color: #9CA3AF;
margin-top: 0.2rem;
font-weight: 500;
}
.dash-kpi__trend {
font-size: 0.72rem;
font-weight: 600;
padding: 0.2rem 0.5rem;
border-radius: 999px;
margin-top: 0.4rem;
display: inline-block;
}
.dash-kpi__trend--up { background: #ecfdf5; color: #059669; }
.dash-kpi__trend--down { background: #fef2f2; color: #DC2626; }
/* Tables */
.dash-table {
width: 100%;
border-collapse: collapse;
font-size: 0.875rem;
}
.dash-table th {
text-align: left;
padding: 0.6rem 1rem;
font-size: 0.72rem;
font-weight: 600;
color: #9CA3AF;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 1px solid #f3f4f6;
}
.dash-table td {
padding: 0.875rem 1rem;
border-bottom: 1px solid #f9fafb;
color: #374151;
vertical-align: middle;
}
.dash-table tr:hover td { background: #f9fafb; }
/* Generic page header */
.dash-page-header {
margin-bottom: 1.5rem;
}
.dash-page-header h1 {
font-size: 1.5rem;
font-weight: 800;
color: #111827;
margin-bottom: 0.25rem;
}
.dash-page-header p {
color: #6B7280;
font-size: 0.9rem;
}
/* Empty state */
.dash-empty {
text-align: center;
padding: 3rem 1rem;
color: #9CA3AF;
}
.dash-empty__icon {
font-size: 3rem;
margin-bottom: 0.75rem;
opacity: 0.5;
}
/* Loading pulse */
.dash-skeleton {
background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
background-size: 200% 100%;
animation: skeletonPulse 1.5s ease infinite;
border-radius: 8px;
}
@keyframes skeletonPulse {
0% { background-position: 200% 0; }
100% { background-position: -200% 0; }
}
/* Section grid */
.dash-grid-2 {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.25rem;
}
.dash-grid-3 {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 1.25rem;
}
/* Mobile hamburger visible */
@media (max-width: 768px) {
.dash-main { margin-left: 0; }
.dash-sidebar {
transform: translateX(-100%);
transition: transform 0.3s ease;
}
.dash-sidebar--mobile-open {
transform: translateX(0);
}
.dash-topbar__hamburger { display: flex; }
.dash-topbar__user-info { display: none; }
.dash-content { padding: 1rem; }
.dash-grid-2 { grid-template-columns: 1fr; }
.dash-grid-3 { grid-template-columns: 1fr 1fr; }
.dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
.dash-grid-3 { grid-template-columns: 1fr; }
.dash-kpi-grid { grid-template-columns: 1fr; }
}