/* Cina 2027 — Dragon & Gold Theme */
:root {
  --night: #1a0a0a;
  --deep: #2b0f0f;
  --red: #c8102e;
  --red-dark: #8e0000;
  --gold: #d4af37;
  --gold-light: #f2d675;
  --snow: #fdf6e3;
  --ice: #e8d9b5;
  --white: #fff8ec;
  --danger: #e85d5d;
  --text: #e8d9b5;
  --text-light: #b89a6e;
  --radius: 10px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--night);
  color: var(--text);
  min-height: 100vh;
}

/* LOGIN */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(170deg, #1a0a0a 0%, #2b0f0f 40%, #4a1010 70%, #1a0a0a 100%);
}
.login-box {
  background: var(--deep);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 0 30px rgba(200,16,46,0.15);
}
.login-header { text-align: center; margin-bottom: 1.5rem; }
.aurora-icon { font-size: 2rem; display: block; margin-bottom: 0.5rem; }
.login-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--gold-light);
  margin-bottom: 0.3rem;
}
.login-header p { font-size: 0.85rem; color: var(--text-light); }
.login-form { display: flex; flex-direction: column; gap: 0.8rem; }

.alert {
  background: rgba(232,93,93,0.15);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* INPUTS */
input, textarea, select {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(212,175,55,0.2);
  color: var(--snow);
  padding: 0.7rem 1rem;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border 0.2s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--gold); }
input::placeholder, textarea::placeholder { color: var(--text-light); }
textarea { resize: vertical; min-height: 70px; }
select { cursor: pointer; }
input[type="file"] { padding: 0.5rem; }

/* BUTTONS */
.btn, .login-form button {
  background: linear-gradient(135deg, var(--red), var(--gold));
  color: var(--night);
  border: none;
  padding: 0.7rem 1.5rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn:hover, .login-form button:hover { opacity: 0.85; }
.btn-sm {
  background: rgba(212,175,55,0.12);
  color: var(--gold-light);
  border: 1px solid rgba(212,175,55,0.3);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-sm:hover { background: rgba(212,175,55,0.22); }

/* TOPBAR */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1.5rem;
  background: var(--deep);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-left { display: flex; align-items: center; gap: 0.5rem; }
.topbar-left strong { color: var(--gold-light); font-size: 1rem; }
.topbar-right { display: flex; align-items: center; gap: 1rem; font-size: 0.85rem; }

/* CONTAINER */
.container { max-width: 900px; margin: 0 auto; padding: 1.5rem; }

/* TABS */
.tabs {
  display: flex;
  gap: 0.3rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(212,175,55,0.15);
  padding-bottom: 0;
  overflow-x: auto;
}
.tab {
  background: none;
  border: none;
  color: var(--text-light);
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.tab.active { color: var(--gold-light); border-bottom-color: var(--red); }
.tab:hover { color: var(--snow); }

/* TAB CONTENT */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* SECTIONS */
.section-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.section-head h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--gold-light);
}

/* CARDS */
.card {
  background: var(--deep);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: var(--radius);
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  transition: border 0.2s;
  border-left: 3px solid var(--red);
}
.card:hover { border-color: rgba(212,175,55,0.35); }
.card-sm { padding: 0.8rem 1rem; display: flex; align-items: center; justify-content: space-between; }
.card-head { margin-bottom: 0.5rem; }
.card-head h3 { color: var(--gold-light); font-size: 1rem; margin-bottom: 0.2rem; }
.card a { color: var(--gold); text-decoration: none; font-weight: 500; }
.card a:hover { text-decoration: underline; }

/* BADGES */
.badge {
  font-size: 0.75rem;
  color: var(--text-light);
  background: rgba(212,175,55,0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
}
.badge-total { font-size: 0.9rem; font-weight: 700; color: var(--red); }

/* NOTE BOX */
.note-box {
  background: rgba(200,16,46,0.08);
  border-left: 3px solid var(--gold);
  padding: 0.6rem 1rem;
  margin-top: 0.5rem;
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  color: var(--ice);
}

/* FORMS */
.form-box {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.hidden { display: none !important; }

/* TABLE */
.budget-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.budget-table th {
  text-align: left;
  padding: 0.5rem 0.8rem;
  color: var(--gold-light);
  border-bottom: 1px solid rgba(212,175,55,0.2);
  font-weight: 500;
}
.budget-table td { padding: 0.5rem 0.8rem; border-bottom: 1px solid rgba(212,175,55,0.08); }

/* EMPTY STATE */
.empty { color: var(--text-light); font-style: italic; padding: 2rem; text-align: center; }

/* RESPONSIVE */
@media (max-width: 600px) {
  .container { padding: 1rem; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .budget-table { font-size: 0.75rem; }
  .budget-table th, .budget-table td { padding: 0.4rem; }
  .card-sm { flex-direction: column; align-items: flex-start; gap: 0.3rem; }
}

/* Aggiunte per dashboard */
.btn-danger { background: rgba(232,93,93,0.15); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: rgba(232,93,93,0.3); opacity: 1; }
.card-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.option-detail { font-size: 0.8rem; color: var(--text-light); }
.budget-section-title { font-family: 'Playfair Display', serif; color: var(--gold-light); font-size: 1.1rem; }
