/* dashboard.css — Clerq app UI styles, extends theme.css tokens */

/* NAV */
.dash-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.dash-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-link {
  font-size: 14px;
  color: var(--fg-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--fg);
}

.dash-nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* BUTTONS */
.btn-primary {
  background: var(--accent);
  color: #0c0c0e;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.88; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 18px;
  font-family: var(--font-body);
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.btn-ghost:hover { border-color: var(--fg-muted); color: var(--fg); }

/* MAIN */
.dash-main {
  padding: 40px 24px 80px;
}

.dash-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* PAGE HEADER */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.page-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0 0 4px;
}

.page-sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin: 0;
}

/* SUMMARY CARDS */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.summary-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.3s;
}

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

.card-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 12px;
}

.card-value {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.income-val   { color: #22c55e; }
.expense-val  { color: #ef4444; }
.positive-val { color: #22c55e; }
.negative-val { color: #ef4444; }

.card-hint {
  font-size: 13px;
  color: var(--fg-muted);
}

/* TWO-COLUMN LAYOUT */
.dash-columns {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 24px;
  align-items: start;
}

.dash-right {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* PANEL */
.dash-panel {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.panel-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.panel-count {
  font-size: 13px;
  color: var(--fg-muted);
}

/* EMPTY STATE */
.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--fg-muted);
  font-size: 15px;
  line-height: 1.6;
}

.empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.empty-sub {
  font-size: 13px;
  margin-top: 8px;
}

.empty-sub code {
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--accent);
}

/* TRANSACTION LIST */
.tx-list { }

.tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.tx-row:last-child { border-bottom: none; }
.tx-row:hover { background: rgba(255,255,255,0.02); }

.tx-info { flex: 1; min-width: 0; }

.tx-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.tx-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tx-date {
  font-size: 12px;
  color: var(--fg-muted);
}

.tx-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.tx-amount {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  margin-left: 16px;
  white-space: nowrap;
}

.tx-income  { color: #22c55e; }
.tx-expense { color: var(--fg); }

/* CATEGORY LIST */
.cat-list { padding: 16px 24px; }

.cat-row { margin-bottom: 16px; }
.cat-row:last-child { margin-bottom: 0; }

.cat-label-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.cat-name  { font-size: 13px; color: var(--fg); }
.cat-total { font-size: 13px; font-weight: 600; color: var(--fg-muted); }

.cat-bar-bg {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  overflow: hidden;
}

.cat-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* REPORTS LIST */
.report-list { }

.report-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: background 0.15s;
}

.report-row:last-child { border-bottom: none; }
.report-row:hover { background: rgba(255,255,255,0.02); }

.report-period {
  font-size: 14px;
  color: var(--fg);
  font-weight: 500;
}

.report-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.report-net {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.report-net.positive { color: #22c55e; }
.report-net.negative { color: #ef4444; }

.report-sent {
  font-size: 11px;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  padding: 2px 8px;
  border-radius: 20px;
}

.report-view {
  font-size: 13px;
  color: var(--accent);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  padding: 32px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  color: var(--fg-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover { color: var(--fg); }

/* FORM */
.modal-form { }

.form-group {
  margin-bottom: 16px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-muted);
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: var(--accent);
}

.form-group input::placeholder {
  color: rgba(138, 135, 127, 0.6);
}

.form-hint {
  font-size: 12px;
  color: var(--fg-muted);
  margin: -4px 0 16px;
  font-style: italic;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 8px;
}

.tx-result {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

.tx-result.success {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.tx-result.error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .dash-columns {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .dash-nav-inner {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}
