Files
bonch-md-client/src/styles/globals.css
antigravity-xd 05f9c3198c feat(ui): Implement M3 FAB and finalize core UI rework (Stage 3)
- Implemented M3 Floating Action Button (FAB) with extended variant support
- Integrated FAB into Navigation Rail (top placement) and Bottom Bar (floating)
- Added user profile header to expanded sidebar
- Polished M3 styles and transitions
- Fixed various CSS and layout issues

Refs #3
Co-Authored-By: Claude <noreply@anthropic.com>
2026-04-11 01:18:17 +03:00

521 lines
11 KiB
CSS

:root {
--md-sys-color-primary: #0061a4;
--md-sys-color-on-primary: #ffffff;
--md-sys-color-primary-container: #d1e4ff;
--md-sys-color-on-primary-container: #001d36;
--md-sys-color-secondary: #535f70;
--md-sys-color-on-secondary: #ffffff;
--md-sys-color-secondary-container: #d7e3f7;
--md-sys-color-on-secondary-container: #101c2b;
--md-sys-color-surface: #fdfcff;
--md-sys-color-on-surface: #1a1c1e;
--md-sys-color-surface-variant: #dfe2eb;
--md-sys-color-on-surface-variant: #43474e;
--md-sys-color-outline: #73777f;
--md-sys-color-outline-variant: #c3c7cf;
--md-sys-color-error: #ba1a1a;
--md-sys-color-on-error: #ffffff;
--md-sys-color-background: #fdfcff;
--md-sys-color-on-background: #1a1c1e;
--nav-rail-width: 80px;
--nav-rail-expanded-width: 280px;
--nav-bar-height: 80px;
}
:root.dark {
--md-sys-color-primary: #9ecaff;
--md-sys-color-on-primary: #003258;
--md-sys-color-primary-container: #00497d;
--md-sys-color-on-primary-container: #d1e4ff;
--md-sys-color-secondary: #bbc7db;
--md-sys-color-on-secondary: #253140;
--md-sys-color-secondary-container: #3b4858;
--md-sys-color-on-secondary-container: #d7e3f7;
--md-sys-color-surface: #1a1c1e;
--md-sys-color-on-surface: #e2e2e6;
--md-sys-color-surface-variant: #43474e;
--md-sys-color-on-surface-variant: #c3c7cf;
--md-sys-color-outline: #8d9199;
--md-sys-color-outline-variant: #43474e;
--md-sys-color-error: #ffb4ab;
--md-sys-color-on-error: #690005;
--md-sys-color-background: #1a1c1e;
--md-sys-color-on-background: #e2e2e6;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: 'Roboto', 'Segoe UI', system-ui, -apple-system, sans-serif;
background-color: var(--md-sys-color-background);
color: var(--md-sys-color-on-background);
line-height: 1.5;
transition: background-color 0.3s, color 0.3s;
}
/* M3 Components */
.m3-badge {
position: absolute;
top: -4px;
right: -4px;
background-color: var(--md-sys-color-error);
color: var(--md-sys-color-on-error);
font-size: 10px;
font-weight: 500;
min-width: 16px;
height: 16px;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
padding: 0 4px;
}
.icon-button {
width: 48px;
height: 48px;
border-radius: 24px;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: none;
color: var(--md-sys-color-on-surface-variant);
transition: background-color 0.2s;
cursor: pointer;
position: relative;
overflow: hidden;
}
.icon-button:hover {
background-color: rgba(var(--md-sys-color-on-surface-variant-rgb, 67, 71, 78), 0.08);
}
.m3-button {
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 24px;
height: 40px;
border-radius: 20px;
border: none;
font-weight: 500;
font-size: 14px;
letter-spacing: 0.1px;
transition: all 0.2s;
background-color: transparent;
color: var(--md-sys-color-primary);
text-decoration: none;
cursor: pointer;
}
.m3-button-filled {
background-color: var(--md-sys-color-primary);
color: var(--md-sys-color-on-primary);
}
.m3-button-filled:hover {
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
}
.m3-button-tonal {
background-color: var(--md-sys-color-secondary-container);
color: var(--md-sys-color-on-secondary-container);
}
.m3-button-outlined {
border: 1px solid var(--md-sys-color-outline);
color: var(--md-sys-color-primary);
}
.m3-card {
background-color: var(--md-sys-color-surface-variant);
color: var(--md-sys-color-on-surface-variant);
border-radius: 12px;
padding: 16px;
margin-bottom: 16px;
}
/* M3 FAB */
.m3-fab {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: 56px;
height: 56px;
border-radius: 16px;
border: none;
background-color: var(--md-sys-color-primary-container);
color: var(--md-sys-color-on-primary-container);
box-shadow: 0 3px 1px -2px rgba(0,0,0,.2), 0 2px 2px 0 rgba(0,0,0,.14), 0 1px 5px 0 rgba(0,0,0,.12);
cursor: pointer;
position: relative;
overflow: hidden;
transition: box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.m3-fab:hover {
box-shadow: 0 2px 4px -1px rgba(0,0,0,.2), 0 4px 5px 0 rgba(0,0,0,.14), 0 1px 10px 0 rgba(0,0,0,.12);
}
.m3-fab.extended {
padding: 0 16px;
width: auto;
gap: 12px;
}
.m3-fab-icon {
display: flex;
align-items: center;
justify-content: center;
}
.m3-fab-label {
font-size: 14px;
font-weight: 500;
letter-spacing: 0.1px;
}
.m3-fab-state-layer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--md-sys-color-on-primary-container);
opacity: 0;
transition: opacity 0.2s;
}
.m3-fab:hover .m3-fab-state-layer {
opacity: 0.08;
}
/* M3 Filled Text Field */
.m3-text-field-container {
display: flex;
flex-direction: column;
margin-bottom: 16px;
width: 100%;
}
.m3-text-field-field {
position: relative;
height: 56px;
background-color: var(--md-sys-color-surface-variant);
border-radius: 4px 4px 0 0;
overflow: hidden;
}
.m3-text-field-input {
width: 100%;
height: 100%;
padding: 24px 16px 8px;
border: none;
background: transparent;
color: var(--md-sys-color-on-surface);
font-size: 16px;
outline: none;
z-index: 1;
}
.m3-text-field-label {
position: absolute;
left: 16px;
top: 16px;
color: var(--md-sys-color-on-surface-variant);
font-size: 16px;
transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
pointer-events: none;
z-index: 2;
}
.m3-text-field-container.focused .m3-text-field-label,
.m3-text-field-container.filled .m3-text-field-label {
top: 8px;
font-size: 12px;
color: var(--md-sys-color-primary);
}
.m3-text-field-active-indicator {
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 1px;
background-color: var(--md-sys-color-on-surface-variant);
transition: height 0.2s, background-color 0.2s;
}
.m3-text-field-container.focused .m3-text-field-active-indicator {
height: 2px;
background-color: var(--md-sys-color-primary);
}
.m3-text-field-state-layer {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--md-sys-color-on-surface);
opacity: 0;
transition: opacity 0.2s;
pointer-events: none;
}
.m3-text-field-field:hover .m3-text-field-state-layer {
opacity: 0.08;
}
.m3-text-field-container.error .m3-text-field-label,
.m3-text-field-container.error .m3-text-field-active-indicator {
color: var(--md-sys-color-error);
background-color: var(--md-sys-color-error);
}
.m3-text-field-supporting-text {
font-size: 12px;
padding: 4px 16px 0;
color: var(--md-sys-color-on-surface-variant);
}
.m3-text-field-container.error .m3-text-field-supporting-text {
color: var(--md-sys-color-error);
}
/* Layout */
.app-container {
display: flex;
min-height: 100vh;
}
.main-content {
flex: 1;
padding: 16px;
}
/* Navigation Bar (Mobile) */
.navigation-bar {
position: fixed;
left: 0;
right: 0;
bottom: 0;
height: var(--nav-bar-height);
background-color: var(--md-sys-color-surface-variant);
display: flex;
justify-content: space-around;
align-items: center;
padding: 0 8px;
z-index: 100;
transition: transform 0.2s ease-in-out;
}
.navigation-bar.hidden {
transform: translateY(100%);
}
.mobile-fab-container {
position: fixed;
right: 16px;
bottom: calc(var(--nav-bar-height) + 16px);
z-index: 99;
transition: transform 0.2s ease-in-out, opacity 0.2s;
}
.mobile-fab-container.hidden {
transform: translateY(calc(var(--nav-bar-height) + 16px));
opacity: 0;
}
@media (min-width: 600px) {
.navigation-bar { display: none; }
.main-content { margin-left: var(--nav-rail-width); }
}
@media (min-width: 1240px) {
.main-content.with-expanded-rail { margin-left: var(--nav-rail-expanded-width); }
}
@media (max-width: 599px) {
.main-content { padding-bottom: calc(var(--nav-bar-height) + 16px); }
}
/* Navigation Rail (Tablet/Desktop) */
.navigation-rail {
position: fixed;
left: 0;
top: 0;
bottom: 0;
width: var(--nav-rail-width);
background-color: var(--md-sys-color-surface);
display: flex;
flex-direction: column;
padding: 16px 0;
border-right: 1px solid var(--md-sys-color-outline-variant);
z-index: 100;
transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
overflow-x: hidden;
}
.navigation-rail.expanded {
width: var(--nav-rail-expanded-width);
}
.rail-header {
display: flex;
align-items: center;
padding: 0 16px;
height: 56px;
gap: 12px;
margin-bottom: 8px;
}
.rail-title {
font-size: 20px;
font-weight: 500;
white-space: nowrap;
}
.user-info {
display: flex;
align-items: center;
padding: 16px;
gap: 12px;
margin-bottom: 8px;
}
.user-avatar {
width: 40px;
height: 40px;
border-radius: 20px;
background-color: var(--md-sys-color-primary-container);
color: var(--md-sys-color-on-primary-container);
display: flex;
align-items: center;
justify-content: center;
font-weight: 500;
flex-shrink: 0;
}
.user-details {
display: flex;
flex-direction: column;
overflow: hidden;
}
.user-name {
font-size: 14px;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-group {
font-size: 12px;
opacity: 0.7;
}
.rail-items {
display: flex;
flex-direction: column;
gap: 4px;
}
/* Nav Items Shared */
.nav-item {
display: flex;
align-items: center;
text-decoration: none;
color: var(--md-sys-color-on-surface-variant);
height: 56px;
padding: 0 12px;
position: relative;
transition: background-color 0.2s;
}
.navigation-bar .nav-item {
flex-direction: column;
justify-content: center;
flex: 1;
gap: 4px;
padding: 0;
}
.nav-item-icon-wrapper {
width: 64px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 16px;
transition: background-color 0.2s;
position: relative;
}
.nav-item.active .nav-item-icon-wrapper {
background-color: var(--md-sys-color-secondary-container);
color: var(--md-sys-color-on-secondary-container);
}
.nav-item-label {
font-size: 12px;
font-weight: 500;
white-space: nowrap;
}
.navigation-rail.expanded .nav-item {
height: 56px;
border-radius: 28px;
margin: 0 12px;
}
.navigation-rail.expanded .nav-item-label {
font-size: 14px;
margin-left: 12px;
flex: 1;
}
/* Submenu */
.submenu {
display: flex;
flex-direction: column;
padding-left: 56px;
margin-bottom: 8px;
}
.submenu-item {
height: 48px;
display: flex;
align-items: center;
text-decoration: none;
color: var(--md-sys-color-on-surface-variant);
font-size: 14px;
border-radius: 24px;
margin: 0 12px;
padding: 0 16px;
}
.submenu-item.active {
background-color: var(--md-sys-color-secondary-container);
color: var(--md-sys-color-on-secondary-container);
}
.submenu-arrow {
margin-right: 8px;
}