System / public /admin /style.css
Sebebeb's picture
Update public/admin/style.css
167f1d7 verified
Raw
History Blame Contribute Delete
20.1 kB
/* ─── DISPATCH Admin UI ─────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&family=Syne:wght@400;600;800&display=swap');
:root {
--bg: #0d0d0f;
--surface: #141416;
--surface2: #1c1c20;
--surface3: #242428;
--border: #2a2a30;
--border2: #3a3a42;
--text: #e8e8ec;
--text-dim: #8888a0;
--text-dimmer: #55556a;
--accent: #f5a623;
--accent-dim: #a87010;
--red: #e03030;
--red-dark: #8a1010;
--green: #22c55e;
--mono: 'Space Mono', monospace;
--sans: 'Syne', sans-serif;
--radius: 4px;
--radius-lg: 8px;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body, #root {
height: 100%;
background: var(--bg);
color: var(--text);
font-family: var(--mono);
font-size: 13px;
line-height: 1.5;
}
/* ─── Top Bar ───────────────────────────────────────────────────────────────── */
#topbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 24px;
height: 52px;
background: var(--surface);
border-bottom: 1px solid var(--border);
position: sticky;
top: 0;
z-index: 100;
}
#topbar-logo {
font-family: var(--sans);
font-weight: 800;
font-size: 20px;
letter-spacing: 0.15em;
color: var(--accent);
}
#topbar-status {
display: flex;
align-items: center;
gap: 8px;
font-size: 11px;
letter-spacing: 0.12em;
color: var(--text-dim);
}
/* ─── Status Indicator ──────────────────────────────────────────────────────── */
.indicator {
width: 8px;
height: 8px;
border-radius: 50%;
background: #555;
display: inline-block;
flex-shrink: 0;
transition: background 0.3s;
}
.indicator.online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.indicator.offline { background: var(--red); box-shadow: 0 0 6px var(--red); }
/* ─── Tabs ──────────────────────────────────────────────────────────────────── */
#tabs {
display: flex;
border-bottom: 1px solid var(--border);
background: var(--surface);
}
.tab-btn {
padding: 12px 28px;
background: none;
border: none;
border-bottom: 2px solid transparent;
color: var(--text-dim);
font-family: var(--mono);
font-size: 11px;
font-weight: 700;
letter-spacing: 0.14em;
cursor: pointer;
transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
color: var(--accent);
border-bottom-color: var(--accent);
}
/* ─── Tab Panels ────────────────────────────────────────────────────────────── */
.tab-panel { display: none; height: calc(100vh - 52px - 43px); overflow: hidden; }
.tab-panel.active { display: flex; flex-direction: column; }
/* ─── Notifications Tab Layout ──────────────────────────────────────────────── */
#notif-layout {
display: grid;
grid-template-columns: 300px 1fr 340px;
height: 100%;
overflow: hidden;
}
/* ─── Panel Titles ──────────────────────────────────────────────────────────── */
.panel-title {
font-family: var(--sans);
font-weight: 800;
font-size: 12px;
letter-spacing: 0.18em;
color: var(--text-dim);
padding: 16px 20px 12px;
border-bottom: 1px solid var(--border);
display: flex;
align-items: center;
gap: 8px;
}
.badge {
background: var(--surface3);
color: var(--accent);
padding: 1px 7px;
border-radius: 99px;
font-size: 10px;
font-weight: 700;
}
/* ─── Left Panel: Create Form ───────────────────────────────────────────────── */
#create-panel {
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow-y: auto;
background: var(--surface);
}
.form-group {
padding: 10px 20px;
border-bottom: 1px solid var(--border);
}
.form-group label {
display: block;
font-size: 10px;
letter-spacing: 0.14em;
color: var(--text-dim);
margin-bottom: 6px;
font-weight: 700;
}
.form-group input,
.form-group textarea,
.form-group select {
width: 100%;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-family: var(--mono);
font-size: 12px;
padding: 8px 10px;
outline: none;
transition: border-color 0.2s;
resize: none;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
border-color: var(--accent);
}
.form-group select option { background: var(--surface2); }
#sound-upload-area {
display: flex;
align-items: center;
gap: 10px;
}
.btn-outline {
background: none;
border: 1px solid var(--border2);
color: var(--text-dim);
font-family: var(--mono);
font-size: 10px;
letter-spacing: 0.1em;
padding: 7px 12px;
border-radius: var(--radius);
cursor: pointer;
transition: border-color 0.2s, color 0.2s;
white-space: nowrap;
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
#sound-file-name {
font-size: 11px;
color: var(--text-dimmer);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.btn-create {
margin: 16px 20px;
padding: 14px;
background: #1a4a1a;
border: 1px solid #2d7a2d;
border-radius: var(--radius-lg);
color: var(--green);
font-family: var(--mono);
font-size: 13px;
font-weight: 700;
letter-spacing: 0.12em;
cursor: pointer;
transition: background 0.2s, box-shadow 0.2s;
}
.btn-create:hover {
background: #1f6a1f;
box-shadow: 0 0 20px rgba(34, 197, 94, 0.2);
}
.btn-create:active { transform: scale(0.98); }
/* ─── Middle Panel: Notification List ──────────────────────────────────────── */
#notif-list-panel {
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
}
#notif-list {
flex: 1;
overflow-y: auto;
}
.notif-item {
padding: 14px 20px;
border-bottom: 1px solid var(--border);
cursor: pointer;
transition: background 0.15s;
position: relative;
}
.notif-item:hover { background: var(--surface2); }
.notif-item.selected { background: var(--surface2); border-left: 3px solid var(--accent); }
.notif-item-name {
font-size: 11px;
color: var(--text-dimmer);
letter-spacing: 0.1em;
margin-bottom: 3px;
}
.notif-item-heading {
font-family: var(--sans);
font-weight: 600;
font-size: 14px;
color: var(--text);
margin-bottom: 3px;
}
.notif-item-body {
font-size: 11px;
color: var(--text-dim);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.notif-item-sound {
display: inline-flex;
align-items: center;
gap: 4px;
margin-top: 6px;
font-size: 10px;
color: var(--accent-dim);
background: rgba(245,166,35,0.08);
padding: 2px 7px;
border-radius: 3px;
}
.empty-state {
padding: 40px 20px;
text-align: center;
color: var(--text-dimmer);
font-size: 12px;
letter-spacing: 0.08em;
}
/* ─── Right Panel: Schedule ─────────────────────────────────────────────────── */
#schedule-panel {
display: flex;
flex-direction: column;
background: var(--surface);
overflow-y: auto;
}
.select-hint {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
gap: 12px;
color: var(--text-dimmer);
text-align: center;
line-height: 1.7;
font-size: 12px;
letter-spacing: 0.06em;
}
.select-hint-icon {
font-size: 36px;
color: var(--border2);
}
#schedule-active { padding: 0; display: flex; flex-direction: column; }
#selected-notif-info {
padding: 16px 20px 12px;
border-bottom: 1px solid var(--border);
}
#selected-notif-name {
font-family: var(--sans);
font-size: 16px;
font-weight: 600;
color: var(--text);
}
/* ── Big Red Button ── */
#play-now-btn {
margin: 28px 24px 20px;
width: calc(100% - 48px);
padding: 26px;
background: radial-gradient(circle at 40% 35%, #e84040, #8a0000);
border: 2px solid #c02020;
border-radius: 12px;
color: #fff;
font-family: var(--sans);
font-size: 22px;
font-weight: 800;
letter-spacing: 0.12em;
cursor: pointer;
box-shadow:
0 0 0 4px rgba(200,0,0,0.15),
0 8px 32px rgba(200,0,0,0.35),
inset 0 2px 0 rgba(255,255,255,0.12),
inset 0 -3px 0 rgba(0,0,0,0.3);
position: relative;
transition: box-shadow 0.1s, transform 0.1s;
text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
#play-now-btn:hover {
box-shadow:
0 0 0 6px rgba(200,0,0,0.2),
0 10px 40px rgba(200,0,0,0.5),
inset 0 2px 0 rgba(255,255,255,0.15),
inset 0 -3px 0 rgba(0,0,0,0.35);
transform: translateY(-1px);
}
#play-now-btn:active {
transform: translateY(2px);
box-shadow:
0 0 0 4px rgba(200,0,0,0.12),
0 4px 16px rgba(200,0,0,0.3),
inset 0 3px 6px rgba(0,0,0,0.4);
}
/* ── Schedule Controls ── */
#schedule-controls {
padding: 0 20px 20px;
}
.toggle-row {
display: flex;
align-items: center;
gap: 12px;
padding: 14px 0 12px;
border-top: 1px solid var(--border);
}
.toggle-label {
font-size: 11px;
letter-spacing: 0.14em;
color: var(--text-dim);
font-weight: 700;
}
/* Toggle Switch */
.toggle-switch { position: relative; display: inline-block; cursor: pointer; }
.toggle-switch input { display: none; }
.toggle-track {
display: block;
width: 42px;
height: 22px;
background: var(--surface3);
border: 1px solid var(--border2);
border-radius: 11px;
position: relative;
transition: background 0.2s, border-color 0.2s;
}
.toggle-thumb {
position: absolute;
top: 3px;
left: 3px;
width: 14px;
height: 14px;
background: var(--text-dimmer);
border-radius: 50%;
transition: transform 0.25s, background 0.2s;
}
.toggle-switch input:checked ~ .toggle-track { background: rgba(245,166,35,0.25); border-color: var(--accent); }
.toggle-switch input:checked ~ .toggle-track .toggle-thumb { transform: translateX(20px); background: var(--accent); }
#datetime-pickers {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 10px;
margin: 6px 0 14px;
}
.picker-group label {
display: block;
font-size: 10px;
letter-spacing: 0.14em;
color: var(--text-dim);
margin-bottom: 5px;
font-weight: 700;
}
.picker-group input[type="date"],
.picker-group input[type="time"] {
width: 100%;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-family: var(--mono);
font-size: 12px;
padding: 8px 8px;
outline: none;
transition: border-color 0.2s;
color-scheme: dark;
}
.picker-group input:focus { border-color: var(--accent); }
.btn-schedule {
width: 100%;
padding: 12px;
background: rgba(245,166,35,0.12);
border: 1px solid var(--accent-dim);
border-radius: var(--radius-lg);
color: var(--accent);
font-family: var(--mono);
font-size: 12px;
font-weight: 700;
letter-spacing: 0.12em;
cursor: pointer;
transition: background 0.2s, box-shadow 0.2s;
}
.btn-schedule:hover {
background: rgba(245,166,35,0.2);
box-shadow: 0 0 16px rgba(245,166,35,0.15);
}
/* ─── Devices Tab Layout ─────────────────────────────────────────────────────── */
#devices-layout {
display: grid;
grid-template-columns: 280px 1fr;
height: 100%;
overflow: hidden;
}
#device-list-panel {
border-right: 1px solid var(--border);
display: flex;
flex-direction: column;
overflow: hidden;
background: var(--surface);
}
#device-list {
flex: 1;
overflow-y: auto;
}
.device-item {
display: flex;
align-items: center;
gap: 10px;
padding: 14px 20px;
border-bottom: 1px solid var(--border);
cursor: pointer;
transition: background 0.15s;
}
.device-item:hover { background: var(--surface2); }
.device-item.selected { background: var(--surface2); border-left: 3px solid var(--accent); }
.device-item-info { flex: 1; min-width: 0; }
.device-item-name {
font-family: var(--sans);
font-size: 14px;
font-weight: 600;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.device-item-uuid {
font-size: 10px;
color: var(--text-dimmer);
letter-spacing: 0.06em;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.device-item-last {
font-size: 10px;
color: var(--text-dimmer);
margin-top: 2px;
}
/* ─── Device Detail ──────────────────────────────────────────────────────────── */
#device-detail-panel {
overflow-y: auto;
display: flex;
flex-direction: column;
}
#device-empty-state { flex: 1; }
#device-detail { padding: 0; }
#device-header {
display: flex;
align-items: center;
gap: 14px;
padding: 20px 24px;
border-bottom: 1px solid var(--border);
background: var(--surface);
position: sticky;
top: 0;
z-index: 10;
flex-wrap: wrap;
}
.device-detail-name {
font-family: var(--sans);
font-weight: 800;
font-size: 20px;
}
.device-detail-uuid {
font-size: 10px;
color: var(--text-dimmer);
letter-spacing: 0.08em;
margin-top: 2px;
}
#device-name-edit-area {
display: flex;
align-items: center;
gap: 8px;
margin-left: auto;
}
#device-name-input {
background: var(--surface2);
border: 1px solid var(--border);
border-radius: var(--radius);
color: var(--text);
font-family: var(--mono);
font-size: 12px;
padding: 6px 10px;
outline: none;
width: 180px;
transition: border-color 0.2s;
}
#device-name-input:focus { border-color: var(--accent); }
.btn-sm {
background: none;
border: 1px solid var(--border2);
border-radius: var(--radius);
color: var(--text-dim);
font-family: var(--mono);
font-size: 10px;
letter-spacing: 0.1em;
padding: 6px 12px;
cursor: pointer;
transition: border-color 0.2s, color 0.2s;
}
.btn-sm:hover { border-color: var(--accent); color: var(--accent); }
#device-sections { padding: 16px 24px; display: flex; flex-direction: column; gap: 24px; }
.device-section h3 {
font-size: 10px;
letter-spacing: 0.18em;
color: var(--text-dimmer);
font-weight: 700;
margin-bottom: 10px;
padding-bottom: 8px;
border-bottom: 1px solid var(--border);
}
/* Tag List (cached sounds) */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
background: var(--surface3);
border: 1px solid var(--border2);
color: var(--text-dim);
font-size: 11px;
padding: 3px 10px;
border-radius: 99px;
display: flex;
align-items: center;
gap: 5px;
}
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
/* Tables */
.data-table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
}
.data-table th {
text-align: left;
font-size: 10px;
letter-spacing: 0.12em;
color: var(--text-dimmer);
font-weight: 700;
padding: 6px 10px;
border-bottom: 1px solid var(--border);
}
.data-table td {
padding: 9px 10px;
border-bottom: 1px solid var(--border);
color: var(--text-dim);
vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td:first-child { color: var(--text); }
.action-btn {
background: none;
border: 1px solid var(--border2);
color: var(--text-dimmer);
font-family: var(--mono);
font-size: 10px;
padding: 3px 8px;
border-radius: var(--radius);
cursor: pointer;
transition: border-color 0.2s, color 0.2s;
}
.action-btn:hover { border-color: var(--red); color: var(--red); }
.action-btn.edit:hover { border-color: var(--accent); color: var(--accent); }
/* ─── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dimmer); }
/* ─── Toast ──────────────────────────────────────────────────────────────────── */
#toast {
position: fixed;
bottom: 24px;
left: 50%;
transform: translateX(-50%) translateY(80px);
background: var(--surface3);
border: 1px solid var(--border2);
color: var(--text);
font-family: var(--mono);
font-size: 12px;
padding: 10px 20px;
border-radius: var(--radius-lg);
box-shadow: 0 4px 20px rgba(0,0,0,0.5);
transition: transform 0.3s;
z-index: 9999;
letter-spacing: 0.06em;
}
#toast.show { transform: translateX(-50%) translateY(0); }
#toast.success { border-color: var(--green); color: var(--green); }
#toast.error { border-color: var(--red); color: var(--red); }
/* ─── Login Screen ───────────────────────────────────────────────────────────── */
#login-screen {
position: fixed;
inset: 0;
background: var(--bg);
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
#login-box {
width: 360px;
background: var(--surface);
border: 1px solid var(--border2);
border-radius: var(--radius-lg);
padding: 40px 36px 32px;
box-shadow: 0 8px 48px rgba(0,0,0,0.6);
}
#login-logo {
font-family: var(--sans);
font-weight: 800;
font-size: 28px;
letter-spacing: 0.2em;
color: var(--accent);
text-align: center;
margin-bottom: 4px;
}
#login-subtitle {
text-align: center;
font-size: 10px;
letter-spacing: 0.22em;
color: var(--text-dimmer);
margin-bottom: 32px;
}
#login-box .form-group {
padding: 0;
border-bottom: none;
margin-bottom: 16px;
}
#login-box .btn-create {
margin: 8px 0 0;
width: 100%;
}
#login-error {
font-size: 11px;
color: var(--red);
letter-spacing: 0.08em;
min-height: 18px;
margin-bottom: 4px;
text-align: center;
}
#login-connecting {
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
color: var(--text-dim);
font-size: 12px;
letter-spacing: 0.1em;
padding-top: 8px;
}
.spinner {
width: 16px;
height: 16px;
border: 2px solid var(--border2);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
/* ─── Logout Button ──────────────────────────────────────────────────────────── */
.btn-logout {
background: none;
border: 1px solid var(--border2);
color: var(--text-dimmer);
font-family: var(--mono);
font-size: 10px;
letter-spacing: 0.1em;
padding: 4px 10px;
border-radius: var(--radius);
cursor: pointer;
margin-left: 14px;
transition: border-color 0.2s, color 0.2s;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }