:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #18212b;
  --muted: #6d7884;
  --line: #dce2e8;

  --nav: #111923;
  --nav-soft: #1e2a38;

  --blue: #2f6fda;
  --blue-soft: #edf4ff;

  --red: #b94343;
  --red-soft: #fdecec;

  --amber: #ad6900;
  --amber-soft: #fff2dd;

  --green: #2d8553;
  --green-soft: #eaf7ef;

  --purple: #7055a5;
  --purple-soft: #f1ecfb;

  --shadow: 0 10px 28px rgba(22, 32, 42, 0.07);
}


/* RESET */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;

  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background: var(--bg);
  color: var(--ink);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}


/* MAIN SHELL */

.app-shell {
  min-height: 100vh;

  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}


/* SIDEBAR */

.sidebar {
  min-height: 100vh;

  background: var(--nav);
  color: white;

  padding: 20px 15px;

  display: flex;
  flex-direction: column;
}

.brand-block {
  padding: 4px 8px 18px;

  border-bottom: 1px solid rgba(255, 255, 255, 0.12);

  margin-bottom: 15px;
}

.wu-label {
  margin-bottom: 7px;

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.8px;

  text-transform: uppercase;

  color: #8f9baa;
}

.brand-block h1 {
  margin: 0;

  font-size: 25px;
  line-height: 1.15;

  letter-spacing: -0.5px;
}

.brand-block p {
  margin: 5px 0 0;

  color: #aeb8c4;

  font-size: 13px;
}

.client-block {
  margin: 0 8px 18px;

  padding: 10px 11px;

  border-radius: 10px;

  background: #1d2937;

  color: #d9e0e8;

  font-size: 13px;
  font-weight: 700;
}


/* NAVIGATION */

.main-nav {
  display: grid;
  gap: 7px;
}

.nav-button {
  width: 100%;

  border: 0;

  padding: 11px 12px;

  border-radius: 9px;

  background: transparent;

  color: #c7d0da;

  text-align: left;

  font-weight: 700;

  cursor: pointer;

  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.nav-button:hover {
  background: var(--nav-soft);

  color: white;
}

.nav-button.active {
  background: var(--nav-soft);

  color: white;
}

.sidebar-footer {
  margin-top: auto;

  padding: 10px 8px;

  color: #8e9aa8;

  font-size: 12px;
  line-height: 1.5;
}

.sidebar-footer p {
  margin: 0 0 12px;
}

.sidebar-footer p:last-child {
  margin-bottom: 0;
}


/* MAIN CONTENT */

.main-content {
  min-width: 0;

  padding: 24px;
}


/* TOP BAR */

.topbar {
  margin-bottom: 20px;

  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar h2 {
  margin: 0;

  font-size: 28px;
  line-height: 1.15;

  letter-spacing: -0.5px;
}

.topbar p {
  margin: 4px 0 0;

  color: var(--muted);

  font-size: 14px;
}

.topbar-actions {
  margin-left: auto;

  display: flex;
  align-items: center;
  gap: 9px;
}


/* BUTTONS */

.primary-button,
.secondary-button,
.small-button {
  border-radius: 9px;

  cursor: pointer;

  font-weight: 700;

  transition:
    transform 0.1s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.primary-button:active,
.secondary-button:active,
.small-button:active {
  transform: translateY(1px);
}

.primary-button {
  border: 1px solid var(--blue);

  padding: 10px 13px;

  background: var(--blue);

  color: white;
}

.primary-button:hover {
  background: #255fc0;

  border-color: #255fc0;
}

.secondary-button {
  border: 1px solid var(--line);

  padding: 10px 13px;

  background: white;

  color: var(--ink);
}

.secondary-button:hover {
  background: #f8fafb;
}

.small-button {
  border: 1px solid var(--line);

  padding: 8px 10px;

  background: white;

  color: var(--ink);

  font-size: 12px;
}

.small-button:hover {
  background: #f8fafb;
}


/* VIEWS */

.view {
  display: none;
}

.view.active {
  display: block;
}


/* SUMMARY CARDS */

.summary-grid {
  margin-bottom: 16px;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.summary-card {
  padding: 15px;

  border: 1px solid var(--line);

  border-radius: 14px;

  background: white;

  box-shadow: 0 4px 14px rgba(20, 30, 40, 0.03);
}

.summary-label {
  display: block;

  color: var(--muted);

  font-size: 13px;
}

.summary-number {
  display: block;

  margin-top: 5px;

  font-size: 26px;
  line-height: 1;

  font-weight: 800;
}


/* TODAY */

.today-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 16px;
}


/* PANELS */

.panel {
  overflow: hidden;

  border: 1px solid var(--line);

  border-radius: 14px;

  background: white;

  box-shadow: 0 4px 14px rgba(20, 30, 40, 0.03);
}

.panel-header {
  min-height: 56px;

  padding: 14px 16px;

  border-bottom: 1px solid var(--line);

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-header h3 {
  margin: 0;

  font-size: 16px;
}

.panel-body {
  padding: 14px 16px;
}


/* ATTENTION CARDS */

.attention-card {
  margin-bottom: 9px;

  padding: 12px;

  border: 1px solid var(--line);
  border-left: 5px solid var(--blue);

  border-radius: 10px;

  background: white;

  cursor: pointer;

  transition:
    transform 0.1s ease,
    box-shadow 0.15s ease;
}

.attention-card:last-child {
  margin-bottom: 0;
}

.attention-card:hover {
  box-shadow: 0 6px 15px rgba(20, 30, 40, 0.06);

  transform: translateY(-1px);
}

.attention-card strong {
  display: block;

  margin-bottom: 3px;

  font-size: 14px;
  line-height: 1.4;
}

.attention-card span {
  display: block;

  color: var(--muted);

  font-size: 12px;
  line-height: 1.4;
}

.attention-card.overdue {
  border-left-color: var(--red);
}

.attention-card.materials {
  border-left-color: var(--amber);
}

.attention-card.waiting {
  border-left-color: var(--purple);
}

.attention-card.on-track {
  border-left-color: var(--green);
}


/* REMINDERS */

.section-label {
  margin: 3px 0 8px;

  color: var(--muted);

  font-size: 11px;
  font-weight: 800;

  letter-spacing: 0.6px;

  text-transform: uppercase;
}

.upcoming-label {
  margin-top: 22px;
}

.reminder-row {
  padding: 12px 0;

  border-bottom: 1px solid #edf0f3;

  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto;
  gap: 12px;

  align-items: center;
}

.reminder-date-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.reminder-date-block strong {
  display: block;

  margin: 0;

  font-size: 14px;
  line-height: 1.35;
  font-weight: 800;
}

.reminder-row:last-child {
  border-bottom: 0;
}

.reminder-time {
  font-weight: 800;

  color: #35424e;

  font-size: 13px;
}

.reminder-copy {
  min-width: 0;
}

.reminder-copy strong {
  display: block;

  margin-bottom: 2px;

  font-size: 14px;
}

.reminder-copy span {
  display: block;

  overflow: hidden;

  color: var(--muted);

  font-size: 12px;

  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  padding: 4px 8px;

  border-radius: 999px;

  font-size: 11px;
  font-weight: 800;

  white-space: nowrap;
}

.status-pill.today {
  background: var(--red-soft);

  color: var(--red);
}

.status-pill.upcoming {
  background: var(--blue-soft);

  color: var(--blue);
}


/* FLOW INTRO */

.flow-intro {
  margin-bottom: 14px;

  padding: 18px 20px;

  border: 1px solid var(--line);

  border-radius: 14px;

  background:
    linear-gradient(
      135deg,
      #ffffff,
      #f8fbff
    );
}

.flow-intro h3 {
  margin: 0 0 6px;

  font-size: 17px;
}

.flow-intro p {
  margin: 0;

  max-width: 760px;

  color: var(--muted);

  font-size: 14px;
  line-height: 1.55;
}


/* FLOW BOARD */

.flow-board {
  overflow-x: auto;

  padding-bottom: 10px;

  display: grid;
  grid-template-columns: repeat(8, 220px);
  gap: 10px;

  align-items: start;
}

.flow-column {
  min-height: 500px;

  overflow: hidden;

  border: 1px solid #dce2e8;

  border-radius: 12px;

  background: #edf1f4;

  transition:
    background 0.15s ease,
    outline 0.15s ease;
}

.flow-column.drag-over {
  background: #e6eef9;

  outline: 3px solid rgba(47, 111, 218, 0.22);
}

.flow-column-header {
  padding: 11px;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;

  font-size: 12px;
  font-weight: 800;

  letter-spacing: 0.4px;

  text-transform: uppercase;
}

.flow-count {
  min-width: 22px;

  padding: 2px 7px;

  border-radius: 999px;

  background: #dfe5ea;

  text-align: center;

  font-size: 11px;
}

.flow-card {
  margin: 0 8px 8px;

  padding: 10px;

  border: 1px solid #d8dee4;

  border-radius: 10px;

  background: white;

  box-shadow: 0 2px 8px rgba(20, 30, 40, 0.04);

  cursor: grab;

  user-select: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.1s ease,
    opacity 0.15s ease;
}

.flow-card:hover {
  border-color: #bcc7d2;

  box-shadow: 0 5px 12px rgba(20, 30, 40, 0.07);
}

.flow-card:active {
  cursor: grabbing;
}

.flow-card.dragging {
  opacity: 0.45;

  transform: rotate(1deg);
}

.flow-card strong {
  display: block;

  margin-bottom: 3px;

  font-size: 14px;
}

.flow-card > span {
  display: block;

  color: var(--muted);

  font-size: 12px;
}

.flow-next {
  margin-top: 8px;

  padding: 7px;

  border-radius: 7px;

  background: #f7f9fa;

  font-size: 12px;
  line-height: 1.4;
}


/* CUSTOMERS */

.customer-list {
  display: grid;
  gap: 9px;
}

.customer-row {
  padding: 13px 15px;

  border: 1px solid var(--line);

  border-radius: 11px;

  background: white;

  display: grid;
  grid-template-columns:
    minmax(220px, 1.2fr)
    minmax(140px, 0.9fr)
    minmax(120px, 0.8fr)
    90px;

  gap: 12px;

  align-items: center;
}

.customer-row > div {
  min-width: 0;
}

.customer-row strong {
  display: block;

  margin-bottom: 2px;

  font-size: 14px;
}

.customer-row span {
  color: var(--muted);

  font-size: 13px;
}


/* MODALS */

.modal-backdrop {
  position: fixed;
  inset: 0;

  z-index: 50;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(10, 16, 22, 0.48);
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(620px, 96vw);

  overflow: hidden;

  border-radius: 16px;

  background: white;

  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.modal-header {
  min-height: 60px;

  padding: 16px 18px;

  border-bottom: 1px solid var(--line);

  display: flex;
  align-items: center;
}

.modal-header h3 {
  margin: 0;

  font-size: 17px;
}

.modal-close {
  width: 34px;
  height: 34px;

  margin-left: auto;

  border: 0;

  border-radius: 50%;

  background: #eef1f4;

  color: var(--ink);

  font-size: 20px;
  line-height: 1;

  cursor: pointer;
}

.modal-close:hover {
  background: #e4e8ec;
}

.modal-body {
  padding: 18px;

  display: grid;
  gap: 12px;
}


/* FORMS */

.form-field {
  display: grid;
  gap: 6px;
}

.form-field label {
  color: #4f5b66;

  font-size: 12px;
  font-weight: 800;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;

  border: 1px solid #cdd4db;

  border-radius: 9px;

  padding: 10px 11px;

  background: white;

  color: var(--ink);

  outline: none;
}

.form-field input:focus,
.form-field textarea:focus,
.form-field select:focus {
  border-color: var(--blue);

  box-shadow: 0 0 0 3px rgba(47, 111, 218, 0.1);
}

.form-field textarea {
  min-height: 90px;

  resize: vertical;
}

.modal-actions {
  padding-top: 4px;

  display: flex;
  justify-content: flex-end;
  gap: 8px;
}


/* TABLET */

@media (max-width: 1100px) {

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-grid {
    grid-template-columns: 1fr;
  }

  .customer-row {
    grid-template-columns:
      minmax(200px, 1fr)
      minmax(140px, 0.8fr)
      100px;
  }

  .customer-row > span:nth-of-type(2) {
    display: none;
  }
}


/* MOBILE */

@media (max-width: 760px) {

  .app-shell {
    display: block;
  }

  .sidebar {
    min-height: auto;

    padding: 14px;

    display: block;
  }

  .brand-block {
    margin-bottom: 10px;

    padding-bottom: 12px;
  }

  .brand-block h1 {
    font-size: 22px;
  }

  .client-block {
    margin: 0 0 10px;
  }

  .main-nav {
    grid-template-columns: repeat(4, 1fr);

    gap: 5px;
  }

  .nav-button {
    padding: 10px 6px;

    text-align: center;

    font-size: 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .main-content {
    padding: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .topbar h2 {
    font-size: 24px;
  }

  .topbar-actions {
    flex-direction: column;

    align-items: stretch;
  }

  .topbar-actions button {
    white-space: nowrap;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-card {
    padding: 13px;
  }

  .summary-number {
    font-size: 23px;
  }

  .panel-header {
    min-height: 52px;

    padding: 12px 13px;
  }

  .panel-body {
    padding: 12px 13px;
  }

  .reminder-row {
    grid-template-columns: 70px minmax(0, 1fr);

    gap: 9px;
  }

  .status-pill {
    grid-column: 2;

    justify-self: start;
  }

  .flow-intro {
    padding: 15px;
  }

  .flow-board {
    grid-template-columns: repeat(8, 205px);
  }

  .flow-column {
    min-height: 420px;
  }

  .customer-row {
    grid-template-columns: 1fr;

    gap: 8px;
  }

  .customer-row > span:nth-of-type(2) {
    display: block;
  }

  .customer-row .small-button {
    justify-self: start;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal {
    width: 100%;
  }
}


/* SMALL PHONE */

@media (max-width: 480px) {

  .main-nav {
    grid-template-columns: repeat(2, 1fr);
  }

  .topbar {
    display: block;
  }

  .topbar-actions {
    margin-top: 12px;

    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr 1fr;
  }

  .summary-label {
    font-size: 12px;
  }

  .attention-card {
    padding: 11px;
  }

  .flow-board {
    grid-template-columns: repeat(8, 190px);
  }

  .modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}