/* ========= BASE ========= */
:root {
  --bg: #F3F4F6;
  --panel: #F6F6F6;
  --border: #E5E5E5;
  --line: #E3E3E3;
  --text: #1F2937;
  --text-strong: #2B2B2B;
  --muted: #6B6B6B;
  --muted-2: #8B8B8B;
  --accent: #E3002C;
  --blue: #1E40AF;
  --white: #fff;
  --radius-lg: 22px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-soft: 0 6px 18px rgba(0, 0, 0, .06);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, .06);
  --shadow-card-hover: 0 14px 32px rgba(0, 0, 0, .12);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* ========= LAYOUT ========= */
.container {
  margin: 0 auto;
  padding: 24px 32px 48px;
}


/* ========= BLOCKS ========= */
.block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 24px 0;
  box-shadow: var(--shadow-soft);
}

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 200;
  color: #4e4e4e;
}

.block-title span {
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: var(--muted);
  opacity: 0.5;
}

/* ========= TASKS ========= */
.tasks-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.task-card {
  position: relative;
  background: var(--white);
  border: 1px solid #DADADA;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  min-width: 200px;

  height: auto !important;
  /* <---- разрешаем расти */
  min-height: unset;
  overflow: visible;
  /* <---- ничего не обрезаем */
  gap: 10px;
}

.task-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.left-line {
  position: absolute;
  top: 30px;
  left: 18px;
  width: 3px;
  height: 50px;
  background: var(--accent);
  border-radius: 2px;
}

.left-line-send {
  margin-right: 10px;
  width: 3px;
  height: 55px;
  background: var(--accent);
  border-radius: 2px;
}

.left-line-title {
  margin-right: 10px;
  width: 3px;
  height: 45px;
  background: var(--accent);
  border-radius: 2px;
}

.left-line-two {
  position: absolute;
  top: 30px;
  left: 18px;
  width: 3px;
  height: 45px;
  background: var(--accent);
  border-radius: 2px;
}

.box-send-task {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  width: 100%;
}

.box-send {
  display: flex;
  flex-direction: row;
}

.task-card h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-strong);
  line-height: 1.35;
  margin-bottom: 5px;
}

.input-field {
  background: #EFEFEF;
  border-radius: 999px;
  height: 34px;
  padding: 0 12px;
  /* margin-right: 48px; */
  /* max-width: 240px; */
  display: flex;
  align-items: center;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.input-field input {
  all: unset;
  flex: 1;
  font-size: 13px;
  color: #333;
}

.input-field:focus-within {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(227, 0, 44, 0.15);
}

.arrow-btn {
  position: absolute;
  right: 16px;
  bottom: 13px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--white);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.arrow-btn:hover {
  background: var(--accent);
  color: var(--white);
}


/* ========= MY TASKS ========= */

.box-line-title {
  display: flex;
  flex-direction: row;
}

.my-tasks__head {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  /* align-items: baseline; */
  /* margin-bottom: 10px; */
}

.task-summary div h3 {
  font-size: 14px;
}

.stats {
  font-size: 10px;
  color: #666;

}

.stats b {
  padding: 0 5px;
  font-weight: 600;
  font-size: 24px;
  color: var(--text-strong);
}

.stats .danger {
  color: var(--accent);
  font-weight: 700;
}

.task-summary {
  display: flex;
  justify-content: start;
  opacity: 0.8;
  gap: 1rem;
}

/* .task-summary .stats {
  padding: 5px;
  border-radius: 8px;
  background-color: #f5f5f5;
} */
.block-task {
  border: #ededed solid 1px;
  padding: 8px;
  border-radius: 5px;
  /* min-width: 120px; */
  background-color: #f4f4f4;
  width: 100%;
  /* margin-top: 10px; */
}

.task-summary .stats b {
  padding: 0 5px;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-strong);
}

.task-summary .stats .danger {
  color: var(--accent);
}

.block-stats {
  display: flex;
  flex-direction: column;
  /* margin: 5px; */
}

/* Scroll */
.mini-scroll-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0 42px;
}

.mini-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  flex: 1;
  margin: 0 15px;
  padding: 5px;

}

.mini-scroll {
  scrollbar-width: none;
  /* Firefox */
}

.mini-scroll::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari */
}

.mini-grid {
  display: flex;
  gap: 16px;
  min-width: calc((120px + 16px) * 4);
  padding: 0 15px;
}

.mini {
  scroll-snap-align: start;
  flex: 0 0 calc((100% - 32px) / 3);
  background: var(--white);
  border: 1px solid #E2E2E2;
  border-radius: 12px;
  padding: 12px 14px;
  /* box-shadow: 0 4px 12px rgba(0,0,0,0.06); */
  transition: 0.25s;
  display: flex;
  flex-direction: column;
  /* Важно */
}

.mini:hover {

  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.mini__cap {
  font-size: 9px;
  color: #999;
  margin-bottom: 4px;
}

.mini__title {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini__desc {
  font-size: 10px;
  color: #555;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  /* ограничиваем 2 строками */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  /* добавляем троеточие */
}

.mini__status {
  display: inline-block;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: 6px;
  margin-top: auto;
  width: fit-content;
  /* ✅ Чтобы не растягивался */
  white-space: nowrap;
}

.mini__status.danger {
  background: #FFE5E5;
  color: #B71C1C;
}

.mini__status.warn {
  background: #FFF5CF;
  color: #9C6B00;
}

/* Buttons */
.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--white);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
}

.scroll-btn:hover {
  background: var(--accent);
  color: var(--white);
  transform: translateY(-50%) scale(1.1);
}

.scroll-left {
  left: 8px;
}

.scroll-right {
  right: 8px;
}

/* Fixed fades */
.scroll-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}

.fade-left {
  left: 0;
}

.fade-right {
  right: 0;
}

/* ========= APPROVAL ========= */
.approve-grid {
  display: flex;
  flex-direction: row;
}

.approve-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-card);
  margin: 8px;
}

.approve__title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-strong);
}

.badge {
  position: absolute;
  right: 20px;
  top: 25px;
  font-size: 36px;
  font-weight: 200;
}

.badge.blue {
  color: var(--blue);
}

.badge.red {
  color: var(--accent);
}

/* ========= PROCESSES ========= */
.proc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}

.proc-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  min-height: 120px;
  box-shadow: var(--shadow-card);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-strong);
  transition: transform 0.5s ease, box-shadow 0.5s ease;
  cursor: pointer;

}

.proc-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.proc-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--white);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: .2s;

}

.proc-arrow:hover {
  background: var(--accent);
  color: var(--white);
}

/* ========= RESPONSIVE ========= */

@media (max-width: 1512px) {
  .task-summary {
    margin-top: 20px;
    display: flex;
    justify-content: start;
    opacity: 0.8;
    flex-direction: column;
  }
}

@media (max-width: 1279.98px) {
  .container {
    padding: 20px 24px 40px;
  }
}

@media (max-width: 1199.98px) {
  .tasks-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .my-tasks {
    grid-column: span 2;
  }

  .proc-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .mini {
    flex: 0 0 calc((100% - 16px) / 2);
  }

  .task-summary {
    margin-top: 20px;
    display: flex;
    justify-content: start;
    opacity: 0.8;
    flex-direction: row;
  }
}

@media (max-width: 1023.98px) {
  .sidebar {
    width: 56px;
    padding-top: 12px;
    border-right: none;
    background: transparent;
  }

  .burger {
    display: flex;
  }

  .side-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 220px;
    padding-top: 72px;
    background: var(--white);
    border-right: 1px solid var(--border);
    transform: translateX(-100%);
    opacity: 0;
  }

  .side-nav.open {
    transform: translateX(0);
    opacity: 1;
  }

  .overlay.show {
    display: block;
  }

  .topbar {
    left: 0;
  }

  .page {
    margin-left: 0;
  }

  .topnav__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .topnav__list {
    position: fixed;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    gap: 14px;
    display: none;
    z-index: 6;
  }

  .topnav__list.open {
    display: flex;
    flex-wrap: wrap;
  }

  .approve-grid {
    flex-wrap: wrap;
  }

  .box-send-task {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    gap: 1.5rem;
  }

  .mini-scroll {
    margin: 20px 0 0 0;
  }

  .task-summary {
    margin-top: 20px;
    flex-direction: row;
    gap: 1.5rem;
  }

  .task-card {
    /* padding-bottom: 32px; */
  }
}

@media (max-width: 800px) {
  .task-summary .block-task h3 {
    max-width: 50px;
  }
}

@media (max-width: 767.98px) {
  .container {
    padding: 16px;
  }

  .tasks-grid {
    grid-template-columns: 1fr;
  }

  .mini {
    flex: 0 0 40%;
  }

  .approve-grid {
    flex-direction: column;
  }

  .proc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .task-summary .block-task h3 {
    max-width: 150px;
  }
}

@media (max-width: 559.98px) {
  .proc-grid {
    grid-template-columns: 1fr;
  }

  .my-tasks {
    grid-column: span 1;
  }

  .fade-left {
    display: none;
  }

  .fade-right {
    display: none;
  }

  .mini-scroll-wrap {
    padding: 0;
  }

  .scroll-btn {
    display: none;
  }
}

@media (max-width: 400px) {
  .task-summary .stats {
    max-width: 50px;
  }

  .task-summary .block-task h3 {
    max-width: 50px;
  }
}

.autocomplete {
  position: relative;
  width: 100%;
}

.autocomplete-list {
  position: absolute;
  top: 38px;
  left: 0;
  right: 0;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
  padding: 6px 0;
  margin: 4px 0 0;
  display: none;
  z-index: 10;
}

.autocomplete-list li {
  padding: 8px 14px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.2s;
}

.autocomplete-list li:hover {
  background: #f5f5f5;
}




/* ---- input-pill контейнер ---- */
.input-field-text {
  display: flex;
  align-items: flex-start;
  background: #EFEFEF;
  border-radius: 20px;
  /* убрал 999px, чтобы при росте смотрелось нормально */
  padding: 0 12px;
  box-sizing: border-box;
  min-height: 34px;
  height: auto;
  /* <---- чтобы рос */
  transition: height 0.1s ease;
  margin-top: 8px;
  /* margin-right: 48px; */
}

/* 2. textarea растёт без скролла */
.input-field-text textarea {
  all: unset;
  display: block;
  width: 100%;
  font-size: 13px;
  line-height: 1.3;
  font-family: inherit;
  box-sizing: border-box;
  min-height: 22px;
  padding: 8px 0;
  resize: none;
  overflow: hidden;
  background: transparent;
  color: #222;
}

/* если нужно ограничение роста — при достижении max появится скролл */
.input-field-text textarea.maxed {
  overflow: auto;
}

/* фокус: тонкая подсветка */
.input-field-text:focus-within {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(227, 0, 44, 0.15);
}



/* ===== Custom Date picker styles ===== */
.date-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* width: 100%; */
  min-width: 150px;
  margin-top: 8px;
}

.date-label {
  font-size: 12px;
  color: var(--muted-2);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* pill container */
.input-field.date-picker {
  background: #EFEFEF;
  border-radius: 999px;
  padding: 6px 12px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 180px;
}

/* visible pill */
.date-display {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-display .fa-calendar {
  font-size: 16px;
  color: var(--muted-2);
  width: 18px;
  text-align: center;
}

.date-text {
  font-size: 13px;
  color: var(--text-strong);
}

/* clear button */
.clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  border-radius: 8px;
  padding: 4px;
  transition: color .15s, background .15s, opacity .12s;
  opacity: 0;
  pointer-events: none;
}

.clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.clear-btn:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-strong);
}

/* Calendar popup (attached to body) */
.r4s-calendar {
  position: fixed;
  width: 308px;
  background: #2b2b2b;
  /* dark popup like mac native in your screenshots */
  color: #fff;
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  padding: 12px;
  z-index: 2147483647;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
  user-select: none;
}

/* header */
.r4s-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.r4s-cal-title {
  font-weight: 700;
  font-size: 16px;
}

.r4s-cal-nav {
  display: flex;
  gap: 8px;
}

.r4s-cal-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
}

/* week days row */
.r4s-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  text-align: center;
}

/* days grid */
.r4s-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.r4s-day {
  width: 36px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  color: #fff;
}

.r4s-day:hover {
  background: rgba(255, 255, 255, 0.06);
}

.r4s-day.outside {
  color: rgba(255, 255, 255, 0.35);
  cursor: default;
}

.r4s-day.today {
  outline: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
}

.r4s-day.selected {
  background: #6ea8ff;
  color: #0b2340;
  font-weight: 600;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

/* footer: clear / today */
.r4s-footer {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.r4s-footer button {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 13px;
  padding: 6px 8px;
}

.r4s-footer button:hover {
  text-decoration: underline;
}

/* small */
@media (max-width: 480px) {
  .r4s-calendar {
    width: 260px;
    padding: 8px;
  }

  .r4s-day {
    width: 34px;
    height: 30px;
    font-size: 13px;
  }
}


/* attach (paperclip) button: same visual language as clear-btn */
.attach-btn {
  position: relative;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted-2);
  border-radius: 50px;
  padding: 6px;
  transition: color .15s, background .15s;
  background: rgba(0, 0, 0, 0.04);
  margin-left: 5px;
}

.attach-btn:hover {
  background: rgba(0, 0, 0, 0.09);
  color: var(--text-strong);
}

/* small badge showing number of attached files */
.attach-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 12px;
  height: 12px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: none;
  /* shown only when files attached */
  align-items: center;
  justify-content: center;
  display: inline-flex;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

/* show when count > 0 */
.attach-count.visible {
  display: inline-flex;
}

.block-piker-attach {
  display: flex;
  flex-direction: row;
  align-items: end;
}


/* ===== МОИ ПАПКИ ===== */
.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  padding-top: 8px;
}

.folder-card {
  background: var(--white);
  border: 1px solid #E2E2E2;
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /* ВАЖНО — иконка фиксируется сверху */
  justify-content: flex-start;
  gap: 8px;
  min-height: 120px;
  /* чтобы не сжимались визуально */
}

.folder-card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
}

.folder-icon {
  font-size: 32px;
  color: var(--accent);
  width: 52px;
  height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  /* не сжимается */
  display: flex;
  align-items: center;
  justify-content: center;
}

.folder-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-strong);
  width: 100%;
  /* главное правило для многострочного текста */
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Карточка "Создать папку" */
.folder-card.add-folder {
  border: 2px dashed #ccc;
  background: transparent;
  box-shadow: none;
}

.folder-card.add-folder .folder-icon {
  background: transparent;
  color: #888;
}

.folder-card.add-folder:hover {
  border-color: var(--accent);
}

.folder-card.add-folder:hover .folder-icon {
  color: var(--accent);
}


.onec-block {
  background: #ffffff;
  border-radius: 18px;
  padding: 22px 26px;
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.06),
    0 8px 18px rgba(0, 0, 0, 0.07);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 360px;
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.onec-block:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}


.onec-title {
  font-size: 18px;
  font-weight: 700;
  color: #2b2b2b;
  margin-bottom: 4px;
}

.onec-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.onec-label {
  font-size: 13px;
  color: #7a7a7a;
}

.onec-value {
  font-size: 18px;
  font-weight: 600;
  color: #8a8a8a;
  letter-spacing: -0.3px;
}

.onec-bad {
  color: #e3002c;
}

.onec-label.onec-count {
  font-size: 18px;
  font-weight: 600;
}

.onec-value.onec-count{
  color: #656565;

}