Files
The-transit-Project/admin_ui/src/styles.css
T

1239 lines
22 KiB
CSS

/* ============================================================
Transit Admin — Design System
============================================================ */
:root {
--bg: #eef1f6;
--surface: #ffffff;
--surface-2: #f8fafc;
--surface-3: #f1f5f9;
--border: #e2e8f0;
--border-strong: #cbd5e1;
--text: #0f172a;
--text-muted: #5b6b83;
--text-faint: #94a3b8;
--primary: #4f46e5;
--primary-hover: #4338ca;
--primary-soft: #eef2ff;
--primary-soft-2: #e0e7ff;
--accent: #0284c7;
--accent-soft: #e0f2fe;
--success: #059669;
--success-soft: #d1fae5;
--danger: #e11d48;
--danger-hover: #be123c;
--danger-soft: #ffe4e6;
--warning: #d97706;
--warning-soft: #fef3c7;
--sidebar-bg: #0e1526;
--sidebar-bg-2: #131c34;
--sidebar-text: #93a4c0;
--radius: 16px;
--radius-sm: 10px;
--radius-xs: 8px;
--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
--shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
--shadow-lg: 0 20px 44px rgba(15, 23, 42, 0.16);
--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* {
box-sizing: border-box;
}
body {
margin: 0;
color: var(--text);
background: var(--bg);
font-family: var(--font-sans);
-webkit-font-smoothing: antialiased;
}
/* ============================================================
Layout shell
============================================================ */
.app-shell {
display: flex;
min-height: 100vh;
}
.sidebar {
width: 258px;
flex-shrink: 0;
position: sticky;
top: 0;
height: 100vh;
background: linear-gradient(180deg, var(--sidebar-bg) 0%, var(--sidebar-bg-2) 100%);
color: var(--sidebar-text);
display: flex;
flex-direction: column;
padding: 22px 16px 18px;
}
.brand {
display: flex;
gap: 12px;
align-items: center;
padding: 2px 8px 22px;
}
.brand-mark {
width: 40px;
height: 40px;
flex-shrink: 0;
border-radius: 12px;
background: linear-gradient(135deg, #6366f1, #0ea5e9);
display: grid;
place-items: center;
color: #fff;
box-shadow: 0 8px 18px rgba(99, 102, 241, 0.4);
}
.brand-text .brand-name {
font-size: 1.05rem;
font-weight: 700;
color: #fff;
letter-spacing: -0.01em;
line-height: 1.15;
}
.brand-text .brand-sub {
font-size: 0.68rem;
text-transform: uppercase;
letter-spacing: 0.16em;
color: rgba(147, 164, 192, 0.7);
}
.nav-label {
font-size: 0.68rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.14em;
color: rgba(147, 164, 192, 0.55);
margin: 20px 12px 8px;
}
.nav-item {
display: flex;
align-items: center;
gap: 12px;
width: 100%;
padding: 10px 12px;
margin-bottom: 4px;
border: none;
border-radius: 12px;
background: transparent;
color: var(--sidebar-text);
font: inherit;
font-size: 0.93rem;
text-align: left;
cursor: pointer;
transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
.nav-item svg {
flex-shrink: 0;
}
.nav-item:hover {
background: rgba(255, 255, 255, 0.06);
color: #e2e8f0;
}
.nav-item:active {
transform: translateY(1px);
}
.nav-item.active {
background: rgba(99, 102, 241, 0.18);
color: #fff;
box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.4);
}
.sidebar-footer {
margin-top: auto;
border-top: 1px solid rgba(255, 255, 255, 0.08);
padding-top: 14px;
}
.user-chip {
display: flex;
align-items: center;
gap: 10px;
padding: 8px;
}
.user-avatar {
width: 36px;
height: 36px;
flex-shrink: 0;
border-radius: 50%;
background: linear-gradient(135deg, #6366f1, #0ea5e9);
display: grid;
place-items: center;
color: #fff;
font-weight: 700;
font-size: 0.85rem;
text-transform: uppercase;
}
.user-meta {
min-width: 0;
flex: 1;
}
.user-meta .user-name {
color: #e2e8f0;
font-weight: 600;
font-size: 0.88rem;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.user-meta .user-role {
font-size: 0.72rem;
color: rgba(147, 164, 192, 0.75);
}
.logout-btn {
border: none;
background: transparent;
color: var(--sidebar-text);
cursor: pointer;
padding: 8px;
border-radius: 10px;
display: grid;
place-items: center;
transition: background 0.15s ease, color 0.15s ease;
}
.logout-btn:hover {
background: rgba(225, 29, 72, 0.16);
color: #fda4af;
}
.main {
flex: 1;
min-width: 0;
margin: 0 auto;
max-width: 1400px;
}
.topbar {
position: sticky;
top: 0;
z-index: 40;
display: flex;
justify-content: space-between;
align-items: center;
gap: 16px;
padding: 20px 32px 14px;
background: linear-gradient(180deg, rgba(238, 241, 246, 0.95) 0%, rgba(238, 241, 246, 0.8) 100%);
backdrop-filter: blur(10px);
}
.topbar-title .eyebrow {
margin: 0 0 4px;
text-transform: uppercase;
letter-spacing: 0.14em;
color: var(--primary);
font-size: 0.72rem;
font-weight: 700;
}
.topbar-title h1 {
margin: 0;
font-size: 1.55rem;
letter-spacing: -0.02em;
}
.topbar-title p {
margin: 4px 0 0;
color: var(--text-muted);
font-size: 0.92rem;
}
.content {
padding: 10px 32px 48px;
display: grid;
gap: 20px;
}
/* ============================================================
Cards
============================================================ */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 20px 22px;
box-shadow: var(--shadow-sm);
}
.section-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 16px;
margin-bottom: 16px;
}
.section-header h2,
.section-header h3 {
margin: 0 0 4px;
font-size: 1.15rem;
font-weight: 650;
letter-spacing: -0.01em;
}
.section-header p {
margin: 0;
color: var(--text-muted);
font-size: 0.9rem;
}
.list-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
gap: 12px;
margin: 4px 0 18px;
}
.mini-card {
background: var(--surface-2);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 14px 16px;
transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.mini-card:hover {
border-color: var(--border-strong);
box-shadow: var(--shadow-md);
transform: translateY(-1px);
}
.mini-card strong {
display: block;
margin-bottom: 4px;
font-size: 0.98rem;
}
.mini-card .meta-line {
color: var(--text-muted);
font-size: 0.85rem;
margin-top: 2px;
}
.mini-card .card-actions {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin-top: 12px;
}
.stack {
display: grid;
gap: 20px;
}
/* ============================================================
Forms
============================================================ */
.form-row {
display: flex;
gap: 10px;
margin: 10px 0;
flex-wrap: wrap;
align-items: center;
}
.stack-form {
margin-top: 12px;
padding-top: 14px;
border-top: 1px dashed var(--border);
}
input,
select,
button {
border-radius: var(--radius-xs);
border: 1px solid var(--border-strong);
padding: 10px 12px;
font: inherit;
font-size: 0.92rem;
transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input,
select {
background: var(--surface);
min-width: 170px;
flex: 1;
color: var(--text);
}
input:focus,
select:focus {
outline: none;
border-color: var(--primary);
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
input[readonly] {
background: var(--surface-3);
color: var(--text-muted);
}
input[type="checkbox"] {
min-width: auto;
flex: none;
accent-color: var(--primary);
}
/* Buttons */
button {
background: var(--primary);
color: #fff;
cursor: pointer;
border: 1px solid transparent;
font-weight: 550;
transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}
button:hover {
background: var(--primary-hover);
box-shadow: 0 8px 20px rgba(79, 70, 229, 0.22);
transform: translateY(-1px);
}
button:active {
transform: translateY(0);
}
button:disabled {
opacity: 0.55;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
button.secondary {
background: var(--surface);
color: var(--text);
border-color: var(--border-strong);
}
button.secondary:hover {
background: var(--surface-3);
box-shadow: var(--shadow-sm);
}
button.danger {
background: var(--danger);
border-color: transparent;
}
button.danger:hover {
background: var(--danger-hover);
box-shadow: 0 8px 20px rgba(225, 29, 72, 0.24);
}
button.ghost {
background: transparent;
color: var(--text-muted);
border-color: transparent;
}
button.ghost:hover {
background: var(--surface-3);
color: var(--text);
box-shadow: none;
}
button.sm {
padding: 7px 10px;
font-size: 0.85rem;
border-radius: 8px;
}
button.block {
width: 100%;
}
.icon-btn {
background: transparent;
color: var(--text-faint);
border: none;
padding: 6px;
display: grid;
place-items: center;
line-height: 1;
}
.icon-btn:hover {
background: var(--surface-3);
color: var(--text);
box-shadow: none;
}
/* Segmented control */
.segmented {
display: inline-flex;
background: var(--surface-3);
border: 1px solid var(--border);
border-radius: 12px;
padding: 4px;
gap: 4px;
}
.segmented button {
background: transparent;
color: var(--text-muted);
border: none;
padding: 8px 16px;
font-size: 0.9rem;
border-radius: 9px;
font-weight: 550;
}
.segmented button:hover {
background: rgba(255, 255, 255, 0.7);
box-shadow: none;
}
.segmented button.active {
background: var(--surface);
color: var(--primary);
box-shadow: var(--shadow-sm);
}
/* ============================================================
Messages / alerts
============================================================ */
.message {
margin-top: 12px;
color: var(--success);
font-weight: 600;
font-size: 0.92rem;
background: var(--success-soft);
border: 1px solid rgba(5, 150, 105, 0.25);
padding: 10px 14px;
border-radius: var(--radius-xs);
}
.message.error {
color: var(--danger);
background: var(--danger-soft);
border-color: rgba(225, 29, 72, 0.28);
}
.error {
color: var(--danger);
margin-top: 10px;
font-size: 0.92rem;
}
.muted {
color: var(--text-muted);
font-size: 0.88rem;
}
.faint {
color: var(--text-faint);
font-size: 0.82rem;
}
/* ============================================================
Badges & pills
============================================================ */
.badge {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border-radius: 999px;
font-size: 0.78rem;
font-weight: 600;
line-height: 1.4;
white-space: nowrap;
}
.badge-primary {
background: var(--primary-soft);
color: var(--primary);
}
.badge-accent {
background: var(--accent-soft);
color: var(--accent);
}
.badge-success {
background: var(--success-soft);
color: var(--success);
}
.badge-warning {
background: var(--warning-soft);
color: var(--warning);
}
.badge-danger {
background: var(--danger-soft);
color: var(--danger);
}
.badge-muted {
background: var(--surface-3);
color: var(--text-muted);
}
.pill-chip {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 5px 12px;
border-radius: 999px;
background: var(--accent-soft);
border: 1px solid #bae6fd;
color: #075985;
font-size: 0.85rem;
font-weight: 550;
}
.pill-chip button {
background: transparent;
border: none;
color: #075985;
cursor: pointer;
padding: 0;
display: grid;
place-items: center;
font-size: 0.95rem;
line-height: 1;
}
.pill-chip button:hover {
background: transparent;
box-shadow: none;
color: var(--danger);
}
/* ============================================================
Stats (dashboard)
============================================================ */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 16px;
}
.stat-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius);
padding: 18px 20px;
display: flex;
align-items: center;
gap: 14px;
box-shadow: var(--shadow-sm);
transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover {
box-shadow: var(--shadow-md);
transform: translateY(-2px);
}
.stat-icon {
width: 44px;
height: 44px;
flex-shrink: 0;
border-radius: 12px;
display: grid;
place-items: center;
}
.stat-icon.primary {
background: var(--primary-soft);
color: var(--primary);
}
.stat-icon.accent {
background: var(--accent-soft);
color: var(--accent);
}
.stat-icon.success {
background: var(--success-soft);
color: var(--success);
}
.stat-icon.warning {
background: var(--warning-soft);
color: var(--warning);
}
.stat-icon.danger {
background: var(--danger-soft);
color: var(--danger);
}
.stat-card .stat-value {
font-size: 1.6rem;
font-weight: 750;
letter-spacing: -0.02em;
line-height: 1.1;
}
.stat-card .stat-label {
color: var(--text-muted);
font-size: 0.82rem;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 0.06em;
}
/* ============================================================
Modals
============================================================ */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(15, 23, 42, 0.55);
backdrop-filter: blur(4px);
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
z-index: 1000;
animation: fadeIn 0.15s ease;
}
.modal {
background: var(--surface);
border-radius: var(--radius);
width: 100%;
max-width: 460px;
max-height: 88vh;
display: flex;
flex-direction: column;
box-shadow: var(--shadow-lg);
animation: popIn 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal-wide {
max-width: 720px;
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 18px 22px 0;
}
.modal-header h3 {
margin: 0;
font-size: 1.1rem;
font-weight: 650;
}
.modal-body {
padding: 16px 22px 20px;
overflow-y: auto;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 10px;
padding: 14px 22px 18px;
border-top: 1px solid var(--border);
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
@keyframes popIn {
from { opacity: 0; transform: translateY(8px) scale(0.98); }
to { opacity: 1; transform: translateY(0) scale(1); }
}
/* ============================================================
Data tables
============================================================ */
.table-wrap {
overflow-x: auto;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--surface);
}
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 0.92rem;
}
.data-table thead {
background: var(--surface-3);
}
.data-table th {
padding: 12px 14px;
text-align: left;
font-weight: 650;
font-size: 0.78rem;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
border-bottom: 1px solid var(--border);
white-space: nowrap;
}
.data-table td {
padding: 12px 14px;
border-bottom: 1px solid var(--border);
vertical-align: top;
}
.data-table tbody tr {
transition: background 0.12s ease;
}
.data-table tbody tr:hover {
background: rgba(99, 102, 241, 0.03);
}
.data-table tbody tr:last-child td {
border-bottom: none;
}
.flex-1 { flex: 1; }
.minw-0 { min-width: 0; }
.no-grow { flex: none; }
.truncate-cell {
max-width: 340px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.error-cell {
font-family: var(--font-mono);
font-size: 0.82rem;
max-width: 460px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
}
/* ============================================================
Route stop board (drag & drop)
============================================================ */
.route-stops-board {
display: grid;
gap: 10px;
margin: 12px 0 18px;
padding: 10px;
border-radius: var(--radius);
border: 2px dashed var(--border-strong);
background: var(--surface-3);
min-height: 60px;
}
.route-stops-board.drop-ready {
border-color: var(--primary);
background: var(--primary-soft);
}
.route-stop-item {
display: flex;
align-items: center;
gap: 12px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-sm);
padding: 12px 14px;
box-shadow: var(--shadow-sm);
cursor: grab;
transition: box-shadow 0.15s ease;
}
.route-stop-item:hover {
box-shadow: var(--shadow-md);
}
.route-stop-item.dragging {
opacity: 0.6;
transform: scale(0.995);
}
.route-stop-handle {
font-size: 1.2rem;
line-height: 1;
color: var(--text-faint);
user-select: none;
cursor: grab;
}
.route-stop-content {
flex: 1;
min-width: 0;
}
.route-stop-content strong {
display: block;
margin-bottom: 2px;
}
.route-stop-actions {
display: flex;
gap: 6px;
flex-shrink: 0;
}
.route-stop-actions button {
padding: 8px 10px;
min-width: 38px;
}
.route-order-badge {
width: 28px;
height: 28px;
flex-shrink: 0;
border-radius: 50%;
background: var(--primary-soft);
color: var(--primary);
font-weight: 700;
font-size: 0.85rem;
display: grid;
place-items: center;
}
.available-stops-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
gap: 10px;
margin: 12px 0 18px;
}
.available-stop {
cursor: grab;
user-select: none;
}
/* ============================================================
Timetable
============================================================ */
.timetable-container {
overflow-x: auto;
margin: 4px 0;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--surface);
}
.timetable {
width: 100%;
border-collapse: collapse;
font-size: 0.92rem;
}
.timetable thead {
background: var(--surface-3);
}
.timetable th {
padding: 12px 14px;
text-align: left;
font-weight: 650;
font-size: 0.78rem;
text-transform: uppercase;
letter-spacing: 0.06em;
color: var(--text-muted);
border-bottom: 2px solid var(--border);
}
.timetable td {
padding: 12px 14px;
border-bottom: 1px solid var(--border);
vertical-align: top;
}
.timetable tbody tr:hover {
background: rgba(99, 102, 241, 0.03);
}
.time-cell {
font-weight: 650;
color: var(--primary);
width: 150px;
white-space: nowrap;
background: var(--surface-2);
}
.schedule-items {
display: flex;
flex-wrap: wrap;
gap: 10px;
min-height: 60px;
align-content: flex-start;
}
.schedule-card {
background: linear-gradient(135deg, var(--primary-soft), rgba(14, 165, 233, 0.08));
border: 1px solid var(--primary-soft-2);
border-radius: var(--radius-sm);
padding: 12px;
flex: 0 1 auto;
min-width: 210px;
transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.schedule-card:hover {
transform: translateY(-2px);
box-shadow: var(--shadow-md);
}
.schedule-header {
display: flex;
justify-content: space-between;
align-items: center;
gap: 8px;
margin-bottom: 6px;
}
.schedule-header strong {
color: var(--primary);
font-size: 0.95rem;
}
.schedule-time {
font-size: 0.82rem;
font-weight: 600;
color: var(--text-muted);
background: rgba(255, 255, 255, 0.7);
padding: 3px 8px;
border-radius: 6px;
white-space: nowrap;
}
.schedule-details {
font-size: 0.85rem;
color: var(--text-muted);
}
.schedule-details > div {
margin-top: 2px;
}
.schedule-plate {
color: var(--text-faint);
font-size: 0.8rem;
font-family: var(--font-mono);
}
.schedule-expand {
width: 100%;
margin-top: 10px;
padding: 8px;
font-size: 0.82rem;
background: rgba(255, 255, 255, 0.65);
border: 1px solid var(--border);
border-radius: var(--radius-xs);
color: var(--text);
cursor: pointer;
text-align: center;
}
.schedule-expand:hover {
background: var(--surface);
box-shadow: var(--shadow-sm);
}
.stop-table {
width: 100%;
font-size: 0.82rem;
border-collapse: collapse;
margin-top: 10px;
}
.stop-table td {
padding: 4px 6px;
border-bottom: 1px solid var(--border);
}
.stop-table tr:last-child td {
border-bottom: none;
}
/* ============================================================
Weekly panels
============================================================ */
.weekly-panels {
display: grid;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 16px;
margin-top: 20px;
align-items: start;
}
.weekly-panel {
min-width: 0;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
background: var(--surface-2);
padding: 14px;
}
.weekly-panel h4 {
margin: 0 0 10px;
font-size: 0.95rem;
}
@media (max-width: 900px) {
.weekly-panels {
grid-template-columns: 1fr;
}
}
/* ============================================================
Login / auth
============================================================ */
.auth-page {
min-height: 100vh;
display: grid;
place-items: center;
background:
radial-gradient(circle at 15% 20%, rgba(99, 102, 241, 0.16), transparent 34%),
radial-gradient(circle at 85% 75%, rgba(14, 165, 233, 0.14), transparent 30%),
linear-gradient(180deg, #f1f5f9 0%, #e0e7ff 100%);
padding: 24px;
}
.auth-card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 20px;
box-shadow: var(--shadow-lg);
width: 100%;
max-width: 420px;
padding: 36px 34px 30px;
}
.auth-brand {
display: flex;
flex-direction: column;
align-items: center;
gap: 10px;
margin-bottom: 26px;
text-align: center;
}
.auth-brand .brand-mark {
width: 56px;
height: 56px;
border-radius: 16px;
}
.auth-brand h1 {
margin: 6px 0 0;
font-size: 1.4rem;
letter-spacing: -0.02em;
}
.auth-brand p {
margin: 0;
color: var(--text-muted);
font-size: 0.9rem;
}
.auth-card form {
display: grid;
gap: 14px;
}
.auth-card label {
display: grid;
gap: 6px;
font-size: 0.85rem;
font-weight: 550;
color: var(--text-muted);
}
.auth-card input {
width: 100%;
flex: none;
min-width: 0;
padding: 12px 14px;
border-radius: var(--radius-xs);
}
.auth-card .auth-submit {
margin-top: 4px;
padding: 12px;
font-size: 0.95rem;
border-radius: var(--radius-xs);
}
.auth-footer {
text-align: center;
margin-top: 18px;
color: var(--text-faint);
font-size: 0.82rem;
}
/* ============================================================
Responsive
============================================================ */
@media (max-width: 1024px) {
.sidebar {
width: 76px;
padding: 18px 10px 14px;
}
.brand-text,
.nav-label,
.nav-item span,
.user-meta {
display: none;
}
.nav-item {
justify-content: center;
padding: 12px;
}
.sidebar-footer .user-chip {
flex-direction: column;
gap: 6px;
}
.topbar {
padding: 16px 18px 12px;
}
.content {
padding: 10px 18px 40px;
}
}
@media (max-width: 640px) {
.topbar {
flex-direction: column;
align-items: flex-start;
}
}