/* ================= VARIABLES ================= */

:root {
  --bg: #ffffff;
  --text: #111111;
  --card: #ffffff;

  --accent: #6a5acd;          /* links, focus, highlights */
  --primary-btn: #6a5acd;     /* CTA in light mode */
}

/* ================= DARK THEME ================= */

[data-theme="dark"] {
  --bg: #121417;
  --text: #d6d9dd;
  --card: #121417;

  --accent: #8a7cff;
  --primary-btn: #2a2f36;     /* calm neutral CTA */
}

/* ================= BASE ================= */

body {
  background: var(--bg);
  color: var(--text);
}

.container {
  background: transparent;
}

/* ================= LINKS ================= */

a {
  color: var(--accent);
  text-decoration: none;
  opacity: 0.85;
}

a:hover {
  text-decoration: underline;
  opacity: 1;
}

html[data-theme="dark"] a {
  opacity: 0.75;
}

/* ================= HEADER ================= */

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 1.4rem 0;
  margin-bottom: 2rem;

  background: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html[data-theme="dark"] .app-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-title {
  font-size: 2.2rem;
  font-weight: 700;
}

/* ================= THEME TOGGLE BUTTON ================= */

.theme-btn {
  background: none;
  border: none;
  font-size: 2rem;
  padding: 0.4rem;
  line-height: 1;
  opacity: 0.6;
}

.theme-btn:hover {
  opacity: 1;
}

.theme-btn:active {
  transform: scale(0.95);
}

/* icon visibility logic */
[data-theme="light"] .icon-night { display: none; }
[data-theme="dark"]  .icon-day   { display: none; }

/* ================= INPUTS ================= */

input[type="number"],
input[type="text"] {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

html[data-theme="dark"] input[type="number"],
html[data-theme="dark"] input[type="text"] {
  border-color: rgba(255, 255, 255, 0.2);
}

input[type="number"]:focus,
input[type="text"]:focus {
  border-color: var(--accent);
  outline: none;
}

/* ================= PRIMARY ACTION BUTTON ================= */

.primary-action {
  width: 100%;
  background: var(--primary-btn);
  color: #ffffff;
  border: none;

  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;

  padding: 1.2rem;
  border-radius: 8px;
}

.primary-action:active {
  transform: scale(0.98);
}

html[data-theme="dark"] .primary-action {
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ================= TABLES ================= */

table {
  background: transparent;
}

tbody tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] tbody tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.025);
}

/* row separators */
table th,
table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] table th,
html[data-theme="dark"] table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

/* ================= OVER LIMIT ================= */

tr.over-limit {
  background-color: rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] tr.over-limit {
  background-color: rgba(138, 124, 255, 0.12);
  color: #eae6ff;
}

/* ================= HR ================= */

hr {
  border-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="dark"] hr {
  border-color: rgba(255, 255, 255, 0.1);
}

/* ================= FOOTER ================= */

.app-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;

  font-size: 0.95em;
  opacity: 0.65;
}

.app-footer a {
  color: var(--accent);
  opacity: 0.85;
}

.app-footer a:hover {
  opacity: 1;
}

.footer-main {
  line-height: 1.5;
}

.footer-version {
  margin-top: 0.4rem;
  font-size: 0.85em;
  opacity: 0.6;
}

/* ================= MOBILE READABILITY ================= */

@media (max-width: 600px) {

  body {
    font-size: 18px;
  }

  input[type="number"],
  input[type="text"] {
    font-size: 20px;
    height: 52px;
    padding: 10px 12px;
  }

  .primary-action {
    font-size: 18px;
    min-height: 52px;
  }

  table {
    font-size: 17px;
  }
}

/* OVERRIDE SKELETON PRIMARY BUTTON */

.button-primary {
  background-color: var(--primary-btn) !important;
  border-color: var(--primary-btn) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .button-primary {
  background-color: #2a2f36 !important;
  border-color: #2a2f36 !important;
}