/* ===========================
   Ranch Manager – Red Dead Redemption 2 Style
   =========================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cinzel:wght@400;600;700&family=Crimson+Text:ital,wght@0,400;0,600;1,400&display=swap');

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

/* ── Body & Background ── */
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #0d0603;
  color: #e8d5b0;
  min-height: 100vh;
  background-image:
    /* Top atmospheric haze */
    radial-gradient(ellipse 120% 50% at 50% -10%, rgba(90,20,5,0.7) 0%, transparent 70%),
    /* Left warm glow */
    radial-gradient(ellipse 60% 80% at -5% 60%, rgba(110,30,5,0.45) 0%, transparent 60%),
    /* Right warm glow */
    radial-gradient(ellipse 60% 80% at 105% 40%, rgba(80,20,5,0.4) 0%, transparent 60%),
    /* Bottom deep vignette */
    radial-gradient(ellipse 100% 60% at 50% 110%, rgba(0,0,0,0.9) 0%, transparent 60%),
    /* Subtle center warmth */
    radial-gradient(ellipse 80% 60% at 50% 50%, rgba(40,8,2,0.5) 0%, transparent 100%);
}

/* Noise texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

/* Bottom ground fade */
body::after {
  content: '';
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 180px;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

/* ===== NAV BAR — Transparent / Glass ===== */
.ranch-nav {
  background: linear-gradient(to bottom,
    rgba(0,0,0,0.72) 0%,
    rgba(10,3,1,0.45) 100%);
  border-bottom: 1px solid rgba(180,100,40,0.18);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(180,100,40,0.28);
  border-radius: 6px;
  color: #d4b896;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.nav-btn:hover  { background: rgba(140,55,15,0.45); border-color: rgba(220,140,60,0.55); color: #f5e0b5; }
.nav-btn.active { background: rgba(140,55,15,0.55); border-color: rgba(220,140,60,0.65); color: #f5e0b5; }

.nav-spacer { flex: 1; }

.nav-guild-badge {
  padding: 5px 14px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(180,100,40,0.35);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  color: #f0c070;
  letter-spacing: 0.3px;
}

/* ===== MAIN WRAPPER ===== */
.ranch-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  position: relative;
  z-index: 1;
}

/* ===== RDR2 LOGO / ORNATE PAGE HEADER ===== */
.rdr-header {
  text-align: center;
  padding: 44px 20px 36px;
  position: relative;
  margin-bottom: 28px;
}

/* Top horizontal ornament line */
.rdr-header::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201,168,76,0.7), rgba(201,168,76,1), rgba(201,168,76,0.7), transparent);
  margin-bottom: 22px;
}

/* Bottom horizontal ornament line */
.rdr-header::after {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(201,168,76,0.7), rgba(201,168,76,1), rgba(201,168,76,0.7), transparent);
  margin-top: 22px;
}

.rdr-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 5px;
  color: #a07840;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.rdr-title {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(26px, 5vw, 48px);
  font-weight: 900;
  color: #f0c070;
  line-height: 1.1;
  letter-spacing: 2px;
  text-shadow:
    0 0 40px rgba(201,168,76,0.35),
    0 2px 4px rgba(0,0,0,0.8);
  margin-bottom: 4px;
}

.rdr-subtitle {
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  font-style: italic;
  color: rgba(200,165,100,0.65);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

/* Ornate corner brackets (purely CSS) */
.rdr-badge {
  display: inline-block;
  position: relative;
  padding: 20px 36px;
  margin: 0 auto;
}
.rdr-badge::before,
.rdr-badge::after {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border-color: rgba(201,168,76,0.6);
  border-style: solid;
}
.rdr-badge::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.rdr-badge::after  { bottom: 0; right: 0; border-width: 0 2px 2px 0; }

.rdr-ornament {
  color: rgba(201,168,76,0.55);
  font-size: 18px;
  letter-spacing: 8px;
  margin: 6px 0;
  display: block;
}

/* ===== SECTION HEADER ===== */
.section-title {
  font-family: 'Cinzel', serif;
  font-size: 18px;
  font-weight: 700;
  color: #f0c070;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.section-sub {
  font-size: 12px;
  color: rgba(200,170,120,0.55);
  margin-bottom: 16px;
}

/* ===== TOTALS BAR ===== */
.totals-bar {
  background: rgba(15,5,2,0.75);
  border: 1px solid rgba(180,100,40,0.2);
  border-radius: 8px;
  padding: 14px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 14px;
  backdrop-filter: blur(4px);
}
.totals-bar strong { color: #f0c070; }
.totals-bar .t-label { color: rgba(200,170,120,0.7); margin-right: 4px; }

/* ===== PLAYER GRID ===== */
.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.player-card {
  background: rgba(12,4,2,0.82);
  border: 1px solid rgba(140,65,20,0.3);
  border-radius: 10px;
  padding: 18px;
  transition: border-color 0.2s, background 0.2s;
  backdrop-filter: blur(4px);
}
.player-card:hover { border-color: rgba(201,168,76,0.5); background: rgba(20,7,3,0.9); }

.player-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.player-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(180,100,40,0.45);
  object-fit: cover;
  background: rgba(80,40,10,0.5);
  flex-shrink: 0;
}
.player-name { font-weight: 700; font-size: 15px; color: #f5e0b5; margin-bottom: 2px; }
.player-id   { font-size: 11px; color: rgba(180,140,90,0.6); font-family: monospace; }

.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stat-row:last-of-type { border-bottom: none; }
.stat-icon  { font-size: 15px; width: 22px; text-align: center; flex-shrink: 0; }
.stat-label { color: rgba(200,170,120,0.7); flex: 1; }
.stat-val   { font-weight: 700; color: #f5e0b5; }
.stat-val.highlight { color: #f0c070; font-size: 15px; }

.card-actions { display: flex; gap: 8px; margin-top: 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 16px; border: none; border-radius: 6px; font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; transition: filter 0.15s, transform 0.1s; letter-spacing: 0.2px; }
.btn:hover   { filter: brightness(1.18); }
.btn:active  { transform: scale(0.97); }
.btn-edit    { background: rgba(40,80,40,0.8);  border: 1px solid rgba(70,130,70,0.4);  color: #90d890; }
.btn-reset   { background: rgba(90,25,15,0.8);  border: 1px solid rgba(160,55,35,0.4);  color: #e08080; }
.btn-pay     { background: rgba(70,48,8,0.8);   border: 1px solid rgba(160,115,30,0.4); color: #f0c070; }
.btn-pay.paid { background: rgba(25,60,25,0.8); border-color: rgba(50,120,50,0.4);      color: #70d870; }
.btn-primary { background: linear-gradient(135deg, rgba(140,65,18,0.95), rgba(110,45,10,0.95)); border: 1px solid rgba(201,168,76,0.4); color: #f5e0b5; }
.btn-danger  { background: rgba(110,25,12,0.9); border: 1px solid rgba(190,60,35,0.4); color: #f09090; }
.btn-lg { padding: 11px 26px; font-size: 15px; }

/* Badge */
.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 10px; font-weight: 800; letter-spacing: 0.06em; }
.badge-unpaid { background: rgba(150,40,8,0.55); border: 1px solid rgba(210,70,25,0.35); color: #ff9060; }
.badge-paid   { background: rgba(15,80,15,0.55); border: 1px solid rgba(50,150,50,0.35); color: #70ee70; }

/* Payout rows */
.payout-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 5px 0; font-size: 14px; }
.payout-label { color: rgba(200,170,120,0.7); }
.payout-val { font-weight: 700; color: #f5e0b5; }
.payout-total-val { font-weight: 800; color: #f0c070; font-size: 16px; }

/* ===== PANELS ===== */
.info-panel {
  background: rgba(12,4,2,0.78);
  border: 1px solid rgba(160,90,30,0.22);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(6px);
}
.info-panel h3 { font-family: 'Cinzel', serif; font-size: 14px; color: #f0c070; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; letter-spacing: 0.5px; }
.info-panel .info-row { font-size: 13px; color: rgba(200,170,120,0.8); padding: 3px 0; }
.info-panel .info-row strong { color: #e8d5b0; }

/* Totals grid */
.totals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
@media (max-width: 640px) { .totals-grid { grid-template-columns: 1fr; } }

/* Modal */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 200; align-items: center; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: #100501; border: 1px solid rgba(180,100,40,0.4); border-radius: 12px; padding: 28px; width: 380px; max-width: 95vw; }
.modal h3 { font-family: 'Cinzel', serif; font-size: 16px; color: #f0c070; margin-bottom: 18px; letter-spacing: 0.5px; }
.modal label { display: block; font-size: 13px; color: rgba(200,170,120,0.8); margin: 12px 0 4px; }
.modal input { width: 100%; padding: 10px; background: rgba(30,10,3,0.95); border: 1px solid rgba(180,100,40,0.35); border-radius: 7px; color: #e8d5b0; font-size: 14px; }
.modal input:focus { outline: none; border-color: rgba(220,140,60,0.7); }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 12px; color: rgba(200,170,120,0.75); margin-bottom: 5px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; }
.form-group input,
.form-group select {
  width: 100%;
  padding: 11px 13px;
  background: rgba(20,7,2,0.9);
  border: 1px solid rgba(160,90,30,0.35);
  border-radius: 7px;
  color: #e8d5b0;
  font-size: 14px;
  transition: border-color .15s;
}
.form-group input::placeholder { color: rgba(160,120,70,0.38); }
.form-group input:focus,
.form-group select:focus { outline: none; border-color: rgba(201,168,76,0.65); box-shadow: 0 0 0 2px rgba(201,168,76,0.08); }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 18px; }

/* Notice */
.notice { background: rgba(30,12,3,0.7); border: 1px solid rgba(160,90,30,0.22); border-radius: 8px; padding: 12px 16px; font-size: 13px; color: rgba(200,170,120,0.8); margin-bottom: 14px; }

/* Alert */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 13px; margin: 12px 0; }
.alert-success { background: rgba(15,65,15,0.55); border: 1px solid rgba(50,140,50,0.35); color: #70e070; }
.alert-error   { background: rgba(90,15,8,0.55);  border: 1px solid rgba(170,45,25,0.35); color: #f07070; }

/* Section bar */
.section-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }

/* ===== PAGE HEADER (transparent — shows background) ===== */
.page-header {
  background: transparent;
  border-bottom: 1px solid rgba(180,100,40,0.15);
  text-align: center;
  padding: 40px 20px;
}
.page-header h1 { font-family: 'Cinzel Decorative', serif; font-size: clamp(22px, 4vw, 36px); color: #f0c070; margin-bottom: 8px; letter-spacing: 1px; text-shadow: 0 0 30px rgba(201,168,76,0.3); }
.page-header p  { font-family: 'Crimson Text', serif; font-size: 16px; font-style: italic; color: rgba(200,165,100,0.6); }

/* Table */
.ranch-table { width: 100%; border-collapse: collapse; }
.ranch-table th { background: rgba(10,4,1,0.7); color: #c9a84c; padding: 12px 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; text-align: left; border-bottom: 1px solid rgba(160,90,30,0.22); }
.ranch-table td { padding: 13px 14px; border-bottom: 1px solid rgba(255,255,255,0.04); font-size: 13px; vertical-align: middle; }
.ranch-table tr:hover td { background: rgba(255,255,255,0.025); }

/* Utility */
.text-gold  { color: #f0c070; }
.text-muted { color: rgba(200,170,120,0.5); }
.text-green { color: #70e070; }
.text-red   { color: #f07070; }
.mt-1 { margin-top: 8px; }  .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.flex { display: flex; } .gap-2 { gap: 10px; } .items-center { align-items: center; }
.w-full { width: 100%; }
