/* RaspiCFO — common.css */

:root {
  --bg:       #0f1117;
  --panel:    #1a1d2e;
  --panel2:   #252840;
  --accent:   #7c6ff7;
  --accent2:  #5ee7df;
  --income:   #4ade80;
  --expense:  #f87171;
  --warn:     #fbbf24;
  --text:     #e8eaf6;
  --text-sub: #8891c0;
  --border:   #2e3356;
  --radius:   12px;
  --radius-lg: 20px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Utility */
.text-income  { color: var(--income); }
.text-expense { color: var(--expense); }
.text-warn    { color: var(--warn); }
.text-sub     { color: var(--text-sub); }
.text-accent  { color: var(--accent); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary  { background: var(--accent); color: #fff; }
.btn-success  { background: var(--income); color: #000; }
.btn-danger   { background: var(--expense); color: #fff; }
.btn-ghost    { background: var(--panel2); color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Form elements */
input, select, textarea {
  width: 100%;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}
select option { background: var(--panel2); }

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 0.3rem;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  background: var(--panel);
  border-radius: 10px;
  padding: 0.3rem;
}
.tab-btn {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-sub);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.15s;
}
.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 0.6rem 1.4rem;
  font-size: 0.9rem;
  z-index: 9999;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  white-space: nowrap;
}
.toast.show { opacity: 1; pointer-events: auto; visibility: visible; }
.toast.success { border-color: var(--income); color: var(--income); }
.toast.error   { border-color: var(--expense); color: var(--expense); }

/* Amount display */
.amount-lg {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.amount-md {
  font-size: 1.4rem;
  font-weight: 600;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-income  { background: rgba(74,222,128,0.15); color: var(--income); }
.badge-expense { background: rgba(248,113,113,0.15); color: var(--expense); }
