/* =========================================================
   Compound Interest Calculator (CompoundDaily) Styles
   File: assets/cic.css
   ========================================================= */

:root{
  --cic-ink:#1f2937;
  --cic-muted:#6b7280;
  --cic-line:#e6edf2;
  --cic-bg:#f6fafc;

  /* Brand-leaning blue/blue-gray (from your logo family, not the sample) */
  --cic-brand:#6e8f9f;
  --cic-brand2:#7fa6ba;

  --cic-card:#ffffff;
  --cic-soft:#f7fafc;
}

/* Screen-reader-only helper */
.cic-sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}

/* Base wrapper */
.cic-wrap { max-width: 1120px; margin: 0 auto; padding: 12px; }
.cic-shell { display: grid; grid-template-columns: 420px 1fr; gap: 16px; }
@media (max-width: 980px) { .cic-shell { grid-template-columns: 1fr; } }

/* Panels */
.cic-panel {
  background: var(--cic-card);
  border: 1px solid var(--cic-line);
  border-radius: 16px;
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.06);
  overflow: hidden;
}

/* Panel header */
.cic-panel-head { padding: 16px 16px 8px; }
.cic-title { margin: 0; font-size: 26px; line-height: 1.15; color: #23303A; }
.cic-subtitle { margin-top: 6px; color: var(--cic-muted); font-size: 13px; }

/* Currency quick buttons */
.cic-currency-buttons {
  padding: 10px 16px 6px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.cic-currency-btn {
  border: 1px solid #DDE6EC;
  background: var(--cic-soft);
  border-radius: 12px;
  padding: 10px 0;
  font-weight: 800;
  font-size: 18px;
  color: #22313A;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
}

.cic-currency-btn:active { transform: translateY(1px); }

.cic-currency-btn.is-active {
  background: var(--cic-brand);
  border-color: var(--cic-brand);
  color: #fff;
}

/* Form */
.cic-form { padding: 10px 16px 16px; }
.cic-field { margin: 12px 0; }

.cic-field label {
  display: block;
  font-weight: 800;
  color: #22313A;
  margin-bottom: 6px;
  font-size: 13px;
}

.cic-help { margin-top: 6px; color: var(--cic-muted); font-size: 12px; }

/* Inputs */
.cic-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.cic-prefix, .cic-suffix {
  border: 1px solid #DDE6EC;
  background: var(--cic-soft);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 900;
  color: #22313A;
  flex: 0 0 auto;
  white-space: nowrap;
}

.cic-row-money input { flex: 1 1 auto; min-width: 0; }
.cic-row-rate input  { flex: 1 1 auto; min-width: 0; }

.cic-row-rate select {
  width: 128px;
  max-width: 45vw;
  flex: 0 0 auto;
}

input[type="number"], input[type="date"], select {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #DDE6EC;
  background: #FDFEFE;
  border-radius: 12px;
  padding: 12px 12px;
  font-size: 16px;
  color: #111827;
  outline: none;
  min-width: 0;
}

select { padding-right: 34px; }

/* Term grid */
.cic-term-grid {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
}
@media (max-width: 420px) { .cic-term-grid { grid-template-columns: 1fr; } }

/* Divider */
.cic-divider { height: 1px; background: #EEF3F6; margin: 14px 0; }

/* Section title */
.cic-section-title {
  font-weight: 900;
  color: #22313A;
  margin-top: 4px;
  margin-bottom: 6px;
}

/* Buttons */
.cic-actions { margin-top: 14px; }

.cic-actions-row { display: flex; gap: 10px; margin-top: 10px; }

.cic-btn {
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid #DDE6EC;
  background: #fff;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  color: #22313A;
  flex: 1 1 auto;
}

.cic-btn-primary {
  width: 100%;
  background: linear-gradient(180deg, var(--cic-brand2), var(--cic-brand));
  border-color: var(--cic-brand);
  color: #fff;
  font-size: 16px;
  padding: 14px 14px;
}

.cic-btn-light { background: var(--cic-soft); }

.cic-note { margin-top: 10px; color: var(--cic-muted); font-size: 12.5px; }

/* Results panel */
.cic-panel-results { padding-bottom: 10px; }

.cic-results-head { padding: 16px 16px 8px; }

.cic-results-title { font-size: 18px; font-weight: 900; color: #22313A; }

.cic-results-sub {
  margin-top: 6px;
  color: var(--cic-muted);
  font-size: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cic-pill {
  padding: 6px 10px;
  border: 1px solid var(--cic-line);
  border-radius: 999px;
  background: var(--cic-soft);
}

/* KPI Cards */
.cic-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 10px 16px;
}
@media (max-width: 760px) { .cic-kpis { grid-template-columns: 1fr; } }

.cic-kpi {
  border: 1px solid var(--cic-line);
  border-radius: 14px;
  background: #FDFEFE;
  padding: 12px;
}

.cic-kpi-label {
  color: var(--cic-muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cic-kpi-value {
  font-size: 22px;
  font-weight: 900;
  margin-top: 6px;
  color: #111827;
}

/* View/Download bar */
.cic-viewbar {
  margin: 6px 16px 10px;
  border: 1px solid var(--cic-line);
  border-radius: 14px;
  background: var(--cic-soft);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.cic-viewbar-label {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--cic-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.cic-view-toggle,
.cic-mini-actions {
  display: flex;
  gap: 8px;
}

.cic-view-btn,
.cic-mini-btn {
  border-radius: 12px;
  border: 1px solid #DDE6EC;
  background: #fff;
  padding: 10px 12px;
  font-weight: 700; /* less bold so text fits */
  font-size: 12.5px; /* slightly smaller */
  color: #22313A;
  cursor: pointer;
  min-width: 72px;
  text-align: center;
  line-height: 1.1;
}

@media (max-width: 420px) {
  .cic-view-btn,
  .cic-mini-btn {
    min-width: 62px;
    font-size: 12px;
    padding: 10px 8px;
  }
}

.cic-view-btn.is-active {
  background: var(--cic-brand);
  border-color: var(--cic-brand);
  color: #fff;
}

/* TABLE */
.cic-table-wrap { padding: 0 16px 10px; }

.cic-table-scroll {
  overflow-x: auto; /* never run off screen */
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--cic-line);
  border-radius: 14px;
}

.cic-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed; /* key */
}

.cic-table thead th {
  background: var(--cic-brand);
  color: #fff;
  text-align: left;
  padding: 10px 8px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cic-table td {
  border-top: 1px solid #EEF3F6;
  padding: 9px 8px;
  font-size: 13px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cic-table tbody tr:nth-child(even) td { background: var(--cic-soft); }

.cic-col-num { text-align: right; }

/* Small screens */
@media (max-width: 520px) {
  .cic-table thead th { padding: 8px 6px; font-size: 10px; }
  .cic-table td { padding: 8px 6px; font-size: 12px; }
}

/* CHART */
.cic-chart-wrap { padding: 0 16px 10px; }

.cic-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--cic-muted);
  font-size: 12px;
  margin: 6px 0 10px;
}

.cic-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 6px;
  vertical-align: -2px;
}

.cic-swatch-balance { background: var(--cic-brand); }
.cic-swatch-contrib { background: #3b82f6; }
.cic-swatch-growth  { background: #f59e0b; }

.cic-chart {
  width: 100%;
  height: 320px;
  display: block;
  border: 1px solid var(--cic-line);
  border-radius: 14px;
  background: #fff;
}

/* Empty state */
.cic-results-empty { padding: 16px; color: var(--cic-muted); }

/* Weekend note */
.cic-weekend-note { display: none; } /* Shown via JS */

