/* ════════════════════════════════════════
   dashboard.css — All dashboard components
   ════════════════════════════════════════ */

/* ══ STAT CARDS ══ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
}

.stat-card:hover { border-color: var(--accent); }

.stat-label {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 8px;
  font-family: var(--mono);
}

.stat-change { font-size: 12px; display: flex; align-items: center; gap: 4px; }
.stat-change.up      { color: var(--green); }
.stat-change.down    { color: var(--red);   }
.stat-change.neutral { color: var(--muted); }

.stat-icon {
  position: absolute;
  top: 18px; right: 18px;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg { width: 18px; height: 18px; }

.si-orange { background: var(--accent-dim); } .si-orange svg { fill: var(--accent); }
.si-green  { background: var(--green-dim);  } .si-green  svg { fill: var(--green);  }
.si-amber  { background: var(--amber-dim);  } .si-amber  svg { fill: var(--amber);  }
.si-blue   { background: var(--blue-dim);   } .si-blue   svg { fill: var(--blue);   }

/* ══ GRID LAYOUTS ══ */
.mid-grid    { display: grid; grid-template-columns: 1fr 310px; gap: 16px; margin-bottom: 20px; }
.bottom-grid { display: grid; grid-template-columns: 1fr 1fr;   gap: 16px; margin-bottom: 20px; }

/* ══ CARD ══ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title  { font-size: 13.5px; font-weight: 600; }
.card-action { font-size: 12px; color: var(--accent); cursor: pointer; font-weight: 500; }
.card-action:hover { text-decoration: underline; }

/* ══ LISTING ACTIVITY BAR CHART ══ */
.chart-body { padding: 20px; }

.listing-bars {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  height: 150px;
  margin-bottom: 8px;
}

.lb-group  { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.lb        { width: 100%; border-radius: 4px 4px 0 0; transition: opacity 0.2s; cursor: pointer; }
.lb:hover  { opacity: 0.7; }
.lb-label  { font-size: 10px; color: var(--muted); font-family: var(--mono); }

.chart-legend { display: flex; gap: 14px; padding: 0 20px 18px; flex-wrap: wrap; }
.legend-item  { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.legend-dot   { width: 8px; height: 8px; border-radius: 50%; }

/* ══ MATERIAL CATEGORY DONUT ══ */
.donut-wrap {
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.donut-container { position: relative; width: 130px; height: 130px; }
.donut-container svg { transform: rotate(-90deg); }

.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .val { font-size: 20px; font-weight: 600; font-family: var(--mono); }
.donut-center .lbl { font-size: 10px; color: var(--muted); }

.donut-legend { width: 100%; display: flex; flex-direction: column; gap: 9px; }

.donut-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.donut-dot { width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.donut-name { flex: 1; color: var(--muted); }
.donut-val  { font-family: var(--mono); font-weight: 500; }
.donut-pct  { color: var(--muted); font-family: var(--mono); font-size: 11px; }

/* ══ TRANSACTIONS TABLE ══ */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 10px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background 0.13s;
  cursor: pointer;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover      { background: var(--surface2); }

td { padding: 11px 18px; font-size: 13px; }

.cell-flex { display: flex; align-items: center; gap: 9px; }

.row-icon {
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}

/* ── Status chips ── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
}

.chip-dot { width: 5px; height: 5px; border-radius: 50%; }

.chip.completed { background: var(--green-dim); color: var(--green); } .chip.completed .chip-dot { background: var(--green); }
.chip.pending   { background: var(--amber-dim); color: var(--amber); } .chip.pending   .chip-dot { background: var(--amber); }
.chip.cancelled { background: var(--red-dim);   color: var(--red);   } .chip.cancelled .chip-dot { background: var(--red);   }
.chip.active    { background: var(--blue-dim);  color: var(--blue);  } .chip.active    .chip-dot { background: var(--blue);  }
.chip.disputed  { background: var(--accent-dim);color: var(--accent);} .chip.disputed  .chip-dot { background: var(--accent);}

/* ══ ADMIN TO-DO LIST ══ */
.todo-inner { padding: 14px 18px; }

.todo-input-row { display: flex; gap: 8px; margin-bottom: 14px; }

.todo-input {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border 0.15s;
}

.todo-input:focus       { border-color: var(--accent); }
.todo-input::placeholder { color: var(--muted); }

.todo-add-btn {
  background: var(--accent);
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: opacity 0.15s;
}

.todo-add-btn:hover { opacity: 0.85; }

.todo-list {
  display: flex;
  flex-direction: column;
  max-height: 260px;
  overflow-y: auto;
}

.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.todo-item:last-child { border-bottom: none; }

.todo-check {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  margin-top: 1px;
}

.todo-check.done { background: var(--green); border-color: var(--green); }

.todo-check.done::after {
  content: '';
  display: block;
  width: 9px; height: 5px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) translateY(-1px);
}

.todo-body { flex: 1; min-width: 0; }
.todo-text { font-size: 13px; line-height: 1.4; transition: color 0.15s; }
.todo-text.done { color: var(--muted); text-decoration: line-through; }
.todo-meta { font-size: 11px; color: var(--muted); margin-top: 2px; font-family: var(--mono); }

.todo-del {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
  transition: color 0.13s;
}

.todo-del:hover { color: var(--red); }

/* ══ ACTIVITY FEED ══ */
.feed-list { padding: 6px 0; }

.feed-item {
  display: flex;
  gap: 12px;
  padding: 11px 18px;
  transition: background 0.13s;
  cursor: pointer;
}

.feed-item:hover { background: var(--surface2); }

.feed-icon {
  width: 30px; height: 30px;
  border-radius: 7px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}

.feed-icon svg { width: 14px; height: 14px; }

.fi-orange { background: var(--accent-dim); } .fi-orange svg { fill: var(--accent); }
.fi-green  { background: var(--green-dim);  } .fi-green  svg { fill: var(--green);  }
.fi-amber  { background: var(--amber-dim);  } .fi-amber  svg { fill: var(--amber);  }
.fi-red    { background: var(--red-dim);    } .fi-red    svg { fill: var(--red);    }
.fi-blue   { background: var(--blue-dim);   } .fi-blue   svg { fill: var(--blue);   }

.feed-body { flex: 1; min-width: 0; }
.feed-title { font-size: 13px; font-weight: 500; margin-bottom: 2px; }
.feed-sub   { font-size: 12px; color: var(--muted); }
.feed-time  { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; margin-top: 2px; }
