/* Inbox layout — extends theme.css design tokens */

/* App shell */
.app-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  background: var(--fg);
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: #FFFFFF;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.875rem;
  border-radius: 10px;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.sidebar-link:hover, .sidebar-link.active {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
}
.sidebar-link--muted {
  margin-top: auto;
  color: rgba(255,255,255,0.35);
  font-size: 0.8rem;
}
.sidebar-link--muted:hover {
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
}

/* Main content */
.main-content {
  padding: 2.5rem 2.75rem;
  overflow-y: auto;
}

/* Header */
.inbox-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
}
.inbox-header h1 {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.25rem;
}
.inbox-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #E8F5EC;
  border: 1px solid #B8DFC5;
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1A6B35;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22C55E;
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 1px 8px rgba(10,54,34,0.05);
}
.stat-card--tax {
  background: #FDF9F0;
  border-color: #E8D8B8;
}
.stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.stat-value {
  font-family: 'Fraunces', serif;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1;
  margin-bottom: 0.4rem;
}
.stat-value--income { color: var(--fg); }
.stat-value--expense { color: #B05C1A; }
.stat-value--net { color: var(--fg-mid); }
.stat-value--tax { color: var(--accent); }
.stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Two-column body */
.inbox-body {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.75rem;
}

/* Section header */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
}
.filter-row {
  display: flex;
  gap: 0.4rem;
}
.filter-btn {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--fg-mid);
  cursor: pointer;
  transition: all 0.15s;
}
.filter-btn:hover { border-color: var(--fg-light); }
.filter-btn.active {
  background: var(--fg);
  color: #fff;
  border-color: var(--fg);
}

/* Transaction list */
.tx-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.tx-loading, .nudge-loading, .tax-loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.tx-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(10,54,34,0.04);
  transition: box-shadow 0.15s;
}
.tx-item:hover { box-shadow: 0 2px 12px rgba(10,54,34,0.08); }
.tx-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.tx-info { flex: 1; min-width: 0; }
.tx-desc {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}
.tx-right { text-align: right; flex-shrink: 0; }
.tx-amount {
  font-size: 0.95rem;
  font-weight: 700;
}
.tx-amount--income { color: var(--fg); }
.tx-amount--expense { color: #B05C1A; }
.tx-status {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  display: inline-block;
  margin-top: 0.2rem;
}
.tx-status--settled { background: #E8F5EC; color: #1A6B35; }
.tx-status--pending { background: #F0EBE3; color: #7A5A1A; }
.tx-status--overdue { background: #FDE8E8; color: #B91C1C; }

/* Right sidebar */
.inbox-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Nudge panel */
.nudge-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 1.25rem;
}
.nudge-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
}
.nudge-list { display: flex; flex-direction: column; gap: 0.75rem; }
.nudge-item {
  padding: 0.875rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.nudge-item:hover { border-color: var(--accent); transform: translateX(2px); }
.nudge-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 0.25rem;
}
.nudge-item-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.nudge-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 8px;
  margin-top: 0.4rem;
}
.nudge-tag--urgent { background: #FDE8E8; color: #B91C1C; }
.nudge-tag--warning { background: #FDF9F0; color: #7A5A1A; }
.nudge-tag--info { background: #E8F5EC; color: #1A6B35; }
.nudge-dismiss {
  background: none;
  border: none;
  font-size: 0.7rem;
  color: var(--text-muted);
  cursor: pointer;
  margin-top: 0.5rem;
  padding: 0;
}
.nudge-dismiss:hover { color: var(--fg); }
.nudge-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

/* Tax panel */
.tax-panel {
  background: #FDF9F0;
  border: 1px solid #E8D8B8;
  border-radius: 14px;
  padding: 1.25rem;
}
.tax-panel-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 1rem;
}
.tax-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  font-size: 0.8rem;
}
.tax-row:last-of-type { border-bottom: none; }
.tax-row-label { color: var(--fg-mid); }
.tax-row-value { font-weight: 600; }
.tax-row-value--total {
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  color: var(--accent);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid #E8D8B8;
}
.tax-deadline {
  font-size: 0.72rem;
  color: #B05C1A;
  font-weight: 600;
  margin-top: 0.75rem;
  text-align: center;
  background: #FDE8D8;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
}

/* Responsive */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .inbox-body { grid-template-columns: 1fr; }
  .inbox-sidebar { flex-direction: row; }
}
@media (max-width: 768px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: auto;
    flex-direction: row;
    padding: 0.75rem 1rem;
    z-index: 100;
    overflow-x: auto;
  }
  .sidebar-brand, .sidebar-link--muted { display: none; }
  .sidebar-nav { flex-direction: row; gap: 0.5rem; }
  .sidebar-link { padding: 0.5rem 0.75rem; font-size: 0.75rem; }
  .main-content { padding: 1.5rem 1.25rem 5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .stat-value { font-size: 1.3rem; }
  .inbox-sidebar { flex-direction: column; }
}