/* css/03-dashboard.css — Dashboard page. Load order matters: files are cut from one stylesheet, in cascade order. */
/* ─── DASHBOARD ─── */
.hero-banner {
  background: linear-gradient(90deg, #F9FAFB 35%, rgba(249,250,251,0.1) 100%), url('https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?q=80&w=1600&auto=format&fit=crop') center 30%/cover no-repeat;
  border-radius: 8px; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 16px; box-shadow: 0 1px 6px rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.04);
}
.hero-greeting { font-size: 9px; font-weight: 700; letter-spacing: 0.15em; color: var(--text-mid); text-transform: uppercase; margin-bottom: 2px; }
.hero-name { font-size: 24px; font-weight: 700; color: var(--text); line-height: 1; margin-bottom: 4px; letter-spacing: -0.5px; }
.hero-sub { font-size: 11px; color: var(--text-mid); }

.view-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; gap: 16px; }
.view-title   { font-family: 'Poppins', sans-serif; font-size: 18px; font-weight: 700; letter-spacing: -0.3px; line-height: 1.2; }
.view-subtitle { font-size: 12px; color: var(--text-mid); margin-top: 2px; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow: hidden; position: relative; box-shadow: var(--shadow-xs); }
.dash-stat-card { transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s; cursor: pointer; }
.stat-tint-red    { background: var(--red-tint); }
.stat-tint-green  { background: var(--green-tint); }
.stat-tint-amber  { background: var(--amber-tint); }
.stat-tint-blue   { background: var(--blue-tint); }
.dash-stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--border-mid); }
.stat-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.stat-icon-wrap { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; }
.stat-icon-wrap svg { width: 12px; height: 12px; }
.stat-arrow { color: var(--text-muted); transition: transform 0.2s; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.stat-arrow svg { width: 10px; height: 10px; }
.dash-stat-card:hover .stat-arrow { transform: translateX(2px); color: var(--text); border-color: var(--text-mid); }
.stat-label { font-size: 9px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 2px; }
.stat-value { font-size: 24px; font-weight: 700; line-height: 1; color: var(--text); display: flex; align-items: center; gap: 6px; }
.stat-nav-hint { font-size: 10px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }

.dashboard-row-2col { display: grid; grid-template-columns: 1.8fr 1fr; gap: 16px; margin-bottom: 16px; align-items: stretch; }
@media(max-width: 1000px) { .dashboard-row-2col { grid-template-columns: 1fr; } }
.quick-actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa-btn { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; font-size: 11px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 6px; cursor: pointer; transition: all 0.15s; }
.qa-btn:hover { border-color: var(--text-mid); background: var(--bg); box-shadow: var(--shadow-sm); }
.qa-btn svg { color: var(--text-muted); width: 12px; height: 12px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; box-shadow: var(--shadow-xs); }
.panel-header { padding: 8px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.panel-body  { padding: 12px; }

.dash-product-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; }
.dash-product-row:last-child { border-bottom: none; }
.dash-product-row:hover { background: #FAFAF9; }
.dash-product-name { font-size: 12px; font-weight: 600; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--border); transition: background 0.1s; }
.deadline-row:last-child { border-bottom: none; }
.deadline-row:hover { background: var(--bg); }
.deadline-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.deadline-info { flex: 1; min-width: 0; }
.deadline-pillar { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.deadline-product { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.deadline-remind-btn { font-size: 10px; font-weight: 500; padding: 3px 8px; background: none; border: 1px solid var(--border); border-radius: 6px; color: var(--text-muted); cursor: pointer; font-family: 'Poppins', sans-serif; display: flex; align-items: center; gap: 3px; flex-shrink: 0; transition: border-color 0.1s, color 0.1s; }
.deadline-remind-btn:hover { border-color: var(--red); color: var(--red); }

.empty-state { text-align: center; padding: 40px 24px; }
.empty-state-sm { text-align: center; padding: 24px 16px; }
.empty-icon { font-size: 28px; display: block; margin-bottom: 12px; }
.empty-state h3   { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.empty-state p    { font-size: 12px; color: var(--text-mid); line-height: 1.6; margin-bottom: 16px; }
.empty-state-sm p { font-size: 12px; color: var(--text-mid); line-height: 1.6; margin-bottom: 12px; }
.muted { color: var(--text-muted) !important; font-size: 12px; }

/* Global Refresh button fix */
#global-refresh-btn { bottom: 16px !important; right: 16px !important; width: 36px !important; height: 36px !important; }

/* Ensure scrollbars are neat */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* The rest of the necessary utility classes */
.btn-primary { padding: 9px 18px; background: var(--red); color: white; border: none; border-radius: var(--radius); font-size: 12px; font-weight: 500; transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s; box-shadow: 0 1px 3px rgba(192,40,45,0.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(192,40,45,0.3); }
.btn-primary:hover { opacity: 0.88; }
.btn-primary-sm { padding: 7px 14px; background: var(--red); color: white; border: none; border-radius: var(--radius); font-size: 11px; font-weight: 500; transition: opacity 0.15s, transform 0.15s, box-shadow 0.15s; box-shadow: 0 1px 3px rgba(192,40,45,0.22); }
.btn-primary-sm:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(192,40,45,0.28); }
.btn-primary-sm:hover { opacity: 0.88; }
.btn-secondary-sm { padding: 6px 12px; background: none; border: 1px solid var(--border-mid); border-radius: var(--radius); font-size: 11px; font-weight: 500; color: var(--text); transition: background .15s; }
.btn-secondary-sm:hover { background: var(--bg); }
.btn-danger-sm { padding: 7px 14px; background: none; color: var(--red); border: 1px solid var(--red-mid); border-radius: var(--radius); font-size: 11px; font-weight: 500; transition: background 0.15s; }
.btn-danger-sm:hover { background: var(--red-light); }
.btn-danger-xs { padding: 5px 10px; background: none; color: var(--red); border: 1px solid var(--red-mid); border-radius: 6px; font-size: 10px; font-weight: 500; flex-shrink: 0; }
.btn-danger-xs:hover { background: var(--red-light); }
.btn-link-sm { background: none; border: none; padding: 4px 2px; font-size: 12px; font-weight: 500; color: var(--text-mid); cursor: pointer; font-family: 'Poppins', sans-serif; display: inline-flex; align-items: center; gap: 4px; transition: color .15s; }
.btn-link-sm:hover { color: var(--red); }
.pd-task-row:hover { background: #FAFAF9; }
.btn-outline { padding: 9px 18px; background: none; border: 1px solid var(--border-mid); border-radius: var(--radius); font-size: 12px; font-weight: 500; color: var(--text); transition: background 0.15s; }
.btn-outline:hover { background: var(--bg); }

.status-chip { font-size: 10px; font-weight: 600; padding: 3px 10px; border-radius: 99px; flex-shrink: 0; text-transform:uppercase; letter-spacing:0.04em;}
.status-active   { background: var(--blue-light); color: var(--blue); }
.status-complete { background: var(--green-light); color: var(--green); }
.status-archived { background: #F3F4F6; color: #6B7280; }
.pill { font-size: 10px; padding: 2px 8px; border-radius: 99px; font-weight: 500; }
.pill-green { background: var(--green-light); color: var(--green); }
.pill-amber { background: var(--amber-light); color: var(--amber); }
.pill-red   { background: var(--red-light);   color: var(--red);   }
.pill-grey  { background: #F3F4F6; color: #6B7280; }
.pill-blue  { background: var(--blue-light); color: var(--blue); }

.tracker-table { width:100%; border-collapse:collapse; font-size:12px; min-width:640px; }
.tracker-table th { text-align:left; font-size:10px; font-weight:600; color:var(--text-muted); text-transform:uppercase; letter-spacing:.05em; padding:8px 12px; border-bottom:2px solid var(--border); white-space:nowrap; background:var(--surface); position:sticky; top:0; z-index:1; }
.tracker-table td { padding:8px 12px; border-bottom:1px solid var(--border); vertical-align:middle; }
.tracker-row:last-child td { border-bottom:none; }
.tracker-row:hover { background:var(--bg); }
.tracker-row-done { opacity:.6; }
.tracker-row-done .tracker-pillar-name { text-decoration:line-through; }
.tracker-num         { color:var(--text-muted); font-size:11px; font-weight:600; width:32px; }
.tracker-pillar-name { font-weight:500; color:var(--text); margin-bottom:2px; font-size: 12px;}
.tracker-pillar-owner { font-size:10px; color:var(--text-muted); }
.tracker-deadline    { white-space:nowrap; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-box { background: var(--surface); border-radius: 12px; width: 100%; max-width: 640px; max-height: 88vh; display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.modal-title { font-size: 14px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 16px; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { background: var(--bg); }
.modal-body  { overflow-y: auto; padding: 20px; flex: 1; min-height: 0; }

.form-section-label { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 12px; }
.form-hint { font-weight: 400; color: var(--text-muted); text-transform: none; letter-spacing: 0; font-size: 10px; }
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-size: 11px; font-weight: 500; color: var(--text-mid); margin-bottom: 6px; }
.req { color: var(--red); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.input-field { flex: 1; min-width: 180px; padding: 8px 10px; border: 1px solid var(--border-mid); border-radius: var(--radius); font-size: 12px; color: var(--text); background: var(--bg); outline: none; }
.input-field:focus { border-color: var(--red); }
.select-field { padding: 8px 10px; border: 1px solid var(--border-mid); border-radius: var(--radius); font-size: 12px; color: var(--text); background: var(--bg); outline: none; }
textarea.input-field { resize: vertical; line-height: 1.5; }

/* Pillar date rows in form */
.pillar-date-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pillar-date-row:last-of-type { border-bottom: none; }
.pillar-date-num  { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); color: var(--text-muted); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pillar-date-name { flex: 1; font-size: 13px; color: var(--text); display: flex; flex-direction: column; gap: 1px; }
.pillar-date-input { width: 148px; flex-shrink: 0; font-size: 12px; padding: 6px 10px; }
.pillar-owner { font-size: 11px; color: var(--text-muted); }

/* Pillar detail view */
.pillar-detail-list { display: flex; flex-direction: column; gap: 0; }

/* ═══ Collapsible status groups, horizontal card grid ═══
   Was one flat vertical list of full-width rows. Groups are now
   individually collapsible, and within an expanded group the tasks
   lay out as cards side by side instead of stacked one-per-line. */
.task-group-header { display:flex; align-items:center; gap:8px; margin:16px 0 8px; cursor:pointer; user-select:none; }
.task-group-header:hover .pcf-pill { filter:brightness(0.97); }
.task-group-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(300px, 1fr)); gap:12px; margin-bottom:4px; }

.task-filter-bar { display:flex; gap:8px; flex-wrap:wrap; align-items:center; padding-bottom:14px; margin-bottom:4px; border-bottom:1px solid var(--border); }

.pillar-detail-row  { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background:#fff; transition: background .12s, opacity .12s, box-shadow .12s; }
.pillar-detail-row:hover { box-shadow: var(--shadow-xs); }
.pillar-detail-row:last-child { border-bottom: 1px solid var(--border); }
.pillar-detail-num  { width: 22px; height: 22px; border-radius: 50%; background: var(--bg); color: var(--text-muted); font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.task-drag-handle { display:flex; align-items:center; justify-content:center; width:14px; flex-shrink:0; color:var(--border-mid); cursor:grab; margin-top:5px; }
.task-drag-handle:hover { color:var(--text-muted); }
.pillar-detail-row[draggable="true"]:active { cursor:grabbing; }
.pillar-detail-row.task-dragging { opacity:0.4; }
.pillar-detail-row.task-drop-target { background:var(--red-tint); border-top:2px solid var(--red); }
.pillar-detail-body { flex: 1 1 160px; min-width: 0; }
.pillar-detail-name { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 4px; }
.pillar-detail-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pillar-detail-actions { flex: 1 1 100%; margin-top: 4px; padding-top: 8px; border-top: 1px dashed var(--border); }
.task-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 99px; flex-shrink: 0; white-space: nowrap; }
.task-complete    { background: var(--green-light); color: var(--green); }
.task-in-progress { background: var(--blue-light);  color: var(--blue); }
.task-not-started { background: #F3F4F6; color: #6B7280; }
.task-overdue     { background: var(--red-light);   color: var(--red);  }

/* Dashboard panels */
.btn-secondary-sm { padding: 6px 14px; background: none; border: 1px solid var(--border-mid); border-radius: var(--radius); font-size: 12px; font-weight: 500; color: var(--text); transition: background .15s; }
.btn-secondary-sm:hover { background: var(--bg); }

