Files
factoryOps-v2/dashboard/app/globals.css
Johngreen ab2a3e35b2 feat: Phase 0-2 complete — auth, machines, equipment parts with full CRUD
Multi-tenant factory inspection system (SpiFox, Enkid, Alpet):
- FastAPI backend with JWT auth, PostgreSQL (asyncpg)
- Next.js 16 frontend with App Router, SWR data fetching
- Machines CRUD with equipment parts management
- Part lifecycle tracking (hours/count/date) with counters
- Partial unique index for soft-delete support
- 24 pytest tests passing, E2E verified

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-02-10 12:05:22 +09:00

1074 lines
18 KiB
CSS

:root {
--md-primary: #1a73e8;
--md-primary-dark: #1557b0;
--md-success: #1e8e3e;
--md-error: #d93025;
--md-warning: #f9ab00;
--md-surface: #ffffff;
--md-surface-variant: #f8f9fa;
--md-on-surface: #202124;
--md-on-surface-secondary: #5f6368;
--md-outline: #dadce0;
--md-radius: 8px;
--md-radius-lg: 12px;
}
* {
box-sizing: border-box;
padding: 0;
margin: 0;
}
html, body {
max-width: 100vw;
overflow-x: hidden;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
color: var(--md-on-surface);
background: var(--md-surface-variant);
-webkit-font-smoothing: antialiased;
}
a {
color: inherit;
text-decoration: none;
}
.material-symbols-outlined {
font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
@keyframes spin {
from { transform: rotate(0deg); }
to { transform: rotate(360deg); }
}
.spinning {
animation: spin 1s linear infinite;
}
.loading {
display: flex;
align-items: center;
justify-content: center;
padding: 40px;
color: var(--md-primary);
}
.loading .material-symbols-outlined {
font-size: 36px;
}
.auth-loading {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: var(--md-surface-variant);
}
.auth-loading .material-symbols-outlined {
font-size: 48px;
color: var(--md-primary);
}
.card {
background: var(--md-surface);
border-radius: var(--md-radius-lg);
border: 1px solid var(--md-outline);
overflow: hidden;
}
.card-header {
display: flex;
align-items: center;
gap: 8px;
padding: 16px 20px;
border-bottom: 1px solid var(--md-outline);
font-size: 14px;
font-weight: 500;
color: var(--md-on-surface);
}
.card-header .material-symbols-outlined {
font-size: 20px;
color: var(--md-primary);
}
.card-body {
padding: 20px;
}
.btn-outline {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 8px 16px;
border: 1px solid var(--md-outline);
border-radius: 20px;
background: transparent;
color: var(--md-on-surface-secondary);
font-size: 13px;
cursor: pointer;
transition: background 0.2s;
}
.btn-outline:hover {
background: var(--md-surface-variant);
}
.btn-outline .material-symbols-outlined {
font-size: 16px;
}
.empty-message {
text-align: center;
padding: 32px;
color: var(--md-on-surface-secondary);
font-size: 14px;
}
.home-container {
max-width: 960px;
margin: 0 auto;
padding: 32px 20px;
}
.home-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 32px;
}
.home-title {
display: flex;
align-items: center;
gap: 12px;
}
.home-title .material-symbols-outlined {
font-size: 32px;
color: var(--md-primary);
}
.home-title h1 {
font-size: 24px;
font-weight: 500;
}
.home-user {
display: flex;
align-items: center;
gap: 12px;
font-size: 13px;
color: var(--md-on-surface-secondary);
}
.tenant-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
gap: 16px;
}
.tenant-card {
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
padding: 24px 16px;
border: 1px solid var(--md-outline);
border-radius: var(--md-radius-lg);
background: var(--md-surface);
cursor: pointer;
transition: border-color 0.2s, box-shadow 0.2s;
}
.tenant-card:hover {
border-color: var(--md-primary);
box-shadow: 0 2px 8px rgba(26, 115, 232, 0.15);
}
.tenant-icon {
font-size: 36px;
color: var(--md-primary);
}
.tenant-name {
font-size: 15px;
font-weight: 500;
color: var(--md-on-surface);
}
.tenant-id {
font-size: 12px;
color: var(--md-on-surface-secondary);
}
.login-container {
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: var(--md-surface-variant);
padding: 20px;
}
.login-card {
background: var(--md-surface);
border-radius: var(--md-radius-lg);
padding: 40px;
width: 100%;
max-width: 400px;
border: 1px solid var(--md-outline);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}
.login-header {
text-align: center;
margin-bottom: 32px;
}
.login-icon {
font-size: 48px;
color: var(--md-primary);
margin-bottom: 12px;
display: block;
}
.login-header h1 {
font-size: 24px;
font-weight: 500;
margin: 0 0 8px 0;
}
.login-header p {
font-size: 14px;
color: var(--md-on-surface-secondary);
margin: 0;
}
.login-form {
display: flex;
flex-direction: column;
gap: 20px;
}
.login-error {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 16px;
background: #fce8e6;
border-radius: var(--md-radius);
color: var(--md-error);
font-size: 14px;
}
.login-error .material-symbols-outlined {
font-size: 20px;
}
.form-field {
display: flex;
flex-direction: column;
gap: 8px;
}
.form-field label {
font-size: 14px;
font-weight: 500;
color: var(--md-on-surface-secondary);
}
.form-field input {
padding: 14px 16px;
border: 1px solid var(--md-outline);
border-radius: var(--md-radius);
background: var(--md-surface);
color: var(--md-on-surface);
font-size: 16px;
transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field input:focus {
outline: none;
border-color: var(--md-primary);
box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}
.form-field input::placeholder {
color: #9aa0a6;
}
.form-field input:disabled {
background: #f1f3f4;
opacity: 0.7;
cursor: not-allowed;
}
.login-button {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
padding: 14px 24px;
background: var(--md-primary);
color: #ffffff;
border: none;
border-radius: 20px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s, box-shadow 0.2s;
margin-top: 8px;
}
.login-button:hover:not(:disabled) {
background: var(--md-primary-dark);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.login-button:disabled {
background: #a8c7fa;
cursor: not-allowed;
}
.login-button .material-symbols-outlined {
font-size: 18px;
}
.toast-container {
position: fixed;
bottom: 24px;
right: 24px;
z-index: 1000;
display: flex;
flex-direction: column;
gap: 8px;
}
.toast {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
border-radius: var(--md-radius);
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
min-width: 300px;
max-width: 480px;
animation: toast-in 0.3s ease;
}
.toast-success { background: #e6f4ea; color: var(--md-success); }
.toast-error { background: #fce8e6; color: var(--md-error); }
.toast-info { background: #e8f0fe; color: var(--md-primary); }
.toast-icon { font-size: 20px; }
.toast-message { flex: 1; font-size: 14px; }
.toast-close {
background: none;
border: none;
cursor: pointer;
color: inherit;
opacity: 0.6;
padding: 4px;
}
.toast-close:hover { opacity: 1; }
.toast-exit {
animation: toast-out 0.3s ease forwards;
}
@keyframes toast-in {
from { transform: translateX(100%); opacity: 0; }
to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
from { transform: translateX(0); opacity: 1; }
to { transform: translateX(100%); opacity: 0; }
}
/* ===== TopNav ===== */
.topnav {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 20px;
background: var(--md-surface);
border-bottom: 1px solid var(--md-outline);
z-index: 100;
}
.topnav-left {
display: flex;
align-items: center;
gap: 12px;
}
.topnav-brand {
display: flex;
align-items: center;
gap: 8px;
background: none;
border: none;
cursor: pointer;
padding: 4px;
border-radius: var(--md-radius);
color: var(--md-primary);
transition: background 0.2s;
}
.topnav-brand:hover {
background: var(--md-surface-variant);
}
.topnav-brand .material-symbols-outlined {
font-size: 24px;
}
.topnav-app-name {
font-size: 16px;
font-weight: 600;
color: var(--md-on-surface);
}
.topnav-divider {
width: 1px;
height: 24px;
background: var(--md-outline);
}
.topnav-tenant {
font-size: 14px;
font-weight: 500;
color: var(--md-on-surface-secondary);
}
.topnav-center {
display: flex;
align-items: center;
gap: 4px;
}
.topnav-item {
display: flex;
align-items: center;
gap: 6px;
padding: 8px 14px;
background: none;
border: none;
border-radius: 20px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
color: var(--md-on-surface-secondary);
transition: background 0.2s, color 0.2s;
}
.topnav-item:hover {
background: var(--md-surface-variant);
color: var(--md-on-surface);
}
.topnav-item.active {
background: #e8f0fe;
color: var(--md-primary);
}
.topnav-item .material-symbols-outlined {
font-size: 18px;
}
.topnav-right {
display: flex;
align-items: center;
gap: 12px;
}
.topnav-user {
font-size: 13px;
color: var(--md-on-surface-secondary);
}
/* ===== Tenant Layout ===== */
.tenant-layout {
min-height: 100vh;
}
.tenant-main {
padding-top: 56px;
}
/* ===== Page Common ===== */
.page-container {
max-width: 1200px;
margin: 0 auto;
padding: 24px 20px;
}
.page-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24px;
}
.page-title {
display: flex;
align-items: center;
gap: 10px;
font-size: 20px;
font-weight: 500;
}
.page-title .material-symbols-outlined {
font-size: 28px;
color: var(--md-primary);
}
.page-error {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 12px;
padding: 80px 20px;
color: var(--md-error);
}
.page-error .material-symbols-outlined {
font-size: 48px;
}
.page-error p {
font-size: 16px;
color: var(--md-on-surface-secondary);
}
.page-breadcrumb {
margin-bottom: 16px;
}
/* ===== Buttons ===== */
.btn-primary {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 10px 20px;
background: var(--md-primary);
color: #ffffff;
border: none;
border-radius: 20px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: background 0.2s, box-shadow 0.2s;
}
.btn-primary:hover:not(:disabled) {
background: var(--md-primary-dark);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.btn-primary:disabled {
opacity: 0.6;
cursor: not-allowed;
}
.btn-primary .material-symbols-outlined {
font-size: 18px;
}
.btn-sm {
padding: 6px 12px;
font-size: 12px;
}
.btn-sm .material-symbols-outlined {
font-size: 16px;
}
.btn-text {
display: inline-flex;
align-items: center;
gap: 4px;
background: none;
border: none;
color: var(--md-on-surface-secondary);
font-size: 13px;
cursor: pointer;
padding: 6px 8px;
border-radius: var(--md-radius);
transition: background 0.2s, color 0.2s;
}
.btn-text:hover {
background: var(--md-surface-variant);
color: var(--md-on-surface);
}
.btn-text .material-symbols-outlined {
font-size: 18px;
}
.btn-icon {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
background: none;
border: none;
border-radius: 50%;
cursor: pointer;
color: var(--md-on-surface-secondary);
transition: background 0.2s, color 0.2s;
}
.btn-icon:hover {
background: var(--md-surface-variant);
color: var(--md-on-surface);
}
.btn-icon .material-symbols-outlined {
font-size: 18px;
}
.btn-icon-danger:hover {
background: #fce8e6;
color: var(--md-error);
}
/* ===== Empty State ===== */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
gap: 12px;
padding: 60px 20px;
color: var(--md-on-surface-secondary);
}
.empty-state .material-symbols-outlined {
font-size: 48px;
opacity: 0.4;
}
.empty-state p {
font-size: 15px;
}
/* ===== Machine Grid ===== */
.machine-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 16px;
}
.machine-card {
background: var(--md-surface);
border: 1px solid var(--md-outline);
border-radius: var(--md-radius-lg);
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
}
.machine-card:hover {
border-color: var(--md-primary);
box-shadow: 0 2px 8px rgba(26, 115, 232, 0.12);
}
.machine-card-body {
display: flex;
flex-direction: column;
gap: 12px;
padding: 20px;
cursor: pointer;
}
.machine-card-icon {
color: var(--md-primary);
}
.machine-card-icon .material-symbols-outlined {
font-size: 32px;
}
.machine-card-info {
display: flex;
flex-direction: column;
gap: 4px;
}
.machine-card-name {
font-size: 16px;
font-weight: 500;
}
.machine-card-code {
font-size: 13px;
color: var(--md-on-surface-secondary);
font-family: 'SF Mono', 'Menlo', monospace;
}
.machine-card-model {
font-size: 12px;
color: var(--md-on-surface-secondary);
}
.machine-card-meta {
display: flex;
align-items: center;
gap: 12px;
padding-top: 8px;
border-top: 1px solid var(--md-outline);
}
.machine-card-parts {
display: flex;
align-items: center;
gap: 4px;
font-size: 12px;
color: var(--md-on-surface-secondary);
}
.machine-card-parts .material-symbols-outlined {
font-size: 16px;
}
.machine-card-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 4px;
padding: 8px 12px;
border-top: 1px solid var(--md-outline);
background: var(--md-surface-variant);
}
/* ===== Detail Page ===== */
.detail-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 24px;
padding: 20px;
background: var(--md-surface);
border: 1px solid var(--md-outline);
border-radius: var(--md-radius-lg);
}
.detail-header-left {
display: flex;
align-items: center;
gap: 16px;
}
.detail-icon {
font-size: 36px;
color: var(--md-primary);
}
.detail-title {
font-size: 20px;
font-weight: 500;
margin: 0;
}
.detail-subtitle {
font-size: 14px;
color: var(--md-on-surface-secondary);
}
/* ===== Section ===== */
.section {
background: var(--md-surface);
border: 1px solid var(--md-outline);
border-radius: var(--md-radius-lg);
overflow: hidden;
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 16px 20px;
border-bottom: 1px solid var(--md-outline);
}
.section-title {
display: flex;
align-items: center;
gap: 8px;
font-size: 15px;
font-weight: 500;
margin: 0;
}
.section-title .material-symbols-outlined {
font-size: 20px;
color: var(--md-primary);
}
/* ===== Part Table ===== */
.part-table-wrap {
overflow-x: auto;
}
.part-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.part-table th {
text-align: left;
padding: 10px 16px;
font-weight: 500;
color: var(--md-on-surface-secondary);
background: var(--md-surface-variant);
border-bottom: 1px solid var(--md-outline);
white-space: nowrap;
}
.part-table td {
padding: 12px 16px;
border-bottom: 1px solid var(--md-outline);
vertical-align: middle;
}
.part-table tbody tr:hover {
background: #f8f9fa;
}
.part-table tbody tr:last-child td {
border-bottom: none;
}
.part-row-warning {
background: #fff8e1 !important;
}
.part-name-cell {
display: flex;
flex-direction: column;
gap: 2px;
}
.part-name-cell strong {
font-weight: 500;
}
.part-number {
font-size: 11px;
color: var(--md-on-surface-secondary);
font-family: 'SF Mono', 'Menlo', monospace;
}
.part-actions {
display: flex;
align-items: center;
gap: 2px;
}
/* ===== Percentage Bar ===== */
.pct-bar-wrap {
display: flex;
align-items: center;
gap: 8px;
min-width: 100px;
}
.pct-bar {
height: 6px;
background: var(--md-primary);
border-radius: 3px;
transition: width 0.3s;
}
.pct-bar-warning {
background: var(--md-warning);
}
.pct-label {
font-size: 12px;
font-weight: 500;
white-space: nowrap;
}
/* ===== Modal ===== */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.4);
display: flex;
align-items: center;
justify-content: center;
z-index: 200;
padding: 20px;
}
.modal-content {
background: var(--md-surface);
border-radius: var(--md-radius-lg);
width: 100%;
max-width: 480px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}
.modal-lg {
max-width: 640px;
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 20px 24px 0;
}
.modal-header h3 {
font-size: 18px;
font-weight: 500;
margin: 0;
}
.modal-close {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
background: none;
border: none;
border-radius: 50%;
cursor: pointer;
color: var(--md-on-surface-secondary);
transition: background 0.2s;
}
.modal-close:hover {
background: var(--md-surface-variant);
}
.modal-content form {
padding: 20px 24px 24px;
display: flex;
flex-direction: column;
gap: 16px;
}
.modal-actions {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
padding-top: 8px;
}
/* ===== Form Grid ===== */
.form-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
}
.form-field select {
padding: 14px 16px;
border: 1px solid var(--md-outline);
border-radius: var(--md-radius);
background: var(--md-surface);
color: var(--md-on-surface);
font-size: 16px;
transition: border-color 0.2s, box-shadow 0.2s;
width: 100%;
}
.form-field select:focus {
outline: none;
border-color: var(--md-primary);
box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}
.form-field select:disabled {
background: #f1f3f4;
opacity: 0.7;
cursor: not-allowed;
}
.form-field input[type="number"] {
-moz-appearance: textfield;
}
.form-field input[type="number"]::-webkit-outer-spin-button,
.form-field input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* ===== Responsive ===== */
@media (max-width: 768px) {
.topnav-center {
display: none;
}
.topnav-app-name {
display: none;
}
.machine-grid {
grid-template-columns: 1fr;
}
.form-grid {
grid-template-columns: 1fr;
}
.part-table {
font-size: 12px;
}
.part-table th,
.part-table td {
padding: 8px 10px;
}
}
@media (max-width: 480px) {
.login-card {
padding: 32px 24px;
border-radius: 0;
border: none;
box-shadow: none;
max-width: none;
}
.login-container {
padding: 0;
background: var(--md-surface);
}
.home-header {
flex-direction: column;
gap: 16px;
align-items: flex-start;
}
.tenant-grid {
grid-template-columns: 1fr;
}
}