/* Preserved visual design for Raspored plaćanja + Tlocrt skladišta */

.view-schedule,
.view-floor-plan {
  --cv-paper-deep: #e5ebe1;
  --cv-ink: #1b2e2b;
  --cv-ink-soft: #5c6e68;
  --cv-steel: #23403b;
  --cv-line: #d7ded2;
  --cv-orange: #5c7a66;
  --cv-green: #2f8f5b;
  --cv-green-soft: #dceee2;
  --cv-red: #c8453c;
  --cv-red-soft: #f6dedb;
  --cv-amber: #b8862b;
  --cv-amber-soft: #f2e3c2;
  --cv-white: #fffefb;
}

/* —— Raspored plaćanja —— */

.view-schedule-group-header td {
  font-size: 0.875rem;
  letter-spacing: 0.03em;
}

.view-schedule .table-group-header--6m td {
  box-shadow: inset 3px 0 0 var(--cv-steel);
}

.view-schedule .table-group-header--12m td {
  box-shadow: inset 3px 0 0 var(--cv-orange);
}

.view-schedule .view-schedule-table .row-12m {
  box-shadow: inset 3px 0 0 var(--cv-orange);
}

.view-schedule .view-schedule-table .row-6m {
  box-shadow: inset 3px 0 0 var(--cv-steel);
}

.view-schedule .schedule-client-name {
  min-width: 10rem;
  max-width: 14rem;
  vertical-align: middle;
}

.view-schedule .schedule-client-name-mobile {
  display: none;
}

.view-schedule .schedule-periods-cell {
  padding: 0.5rem;
  vertical-align: middle;
}

.view-schedule .schedule-periods-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-schedule .schedule-row-toolbar {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 8px;
}

.view-schedule .schedule-row-nav {
  flex-shrink: 0;
  align-self: center;
}

.view-schedule .schedule-row-nav .btn {
  padding: 0.2rem 0.45rem;
  line-height: 1.2;
}

.view-schedule .schedule-client-periods {
  display: grid;
  flex: 1;
  min-width: 0;
  grid-template-columns: repeat(5, minmax(6.5rem, 1fr));
  gap: 6px;
  min-width: 34rem;
}

.view-schedule .schedule-period-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--cv-line);
  border-radius: 6px;
}

.view-schedule .schedule-period-slot {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  color: var(--bs-secondary-color);
  line-height: 1;
}

.view-schedule .schedule-period-head {
  font-size: 14.5px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
  line-height: 1.2;
}

.view-schedule .schedule-period-col .btn {
  font-size: 12.5px;
  padding: 3px 8px;
  white-space: nowrap;
  width: 100%;
}

.view-schedule .toggle-period-paid--loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  opacity: 0.85;
  pointer-events: none;
}

.view-schedule .toggle-period-paid--loading .spinner-border-sm {
  width: 0.85rem;
  height: 0.85rem;
  border-width: 0.15em;
}

.view-schedule .period-cell {
  font-size: 14.5px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.view-schedule .period-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.view-schedule .period-inner span {
  white-space: nowrap;
}

.view-schedule .period-cell .btn {
  font-size: 12.5px;
  padding: 3px 8px;
  white-space: nowrap;
  margin-left: auto;
}

.view-schedule .btn-paid-shaded {
  background: var(--cv-green-soft);
  border-color: var(--cv-green);
  color: var(--cv-green);
  opacity: 0.8;
}

.view-schedule .btn-paid-shaded:hover {
  opacity: 1;
}

.view-schedule .btn-orange {
  background: var(--cv-orange);
  border-color: var(--cv-orange);
  color: var(--cv-white);
}

.view-schedule .btn-orange:hover {
  opacity: 0.88;
}

.view-schedule .period-cell.paid,
.view-schedule .schedule-period-col.paid {
  background-color: var(--cv-green-soft);
  color: var(--cv-green);
  font-weight: 600;
}

.view-schedule .period-cell.overdue,
.view-schedule .schedule-period-col.overdue {
  background-color: var(--cv-red-soft);
  color: var(--cv-red);
  font-weight: 600;
}

.view-schedule .view-schedule-table td.period-cell.paid,
.view-schedule .schedule-period-col.paid {
  background-color: var(--cv-green-soft) !important;
  color: var(--cv-green);
}

.view-schedule .view-schedule-table td.period-cell.overdue,
.view-schedule .schedule-period-col.overdue {
  background-color: var(--cv-red-soft) !important;
  color: var(--cv-red);
}

.view-schedule .schedule-period-col.future {
  color: var(--bs-secondary-color);
}

.view-schedule .schedule-period-col.period-focus {
  box-shadow: inset 0 0 0 2px var(--cv-steel);
}

[data-bs-theme="dark"] .view-schedule .schedule-period-col.period-focus {
  box-shadow: inset 0 0 0 2px var(--bs-primary);
}

@media (max-width: 768px) {
  .view-schedule .table-responsive {
    overflow-x: visible;
  }

  .view-schedule .view-schedule-table thead th.schedule-client-head {
    display: none;
  }

  .view-schedule .view-schedule-table .schedule-client-name {
    display: none;
  }

  .view-schedule .schedule-client-name-mobile {
    display: block;
    flex: 1;
    min-width: 0;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .view-schedule .schedule-periods-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .view-schedule .schedule-row-toolbar {
    width: 100%;
    justify-content: space-between;
  }

  .view-schedule .schedule-client-periods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    width: 100%;
  }

  .view-schedule .schedule-period-head {
    font-size: 13px;
  }

  .view-schedule .schedule-period-col {
    min-width: 0;
  }
}

.view-schedule-legend-note {
  margin-bottom: 0.5rem;
}

.view-schedule-legend-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--bs-secondary-color);
}

.view-schedule-legend-future {
  color: var(--bs-secondary-color);
  font-weight: 600;
}

.view-schedule-legend-paid {
  color: var(--cv-green);
  font-weight: 600;
}

.view-schedule-legend-overdue {
  color: var(--cv-red);
  font-weight: 600;
}

[data-bs-theme="dark"] .view-schedule {
  --cv-red: #ff7070;
  --cv-red-soft: rgba(255, 112, 112, 0.22);
  --cv-green: #75d99a;
  --cv-green-soft: rgba(var(--bs-success-rgb), 0.22);
}

[data-bs-theme="dark"] .view-schedule .btn-paid-shaded {
  background: rgba(var(--bs-success-rgb), 0.18);
  border-color: var(--bs-success);
  color: var(--bs-success);
  opacity: 1;
}

[data-bs-theme="dark"] .view-schedule .view-schedule-table td.period-cell.paid {
  color: var(--bs-success);
}

[data-bs-theme="dark"] .view-schedule-legend-paid {
  color: var(--bs-success);
}

/* —— Tlocrt skladišta —— */

.view-floor-plan .plan-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.view-floor-plan .leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--bs-secondary-color);
}

.view-floor-plan .leg-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.view-floor-plan .plan-section-label {
  font-weight: 700;
  font-size: 14px;
  color: var(--bs-secondary-color);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.view-floor-plan .plan-arrow {
  font-size: 12px;
  color: var(--bs-secondary-color);
  margin-bottom: 10px;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.view-floor-plan .plan-strip {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.view-floor-plan .cont-box {
  position: relative;
  width: 96px;
  border-radius: 4px;
  border: 1px solid rgba(27, 46, 43, 0.3);
  display: flex;
  overflow: hidden;
  transition: 0.15s;
  cursor: default;
}

.view-floor-plan .cont-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(27, 46, 43, 0.16);
  z-index: 2;
}

.view-floor-plan .cont-20 {
  height: 120px;
}

.view-floor-plan .cont-40 {
  height: 240px;
}

.view-floor-plan .cont-doors {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  background: repeating-linear-gradient(
    45deg,
    rgba(27, 46, 43, 0.35),
    rgba(27, 46, 43, 0.35) 3px,
    transparent 3px,
    transparent 6px
  );
  border-top: 1px solid rgba(27, 46, 43, 0.3);
}

.view-floor-plan .cont-info {
  flex: 1;
  padding: 8px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.view-floor-plan .cont-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.view-floor-plan .cont-number {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
}

.view-floor-plan .cont-ft {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 9.5px;
  opacity: 0.7;
  text-transform: uppercase;
}

.view-floor-plan .cont-client {
  font-weight: 600;
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.15;
  text-align: center;
  width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.view-floor-plan .cont-status {
  font-size: 9.5px;
  font-weight: 600;
}

.view-floor-plan .plan-free {
  background: var(--cv-green-soft);
  color: var(--cv-green);
}

.view-floor-plan .plan-paid {
  background: var(--cv-steel);
  color: var(--cv-white);
  border-color: var(--cv-steel);
}

.view-floor-plan .plan-paid .cont-doors {
  background: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.4),
    rgba(255, 255, 255, 0.4) 3px,
    transparent 3px,
    transparent 6px
  );
}

.view-floor-plan .plan-due {
  background: var(--cv-amber-soft);
  color: var(--cv-amber);
}

.view-floor-plan .plan-debt {
  background: var(--cv-red-soft);
  color: var(--cv-red);
}

.view-floor-plan .leg-dot.plan-free {
  background: var(--cv-green-soft);
  border: 1px solid #bfdcc8;
}

.view-floor-plan .leg-dot.plan-paid {
  background: var(--cv-steel);
}

.view-floor-plan .leg-dot.plan-due {
  background: var(--cv-amber-soft);
  border: 1px solid #e3cb8e;
}

.view-floor-plan .leg-dot.plan-debt {
  background: var(--cv-red-soft);
  border: 1px solid #e8b4ae;
}

.view-floor-plan .leg-dot.plan-arriving {
  background: repeating-linear-gradient(
    45deg,
    var(--cv-amber-soft),
    var(--cv-amber-soft) 3px,
    #efd9a8 3px,
    #efd9a8 6px
  );
  border: 1px solid var(--cv-amber);
}

.view-floor-plan .plan-arriving {
  background: var(--cv-amber-soft);
  position: relative;
}

.view-floor-plan .cont-blur {
  flex: 1;
  padding: 7px 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  align-items: center;
  text-align: center;
  filter: blur(3px);
  opacity: 0.5;
  color: var(--cv-amber);
}

.view-floor-plan .cont-arriving-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 11px;
  color: var(--cv-amber);
  text-align: center;
  line-height: 1.4;
  background: repeating-linear-gradient(
    45deg,
    rgba(184, 134, 43, 0.08),
    rgba(184, 134, 43, 0.08) 6px,
    transparent 6px,
    transparent 12px
  );
}

@media (max-width: 760px) {
  .view-floor-plan .cont-box {
    width: 80px;
  }

  .view-floor-plan .cont-20 {
    height: 104px;
  }

  .view-floor-plan .cont-40 {
    height: 208px;
  }

  .view-floor-plan .plan-strip {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}
