/* -------------------------------------------- */
/* UNIVERSAL THEME — FUNNEL SANS + LIGHT LILAC */
/* -------------------------------------------- */

/* Import Funnel Sans (Google Fonts) */
@import url('https://fonts.googleapis.com/css2?family=Funnel+Sans:wght@400;500;600;700&display=swap');

/* Your root variables */
:root {
  color-scheme: light !important;
  --pico-background-color: #ffffff !important;
  --pico-color: #a18cd1 !important; /* Base color (used elsewhere) */
  --color-bg: #F7F5FB;
  --color-surface: #FFFFFF;
  --color-accent: #A18CD1;
  --color-accent-light: #CBB7F0;
  --color-border: #E7E1F7;
  --color-hover: #917BC5;
  --color-text: #000000;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.06);

  /* Set default form element colors (can be overridden below) */
  --pico-form-element-background-color: var(--color-surface); /* White */
  --pico-form-element-border-color: var(--color-border);     /* Light Lilac Border */
  --pico-form-element-color: #333333; /* Default input text color: Dark Gray */
}

/* Base Pico input styles */
input, select, textarea {
  /* Use the variables defined above */
  --pico-background-color: var(--pico-form-element-background-color);
  --pico-border-color: var(--pico-form-element-border-color);
  --pico-color: #4f4f4f; /* Overrides the purple from :root */
  --pico-box-shadow: none;

  /* Apply the styles */
  border: var(--pico-border-width, 1px) solid var(--pico-border-color); /* Added default width */
  border-radius: var(--pico-border-radius, var(--radius)); /* Use your --radius */
  outline: 0;
  background-color: var(--pico-background-color);
  box-shadow: var(--pico-box-shadow);
  color: var(--pico-color); /* Use the overridden dark gray color */
  font-weight: var(--pico-font-weight, normal); /* Added default weight */
  padding: 0.6rem 0.8rem; /* Added some default padding */
  font-size: 1rem; /* Added default font size */
  width: 100%; /* Make inputs take full width by default */
  box-sizing: border-box; /* Ensure padding doesn't break layout */
  transition: border-color 0.2s ease, box-shadow 0.2s ease; /* Add focus transition */
}

/* Optional: Add focus styles using your accent color */
input:focus, select:focus, textarea:focus {
  --pico-border-color: var(--color-accent); /* Accent color border on focus */
  --pico-box-shadow: 0 0 0 2px rgba(161, 140, 209, 0.2); /* Subtle glow on focus */
  border-color: var(--pico-border-color);
  box-shadow: var(--pico-box-shadow);
}
/* === Base === */
html, body {
  height: 100%;
  background-color: var(--color-bg);
  font-family: 'Funnel Sans', sans-serif;
  color: var(--color-text);
  margin: 0;
  padding: 0;
}

main {
  width: 100%;
  padding: 1.5rem;
  box-sizing: border-box; /* Ensures padding is included in the width */
}

h1, h2, h3, h4 {
  color: var(--color-accent);
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover {
  color: var(--color-hover);
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 1rem 0;
}

/* -------------------------------------------- */
/* DASHBOARD LAYOUT                             */
/* -------------------------------------------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1.2fr; /* Main findings | Karmic chart | Other details */
  gap: 1.5rem;
  align-items: start; /* Align items to the top of their cell */
}

.dashboard-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  height: 100%; /* Make cards in a row the same height */
  box-sizing: border-box;
}

.stacked-cards {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

/* -------------------------------------------- */
/* FORM BAR                                     */
/* -------------------------------------------- */
.form-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.form-bar input {
  flex-grow: 1;
}

/* -------------------------------------------- */
/* TABLES                                       */
/* -------------------------------------------- */
.primary-table, .detail-table {
  width: 100%;
  border-collapse: collapse;
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.9rem;
}

.primary-table th, .primary-table td,
.detail-table th, .detail-table td {
  border: 1px solid var(--color-border);
  padding: 0.6rem 0.8rem;
  text-align: left;
  vertical-align: middle;
}

.primary-table th, .detail-table th {
  background: var(--color-accent-light);
  font-weight: 600;
}

.primary-table td:nth-child(2), .detail-table td:nth-child(2) {
  text-align: center;
  font-weight: 600;
}

.primary-table tr:nth-child(even), .detail-table tr:nth-child(even) {
  background: #FAF9FD;
}

/* Center align content in the last column of the main table */
.primary-table td:last-child {
    text-align: center;
}


/* -------------------------------------------- */
/* KARMIC CHART GRID                            */
/* -------------------------------------------- */
.karmic-grid table {
  width: 100%;
  border-collapse: collapse;
}

.karmic-grid td {
  color: #222 !important;                /* Make numbers visible */
  background-color: #f8f6fb !important;  /* Soft lilac tone background */
  border: 1px solid #d9c9f3 !important;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
}

.karmic-grid small {
  color: #7a6ba3 !important;
  font-weight: 500;
}


/* -------------------------------------------- */
/* POSITIVE / NEGATIVE LINES                    */
/* -------------------------------------------- */
.lines-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.lines-grid ul {
    margin: 0;
    padding-left: 1.2rem;
    font-size: 0.9rem;
}
.lines-grid li {
    margin-bottom: 0.25rem;
}

/* -------------------------------------------- */
/* BUTTONS & INPUTS                             */
/* -------------------------------------------- */
button, .compact-button, .secondary {
  border: none;
  border-radius: 6px;
  padding: 0.45rem 0.9rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  white-space: nowrap; /* Prevent button text from wrapping */
}

.compact-button {
  background-color: var(--color-accent);
  color: white;
}
.compact-button:hover {
  background-color: var(--color-hover);
}

.secondary {
  font-size: 0.8rem;
  padding: 0.3rem 0.7rem;
  background-color: var(--color-accent-light);
  color: var(--color-text);
}
.secondary:hover {
  background-color: var(--color-hover);
  color: white;
}

input, select, textarea {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.4rem 0.6rem;
  background-color: var(--color-surface);
  font-family: inherit;
  transition: all 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(161, 140, 209, 0.2);
}