/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/*
 * Task 28: UI polish -- prototype alignment.
 *
 * Fonts and colors below are taken verbatim from the working interactive
 * prototype ("ТО-Систем - прототип.html", the `statusVisual(f)` method and
 * its base palette), not re-guessed. IBM Plex Sans is self-hosted here
 * (files vendored at app/assets/fonts/IBMPlexSans-*.ttf, from IBM's own
 * github.com/IBM/plex repo, Apache-2.0 licensed) rather than linked from
 * Google Fonts' CDN, matching this app's no-external-dependencies posture
 * (Kamal/self-hosted, per AGENTS.md) and the same vendoring pattern Task 25
 * already established for PT Sans in app/pdfs/service_book_pdf.rb.
 */

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/IBMPlexSans-Regular-567f2ada.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/IBMPlexSans-Italic-9a96d746.ttf") format("truetype");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/IBMPlexSans-Bold-331cd24e.ttf") format("truetype");
}

:root {
  /* Typography -- IBM Plex Sans for body/UI text everywhere; IBM Plex Mono
     is reserved for tabular/numeric-emphasis content (hour readings,
     prices) per the prototype, but is not embedded yet since nothing in
     this app currently differentiates it -- add IBMPlexMono-*.ttf here the
     same way if that need arises. */
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Traffic-light palette (verbatim from the prototype's statusVisual(f)). */
  --color-overdue-bg: oklch(94% 0.05 25);
  --color-overdue-text: oklch(45% 0.18 25);
  --color-due-soon-bg: oklch(95% 0.06 75);
  --color-due-soon-text: oklch(48% 0.13 75);
  --color-ok-bg: oklch(95% 0.04 155);
  --color-ok-text: oklch(42% 0.1 155);

  /* Base palette (also from the prototype). */
  --color-border: #d7dbe0;
  --color-border-muted: #e4e6ea;
  --color-text-muted: #6b7280;
  --color-text-subtle: #4b5563;
  --color-text-faint: #8b93a1;
  --color-text: #1c2128;
  --color-accent: oklch(48% 0.15 250);
  --color-accent-hover: oklch(40% 0.16 250);
}

html {
  /* Without this, browsers that prefer a dark color scheme paint the
     default (unstyled) background black while our text colors below still
     assume a white background -- e.g. --color-text: #1c2128 becomes
     near-invisible dark-on-black. This app's palette is light-only for
     now, so pin the scheme rather than styling both. */
  color-scheme: light;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  background: #fff;
}

a {
  color: var(--color-accent);
}

a:hover {
  color: var(--color-accent-hover);
}

/* Traffic-light status badges/pills -- used anywhere equipment urgency
   (overdue / due_soon / ok) is rendered, replacing the earlier
   emoji-only placeholder treatment (dashboard + planner). */
.status-badge {
  display: inline-block;
  padding: 0.15em 0.65em;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge--overdue {
  background: var(--color-overdue-bg);
  color: var(--color-overdue-text);
}

/* NB: the app's own code (Equipment#traffic_light, PlannerController) uses
   the symbol :soon (not :due_soon) for this state -- named to match. */
.status-badge--soon {
  background: var(--color-due-soon-bg);
  color: var(--color-due-soon-text);
}

.status-badge--ok {
  background: var(--color-ok-bg);
  color: var(--color-ok-text);
}

/*
 * Responsive mechanic flow: hour-reading form (app/views/organizations/
 * hour_readings/_form.html.erb). A mechanic fills this in from a phone out
 * in the field, so it needs full-width inputs, touch-sized controls, no
 * horizontal scrolling, and no iOS Safari zoom-on-focus (which triggers
 * whenever a focused input's font-size is under 16px). Deliberately scoped
 * to just this form, not a site-wide responsive framework, per the brief's
 * literal "Responsive mechanic flows (hour reading form)" wording.
 */
.hour-reading-form {
  max-width: 28rem;
  margin: 0 auto;
}

.hour-reading-form .field {
  margin-bottom: 1rem;
}

.hour-reading-form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.hour-reading-form input,
.hour-reading-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.75em;
  font-size: 16px; /* >=16px prevents iOS Safari's auto-zoom-on-focus */
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  min-height: 3rem; /* comfortable touch target */
}

.hour-reading-form textarea {
  min-height: 5rem;
}

.hour-reading-form input:focus,
.hour-reading-form textarea:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.hour-reading-form input[type="submit"] {
  width: 100%;
  min-height: 3rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
}

.hour-reading-form input[type="submit"]:hover,
.hour-reading-form input[type="submit"]:active {
  background: var(--color-accent-hover);
}

.hour-reading-form .field-errors {
  margin-bottom: 1rem;
  padding: 0.75em 1em;
  background: var(--color-overdue-bg);
  color: var(--color-overdue-text);
  border-radius: 0.375rem;
}

/* === Global UI shell (auth fallback) === */

.app-sidebar__brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.375rem;
  background: var(--color-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-sans);
}

.auth-card {
  max-width: 26rem;
  margin: 4rem auto;
  background: #fff;
  border: 1px solid var(--color-border-muted);
  border-radius: 0.75rem;
  padding: 2rem;
}

.auth-card__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.auth-card form div {
  margin-bottom: 1rem;
}

.auth-card form label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.auth-card form input[type="text"],
.auth-card form input[type="email"],
.auth-card form input[type="password"] {
  box-sizing: border-box;
  width: 100%;
  padding: 0.6em 0.75em;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
}

.auth-card form input[type="submit"] {
  display: inline-block;
  width: 100%;
  padding: 0.6em 1.1em;
  border-radius: 0.375rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
}

.auth-card form input[type="submit"]:hover {
  background: var(--color-accent-hover);
}

/* === Global UI shell (components) === */

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-header__text h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.page-header__subtitle {
  margin: 0;
  color: var(--color-text-muted);
}

.page-header__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: flex-start;
}

.btn {
  display: inline-block;
  padding: 0.6em 1.1em;
  border-radius: 0.375rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-accent-hover);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--color-text);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-text-faint);
}

.text-danger {
  color: var(--color-overdue-text);
}

.card {
  background: #fff;
  border: 1px solid var(--color-border-muted);
  border-radius: 0.75rem;
  padding: 1.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.app-main table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid var(--color-border-muted);
  border-radius: 0.75rem;
  overflow: hidden;
}

.app-main table th {
  text-align: left;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--color-text-muted);
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-muted);
}

.app-main table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border-muted);
}

.app-main table tbody tr:last-child td {
  border-bottom: none;
}

.app-main table tbody tr:hover {
  background: #f8f9fa;
}

.app-main form:not(.hour-reading-form) {
  max-width: 32rem;
}

.app-main form:not(.hour-reading-form) div {
  margin-bottom: 1rem;
}

.app-main form:not(.hour-reading-form) label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.app-main form:not(.hour-reading-form) input[type="text"],
.app-main form:not(.hour-reading-form) input[type="number"],
.app-main form:not(.hour-reading-form) input[type="email"],
.app-main form:not(.hour-reading-form) input[type="password"],
.app-main form:not(.hour-reading-form) input[type="datetime-local"],
.app-main form:not(.hour-reading-form) select,
.app-main form:not(.hour-reading-form) textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.6em 0.75em;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
}

.app-main form:not(.hour-reading-form) input[type="submit"] {
  display: inline-block;
  padding: 0.6em 1.1em;
  border-radius: 0.375rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
}

.app-main form:not(.hour-reading-form) input[type="submit"]:hover {
  background: var(--color-accent-hover);
}

/* === Global UI shell (sidebar) === */

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: oklch(20% 0.05 255);
  color: #fff;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #fff;
  text-decoration: none;
}

.app-sidebar__section {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  color: oklch(70% 0.02 255);
  margin: 0 0 0.5rem;
}

.app-sidebar__nav {
  display: flex;
  flex-direction: column;
  margin: 0 0 1.5rem;
  flex: 1;
}

.app-sidebar__nav-item {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  color: oklch(85% 0.02 255);
  text-decoration: none;
  margin-bottom: 0.15rem;
}

.app-sidebar__nav-item:hover {
  background: oklch(26% 0.05 255);
  color: #fff;
}

.app-sidebar__nav-item.is-active {
  background: oklch(30% 0.05 250);
  color: #fff;
  font-weight: 600;
}

.app-sidebar__footer {
  border-top: 1px solid oklch(30% 0.05 255);
  padding-top: 1rem;
  font-size: 0.85rem;
  color: oklch(75% 0.02 255);
}

.app-sidebar__footer form {
  margin-top: 0.5rem;
}

.app-main {
  flex: 1;
  background: #f8f9fa;
  padding: 2rem;
  overflow-y: auto;
}

/* === Global UI shell (mobile) === */

.app-sidebar__toggle {
  display: none;
}

@media (max-width: 768px) {
  .app-shell {
    flex-direction: column;
  }

  .app-sidebar__toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: oklch(20% 0.05 255);
    color: #fff;
    border: none;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 600;
  }

  .app-sidebar {
    display: none;
    width: 100%;
  }

  .app-sidebar.is-open {
    display: flex;
  }
}

/* === Global UI shell (flash messages) === */

.flash {
  padding: 0.75em 1em;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
}

.flash--notice {
  background: var(--color-ok-bg);
  color: var(--color-ok-text);
}

.flash--alert {
  background: var(--color-overdue-bg);
  color: var(--color-overdue-text);
}

/* === Sessions (split-screen auth) === */

.auth-split {
  display: flex;
  min-height: 100vh;
}

.auth-split__left {
  flex: 0 0 auto;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-split__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 2rem;
}

.auth-split__tabs {
  display: flex;
  background: #f3f4f6;
  border-radius: 0.5rem;
  padding: 0.25rem;
  margin-bottom: 1.5rem;
}

.auth-split__tab {
  flex: 1;
  text-align: center;
  padding: 0.6em 1em;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.auth-split__tab--active {
  background: #fff;
  color: var(--color-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.auth-split__tab--disabled {
  color: var(--color-text-faint);
  cursor: default;
}

.auth-split__heading {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.auth-split__subtitle {
  margin: 0 0 1.5rem;
  color: var(--color-text-muted);
}

.auth-split__field {
  margin-bottom: 1rem;
}

.auth-split__label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.auth-split__input {
  box-sizing: border-box;
  width: 100%;
  padding: 0.7em 0.85em;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
}

.auth-split__input:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
}

.auth-split__submit {
  display: block;
  width: 100%;
  padding: 0.75em 1.1em;
  margin-top: 0.5rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-accent);
  border: none;
  cursor: pointer;
}

.auth-split__submit:hover {
  background: var(--color-accent-hover);
}

.auth-split__right {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem;
  background: linear-gradient(160deg, oklch(20% 0.05 255), oklch(12% 0.03 255));
  color: #fff;
}

.auth-split__right-eyebrow {
  margin: 0 0 1rem;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: oklch(75% 0.02 255);
}

.auth-split__right-headline {
  margin: 0 0 1rem;
  font-size: 2rem;
  line-height: 1.25;
}

.auth-split__right-subtitle {
  margin: 0;
  max-width: 32rem;
  color: oklch(80% 0.02 255);
}

@media (max-width: 768px) {
  .auth-split__right {
    display: none;
  }

  .auth-split__left {
    max-width: none;
  }
}

/* === Equipment: hero banner (list view) === */

.hero-banner {
  background: linear-gradient(135deg, oklch(30% 0.05 255), oklch(22% 0.05 258));
  border-radius: 0.875rem;
  padding: 1.625rem 1.875rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  color: #fff;
}

.hero-banner__kicker-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.625rem;
}

.hero-banner__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.hero-banner__kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero-banner__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.375rem;
}

.hero-banner__sub {
  font-size: 0.84375rem;
  color: oklch(80% 0.03 250);
}

.hero-banner__cta {
  padding: 0.6875rem 1.25rem;
  background: #fff;
  color: oklch(30% 0.05 255);
  border: none;
  border-radius: 0.5rem;
  font-size: 0.84375rem;
  font-weight: 600;
  white-space: nowrap;
}

/* === Equipment: status pill (list rows + detail header) === */

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-pill--overdue { background: var(--color-overdue-bg); color: var(--color-overdue-text); }
.status-pill--overdue .status-pill__dot { background: var(--color-overdue-text); }
.status-pill--soon { background: var(--color-due-soon-bg); color: var(--color-due-soon-text); }
.status-pill--soon .status-pill__dot { background: var(--color-due-soon-text); }
.status-pill--ok { background: var(--color-ok-bg); color: var(--color-ok-text); }
.status-pill--ok .status-pill__dot { background: var(--color-ok-text); }

/* === Equipment: detail page tab bar === */

.tab-bar {
  display: flex;
  border-bottom: 1px solid var(--color-border-muted);
  margin-bottom: 1.375rem;
}

.tab-bar__item {
  padding: 0.75rem 1rem;
  font-size: 0.84375rem;
  font-weight: 600;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
}

.tab-bar__item.is-active {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

/* === Equipment: forecast panel (Обзор tab) === */

.forecast-panel {
  border-radius: 0.75rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border-muted);
}

.forecast-panel--overdue { background: var(--color-overdue-bg); border-color: var(--color-overdue-text); }
.forecast-panel--soon { background: var(--color-due-soon-bg); border-color: var(--color-due-soon-text); }
.forecast-panel--ok { background: var(--color-ok-bg); border-color: var(--color-ok-text); }

.forecast-panel__kicker {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.forecast-panel__date {
  font-size: 1.5625rem;
  font-weight: 700;
  line-height: 1.1;
}

.forecast-panel--overdue .forecast-panel__kicker,
.forecast-panel--overdue .forecast-panel__days { color: var(--color-overdue-text); }
.forecast-panel--soon .forecast-panel__kicker,
.forecast-panel--soon .forecast-panel__days { color: var(--color-due-soon-text); }
.forecast-panel--ok .forecast-panel__kicker,
.forecast-panel--ok .forecast-panel__days { color: var(--color-ok-text); }

.progress-bar {
  position: relative;
  height: 8px;
  background: #fff;
  border: 1px solid var(--color-border-muted);
  border-radius: 999px;
  margin: 1.25rem 0 0.5625rem;
  overflow: hidden;
}

.progress-bar__fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
}

.forecast-panel--overdue .progress-bar__fill { background: var(--color-overdue-text); }
.forecast-panel--soon .progress-bar__fill { background: var(--color-due-soon-text); }
.forecast-panel--ok .progress-bar__fill { background: var(--color-ok-text); }

.progress-bar__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}

/* === Equipment: stat tiles (header card + downtime card) === */

.stat-tile-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.625rem;
}

.stat-tile {
  background: #f7f8f9;
  border-radius: 0.5rem;
  padding: 0.75rem 0.875rem;
}

.stat-tile__label {
  font-size: 0.6875rem;
  color: var(--color-text-faint);
  margin-bottom: 0.25rem;
}

.stat-tile__value {
  font-size: 1.125rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.downtime-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.875rem;
  background: oklch(30% 0.05 255);
  border-radius: 0.5rem;
  color: #fff;
}

/* === Equipment: journal doc (История ТО tab) === */

.journal-doc {
  background: #fff;
  border: 1px solid var(--color-border-muted);
  border-radius: 0.625rem;
  padding: 1.625rem 1.75rem;
}

.journal-doc__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  border-bottom: 2px solid var(--color-text);
  padding-bottom: 0.875rem;
  margin-bottom: 1rem;
}

.journal-doc__badge {
  width: 34px;
  height: 34px;
  border-radius: 0.5rem;
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
}

/*
 * Fleet planner (Организации::Planner) -- weekly timeline redesign, pixel-
 * matched to the Claude-Design handoff prototype's "FLEET PLANNER" screen.
 * Every color/font below reuses the existing custom properties defined at
 * the top of this file -- no new palette.
 */
.planner-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.planner-stat-card {
  background: #fff;
  border: 1px solid var(--color-border-muted);
  border-radius: 10px;
  padding: 16px 18px;
}

.planner-stat-card__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 8px;
}

.planner-stat-card__value {
  font-size: 26px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.planner-stat-card__value--overdue { color: var(--color-overdue-text); }
.planner-stat-card__value--soon { color: var(--color-due-soon-text); }
.planner-stat-card__value--ok { color: var(--color-ok-text); }

.planner-timeline {
  background: #fff;
  border: 1px solid var(--color-border-muted);
  border-radius: 10px;
  overflow-x: auto;
}

.planner-timeline__inner {
  min-width: max-content;
}

.planner-timeline__header,
.planner-timeline__load-row,
.planner-timeline__row {
  display: flex;
  align-items: center;
}

.planner-timeline__header {
  border-bottom: 1px solid var(--color-border-muted);
  padding: 10px 0;
  align-items: flex-end;
}

.planner-timeline__name-col {
  width: 210px;
  flex: none;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.planner-timeline__header .planner-timeline__name-col,
.planner-timeline__load-row .planner-timeline__name-col {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.planner-timeline__week-col {
  flex: 1;
  min-width: 62px;
  text-align: center;
  font-size: 10.5px;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}

.planner-timeline__load-row {
  border-bottom: 1px solid var(--color-border-muted);
  padding: 6px 0;
  height: 48px;
  background: #fbfbfc;
  align-items: flex-end;
}

.planner-timeline__load-cell {
  flex: 1;
  min-width: 62px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  padding-bottom: 4px;
}

.planner-timeline__load-bar {
  width: 58%;
  border-radius: 3px 3px 0 0;
  background: var(--color-ok-text);
}

.planner-timeline__load-bar--overloaded {
  background: var(--color-overdue-text);
}

.planner-timeline__row {
  border-bottom: 1px solid var(--color-border-muted);
  text-decoration: none;
  color: inherit;
}

.planner-timeline__row:last-child {
  border-bottom: none;
}

.planner-timeline__row:hover {
  background: #f8f9fb;
}

.planner-timeline__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.planner-timeline__status-dot--overdue { background: var(--color-overdue-text); }
.planner-timeline__status-dot--soon { background: var(--color-due-soon-text); }

.planner-timeline__title {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}

.planner-timeline__serial {
  font-size: 10.5px;
  color: var(--color-text-faint);
  font-family: var(--font-mono);
}

.planner-timeline__cell {
  flex: 1;
  min-width: 62px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.planner-timeline__pill {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.planner-timeline__pill--overdue {
  background: var(--color-overdue-bg);
  color: var(--color-overdue-text);
}

.planner-timeline__pill--soon {
  background: var(--color-due-soon-bg);
  color: var(--color-due-soon-text);
}

.planner-timeline__no-date {
  flex: 1;
  padding-left: 10px;
  font-size: 11px;
  color: var(--color-text-faint);
}

.planner-timeline__legend {
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: 12px;
}
