/* Recent documents modal styles */
.recent-modal{
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:clamp(18px,2.6vw,28px);
  padding-bottom:clamp(12px,2vw,20px);
}

.recent-modal__head{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  font-weight:600;
}

.recent-modal__head .muted{
  flex:1 1 100%;
  font-weight:400;
}

.recent-filters{
  border:1px solid rgba(255,255,255,0.18);
  border-radius:14px;
  padding:14px;
  background:rgba(9,37,74,0.45);
}

.recent-body{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.recent-search{
  display:flex;
  align-items:center;
  gap:8px;
}

.recent-search input{
  flex:0 0 260px;
  max-width:100%;
}

.recent-table-wrap{
  border:1px solid rgba(255,255,255,0.14);
  border-radius:16px;
  background:rgba(3,18,40,0.55);
  padding:8px;
  max-height:min(72vh, 640px);
  overflow:auto;
}

.recent-row{
  cursor:pointer;
  transition:background 0.16s ease;
}

.recent-row:hover,
.recent-row.is-expanded{
  background:rgba(255,255,255,0.06);
}

.recent-doc-cell{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.recent-doc-kind{ font-size:0.85rem; opacity:0.85; text-transform:uppercase; }
.recent-doc-number{ font-size:1rem; font-weight:700; }
.recent-doc-date{ font-size:0.85rem; opacity:0.8; }

.recent-client-cell{ font-weight:600; }
.recent-action-cell{ min-width:140px; }

.recent-action-select{
  width:100%;
  min-height:40px;
  border-radius:12px;
  background:rgba(12,32,60,0.85);
  border:1px solid rgba(255,255,255,0.22);
  color:#fff;
  padding:6px 10px;
  box-shadow:0 6px 16px rgba(0,0,0,0.25);
  transition:box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

.recent-action-select:focus-visible{
  outline:2px solid rgba(255,255,255,0.55);
  outline-offset:2px;
  border-color:rgba(255,255,255,0.55);
  box-shadow:0 8px 18px rgba(0,0,0,0.35);
}

.recent-action-select option{
  color:#0b2546;
  background:#f4f8ff;
}

.recent-detail-row{
  display:none;
}

.recent-detail-row.is-visible{
  display:table-row;
}

.recent-detail-row td{
  padding:0;
  background:rgba(9,37,74,0.45);
  border-top:1px solid rgba(255,255,255,0.1);
}

.recent-detail-body{
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.recent-detail-list{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.recent-detail-pos{
  display:grid;
  grid-template-columns:minmax(0,1.6fr) repeat(3, minmax(0,0.7fr));
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid rgba(255,255,255,0.08);
}

.recent-detail-pos:last-child{ border-bottom:none; }

.recent-detail-name{ font-weight:600; }
.recent-detail-qty,
.recent-detail-price,
.recent-detail-total{
  text-align:right;
  font-variant-numeric:tabular-nums;
}

.recent-detail-empty{
  padding:12px;
  border-radius:10px;
  background:rgba(255,255,255,0.05);
  text-align:center;
}

.recent-table-wrap table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
}

#recentTable{
  table-layout:auto;
}

#recentTable col:nth-child(1){ width:260px; }
#recentTable col:nth-child(2){ width:auto; }
#recentTable col:nth-child(3){ width:130px; }
#recentTable col:nth-child(4){ width:150px; }

#recentTable .recent-client-cell{ text-align:left; }

.recent-table-wrap th{
  position:sticky;
  top:0;
  background:#0a4f89;
  z-index:2;
}

.recent-table-wrap tbody tr + tr td{
  border-top:1px solid rgba(255,255,255,0.08);
}

.recent-print-modal{
  display:flex;
  flex-direction:column;
  gap:14px;
}

.recent-print-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

.recent-print-footer{
  display:flex;
  justify-content:flex-end;
}

.recent-email-modal{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.recent-email-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.recent-email-checkbox{
  display:flex;
  gap:8px;
  align-items:center;
}

@media (max-width:780px){
  .recent-search{ flex-direction:column; align-items:flex-start; }
  .recent-search input{ width:100%; flex:1 1 auto; }
  .recent-action-cell{ min-width:0; }
  .recent-detail-pos{ grid-template-columns:minmax(0,1fr) repeat(3, minmax(0,0.7fr)); }
}

@media (min-width:921px){
  #recentTable .recent-client-cell{ text-align:center; }
}
