adminflow-dashboard / style.css
CallmeGodsent's picture
Sleek dashboard with sidebar, header, management like users, settings, one file and bootstrap. make hash based urls. EG index.html#report. Should be responsive as well. Light and dark mode with toggle.
7ca783b verified
:root {
--primary-color: #667eea;
--primary-dark: #5a6fd8;
--secondary-color: #764ba2;
--text-primary: #2d3748;
--text-secondary: #718096;
--bg-primary: #ffffff;
--bg-secondary: #f7fafc;
--bg-sidebar: #f8f9fa;
--border-color: #e2e8f0;
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] {
--primary-color: #667eea;
--primary-dark: #5a6fd8;
--secondary-color: #764ba2;
--text-primary: #f7fafc;
--text-secondary: #cbd5e0;
--bg-primary: #1a202c;
--bg-secondary: #2d3748;
--bg-sidebar: #2d3748;
--border-color: #4a5568;
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--bg-primary);
color: var(--text-primary);
transition: all 0.3s ease;
}
.dashboard-container {
display: flex;
min-height: 100vh;
}
/* Sidebar Styles */
.sidebar {
width: 260px;
background: var(--bg-sidebar);
border-right: 1px solid var(--border-color);
transition: all 0.3s ease;
position: fixed;
height: 100vh;
z-index: 1000;
}
.sidebar-header {
padding: 1.5rem;
border-bottom: 1px solid var(--border-color);
}
.sidebar-header h2 {
color: var(--primary-color);
font-size: 1.5rem;
font-weight: 700;
}
.sidebar-nav {
padding: 1rem 0;
}
.nav-item {
display: flex;
align-items: center;
padding: 0.75rem 1.5rem;
color: var(--text-secondary);
text-decoration: none;
transition: all 0.2s ease;
border-left: 3px solid transparent;
}
.nav-item:hover {
background: var(--bg-secondary);
color: var(--text-primary);
}
.nav-item.active {
background: var(--bg-secondary);
color: var(--primary-color);
border-left-color: var(--primary-color);
}
.nav-item i {
margin-right: 0.75rem;
width: 20px;
text-align: center;
}
/* Main Content */
.main-content {
flex: 1;
margin-left: 260px;
transition: all 0.3s ease;
}
/* Header Styles */
.header {
background: var(--bg-primary);
border-bottom: 1px solid var(--border-color);
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: var(--shadow);
}
.header-left h1 {
font-size: 1.5rem;
font-weight: 600;
color: var(--text-primary);
}
.header-right {
display: flex;
align-items: center;
gap: 1rem;
}
/* Theme Toggle */
.theme-toggle {
background: none;
border: 1px solid var(--border-color);
color: var(--text-secondary);
padding: 0.5rem;
border-radius: 0.375rem;
cursor: pointer;
transition: all 0.2s ease;
}
.theme-toggle:hover {
background: var(--bg-secondary);
color: var(--text-primary);
}
/* Content Area */
.content {
padding: 2rem;
}
.page {
display: none;
}
.page.active {
display: block;
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
/* Card Styles */
.card {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 0.5rem;
padding: 1.5rem;
box-shadow: var(--shadow);
margin-bottom: 1.5rem;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.card-title {
font-size: 1.25rem;
font-weight: 600;
color: var(--text-primary);
}
/* Table Styles */
.table {
width: 100%;
border-collapse: collapse;
background: var(--bg-primary);
}
.table th,
.table td {
padding: 0.75rem 1rem;
text-align: left;
border-bottom: 1px solid var(--border-color);
}
.table th {
background: var(--bg-secondary);
font-weight: 600;
color: var(--text-primary);
}
.table tr:hover {
background: var(--bg-secondary);
}
/* Responsive */
@media (max-width: 768px) {
.sidebar {
width: 70px;
}
.sidebar-header h2,
.nav-item span {
display: none;
}
.main-content {
margin-left: 70px;
}
.nav-item {
padding: 0.75rem;
justify-content: center;
}
.nav-item i {
margin-right: 0;
}
.header {
padding: 1rem;
}
.content {
padding: 1rem;
}
}
/* Stats Grid */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 1.5rem;
margin-bottom: 2rem;
}
.stat-card {
background: var(--bg-primary);
border: 1px solid var(--border-color);
border-radius: 0.5rem;
padding: 1.5rem;
box-shadow: var(--shadow);
}
.stat-value {
font-size: 2rem;
font-weight: 700;
color: var(--primary-color);
margin-bottom: 0.5rem;
}
.stat-label {
color: var(--text-secondary);
font-size: 0.875rem;
}
/* Form Styles */
.form-group {
margin-bottom: 1rem;
}
.form-label {
display: block;
margin-bottom: 0.5rem;
color: var(--text-primary);
font-weight: 500;
}
.form-control {
width: 100%;
padding: 0.75rem;
border: 1px solid var(--border-color);
border-radius: 0.375rem;
background: var(--bg-primary);
color: var(--text-primary);
transition: all 0.2s ease;
}
.form-control:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.btn {
padding: 0.75rem 1.5rem;
border: none;
border-radius: 0.375rem;
font-weight: 500;
cursor: pointer;
transition: all 0.2s ease;
}
.btn-primary {
background: var(--primary-color);
color: white;
}
.btn-primary:hover {
background: var(--primary-dark);
}
/* Settings Grid */
.settings-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
}
.setting-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 0;
border-bottom: 1px solid var(--border-color);
}
.setting-item:last-child {
border-bottom: none;
}
.toggle-switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--border-color);
transition: .4s;
border-radius: 24px;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .toggle-slider {
background-color: var(--primary-color);
}
input:checked + .toggle-slider:before {
transform: translateX(26px);
}