/* CSS riêng cho trang: folder-manager.html
   Đã thiết kế lại theo layout 2 cột giống account-settings.html:
   cột trái là cây thư mục (thay cho settings-nav), cột phải là các
   .card chi tiết (dùng chung .card/.field-*/.stat-row từ base.css). */

.main{max-width:1100px;}

.folder-layout{
  display:grid; grid-template-columns:280px 1fr; gap:24px;
}

/* ===== Cột trái: cây thư mục ===== */
.folder-nav{
  position:sticky; top:26px; align-self:start;
  background:var(--surface); border:1px solid var(--line); border-radius:8px;
  padding:14px; max-height:calc(100vh - 80px); overflow-y:auto;
}

.folder-nav-toolbar{display:flex; gap:8px; margin-bottom:10px;}
.folder-nav-toolbar .search-box{padding:7px 10px; min-width:0;}
.folder-nav-toolbar .btn-new{padding:0 12px; flex-shrink:0;}

.tree-wrap{padding:2px 0;}

.folder-row{
  display:flex; align-items:center; gap:7px;
  padding:8px 8px; border-radius:var(--radius);
  cursor:pointer; user-select:none; border:1px solid transparent;
  transition:background .12s ease, border-color .12s ease;
}
.folder-row:hover{background:var(--accent-soft);}
.folder-row.selected{background:var(--accent-soft); border-color:var(--accent);}
.folder-row.drag-over{border-color:var(--gold); background:var(--gold-soft);}
.folder-row.dragging{opacity:0.4;}

.drag-handle{color:var(--line-strong); cursor:grab; flex-shrink:0; display:flex; padding:1px;}
.drag-handle:hover{color:var(--ink-soft);}

.chev-btn{
  width:16px;height:16px;flex-shrink:0; display:flex; align-items:center; justify-content:center;
  background:none; border:none; cursor:pointer; color:var(--ink-soft); transition:transform .12s ease;
}
.chev-btn.open{transform:rotate(90deg);}
.chev-btn.hidden-chev{visibility:hidden;}

.folder-color-dot{width:8px;height:8px; border-radius:2px; flex-shrink:0;}
.folder-icon-sm{width:22px;height:22px;flex-shrink:0; border-radius:4px; background:var(--paper); border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:11px;}
.folder-name{flex:1; font-size:12.5px; color:var(--ink); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.folder-count-sm{font-family:'IBM Plex Mono', monospace; font-size:10px; color:var(--ink-soft); flex-shrink:0;}

.children{margin-left:22px; border-left:1px solid var(--line); padding-left:6px;}
.children.collapsed{display:none;}

.empty-tree{text-align:center; padding:36px 14px; color:var(--ink-soft); font-size:12px;}
.empty-tree svg{color:var(--line-strong); margin-bottom:8px;}

/* ===== Cột phải: chi tiết thư mục (card layout) ===== */
.folder-detail{min-width:0;}

.detail-header{display:flex; align-items:center; gap:12px; margin-bottom:20px;}
.detail-icon-big{
  width:44px;height:44px;flex-shrink:0; border-radius:var(--radius);
  display:flex; align-items:center; justify-content:center; font-size:20px;
}
.detail-title{font-family:'Source Serif 4', serif; font-size:20px; font-weight:600;}
.detail-sub{font-size:11.5px; color:var(--ink-soft); margin-top:2px;}

/* Bảng chọn màu/icon — tái dùng pattern swatch/icon-choice của account-settings.html */
.swatch-row{display:flex; gap:8px; flex-wrap:wrap;}
.swatch{width:26px;height:26px; border-radius:50%; cursor:pointer; border:2px solid transparent; transition:border-color .12s ease, transform .12s ease;}
.swatch:hover{transform:scale(1.08);}
.swatch.selected{border-color:var(--ink);}

.icon-row{display:flex; gap:8px; flex-wrap:wrap;}
.icon-choice{
  width:36px;height:36px; border-radius:var(--radius); background:var(--paper); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center; font-size:16px; cursor:pointer;
  transition:border-color .12s ease, background .12s ease;
}
.icon-choice:hover{border-color:var(--line-strong);}
.icon-choice.selected{border-color:var(--accent); background:var(--accent-soft);}

.field-2col{display:grid; grid-template-columns:1fr 1fr; gap:14px;}

.danger-item{display:flex; align-items:center; justify-content:space-between; gap:16px;}
.danger-item-title{font-size:13px; color:var(--ink); margin-bottom:2px;}
.danger-item-desc{font-size:11.5px; color:var(--ink-soft); max-width:380px;}

.detail-empty{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  min-height:360px; text-align:center; color:var(--ink-soft);
  background:var(--surface); border:1px solid var(--line); border-radius:8px;
}
.detail-empty svg{color:var(--line-strong); margin-bottom:14px;}
.detail-empty p{margin:0; font-size:13.5px; max-width:280px; line-height:1.6;}