/*
 * Bill Bucks stylesheet — ported directly from frontend/src/App.css
 */

:root {
  --gold: #FFD000;
  --white: #FFFFFF;
  --cream: #F0EFEE;
  --black: #000000;
  --orange: #F08020;
  --cyan: #00C0D8;
  --teal: #007890;
  --gold-light: #FFE378;
  --red-dark: #D34400;
  --pink: #FFB4C8;
  --red: #C23C49;
  --red-deepest: #991313;
  --cyan-light: #89EFF7;
  --navy: #1F1F47;
  --green-light: #88E4B6;
  --green: #24C976;
  --green-dark: #476052;
  --green-darkest: #2E3A33;
  --gray: #565652;
}

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

body {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  background: var(--white);
  color: var(--black);
}

h1, h2 { font-family: 'Sora', sans-serif; font-weight: 800; }
h3      { font-family: 'Sora', sans-serif; font-weight: 400; }
label   { font-family: 'Sora', sans-serif; font-weight: 400; }
button  { font-family: 'Inter', sans-serif; font-weight: 700; }
p, td, input, select, textarea { font-family: 'Inter', sans-serif; font-weight: 300; }
th      { font-family: 'Inter', sans-serif; font-weight: 700; }
.caption { font-family: 'Inter', sans-serif; font-weight: 400; }
.lead   { font-family: 'Sora', sans-serif; font-weight: 200; }

.app { max-width: 920px; margin: 0 auto; padding: 24px; }

/* ── Login ────────────────────────────────────── */
.login-card {
  max-width: 400px;
  margin: 100px auto;
  background: var(--white);
  padding: 48px 40px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,.06);
  text-align: center;
  border-top: 4px solid var(--gold);
}
.login-card .logo { width: 120px; margin-bottom: 20px; }
.login-card h1 { font-size: 1.8rem; margin-bottom: 4px; }
.login-card .subtitle { font-family: 'Sora', sans-serif; font-weight: 200; color: var(--gray); margin-bottom: 28px; font-size: 1rem; }

.btn-sso {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  border: 1px solid #d9d9d6;
  border-radius: 8px;
  background: var(--white);
  color: var(--black);
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-bottom: 20px;
}
.btn-sso:hover { background: var(--cream); box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* ── Header ───────────────────────────────────── */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--cream);
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header-left .logo { height: 36px; }
header h1 { font-size: 1.5rem; color: var(--gold); }
.user-info { display: flex; align-items: center; gap: 12px; font-size: 0.85rem; color: var(--gray); }
.btn-link { background: none; border: none; color: var(--teal); cursor: pointer; font-size: 0.85rem; font-weight: 700; }
.btn-link:hover { color: var(--cyan); }

/* ── Nav ──────────────────────────────────────── */
nav {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--cream);
  border-radius: 10px;
  padding: 4px;
}
nav button {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--gray);
  transition: all 0.15s;
}
nav button:hover { color: var(--black); }
nav button.active {
  background: var(--gold);
  color: var(--black);
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ── Messages ─────────────────────────────────── */
.msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 0.9rem; font-weight: 400; }
.msg.error   { background: #fef2f2; color: var(--red-deepest); border: 1px solid var(--pink); }
.msg.success { background: #f0fdf8; color: var(--green-dark); border: 1px solid var(--green-light); }

/* ── Dashboard Cards ──────────────────────────── */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.card {
  background: var(--white);
  padding: 24px;
  border-radius: 14px;
  border: 1px solid var(--cream);
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
}
.card h3 {
  font-size: 0.78rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.big-num { font-family: 'Sora', sans-serif; font-size: 2.6rem; font-weight: 800; line-height: 1; }
.card p { font-size: 0.78rem; color: var(--gray); margin-top: 6px; font-weight: 400; }

.card-sheet-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  color: var(--teal);
  text-decoration: none;
}
.card-sheet-link:hover { color: var(--cyan); text-decoration: underline; }

.profile-divider { border: none; border-top: 1px solid var(--cream); margin: 24px 0 8px; }

/* ── Danger buttons ───────────────────────────── */
.btn-danger {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: background 0.15s, color 0.15s;
}
.btn-danger:hover { background: var(--red); color: var(--white); }
.btn-danger-sm {
  background: none;
  border: 1px solid var(--red);
  color: var(--red);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.btn-danger-sm:hover { background: var(--red); color: var(--white); }

/* ── Admin panel ─────────────────────────────── */
.admin-section {
  background: var(--white);
  padding: 36px;
  border-radius: 14px;
  border: 1px solid var(--cream);
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.admin-section h2 { margin-bottom: 20px; }
.admin-select {
  font-size: 0.82rem;
  padding: 4px 6px;
  border: 1px solid var(--cream);
  border-radius: 6px;
  background: var(--white);
  color: var(--black);
  cursor: pointer;
  width: auto;
  min-width: min-content;
}
.num-cell { font-variant-numeric: tabular-nums; text-align: right; }

.give-card::before    { background: var(--gold); }
.give-card .big-num   { color: var(--black); }
.receive-card::before { background: var(--cyan); }
.receive-card .big-num { color: var(--teal); }
.amazon-card::before  { background: var(--orange); }
.amazon-card .big-num  { color: var(--orange); }
.dayoff-card::before  { background: var(--green); }
.dayoff-card .big-num  { color: var(--green-dark); font-size: 1.6rem; }

/* ── Forms ─────────────────────────────────────── */
.form-section {
  background: var(--white);
  padding: 36px;
  border-radius: 14px;
  border: 1px solid var(--cream);
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.form-section h2 { margin-bottom: 24px; }
label { display: block; margin-bottom: 18px; font-size: 0.85rem; color: var(--gray); }
input, select, textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 11px 14px;
  border: 1px solid #d9d9d6;
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--white);
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(255, 208, 0, 0.15);
}
textarea { min-height: 80px; resize: vertical; }
button[type="submit"] {
  background: var(--gold);
  color: var(--black);
  border: none;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}
button[type="submit"]:hover    { background: #e6bb00; }
button[type="submit"]:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Tables ────────────────────────────────────── */
.history-section {
  background: var(--white);
  padding: 36px;
  border-radius: 14px;
  border: 1px solid var(--cream);
  box-shadow: 0 1px 6px rgba(0,0,0,.04);
}
.history-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.history-header h2 { margin: 0; }
.history-header + .history-header, .table-scroll + .history-header, .pagination-controls + .history-header { margin-top: 36px; }
.history-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.filter-group { display: flex; gap: 6px; }
.filter-btn { padding: 5px 14px; border-radius: 20px; border: 1px solid var(--cream); background: var(--white); font-size: 0.82rem; cursor: pointer; color: var(--black); transition: background 0.15s, border-color 0.15s; }
.filter-btn:hover { border-color: var(--gold); }
.filter-btn.active { background: var(--gold); border-color: var(--gold); color: var(--black); font-weight: 600; }
table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.admin-table { min-width: 700px; }
.admin-table .num-cell, .admin-table td:last-child { white-space: nowrap; }
.admin-table th:first-child { position: sticky; left: 0; z-index: 2; background: #fff; box-shadow: 2px 0 4px -2px rgba(0,0,0,.1); }
.admin-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; box-shadow: 2px 0 4px -2px rgba(0,0,0,.1); }
.admin-table tr:hover td:first-child { background: #fafaf8; }
th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--cream);
  color: var(--gray);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
th.sortable-th { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable-th:hover { color: var(--gold); }
td { padding: 10px 12px; border-bottom: 1px solid var(--cream); font-size: 0.88rem; }
tr:hover td { background: #fafaf8; }
tr.sent td:nth-child(4)     { color: var(--red); font-weight: 700; }
tr.sent td:nth-child(4)::before { content: '-'; }
tr.received td:nth-child(4) { color: var(--green); font-weight: 700; }
tr.received td:nth-child(4)::before { content: '+'; }

/* ── Dashboard help link ──────────────────────── */
.help-link {
  display: inline-block;
  margin-bottom: 16px;
  margin-right: 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--teal);
  text-decoration: none;
}
.help-link:hover { color: var(--cyan); text-decoration: underline; }

/* ── Redeem form extras ───────────────────────── */
.redeem-note {
  background: var(--cream);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.87rem;
  color: var(--gray);
  margin-bottom: 20px;
  line-height: 1.5;
}
.redeem-note a { color: var(--teal); }

.field-hint {
  display: block;
  font-size: 0.78rem;
  color: var(--gray);
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  margin-bottom: 4px;
}

.input-readonly {
  background: var(--cream) !important;
  color: var(--gray) !important;
  cursor: default;
}

.bill-bucks-preview {
  background: #fffbe6;
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  margin-bottom: 20px;
  color: var(--black);
}

/* ── Pagination ───────────────────────────────── */
.pagination-controls { display: flex; align-items: center; gap: 12px; justify-content: center; margin: 8px 0 4px; }
.page-btn { padding: 5px 14px; border-radius: 20px; border: 1px solid var(--cream); background: var(--white); font-size: 0.82rem; cursor: pointer; color: var(--black); transition: background 0.15s, border-color 0.15s; }
.page-btn:hover:not(:disabled) { border-color: var(--gold); background: #fffbe6; }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 0.82rem; color: var(--gray); }
.per-page-sel { font-size: 0.82rem; padding: 5px 8px; border: 1px solid var(--cream); border-radius: 20px; background: var(--white); color: var(--black); cursor: pointer; width: auto; margin-top: 0; }

/* ── Dev button ───────────────────────────────── */
.btn-dev { background: none; border: 1px solid var(--teal); color: var(--teal); padding: 9px 20px; border-radius: 8px; font-size: 0.88rem; font-weight: 700; cursor: pointer; margin-top: 8px; margin-left: 10px; transition: background 0.15s, color 0.15s; }
.btn-dev:hover { background: var(--teal); color: var(--white); }
.btn-dev:disabled { opacity: 0.45; cursor: not-allowed; }

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
  .app { padding: 16px; }
  .login-card { margin: 40px auto; padding: 36px 28px; }
  header { flex-wrap: wrap; gap: 8px; }
  .user-info { font-size: 0.8rem; }
  .cards { grid-template-columns: 1fr 1fr; gap: 12px; }
  .big-num { font-size: 2.2rem; }
  .dayoff-card .big-num { font-size: 1.4rem; }
  .form-section, .history-section { padding: 24px 20px; }
  button[type="submit"] { width: 100%; }
  table { min-width: 480px; }
}

@media (max-width: 480px) {
  .app { padding: 12px; }
  .login-card { margin: 16px auto; padding: 28px 20px; border-radius: 12px; }
  .login-card .logo { width: 90px; }
  .login-card h1 { font-size: 1.5rem; }
  header { flex-direction: column; align-items: flex-start; gap: 6px; padding-bottom: 12px; }
  .header-left .logo { height: 28px; }
  header h1 { font-size: 1.2rem; }
  .user-info { width: 100%; justify-content: space-between; }
  nav { padding: 3px; gap: 3px; }
  nav button { padding: 9px 6px; font-size: 0.78rem; }
  .cards { grid-template-columns: 1fr; gap: 10px; }
  .card { padding: 18px; }
  .big-num { font-size: 2.4rem; }
  .dayoff-card .big-num { font-size: 1.5rem; }
  .form-section, .history-section { padding: 20px 16px; border-radius: 10px; }
  .form-section h2, .history-section h2 { font-size: 1.2rem; }
  input, select, textarea { font-size: 1rem; padding: 12px 12px; }
  button[type="submit"] { padding: 14px; font-size: 1rem; }
  .bill-bucks-preview { font-size: 0.85rem; }
}
