/* ============================================================
   BudgetCashflow – Global Styles
   - App shell (body, header, main)
   - Global palette + typography
   - Shared buttons / inputs / messages
============================================================ */

:root {
  /* Core layout colors */
  --bg: #0d0f17;
  --fg: #e5e7eb;
  --card-bg: #0d0f17;
  --border-subtle: #1e293b;
  --current-month-bg: #111827;

  /* Accent (cool blue for controls) */
  --accent: #38bdf8; /* cyan-400 */
  --accent-soft: #1f2937; /* slate-800 */

  /* Unified semantic colors */
  --red: #ef4444; /* red-500 */
  --green: rgba(6, 214, 160, 0.9); /* green-500 */

  --error: var(--red);
  --message: var(--green);

  /* === VALUE CELL COLORS: OUTLINE STYLE === */

  /* Vibrant bases (unchanged) */
  --value-green-base: #06d6a0;
  --value-red-base: #ef4444;

  /* Outlines instead of fills */
  --value-green-outline: rgba(6, 214, 160, 0.9);
  --value-red-outline: rgba(239, 68, 68, 0.9);

  /* Light hover backgrounds for feedback */
  --value-green-hover-bg: rgba(6, 214, 160, 0.12);
  --value-red-hover-bg: rgba(239, 68, 68, 0.12);

  /* Row + label styling */
  --cf-row-hover-bg: #0c2036;
  --cf-label-bg: #0d0f17;

  /* Sticky column widths */
  --cf-actions-width: 110px;
  --cf-kind-width: 110px;
  --cf-type-width: 110px;
  --cf-name-width: 110px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--fg);

  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===== Header / layout ===== */

.header {
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0.5rem 1rem 1rem;
  flex: 0 0 auto;
  
  width: 100%;
  margin: 0 auto;
}

.header-inner {
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-weight: 700;
}

.nav a {
  margin-right: 1rem;
  text-decoration: none;
  color: var(--fg);
}

.nav a:hover {
  text-decoration: underline;
}

.link-button {
  background: none;
  border: none;
  color: var(--fg);
  cursor: pointer;
  padding: 0;
  margin-right: 15px;
}

.link-button:hover {
  text-decoration: underline;
  color: var(--fg);
}

.theme-toggle {
  margin-left: 0.5rem;
  cursor: pointer;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.25rem 0.5rem;
  color: var(--fg);
}

/* Main app area */

.main {
  flex: 1 1 auto;
  width: 100%;
  
  margin: 0 auto;
  padding: 0px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

h1,
h2,
h3 {
  margin-top: 0;
}

/* ===== Global form + controls ===== */

input,
select,
button {
  font: inherit;
}

select {
  background: transparent;
  color: var(--fg);
  border: none;
  padding: 0.25rem 0.35rem;
}

select:focus {
  outline: none;
  background: #1f2937;
}

button {
  border-radius: 0.5rem;
  border: none;
  background: none;
  color: #0d0f17;
  cursor: pointer;
}

.settings-submit-btn {
  background-color: var(--accent);
  padding: 0.5rem 1rem;
  font-weight: 600;
}

button:hover {
  opacity: 0.92;
}

.icon-btn {
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  color: var(--fg);
  cursor: pointer;
}

/* Messages */

.error {
  color: var(--error);
}

.message {
  color: var(--message);
}

.header-entity-switcher {
  margin-bottom: 0px;
}

.header-entity-switcher option {
  background-color: #1e293b;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  color: inherit;
}

.logo-img {
  width: 20px; /* adjust if needed */
  height: 20px;
  display: block;
}

.logo-text {
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.25px;
}
