
.docsPageShell [id] {
  scroll-margin-top: calc(var(--app-topbar-height, 72px) + 24px);
}

.docsMobileTabs {
  display: none;
}

.docsMobileTab {
  text-decoration: none;
}
/* ===== Documents page ===== */
.docsPageShell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.docsHero {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 2px;
  padding: 6px 2px 2px;
}

.docsEyebrow {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #e87722;
  margin-bottom: 8px;
}

.docsTitle {
  margin: 0;
  font-size: 40px;
  line-height: 1.04;
  font-weight: 900;
  color: #0b2742;
}

.docsLead {
  margin: 10px 0 0;
  max-width: 720px;
  font-size: 15px;
  line-height: 1.55;
  color: #5f6f85;
  font-weight: 600;
}

.docsHeroActions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.docsSummaryPill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(11, 58, 102, 0.10), rgba(232, 119, 34, 0.10));
  border: 1px solid rgba(11, 58, 102, 0.14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.docsSummaryValue {
  font-size: 18px;
  font-weight: 900;
  color: var(--docs-summary-value);
}

.docsSummaryLabel {
  font-size: 12px;
  font-weight: 800;
  color: var(--docs-summary-label);
  white-space: nowrap;
}
.docsAddBtn { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; padding: 0 18px; font-weight: 800; }
.docsStatsGrid { margin-top: 0; gap: 16px; }

.docsStatCard {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 18px 18px 16px;
  border: 1px solid rgba(219, 223, 228, 0.95);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 28px rgba(16, 24, 40, 0.07);
}

.docsStatCard::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #0b3a66, #e87722);
  opacity: 0.95;
}

.docsStatCard.toneIncoming::before { background: linear-gradient(90deg, #1570ef, #53b1fd); }
.docsStatCard.tonePending::before { background: linear-gradient(90deg, #e87722, #f5b041); }
.docsStatCard.toneComplete::before { background: linear-gradient(90deg, #12b76a, #6ce9a6); }
.docsStatCard.toneOverdue::before { background: linear-gradient(90deg, #d92d20, #f97066); }
.docsStatCard:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(16, 24, 40, 0.10); }
.docsStatCard.isActive {
  border-color: rgba(11, 58, 102, 0.22);
  box-shadow: 0 16px 32px rgba(11, 58, 102, 0.10);
}
.docsStatCard .statValue { color: #101828; }
.docsStatHeader { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.docsStatHint { margin-top: 4px; color: #667085; font-size: 12px; font-weight: 700; }

.docsQuickFilters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.docsQuickFilter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.95);
  background: rgba(248, 250, 252, 0.95);
  color: #344054;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  transition: background .12s ease, border-color .12s ease, color .12s ease, transform .12s ease;
}

.docsQuickFilter span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(11, 58, 102, 0.08);
  color: #0b3a66;
  font-size: 11px;
  font-weight: 900;
}

.docsQuickFilter:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.98);
  border-color: rgba(11, 58, 102, 0.20);
}

.docsQuickFilter.isActive {
  background: linear-gradient(135deg, rgba(11, 58, 102, 0.10), rgba(232, 119, 34, 0.10));
  border-color: rgba(11, 58, 102, 0.22);
  color: #0b3a66;
}

.docsControlsCard {
  background: linear-gradient(180deg, rgba(255,255,255,0.97), rgba(248,250,252,0.96));
  border: 1px solid rgba(222, 227, 232, 0.96);
  box-shadow: 0 14px 34px rgba(16, 24, 40, 0.08);
  border-radius: 22px;
  padding: 18px;
  backdrop-filter: blur(10px);
}

.docsControlsTop,
.docsTableTopbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.docsSectionTitle { font-size: 16px; font-weight: 900; color: #0f1728; }
.docsSectionSub { margin-top: 4px; color: #667085; font-size: 13px; font-weight: 600; }

.docsClearFilters {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(11, 58, 102, 0.14);
  background: rgba(11, 58, 102, 0.04);
  color: #0b3a66;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.docsClearFilters:hover { background: rgba(11, 58, 102, 0.08); }

.docsControlsGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 16px;
}

.docsToolbarSearch,
.docsToolbarFilters {
  height: 100%;
  margin: 0;
  border-radius: 18px;
  box-shadow: none;
  padding: 16px;
  border: 1px solid rgba(203, 213, 225, 0.75);
  background: linear-gradient(180deg, rgba(248,250,252,1), rgba(244,247,250,0.98));
  backdrop-filter: none;
}

.docsToolbarSearch { grid-template-columns: minmax(0, 1fr) 220px 132px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.65); }
.docsToolbarFilters { grid-template-columns: repeat(3, minmax(0, 1fr)) 128px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.65); }
.docsToolbarSearch .search,
.docsToolbarSearch .select,
.docsToolbarFilters .select,
.docsToolbarFilters .date { background: rgba(255,255,255,0.95); }
.docsSearchControl,
.docsSortControl { min-width: 0; }
.docsControlBtn { height: 42px; align-self: end; }

.docsTableWrap {
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(249,250,251,0.98));
  border: 1px solid rgba(224, 229, 234, 0.98);
  box-shadow: 0 16px 40px rgba(16, 24, 40, 0.09);
  overflow: auto;
}

.docsTableTopbar {
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eef2f6;
  background: linear-gradient(180deg, rgba(255,255,255,0.72), rgba(248,250,252,0.88));
}

.docsResultsMeta {
  font-size: 12px;
  font-weight: 800;
  color: #5f6b7a;
  white-space: nowrap;
}

.docsTableModern {
  width: 100%;
  min-width: 1100px;
  border-collapse: separate;
  border-spacing: 0;
}

.docsTableModern th,
.docsTableModern td {
  padding: 18px 16px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: top;
}

.docsTableModern th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: linear-gradient(180deg, #123E66, #0B3A66);
  color: #ffffff;
  text-align: left;
  font-size: 11.5px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.docsTableModern th:not(:last-child) { border-right: 1px solid rgba(255,255,255,0.08); }
.docsTableModern tbody tr { background: rgba(255, 255, 255, 0.94); transition: background .12s ease; }
.docsTableModern tbody tr:hover { background: linear-gradient(90deg, rgba(255,247,237,0.78), rgba(255,255,255,0.98)); }
.docsTableModern .chip { font-size: 11px; letter-spacing: .02em; }
.docsTableModern tbody tr,
.docsTableModern tbody tr td { cursor: pointer; }

.docsRow.rowToneIncoming { background: linear-gradient(90deg, rgba(219, 234, 254, 0.28), rgba(255,255,255,0.95)); }
.docsRow.rowTonePending { background: linear-gradient(90deg, rgba(254, 242, 242, 0.55), rgba(255,255,255,0.96)); }
.docsRow.rowToneIncoming:hover { background: linear-gradient(90deg, rgba(219, 234, 254, 0.42), rgba(255,255,255,0.98)); }
.docsRow.rowTonePending:hover { background: linear-gradient(90deg, rgba(254, 226, 226, 0.72), rgba(255,255,255,0.98)); }
.docsRow td:first-child { border-left: 4px solid transparent; }
.docsRow.rowToneIncoming td:first-child { border-left-color: #1570ef; }
.docsRow.rowTonePending td:first-child { border-left-color: #d92d20; }
.docsRow.rowToneComplete td:first-child,
.docsRow.rowToneNeutral td:first-child { border-left-color: transparent; }

.docStatusCell,
.docInfoCell,
.routeInfoCell,
.docStateCell,
.latestRemarkCell,
.requesterCell,
.daysCellWrap,
.deadlineCell {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.docStatusCell .chip,
.docStateCell .chip { align-self: flex-start; }
.docsTableModern .docStatusCell > .chip { font-size: 12px; padding: 7px 12px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.45); }
.docStatusBadges { display: flex; flex-wrap: wrap; gap: 6px; max-width: 230px; }

.docMiniBadge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(11, 58, 102, 0.16);
  background: rgba(11, 58, 102, 0.06);
  color: #0b3a66;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.docMiniBadge.warn { background: rgba(217,45,32,0.08); border-color: rgba(217,45,32,0.20); color: #b42318; }
.docMiniBadge.muted { background: rgba(102,112,133,0.09); border-color: rgba(102,112,133,0.16); color: #00ff1a; }
.docMiniBadge.new { background: rgba(102,112,133,0.09); border-color: rgba(102,112,133,0.16); color: #00ff2a; }

.docInfoTitle { font-size: 15px; line-height: 1.35; font-weight: 800; color: #0f1728; }
.docInfoMeta,
.docStateHint,
.requesterMeta,
.daysHintText { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: #667085; font-weight: 700; }
.docInfoTracking { color: #0b5ea8; font-weight: 900; }
.docMetaDot { color: #98a2b3; }

.routeLine { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 10px; align-items: start; }
.routeLabel {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  font-weight: 900;
  line-height: 1.5;
  white-space: nowrap;
}

.routeValue { font-size: 13px; line-height: 1.45; color: #475467; font-weight: 700; min-width: 0; }
.routeValue.strong { color: #111827; font-size: 14px; font-weight: 900; }
.docStateHint { max-width: 150px; }
.daysCellWrap { align-items: flex-start; }
.daysPill {
  display: inline-flex;
  min-width: 46px;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid #d7dde4;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: #344054;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.55);
}
.daysPill.warn { background: rgba(243,156,18,.11); border-color: rgba(243,156,18,.38); color: #b66a00; }
.daysPill.danger { background: rgba(217,45,32,.11); border-color: rgba(217,45,32,.30); color: #b42318; }
.requesterName { font-size: 14px; line-height: 1.35; font-weight: 800; color: #101828; }
.docsEmptyState { padding: 34px 18px !important; text-align: center; color: #667085; }

.latestRemarkCell { min-width: 0; min-height: 48px; justify-content: center; }
.latestRemarkText {
  font-size: 12px;
  line-height: 1.45;
  color: #344054;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.latestRemarkCell.hasRemark {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(11, 58, 102, 0.04);
  border: 1px solid rgba(11, 58, 102, 0.08);
}

.latestRemarkBlank { min-height: 18px; }
.docStateCell { gap: 6px; }
.docStateMain { display: inline-flex; align-items: center; gap: 8px; min-height: 22px; }
.docStateDot { width: 10px; height: 10px; border-radius: 999px; flex: 0 0 10px; background: #98a2b3; box-shadow: 0 0 0 4px rgba(152,162,179,0.12); }
.docStateText { font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; color: #344054; }
.docStateMain.isActive .docStateDot { background: #e87722; box-shadow: 0 0 0 4px rgba(232,119,34,0.14); }
.docStateMain.isTransit .docStateDot { background: #1570ef; box-shadow: 0 0 0 4px rgba(21,112,239,0.14); }
.docStateMain.isReleased .docStateDot { background: #12b76a; box-shadow: 0 0 0 4px rgba(18,183,106,0.14); }
.docStateMain.isArchived .docStateDot { background: #667085; box-shadow: 0 0 0 4px rgba(102,112,133,0.12); }

@media (max-width: 1200px) {
  .docsControlsGrid { grid-template-columns: 1fr; }
  .docsToolbarSearch { grid-template-columns: minmax(0, 1fr) 220px 132px; }
}

@media (max-width: 900px) {
  .docsHero,
  .docsControlsTop,
  .docsTableTopbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .docsTitle { font-size: 34px; }
  .docsHeroActions { width: 100%; justify-content: flex-start; }
  .docsToolbarSearch,
  .docsToolbarFilters { grid-template-columns: 1fr; }
  .docsControlBtn,
  .docsAddBtn,
  .docsClearFilters { width: 100%; }
  .docsQuickFilters { width: 100%; }
  .docsQuickFilter { width: 100%; justify-content: space-between; }
  .docsResultsMeta { white-space: normal; }
}


@media (max-width: 900px) {
  .docsPageShell { gap: 12px; }
  .docsPageShell [id] { scroll-margin-top: calc(var(--app-topbar-height, 62px) + 76px); }

  .docsMobileTabs {
    position: sticky;
    top: calc(var(--app-topbar-height, 62px) + env(safe-area-inset-top) + 8px);
    z-index: 16;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(203, 213, 225, 0.9);
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.08);
  }

  .docsMobileTab {
    min-width: 0;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    border-radius: 999px;
    color: #475467;
    background: rgba(248, 250, 252, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.95);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .02em;
  }

  .docsMobileTab.isActive {
    color: #0b3a66;
    background: linear-gradient(135deg, rgba(11, 58, 102, 0.10), rgba(232, 119, 34, 0.10));
    border-color: rgba(11, 58, 102, 0.16);
  }

  .docsHero { gap: 14px; padding: 2px 0 0; }
  .docsTitle { font-size: 24px; line-height: 1.08; }
  .docsLead { font-size: 12px; line-height: 1.45; margin-top: 6px; }
  .docsHeroActions { gap: 8px; }
  .docsSummaryPill, .docsAddBtn { min-height: 40px; }
  .docsSummaryPill { padding: 0 12px; gap: 8px; }
  .docsSummaryValue { font-size: 16px; }
  .docsSummaryLabel { font-size: 11px; }
  .docsAddBtn { padding: 0 14px; font-size: 12px; }

  .docsStatsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .docsStatCard {
    padding: 12px;
    border-radius: 16px;
  }

  .docsStatCard .statValue { font-size: 22px; }
  .docsStatHint { display: none; }
  .docsStatHeader .chip { display: none; }
  .docsControlsCard { padding: 12px; border-radius: 18px; }
  .docsSectionTitle { font-size: 14px; }
  .docsQuickFilters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    margin-top: 10px;
    scrollbar-width: none;
  }

  .docsQuickFilters::-webkit-scrollbar { display: none; }

  .docsQuickFilter {
    width: auto;
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 10px;
    font-size: 11px;
    gap: 6px;
    white-space: nowrap;
  }

  .docsQuickFilter span { min-width: 22px; height: 22px; font-size: 10px; }
  .docsControlsGrid { gap: 10px; margin-top: 12px; }
  .docsToolbarSearch,
  .docsToolbarFilters {
    padding: 12px;
    border-radius: 16px;
    gap: 10px;
  }

  .docsToolbarSearch label,
  .docsToolbarFilters label { font-size: 11px; }

  .docsTableWrap {
    overflow: visible;
    border-radius: 18px;
  }

  .docsTableTopbar { padding: 12px 14px; }

  .docsTableModern,
  .docsTableModern thead,
  .docsTableModern tbody,
  .docsTableModern tr,
  .docsTableModern td {
    display: block;
    width: 100%;
  }

  .docsTableModern {
    min-width: 0;
    border-spacing: 0;
  }

  .docsTableModern thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .docsTableModern tbody { padding: 8px; }

  .docsTableModern tbody tr {
    margin: 0 0 10px;
    padding: 12px;
    border: 1px solid rgba(224, 229, 234, 0.98);
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
    overflow: hidden;
  }

  .docsTableModern tbody tr:last-child { margin-bottom: 0; }
  .docsTableModern tbody tr td {
    padding: 0;
    border: 0;
    min-width: 0;
  }

  .docsRow td:first-child { border-left: 0; }
  .docsRow.rowToneIncoming,
  .docsRow.rowTonePending,
  .docsRow.rowToneComplete,
  .docsRow.rowToneNeutral { background: #fff; }
  .docsRow.rowToneIncoming::before,
  .docsRow.rowTonePending::before,
  .docsRow.rowToneComplete::before,
  .docsRow.rowToneNeutral::before {
    content: "";
    display: block;
    height: 3px;
    margin: -12px -12px 10px;
    background: linear-gradient(90deg, #0b3a66, #e87722);
  }

  .docsRow.rowToneIncoming::before { background: linear-gradient(90deg, #1570ef, #53b1fd); }
  .docsRow.rowTonePending::before { background: linear-gradient(90deg, #d92d20, #f97066); }

  .docsTableModern td + td { margin-top: 10px; }

  .docsTableModern td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 5px;
    color: #98a2b3;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
  }

  .docStatusCell,
  .docInfoCell,
  .routeInfoCell,
  .docStateCell,
  .latestRemarkCell,
  .requesterCell,
  .deadlineCell {
    gap: 5px;
  }

  .docStatusBadges { max-width: 100%; }
  .docInfoTitle,
  .routeValue,
  .requesterName,
  .latestRemarkText,
  .deadlineMetaLine,
  .docStateHint {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .docInfoTitle { font-size: 13px; }
  .docInfoMeta,
  .docStateHint,
  .requesterMeta,
  .routeValue,
  .deadlineMetaLine {
    font-size: 11px;
    line-height: 1.4;
  }

  .routeLine { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; }
  .routeLabel { font-size: 9.5px; }
  .routeValue.strong { font-size: 12px; }
  .latestRemarkCell.hasRemark { padding: 8px 10px; border-radius: 12px; }
  .deadlineBadge { align-self: flex-start; }
  .docsResultsMeta { font-size: 11px; }
}

@media (max-width: 560px) {
  .docsStatsGrid { grid-template-columns: 1fr 1fr; }
  .docsStatCard .statTitle { font-size: 10px; }
  .docsStatCard .statValue { font-size: 20px; }
}
