mapdash/frontend/src/styles.css

302 lines
12 KiB
CSS

:root {
--bar-color: #4169E1;
--grid-line: #e2e2e2;
--label-w: 340px;
--row-even: #f0f0f0;
--row-odd: #FFFFFF;
--row-hover: #FFECB3;
--month-hover: rgba(65, 105, 225, 0.10);
/* appearance (overridden at runtime by appearance.ts) */
--row-h: 30px;
--bar-h: 18px;
--bar-font: 11px;
--label-font: 12px;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
display: flex;
flex-direction: column;
font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
background: #fff;
color: #222;
}
header {
flex: 0 0 auto;
padding: 12px 16px;
border-bottom: 1px solid #e2e2e2;
display: flex;
gap: 14px;
align-items: stretch;
/* Single row: keep every block (incl. the counters) on one line and, when the
window is too narrow, compress the fields group first instead of wrapping. */
flex-wrap: nowrap;
background: #fff;
z-index: 20;
}
/* Header groups (boxed blocks). By default they keep their natural width. */
.hgroup {
display: flex;
align-items: center;
gap: 16px;
padding: 10px 14px;
background: #f2f2f2;
border: 1px solid #e2e2e2;
border-radius: 8px;
flex-shrink: 0;
}
/* The fields group is the one that gives way first when space runs out. */
.hgroup-fields { flex-shrink: 1; min-width: 0; }
.hgroup-fields .field,
.hgroup-fields .fcol,
.hgroup-fields .dropdown,
.hgroup-fields .dropdown-btn { min-width: 0; }
.hgroup-brand { background: #eaeaea; }
/* Fields group: top-align so the date input sits UNDER Город/Бренд. */
.hgroup-fields { align-items: flex-start; }
.fcol { display: flex; flex-direction: column; gap: 8px; }
input[type=date] {
border: 1px solid #ccc;
border-radius: 4px;
padding: 6px 8px;
font-size: 13px;
min-width: 0;
width: 100%;
box-sizing: border-box;
}
/* Compact single-column layout: the three checkboxes stack in three rows so the
block takes as little horizontal space as possible. */
.hgroup-checks {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: center;
gap: 6px;
}
.hgroup-checks .checkbox-field { align-self: flex-start; }
.brand { display: flex; flex-direction: column; justify-content: center; line-height: 1.2; }
.brand-name { font-size: 18px; font-weight: 700; white-space: nowrap; }
.brand-sub { font-size: 15px; font-weight: 400; color: #666; white-space: nowrap; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11px; color: #666; text-transform: uppercase; letter-spacing: .03em; }
input[type=text] {
border: 1px solid #ccc;
border-radius: 4px;
padding: 6px 8px;
font-size: 13px;
min-width: 0;
width: 100%;
}
/* Counters as a compact gray block, pushed to the end of the header row so it
sits in line with the other boxed groups instead of floating below. */
.hgroup-status { margin-left: auto; align-items: center; }
#status { font-size: 12px; color: #888; line-height: 1.4; white-space: nowrap; }
/* Scale group: stack the "Оформление" button under the zoom slider. */
.hgroup-scale { flex-direction: column; align-items: flex-start; gap: 10px; }
.hgroup-scale .decor-wrap { align-self: flex-start; }
.checkbox-field { flex-direction: row; align-items: center; gap: 6px; align-self: center; }
.checkbox-field label {
display: flex; align-items: center; gap: 6px;
font-size: 13px; color: #222; text-transform: none; letter-spacing: normal;
cursor: pointer; white-space: nowrap;
}
.checkbox-field input[type=checkbox] { cursor: pointer; }
.zoom-field input[type=range] { width: 150px; cursor: pointer; }
.zoom-field label { white-space: nowrap; }
/* checkbox dropdown filter */
.dropdown { position: relative; }
.dropdown-btn {
border: 1px solid #ccc; border-radius: 4px; background: #fff;
padding: 6px 10px; font-size: 13px; min-width: 180px; text-align: left;
cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.dropdown-btn:hover { border-color: #999; }
.dropdown-btn .caret { font-size: 10px; color: #888; }
.dropdown-panel {
display: none; position: absolute; top: calc(100% + 4px); left: 0;
background: #fff; border: 1px solid #ccc; border-radius: 4px;
box-shadow: 0 4px 14px rgba(0,0,0,.12); padding: 6px 0;
min-width: 220px; max-height: 280px; overflow-y: auto; z-index: 30;
}
.dropdown.open .dropdown-panel { display: block; }
.dropdown-panel label {
display: flex; align-items: center; gap: 8px; padding: 5px 12px;
font-size: 13px; cursor: pointer; white-space: nowrap;
}
.dropdown-panel label:hover { background: #f4f4f4; }
.dropdown-panel .dp-actions {
display: flex; gap: 10px; padding: 4px 12px 8px;
border-bottom: 1px solid #eee; margin-bottom: 4px;
}
.dropdown-panel .dp-actions a { font-size: 11px; color: #567; cursor: pointer; text-decoration: underline; }
/* Оформление button + context menu */
.decor-wrap { position: relative; align-self: center; }
.decor-btn {
border: 1px solid #ccc; border-radius: 4px; background: #fff;
padding: 8px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.decor-btn:hover { border-color: #999; }
.decor-menu {
display: none; position: absolute; top: calc(100% + 6px); right: 0;
background: #fff; border: 1px solid #ccc; border-radius: 6px;
box-shadow: 0 6px 20px rgba(0,0,0,.15); padding: 10px 12px; z-index: 50;
width: max-content; max-width: min(420px, 92vw); max-height: calc(100vh - 96px); overflow-y: auto;
}
.decor-menu.open { display: block; }
.decor-section { margin-bottom: 22px; padding-bottom: 14px; border-bottom: 1px solid #eee; }
.decor-section:last-of-type { border-bottom: none; margin-bottom: 8px; }
.decor-section-title {
font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
color: #666; margin: 6px 0 4px;
}
.decor-row {
display: flex; align-items: center; justify-content: space-between; gap: 12px;
padding: 3px 0; font-size: 13px;
}
.decor-row > span { color: #222; }
.decor-row input[type=number] { width: 84px; padding: 4px 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 13px; }
.decor-row input[type=color] { width: 42px; height: 26px; padding: 0; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; }
.decor-reset { margin-top: 6px; width: 100%; padding: 6px; font-size: 12px; border: 1px solid #ccc; border-radius: 4px; background: #f7f7f7; cursor: pointer; }
.decor-reset:hover { background: #efefef; }
/* ---- view modes: timeline / map / split ---- */
/* Stacked, individual buttons (compact vertical column). */
.mode-switch { display: flex; flex-direction: column; gap: 6px; }
.mode-btn {
border: 1px solid #ccc; border-radius: 6px; background: #fff; color: #333; cursor: pointer;
padding: 6px 12px; font-size: 13px; white-space: nowrap; text-align: left; width: 100%;
}
.mode-btn:hover { background: #f0f0f0; }
.mode-btn.active { background: #2e66d6; border-color: #2e66d6; color: #fff; }
#view { display: flex; flex: 1 1 auto; min-height: 0; min-width: 0; --split-left: 50%; }
#pane-timeline { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
#pane-map { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#map { width: 100%; height: 100%; }
/* timeline-only */
#view.mode-timeline #pane-timeline { flex: 1 1 auto; }
#view.mode-timeline #pane-map,
#view.mode-timeline #split-resizer { display: none; }
/* map-only */
#view.mode-map #pane-map { flex: 1 1 auto; }
#view.mode-map #pane-timeline,
#view.mode-map #split-resizer { display: none; }
/* split */
#view.mode-split #pane-timeline { flex: 0 0 var(--split-left); }
#view.mode-split #pane-map { flex: 1 1 auto; }
#view.mode-split #split-resizer { display: block; }
#split-resizer {
flex: 0 0 6px; background: #e2e2e2; cursor: col-resize; position: relative;
}
#split-resizer:hover { background: #b9c6e6; }
#map-legend {
position: absolute; left: 10px; bottom: 10px; z-index: 5;
background: rgba(255,255,255,.92); border: 1px solid #ddd; border-radius: 6px;
padding: 6px 10px; font-size: 12px; color: #333; display: flex; gap: 14px; align-items: center;
box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
#map-legend .lg-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
#map-legend .lg-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
#map-legend .lg-free { background: #59a831; }
#map-legend .lg-busy { background: #e35b45; }
#map-empty {
position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
color: #888; font-size: 14px; z-index: 5;
}
/* Custom hover tooltip for map markers and clusters. */
.map-tip {
position: fixed; z-index: 1000; pointer-events: none;
background: rgba(33,33,33,.94); color: #fff; font-size: 12px; line-height: 1.35;
padding: 8px 10px; border-radius: 6px; max-width: 340px;
box-shadow: 0 4px 14px rgba(0,0,0,.3);
}
.map-tip .tip-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.map-tip .tip-free { background: #59a831; }
.map-tip .tip-busy { background: #e35b45; }
.map-tip .tip-row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-tip .tip-head { font-weight: 700; margin-bottom: 3px; }
.map-tip .tip-sub { color: #cfd3d6; }
.map-tip .tip-more { color: #cfd3d6; margin-top: 3px; }
#chart-wrap { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
#timeline { border: none; }
/* vis-timeline bars: colour comes from each item's inline style (per status /
collision). Height and vertical centring come from --bar-h + symmetric vis
margin (see appearance.ts marginVertical); flex centres the text too. */
/* The vis item spans the FULL row height and is transparent; the visible bar
is an inner div (.bar-inner) of --bar-h height, flex-centred. This makes
vertical centring independent of vis-timeline's own item positioning. */
.vis-item.vis-range {
height: var(--row-h);
background-color: transparent !important;
border: none !important;
box-shadow: none !important;
padding: 0;
display: flex;
align-items: center;
cursor: pointer;
}
.vis-item.vis-range .vis-item-overflow { display: flex; align-items: center; height: 100%; width: 100%; overflow: hidden; }
.vis-item.vis-range .vis-item-content { padding: 0; width: 100%; }
.bar-inner {
height: var(--bar-h);
width: 100%;
box-sizing: border-box;
border-radius: 3px;
display: flex;
align-items: center;
padding: 0 6px;
color: #FFFFFF;
font-size: var(--bar-font);
line-height: 1;
white-space: nowrap;
overflow: hidden;
}
.vis-item.vis-range:hover .bar-inner { filter: brightness(0.92); }
.vis-foreground .vis-group { min-height: var(--row-h); }
.vis-labelset .vis-label { font-size: var(--label-font); display: flex; align-items: center; min-height: var(--row-h); }
/* Zebra striping */
.vis-label.row-even, .vis-group.row-even { background-color: var(--row-even); }
.vis-label.row-odd, .vis-group.row-odd { background-color: var(--row-odd); }
/* Row hover */
.vis-label.row-hover, .vis-group.row-hover { background-color: var(--row-hover) !important; }
/* Fixed/resizable label column */
.vis-label .vis-inner {
display: inline-block;
min-width: var(--label-w);
max-width: var(--label-w);
overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle;
}
/* Column resize handle */
#col-resizer {
position: absolute; top: 0; bottom: 0; width: 9px; margin-left: -4px;
cursor: col-resize; z-index: 25; display: none;
}
#col-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: #ccc; }
#col-resizer:hover::after, #col-resizer.dragging::after { background: var(--bar-color); width: 2px; left: 3px; }
/* Hovered-month column highlight */
.vis-item.vis-background.month-hover-bg { background-color: var(--month-hover); }
#tooltip {
position: fixed; display: none; background: #222; color: #fff;
padding: 6px 10px; border-radius: 4px; font-size: 12px; pointer-events: none;
z-index: 100; max-width: 320px; line-height: 1.4; white-space: pre-line;
}
#empty { padding: 40px; text-align: center; color: #999; font-size: 13px; }