/* ===== PROJECT LAYOUT ===== */

body {
  font-family: Roboto, Helvetica, Arial, sans-serif;
}

.project-hub-wrapper {
  font-family: 'Roboto', system-ui, -apple-system, sans-serif;
}

.project-layout,
.project-main {
  overflow: visible;
}


/* Wrapper giới hạn chiều ngang */
.project-hub-wrapper {
  width: 100%;
  max-width: 100%;
  padding: 0 40px;
}

/* Tablet */
@media (max-width: 1024px) {
  .project-hub-wrapper {
    padding: 0 15px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .project-hub-wrapper {
    padding: 0px;
  }
}


/* ===== GRID HUB ===== */

/* Desktop */
.project-hub {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 220px;
  gap: 20px;
  align-items: start;
}

/* Mobile */
@media (max-width: 768px) {
  .project-hub {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}


/* ===== TOOLBAR ===== */
/* Toolbar là CON TRỰC TIẾP của grid */

/* TOOLBAR GRID */
.project-toolbar-wrap {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 50;

  background: rgba(255, 255, 255, 0.92); /* 🔥 che content */
  backdrop-filter: blur(6px);            /* 🔥 phủ mịn */
  -webkit-backdrop-filter: blur(6px);

  border-bottom: 1px solid #e5e7eb;       /* tách lớp nhẹ */

}

/* Tránh layout nhảy */
.project-toolbar {
  min-height: 64px; /* chỉnh đúng chiều cao thực tế toolbar */
  background: #F0F0F1;
}

.project-content {
  padding-top: 16px; /* hoặc = spacing design */
}

/* TOOLBAR LAYOUT */
.project-toolbar {
  width: 100%;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
  column-gap: 30px;
  padding: 16px 0;
}

/* LEFT */
.toolbar-left {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 15px;
}

.toolbar-title-row {
  display: flex;
  align-items: center;
  width: 100%;
}

/* TITLE CHÍNH */
.project-toolbar-title {
  font-size: 26px;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
  color: #005891;
}

/* BREADCRUMB PHỤ */
.project-breadcrumb {
  margin-top: 4px;
  font-size: 10px;
  color: #A2A2A2;
}

.project-breadcrumb .bc-item {
  color: inherit;
  text-decoration: none;
}

.project-breadcrumb .bc-item:hover {
  text-decoration: underline;
}

.project-breadcrumb .bc-sep {
  margin: 0 6px;
  color: #aaa;
}


/* ======RIGHT===== */
.toolbar-right {
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr auto; /* 🔥 CHUẨN */
  align-items: start;
  gap: 10px;
  min-width: 0; /* 🔥 RẤT QUAN TRỌNG */
}



/* SEARCH */
.toolbar-search {
  min-width: 0;          /* 🔥 cho phép co */
}

.toolbar-search input {
  max-width: 360px;      /* 🔥 GIỚI HẠN */
}


.toolbar-controls {
  height: 40px;
  display: flex;
  align-items: flex-start; /* 🔥 CHỐT */
  gap: 0;
  white-space: nowrap;
}

.toolbar-controls button {
  text-transform: none;
}

.toolbar-view {
  margin-left: 15px;
}

.toolbar-filter {
  position: relative;
}

.filter-btn {
  height: 40px;
  padding: 0 14px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 10px;
}

.filter-btn:hover {
  background: #f8fafc;
}

.filter-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 120px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  display: none;
  z-index: 20;
}

.toolbar-filter.is-open .filter-dropdown {
  display: block;
}

.filter-btn.is-active {
  background: #8DD9E8;
  border-color: #019EDD;
  color: #2563eb;
}


.filter-dropdown button {
  display: block;
  width: 100%;
  padding: 0px 12px;          /* gọn hơn */
  font-size: 13px;
  line-height: 1.15;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.filter-dropdown button,
.arrange-dropdown button {
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.filter-dropdown button:hover {
  background: #8DD9E8;        /* hover fill full hàng */
}

.filter-dropdown button.is-active {
  font-weight: 600;
  color: #2563eb;
}



/* ===== ARRANGE ===== */

.toolbar-arrange {
  position: relative;

}

.arrange-btn {
  height: 40px;
  padding: 0px 12px;          /* cho chỗ chứa chữ */
  display: inline-flex;     /* 🔥 QUAN TRỌNG */
  align-items: center;

  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;

  margin-bottom: 10px;
}


.arrange-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.arrange-btn svg {
  display: block;
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* HOVER */
.arrange-btn:hover {
  color: #0f172a;
  background: #f8fafc;
}

/* 🔵 ACTIVE / SELECTED */
.arrange-btn.is-active {
  background: #8DD9E8;
  border-color: #019EDD;
  color: #2563eb;
}


.arrange-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 180px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.08);
  display: none;
  z-index: 20;
}

.toolbar-arrange.is-open .arrange-dropdown {
  display: block;
}

.arrange-dropdown button {
  display: block;
  width: 100%;
  padding: 0px 12px;          /* gọn hơn */
  font-size: 13px;
  line-height: 1.15;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.arrange-dropdown button:hover {
  background: #8DD9E8;        /* hover fill full hàng */
}

.filter-dropdown button,
.arrange-dropdown button {
  text-transform: none;
}

.filter-dropdown,
.arrange-dropdown {
  padding: 6px 0;   /* 👈 chỉnh ở đây: 0 / 2 / 4 tuỳ ý */
}

/* Màu active Filter và Arrange */
.filter-btn.is-active,
.arrange-btn.is-active {
  background: #8BDCAA;
  border-color: #4893AF;
  color: #00467F;
}


.filter-dropdown button.is-active,
.arrange-dropdown button.is-active {
  background: #8BDCAA;
  border-color: #4893AF;
  color: #00467F;
}

.toolbar-filter,
.toolbar-arrange {
  position: relative;
}

.toolbar-state {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.1;
  color: #6b7280;      /* xám nhạt */
  font-weight: 500;
  white-space: nowrap;
}


.toolbar-states-row {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* text trạng thái */
.toolbar-states {
  display: flex;
  gap: 10px;
}

.toolbar-state {
  font-size: 11px;
  line-height: 1.1;
  color: #6b7280;
  font-weight: 500;
  white-space: nowrap;
}


/* VIEW */
.toolbar-view {
  height: 40px;
  display: inline-flex;
  align-items: justify-content;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
}

.view-btn {
  width: 30px;
  height: 100%;
  padding: 0px;

  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;


  border: none;
  background: #fff;
  cursor: pointer;
}


.view-btn svg {
  width: 28px;
  height: 28px;
  display: grid;          /* 🔥 diệt inline baseline */
  fill: #334155;
}

.view-btn {
  box-sizing: border-box;
}
.toolbar-view .view-btn.is-active {
  background: #A6C0C9;
}


.view-btn:hover svg {
  fill: #0f172a;
}


button {
  font-family: inherit;
}


/* ===== SIDEBAR ===== */

.project-sidebar {
  grid-column: 1;
}

/* ===== CONTENT ===== */

.project-content {
  grid-column: 2;
  min-width: 0;
  padding-right: 20px;
  border-right: 1px solid #f1f5f9;

  margin-left: 10px;   /* 👈 thêm dòng này */
}

/* ===== META RAIL ===== */

.project-meta-rail {
  grid-column: 3;
}

.guide-rail-toc ul ul {
  display: none;
}

/* ===== GUIDE RAIL STICKY ===== */

.project-meta-rail--guide {
  position: sticky;
  top: 80px; /* chỉnh theo chiều cao toolbar */
  align-self: start;
}



/* =========================
   META RAIL – PRO UI
   ========================= */

.project-meta-rail {
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  padding: 20px 16px;
  font-family: Inter, system-ui, sans-serif;
}

/* Section */
.project-meta-rail .rail-section {
  margin-bottom: 20px;
}

.project-meta-rail h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #6b7280;
}

/* List reset */
.project-meta-rail ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Item */
.project-meta-rail li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.project-meta-rail li:last-child {
  border-bottom: none;
}

/* Label */
.project-meta-rail .rail-label {
  font-size: 14px;
  color: #374151;
}

/* Value */
.project-meta-rail strong {
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

/* Subtle hover */
.project-meta-rail li:hover {
  background: #f9fafb;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 768px) {
  .project-meta-rail {
    border-left: none;
    border-top: 1px solid #e5e7eb;
    padding: 16px;
  }
}



/* ===== MOBILE: ẨN META RAIL ===== */
@media (max-width: 768px) {

  .project-meta-rail {
    display: none;
  }

}


/* ===== CSS Toobar Search có clear Filter, Search ===== */
.toolbar-search {
  position: relative;
}

.search-input {
  width: 100%;
  padding-right: 15px; /* đủ chỗ cho 2 nút X */
}

.search-actions {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 2px;  
}

.search-clear {
  width: 14px;
  height: 14px;
  border-radius: 50%;

  display: flex;          /* 🔥 BẮT BUỘC */
  align-items: center;           /* 🔥 center dọc */
  justify-content: center;       /* 🔥 center ngang */

  font-size: 11px;
  line-height: 1;                /* OK vì đã flex */
  padding: 0;
  border: none;
  background: transparent;

  cursor: pointer;
  opacity: .6;
}

.search-clear:hover {
  opacity: 1;
  color: #00528B;
  background: #C6D3DE;
}


/* ===== MOBILE SIDEBAR TOGGLE BUTTON ===== */

.sidebar-toggle {
  display: none; /* desktop ẩn */
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  margin-left: 10px;
  color: #005891;
}


/* ===== MOBILE TOOLBAR ===== */
@media (max-width: 768px) {

  .project-toolbar {
    grid-template-columns: 1fr;   /* 🔥 QUAN TRỌNG NHẤT */
    padding-left: 0px;
    padding-right: 0px;
  }


  .toolbar-title-row {
    display: flex;
    align-items: baseline;
    width: 100%;
  }

  .project-toolbar-title {
    flex: 1;          /* 🔥 chiếm hết phần trái */
    margin-right: 0;  /* 🔥 XOÁ hack */
  }

  /* Wrapper bỏ padding để nền xám full */
  .project-hub-wrapper {
    padding: 0;
  }
}

/* ===== PROJECT TITLE LINK STYLE ===== */

.project-toolbar-title a {
  color: inherit;
  text-decoration: none;
  padding: 2px 6px;
  margin-left: -8px;
  border-radius: 6px;
  transition: background .2s ease, color .2s ease;
}

.project-toolbar-title a:hover {
  background: #8BDCAA;
  color: #273955;
}

@media (max-width: 768px) {

  /* Left & Right rớt hàng */
  .toolbar-left,
  .toolbar-right {
    grid-column: 1;
  }

  .toolbar-left {
    grid-column: 1 / -1;
    margin-bottom: 5px;
    width: 100%;
  }
    /* RIGHT rớt xuống dưới */
  .toolbar-right {
    grid-template-columns: 1fr;
    margin-top: 5px;
    row-gap: 2px;
    background: #FFFFFF;
  }

}

@media (max-width: 768px) {

  .project-breadcrumb {
    margin-top: 0px;
    font-size: 11px;
    line-height: 1.2;     /* 🔥 thu chiều cao dòng */
    width: 100%;
  }

}


@media (max-width: 768px) {

  .sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-left: auto;     /* đẩy phải */
    padding: 2px;          /* hit-area đẹp */
    font-size: 22px;
    line-height: 1;
    margin-bottom: 0px;

    transform: translateY(2px); /* 🔥 hạ nhẹ xuống đúng “đáy chữ” */
  }

}


@media (max-width: 768px) {
  .project-meta-rail {
    display: none;
  }

  .project-content {
    grid-column: 1 / -1;
    width: 100%;
    padding-top: 10px;
    padding-right: 5px;
    border-right: none;

    margin-left: 0;

    text-align: justify;
    text-justify: inter-word;
  }

}

@media (max-width: 768px) {

  .filter-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    min-width: 120px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
    display: none;
    z-index: 20;
  }
}



/* ===== GUIDE NAV BUTTON SYSTEM ===== */

.toolbar-guide .toolbar-right {
  display: flex;
  align-self: end;
  gap: 16px;
  position: relative;
  top: 22px;   /* đẩy xuống mà không tăng chiều cao toolbar */
}

.toolbar-guide .toolbar-right a,
.toolbar-guide .toolbar-right span,
.toolbar-guide .toolbar-right button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  height: 32px;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  background: transparent;
  border: none;
  color: #374151;
}

.toolbar-guide .is-disabled {
  opacity: .35;
  pointer-events: none;
}

.toolbar-guide .guide-voice-btn {
  margin-left: auto;
}
.toolbar-guide .toolbar-right {
  padding-right: 230px;
}


@media (min-width: 769px) {

  .toolbar-guide .toolbar-right a,
  .toolbar-guide .toolbar-right span,
  .toolbar-guide .toolbar-right button {

    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;

    height: 34px;
    padding: 0 14px;

    transition: all .2s ease;
  }

  .toolbar-guide .toolbar-right a:hover,
  .toolbar-guide .toolbar-right button:hover {
    background: #8BDCAA;
    border-color: #4893AF;
    color: #00467F;
  }

}


@media (max-width: 768px) {
  .toolbar-guide .toolbar-right {
    gap: 8px;
  }
}


@media (max-width: 768px) {

  .toolbar-guide-wrap {
    border-bottom: 1px solid #e5e7eb;
  }

}
@media (max-width: 768px) {

  .toolbar-guide .toolbar-right {
    top: 10px;   /* desktop là 20px, mobile chỉ cần 5px */
    height: 30px;
    font-size: 14px;
  }
    .toolbar-guide .toolbar-right {
      padding-right: 5px;
    }

}

/* ===== CSS SEND EMAIL ===== */
/* ===== SEND EMAIL MODAL ===== */

.guide-email-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: none;
  z-index: 9999999;
  padding: 5px 5px;
}

.guide-email-modal.is-open {
  display: block;
}

/* Center tuyệt đối */
.guide-email-modal__inner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: 480px;
  max-width: 90%;
  background: #fff;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}


/* ===== Toolbar Mobile Meta ===== */

.toolbar-mobile-meta {
  display: none;
  align-items: center;
  gap: 0px;
}

.toolbar-mobile-meta button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* Chỉ hiện mobile */
/* ===== Mobile only ===== */
@media (max-width: 768px) {

  .toolbar-mobile-meta {
    display: flex;
    align-items: center;
    gap: 0px;            /* ↓ giảm khoảng cách */
  }

  .toolbar-mobile-meta button {
    padding: 0;    /* ↓ bỏ padding dư */
    font-size: 16px;     /* ↓ icon nhỏ lại chút */
    line-height: 1;
  }

}

@media (max-width: 768px) {

  .toolbar-guide-actions {
    flex: 0 0 auto !important;
    width: auto !important;
    justify-content: flex-end !important;
    gap: 2px;
  }

  .toolbar-guide-actions > * {
    flex: 0 0 auto !important;
  }

}

@media (max-width: 768px) {

  .toolbar-guide .toolbar-right .toolbar-mobile-meta button {
    height: auto;
    padding: 0;
    background: none;
    border: none;
  }

  .toolbar-mobile-meta .guide-action-btn.like {
    position: relative;
    top: -4px;
  }

}

/* ===== LIKE MOBILE – MÀU CHƯA ACTIVE ===== */
@media (max-width: 768px) {

  .toolbar-mobile-meta .guide-action-btn.like {
    color: #E7C2C9;     /* 👈 màu nhẹ khi chưa active */
    border: #C2476A;
  }

  .toolbar-mobile-meta .guide-action-btn.like.is-active {
    color: #e11d48;     /* 👈 giữ màu đỏ khi active */
  }

}

/* ===== CSS cho Archive guide ===== */


