/* Logos & Ledger Custom Stylesheet */

:root {
  /* Inherited & extended Shivora Labs tokens */
  --bg: #05060a;
  --panel: #0d0f16;
  --panel-2: #11141d;
  --panel-3: #151923;
  --line: rgba(232, 234, 241, 0.08);
  --line-strong: rgba(232, 234, 241, 0.16);
  --text: #f6f7fb;
  --soft: #d9dce6;
  --muted: #9fa5b4;
  
  /* Primary Gradients and Accents */
  --cosmic-cyan: #00e5ff;
  --electric-blue: #0052ff;
  --neon-purple: #8a2be2;
  --success: #4ade80;
  --danger: #ff4d4d;
  --warning: #facc15;
  
  --glass: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(255, 255, 255, 0.06);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  --radius: 12px;
  --font-display: 'Outfit', 'Sora', 'Inter', sans-serif;
  --font-sans: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  position: relative;
}

/* Background Grids & Auroras */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: radial-gradient(circle at 50% 30%, black 20%, transparent 80%);
  pointer-events: none;
}

.aurora-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 800px;
  pointer-events: none;
  z-index: -2;
  overflow: hidden;
}

.aurora-1 {
  position: absolute;
  top: -200px;
  left: 70%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.12) 0%, transparent 70%);
  filter: blur(85px);
}

.aurora-2 {
  position: absolute;
  top: -100px;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(138, 43, 226, 0.1) 0%, transparent 70%);
  filter: blur(85px);
}

.shell {
  width: min(1140px, calc(100% - 40px));
  margin: 0 auto;
}

/* Header styling */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 10, 0.85);
  backdrop-filter: blur(20px);
}

.header-inner {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand strong {
  color: var(--cosmic-cyan);
}

.app-title-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--line-strong);
  border-right: 1px solid var(--line-strong);
  padding: 0 24px;
}

.app-title-badge span {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--neon-purple);
  font-weight: 700;
}

.app-title-badge strong {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--soft-silver);
  font-weight: 600;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid transparent;
}

.button.primary {
  background: linear-gradient(135deg, var(--cosmic-cyan), var(--electric-blue));
  color: #05060a;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 229, 255, 0.2);
}

.button.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 229, 255, 0.35);
}

.button.secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
}

.button.secondary:hover {
  background: var(--line-strong);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.button.danger-outline {
  background: transparent;
  border: 1px solid rgba(255, 77, 77, 0.3);
  color: var(--danger);
}

.button.danger-outline:hover {
  background: rgba(255, 77, 77, 0.08);
  border-color: var(--danger);
}

.button.full-width {
  width: 100%;
}

/* Dashboard Banner */
.dashboard-banner {
  padding: 40px 0 24px 0;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cosmic-cyan);
  margin-bottom: 12px;
}

.dashboard-banner h1 {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, var(--text), var(--soft));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.lede {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 680px;
  margin: 0 auto;
}

/* Metrics grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
}

.card-flow::before { background: linear-gradient(90deg, var(--cosmic-cyan), var(--electric-blue)); }
.card-income::before { background: var(--success); }
.card-expense::before { background: var(--danger); }
.card-receivables::before { background: var(--warning); }

.metric-card:hover {
  border-color: var(--line-strong);
}

.card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric-card h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin: 8px 0 4px 0;
}

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

/* Dashboard layouts */
.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 24px;
  margin-bottom: 40px;
}

.left-panel, .right-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.app-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.app-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Form Styles */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--soft);
}

input, select {
  width: 100%;
  min-height: 40px;
  background: rgba(5, 6, 10, 0.4);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--cosmic-cyan);
  box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.1);
}

/* Chart Card Custom Styles */
.chart-card {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

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

.chart-header h3 {
  margin-bottom: 0;
}

.chart-legend {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  font-weight: 500;
}

.legend-in::before, .legend-out::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.legend-in::before { background: var(--cosmic-cyan); }
.legend-out::before { background: var(--neon-purple); }

.svg-container {
  width: 100%;
  height: 220px;
  position: relative;
}

.svg-bar-in {
  fill: var(--cosmic-cyan);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.svg-bar-out {
  fill: var(--neon-purple);
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.svg-bar-in:hover, .svg-bar-out:hover {
  opacity: 1;
}

/* Storage / controls card */
.card-desc {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 16px;
}

.storage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Ledger lists & Tables */
.ledger-tables {
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-bottom: 60px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title-row h3 {
  margin-bottom: 0;
}

.badge-count {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--warning);
  border: 1px solid rgba(250, 204, 21, 0.2);
  background: rgba(250, 204, 21, 0.05);
  padding: 4px 10px;
  border-radius: 20px;
}

.filter-bar {
  display: flex;
  gap: 12px;
}

.filter-bar select {
  min-height: 36px;
  font-size: 0.8rem;
  background: var(--panel-2);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ledger-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.ledger-table th {
  border-bottom: 1px solid var(--line-strong);
  padding: 12px 16px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.ledger-table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  vertical-align: middle;
  color: var(--soft);
}

.ledger-table tr:hover td {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text);
}

/* Table statuses & badges */
.tag-income {
  color: var(--success);
  font-weight: 600;
}

.tag-expense {
  color: var(--danger);
  font-weight: 600;
}

.tag-category {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.status-unpaid {
  color: var(--warning);
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.15);
}

.status-paid {
  color: var(--success);
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.15);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--danger);
  background: rgba(255, 77, 77, 0.08);
}

.btn-pay {
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  color: var(--cosmic-cyan);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 8px;
}

.btn-pay:hover {
  background: var(--cosmic-cyan);
  color: #05060a;
}

/* Footer layout */
.app-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 860px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .dashboard-banner h1 {
    font-size: 2.2rem;
  }
}

@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .app-title-badge {
    display: none;
  }
}
