/* LashHausOS Dashboard Styles */
/* Extends the base style.css tokens — dark sidebar, light content area */

/* ---- Layout ---- */
.dash-body {
  background: #f4f4f6;
  display: flex;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Sidebar ---- */
.dash-sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--color-primary);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
}

.dash-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 1.25rem 1.5rem;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.3px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 0.75rem;
}

.dash-brand-logo {
  color: var(--color-accent);
  font-size: 1.1rem;
}

.dash-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.75rem;
}

.dash-nav-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}

.dash-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}

.dash-nav-item.active {
  background: var(--color-accent);
  color: #fff;
}

.dash-nav-icon {
  font-size: 0.85rem;
  opacity: 0.8;
}

.dash-sidebar-footer {
  padding: 1rem 1.25rem 0;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.dash-footer-link {
  color: rgba(255,255,255,0.45);
  text-decoration: none;
  font-size: 0.78rem;
  transition: color 0.15s;
}

.dash-footer-link:hover { color: rgba(255,255,255,0.8); }

/* ---- Main content ---- */
.dash-main {
  margin-left: 220px;
  flex: 1;
  padding: 2rem 2rem 4rem;
  max-width: 1200px;
}

.dash-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.dash-header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

.dash-date {
  color: var(--color-muted);
  font-size: 0.85rem;
}

/* ---- KPI Cards ---- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: #fff;
  border: 1px solid #e8e8ee;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
}

.kpi-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: -1px;
  line-height: 1;
  margin-bottom: 0.3rem;
}

.kpi-value.accent, .kpi-value span.accent { color: var(--color-accent); }

.kpi-value-sm {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.3rem;
}

.kpi-sub {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.shopify-card { border-left: 3px solid #96bf48; }

/* ---- Panels ---- */
.dash-panel {
  background: #fff;
  border: 1px solid #e8e8ee;
  border-radius: 12px;
  padding: 0;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.dash-panel-full { width: 100%; }
.dash-panel-half { max-width: 560px; }

.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.dash-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #eee;
}

.dash-panel-header h2 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-primary);
}

.panel-link {
  color: var(--color-accent);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}

.panel-link:hover { text-decoration: underline; }

/* ---- Table ---- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.dash-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  background: #fafafa;
  border-bottom: 1px solid #eee;
  color: var(--color-muted);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.dash-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f0f0f4;
  vertical-align: middle;
}

.dash-table tr:last-child td { border-bottom: none; }

.dash-table tr:hover td { background: #fafafe; }

.td-name { font-weight: 600; color: var(--color-primary); }
.td-sub { font-size: 0.75rem; color: var(--color-muted); margin-top: 1px; }
.td-money { font-weight: 600; font-variant-numeric: tabular-nums; }
.td-money.accent { color: var(--color-accent); }
.td-truncate { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-date { color: var(--color-muted); white-space: nowrap; font-size: 0.8rem; }
.td-mono { font-family: 'SF Mono', 'Fira Mono', monospace; font-size: 0.8rem; }
.td-mono.accent { color: var(--color-accent); }
.td-empty { text-align: center; color: var(--color-muted); padding: 2rem; font-size: 0.85rem; }

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge-paid, .badge-completed { background: #e7f5ee; color: #1a7c45; }
.badge-pending { background: #fff4e0; color: #a05a00; }
.badge-active  { background: #e8f0fe; color: #1c4db1; }
.badge-refunded { background: #fce8e8; color: #c0392b; }
.badge-source-shopify { background: #f0f8e8; color: #4a7c0e; }
.badge-source-manual { background: #f0f0f8; color: #555; }

/* ---- Progress bar ---- */
.progress-bar {
  height: 6px;
  background: #eee;
  border-radius: 100px;
  overflow: hidden;
  width: 100px;
  margin-bottom: 2px;
}

.progress-bar.wide { width: 140px; display: inline-block; vertical-align: middle; margin-right: 8px; }

.progress-fill {
  height: 100%;
  background: var(--color-accent);
  border-radius: 100px;
  transition: width 0.3s;
}

/* ---- Rate pill ---- */
.rate-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 600;
}

.rate-good { background: #e7f5ee; color: #1a7c45; }
.rate-mid  { background: #fff4e0; color: #a05a00; }
.rate-low  { background: #fce8e8; color: #c0392b; }

/* ---- Cert list ---- */
.cert-list { list-style: none; padding: 0.5rem 1.25rem 1rem; }

.cert-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #f0f0f4;
}

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

.cert-icon {
  color: var(--color-accent);
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.cert-date {
  margin-left: auto;
  color: var(--color-muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

/* ---- Shopify info box ---- */
.shopify-info-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--color-text);
}

.code-block {
  background: #f4f4f8;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.65rem 1rem;
  font-family: 'SF Mono', 'Fira Mono', monospace;
  font-size: 0.82rem;
  color: var(--color-primary);
  word-break: break-all;
}

.muted-note { color: var(--color-muted); font-size: 0.8rem; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .dash-two-col { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .dash-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    flex-direction: row;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
    gap: 0.5rem;
    align-items: center;
  }
  .dash-brand { border-bottom: none; padding: 0; margin: 0; flex: 1; }
  .dash-nav { flex-direction: row; flex: none; padding: 0; gap: 0.25rem; }
  .dash-sidebar-footer { flex-direction: row; border-top: none; padding: 0; }
  .dash-main { margin-left: 0; padding: 1rem; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .dash-header { flex-direction: column; gap: 0.25rem; }
}

@media (max-width: 420px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .dash-nav-item span.dash-nav-icon { display: none; }
}
