/* ================================================
   نقود الأفراح v2 — Complete Styles
   ================================================ */

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

:root {
  --gold: #f4c430;
  --gold2: #f59e0b;
  --rose: #f43f5e;
  --groom: #6366f1;
  --groom2: #818cf8;
  --bride: #ec4899;
  --bride2: #f472b6;
  --green: #10b981;
  --amber: #f59e0b;
  --red: #ef4444;
  --bg: #0d0d1b;
  --card: rgba(255, 255, 255, 0.055);
  --cardh: rgba(255, 255, 255, 0.09);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f1f5f9;
  --muted: #94a3b8;
  --r: 14px;
  --sh: 0 8px 32px rgba(0, 0, 0, .45);
}

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Background ── */
.bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.bg-deco span {
  position: absolute;
  font-size: 5rem;
  opacity: .035;
  animation: floatUp 20s linear infinite;
}

.d1 {
  left: 5%;
  animation-delay: 0s;
  font-size: 4rem;
}

.d2 {
  left: 25%;
  animation-delay: 4s;
  font-size: 7rem;
}

.d3 {
  left: 50%;
  animation-delay: 8s;
}

.d4 {
  left: 73%;
  animation-delay: 12s;
  font-size: 6rem;
}

.d5 {
  left: 90%;
  animation-delay: 16s;
  font-size: 3.5rem;
}

@keyframes floatUp {
  0% {
    transform: translateY(110vh) rotate(0deg);
    opacity: 0;
  }

  10% {
    opacity: .035;
  }

  90% {
    opacity: .035;
  }

  100% {
    transform: translateY(-20vh) rotate(360deg);
    opacity: 0;
  }
}

/* ── Header ── */
.header {
  position: relative;
  z-index: 10;
  background: linear-gradient(135deg, rgba(244, 196, 48, .13), rgba(244, 67, 94, .09));
  border-bottom: 1px solid var(--border);
  padding: 1.4rem 2rem;
  backdrop-filter: blur(12px);
}

/* ── Active Workspace Bar ── */
.workspace-bar {
  position: relative;
  z-index: 10;
  max-width: 1300px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wlabel {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gold);
}

.wtabs {
  display: flex;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.3rem;
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.wtab {
  padding: 0.45rem 1.1rem;
  border: none;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  transition: all 0.2s ease;
}

.wtab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.wtab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #000;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(244, 196, 48, 0.25);
}

@media (max-width: 480px) {
  .workspace-bar {
    flex-direction: column;
    align-items: stretch;
    margin: 1rem auto 0;
    gap: 0.4rem;
  }
  .wlabel {
    text-align: center;
    font-size: 0.8rem;
  }
  .wtabs {
    border-radius: 10px;
    padding: 0.2rem;
  }
  .wtab {
    flex: 1;
    padding: 0.35rem 0.6rem;
    font-size: 0.78rem;
  }
}


.hc {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.hico {
  font-size: 2.8rem;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.12);
  }
}

.htitle {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hsub {
  font-size: .85rem;
  color: var(--muted);
  margin-top: .15rem;
}

/* ── Stats ── */
.stats-wrap {
  position: relative;
  z-index: 10;
  max-width: 1300px;
  margin: 1.8rem auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
}

.sc {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.3rem 1.2rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  backdrop-filter: blur(10px);
  transition: transform .25s, background .25s;
}

.sc:hover {
  transform: translateY(-4px);
  background: var(--cardh);
}

.total-card {
  border-color: rgba(244, 196, 48, .35);
}

.groom-card {
  border-color: rgba(99, 102, 241, .35);
}

.bride-card {
  border-color: rgba(236, 72, 153, .35);
}

.count-card {
  border-color: rgba(20, 184, 166, .35);
}

.returned-card {
  border-color: rgba(16, 185, 129, .35);
}

.pending-card {
  border-color: rgba(245, 158, 11, .35);
}

.balance-card {
  border-color: rgba(99, 240, 220, .3);
}

.balance-card .sv {
  color: #5eead4;
}

.si {
  font-size: 2.3rem;
  flex-shrink: 0;
}

.sc>div {
  display: flex;
  flex-direction: column;
  gap: .05rem;
}

.sl {
  font-size: .75rem;
  color: var(--muted);
  font-weight: 600;
}

.sv {
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1.1;
}

.su {
  font-size: .7rem;
  color: var(--muted);
}

.total-card .sv {
  color: var(--gold);
}

.groom-card .sv {
  color: var(--groom2);
}

.bride-card .sv {
  color: var(--bride2);
}

.count-card .sv {
  color: #2dd4bf;
}

.returned-card .sv {
  color: #34d399;
}

.pending-card .sv {
  color: #fbbf24;
}

/* ── Main ── */
.main {
  position: relative;
  z-index: 10;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
}

/* ── Controls bar ── */
.cbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.3rem;
  margin-bottom: 1.2rem;
  backdrop-filter: blur(10px);
}

.sbox {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .45rem .9rem;
  flex: 1;
  min-width: 200px;
}

.sbox input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: .9rem;
  width: 100%;
}

.sbox input::placeholder {
  color: var(--muted);
}

.ftabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.ftab {
  padding: .38rem .85rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: 'Cairo', sans-serif;
  font-size: .82rem;
  cursor: pointer;
  transition: all .2s ease;
}

.ftab:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--text);
}

.ftab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #000;
  border-color: transparent;
  font-weight: 800;
}

.abtns {
  display: flex;
  gap: .6rem;
}

.abtn {
  padding: .48rem 1.1rem;
  border: none;
  border-radius: 9px;
  font-family: 'Cairo', sans-serif;
  font-size: .88rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .25s;
}

.abtn.add {
  background: linear-gradient(135deg, var(--groom), #4338ca);
  color: #fff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, .4);
}

.abtn.add:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, .6);
}

.abtn.import {
  background: linear-gradient(135deg, var(--green), #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, .4);
}

.abtn.import:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, .6);
}

/* ── Table wrapper ── */
.twrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  backdrop-filter: blur(10px);
  box-shadow: var(--sh);
}

.tscroll {
  overflow-x: auto;
}

#tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  min-width: 700px;
}

#tbl thead {
  background: linear-gradient(135deg, rgba(244, 196, 48, .14), rgba(244, 67, 94, .09));
}

#tbl thead th {
  padding: .9rem 1rem;
  text-align: center;
  font-weight: 800;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
  font-size: .8rem;
  letter-spacing: .04em;
  white-space: nowrap;
}

#tbl tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, .04);
  transition: background .18s;
}

#tbl tbody tr:last-child {
  border-bottom: none;
}

#tbl tbody tr:hover {
  background: rgba(255, 255, 255, .04);
}

#tbl tbody td {
  padding: .78rem 1rem;
  text-align: center;
  vertical-align: middle;
  color: var(--text);
}

.tnum {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.tname {
  font-weight: 800;
  text-align: right !important;
  font-size: .92rem;
}

.tamt {
  font-weight: 900;
  font-size: 1rem;
  color: var(--gold);
}

.tbadge {
  display: inline-block;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
}

.tbadge.krami {
  background: rgba(99, 102, 241, .2);
  color: var(--groom2);
  border: 1px solid rgba(99, 102, 241, .3);
}

.tbadge.fatima {
  background: rgba(236, 72, 153, .2);
  color: var(--bride2);
  border: 1px solid rgba(236, 72, 153, .3);
}

.tbadge.done {
  background: rgba(16, 185, 129, .18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, .3);
}

.tbadge.partial {
  background: rgba(245, 158, 11, .18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, .3);
}

.tbadge.pending {
  background: rgba(148, 163, 184, .12);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, .2);
}

.tocc {
  font-size: .78rem;
  color: #a78bfa;
  background: rgba(167, 139, 250, .1);
  border: 1px solid rgba(167, 139, 250, .2);
  padding: .2rem .6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.tnote {
  color: var(--muted);
  font-size: .8rem;
}

.tret {
  font-size: .88rem;
  color: #34d399;
  font-weight: 700;
}

/* ── الفرق badges ── */
.diff-badge {
  display: inline-block;
  padding: .25rem .75rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 800;
  white-space: nowrap;
}

.diff-badge.pos {
  background: rgba(52, 211, 153, .18);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, .35);
}

.diff-badge.neg {
  background: rgba(251, 191, 36, .15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, .3);
}

.diff-badge.eq {
  background: rgba(244, 196, 48, .15);
  color: var(--gold);
  border: 1px solid rgba(244, 196, 48, .3);
}

.diff-badge.zero {
  background: rgba(148, 163, 184, .1);
  color: var(--muted);
  border: 1px solid rgba(148, 163, 184, .2);
}

.tactions {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  flex-wrap: nowrap; /* Keep action buttons in one single line */
}

.tocc-wrap {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap; /* Allow multiple occasion tags to wrap next to each other */
  justify-content: center;
  max-width: 180px;
  margin: 0 auto;
}

.tbtn {
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
  border: none;
  font-family: 'Cairo', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.tbtn.edit {
  background: rgba(99, 102, 241, .2);
  color: var(--groom2);
  border: 1px solid rgba(99, 102, 241, .3);
}

.tbtn.edit:hover {
  background: rgba(99, 102, 241, .4);
}

.tbtn.ret {
  background: rgba(16, 185, 129, .18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, .3);
}

.tbtn.ret:hover {
  background: rgba(16, 185, 129, .38);
}

.tbtn.del {
  background: rgba(244, 67, 94, .15);
  color: #fb7185;
  border: 1px solid rgba(244, 67, 94, .3);
}

.tbtn.del:hover {
  background: rgba(244, 67, 94, .35);
}

.empty {
  text-align: center;
  padding: 3.5rem 1rem;
  color: var(--muted);
  font-size: 1rem;
}

/* ── Export bar ── */
.ebar {
  display: flex;
  gap: .8rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}

.ebtn {
  padding: .55rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s;
}

.ebtn:hover {
  background: var(--cardh);
  transform: translateY(-2px);
}

.ebtn.danger {
  border-color: rgba(244, 67, 94, .4);
  color: #fb7185;
}

.ebtn.danger:hover {
  background: rgba(244, 67, 94, .15);
}

/* ── Overlay / Modal ── */
.ov {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(5px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ov.open {
  display: flex;
}

.modal {
  background: #15152a;
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 20px;
  padding: 1.8rem;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .65);
  animation: slideIn .28s cubic-bezier(.34, 1.56, .64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

.wide-modal {
  max-width: 600px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(.85) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.mhdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.4rem;
}

.mhdr h2 {
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--gold), var(--rose));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mhdr button {
  background: rgba(255, 255, 255, .1);
  border: none;
  color: var(--muted);
  font-size: 1rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  transition: .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mhdr button:hover {
  background: rgba(244, 67, 94, .3);
  color: #fb7185;
}

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fg {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.fg label {
  font-size: .82rem;
  font-weight: 700;
  color: var(--muted);
}

.fg input,
.fg select,
.fg textarea {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .65rem .9rem;
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}

.fg input:focus,
.fg select:focus,
.fg textarea:focus {
  border-color: var(--gold);
}

.fg select option {
  background: #15152a;
  color: var(--text);
}

.fbtns {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
  margin-top: .3rem;
}

.sbtn {
  flex: 1;
  padding: .65rem;
  border: none;
  border-radius: 9px;
  font-family: 'Cairo', sans-serif;
  font-size: .9rem;
  font-weight: 900;
  cursor: pointer;
  transition: all .25s;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #000;
  box-shadow: 0 4px 12px rgba(244, 196, 48, .4);
}

.sbtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(244, 196, 48, .6);
}

.sbtn.gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.cbtn {
  flex: 1;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: rgba(255, 255, 255, .06);
  color: var(--muted);
  font-family: 'Cairo', sans-serif;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}

.cbtn:hover {
  background: var(--cardh);
  color: var(--text);
}

/* ── Return modal extras ── */
.rinfo {
  background: rgba(244, 196, 48, .08);
  border: 1px solid rgba(244, 196, 48, .2);
  border-radius: 10px;
  padding: .9rem 1rem;
  margin-bottom: 1rem;
  font-size: .88rem;
  line-height: 1.8;
}

.rinfo strong {
  color: var(--gold);
}

.rhist {
  margin-top: 1.2rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.rhist h3 {
  font-size: .88rem;
  color: var(--muted);
  margin-bottom: .6rem;
}

.rh-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .5rem .7rem;
  border-radius: 8px;
  background: rgba(16, 185, 129, .08);
  margin-bottom: .4rem;
  border: 1px solid rgba(16, 185, 129, .15);
}

.rh-item span {
  font-size: .82rem;
}

.rh-item .rh-amt {
  color: #34d399;
  font-weight: 800;
}

.rh-item .rh-date {
  color: var(--muted);
  font-size: .75rem;
}

/* ── Import ── */
.imp-body {
  display: flex;
  flex-direction: column;
  gap: .9rem;
}

.idesc {
  font-size: .88rem;
  color: var(--muted);
}

.iex {
  display: block;
  background: rgba(244, 196, 48, .09);
  border: 1px solid rgba(244, 196, 48, .25);
  border-radius: 8px;
  padding: .55rem .9rem;
  color: var(--gold);
  font-size: .8rem;
  font-family: monospace;
  direction: ltr;
  text-align: left;
}

#impTxt {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: .9rem;
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: .87rem;
  outline: none;
  direction: rtl;
}

#impTxt:focus {
  border-color: var(--gold);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 30, .96);
  color: var(--text);
  padding: .75rem 1.8rem;
  border-radius: 999px;
  font-family: 'Cairo', sans-serif;
  font-size: .92rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
  border: 1px solid rgba(244, 196, 48, .3);
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
}

/* ── Print ── */
@media print {

  .bg-deco,
  .cbar,
  .ebar,
  .ov,
  .toast {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .header {
    background: #f4c430;
  }

  .htitle {
    -webkit-text-fill-color: #000;
    color: #000;
  }

  .stats-wrap,
  .twrap {
    border: 1px solid #ddd;
  }

  .tactions {
    display: none;
  }

  #tbl tbody td {
    color: #000;
  }

  .tbadge,
  .tocc {
    border: 1px solid #999;
    color: #000;
    background: #eee;
  }

  .tamt {
    color: #000;
  }
}

/* ── Responsive ── */
@media(max-width:900px) {
  .stats-wrap {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media(max-width:640px) {
  .header {
    padding: 1rem;
  }

  .htitle {
    font-size: 1.6rem;
  }

  .stats-wrap {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 1rem;
  }

  .main {
    padding: 0 1rem 2rem;
  }

  .cbar {
    flex-direction: column;
    align-items: stretch;
  }

  .ftabs {
    justify-content: center;
  }

  .abtns {
    justify-content: center;
  }
}

@media(max-width:400px) {
  .stats-wrap {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════
   سجل الدفعات — History Modal Styles
   ══════════════════════════════════════════ */

/* History button in table rows */
.tbtn.hist {
  background:rgba(167,139,250,.18);
  color:#a78bfa;
  border:1px solid rgba(167,139,250,.3);
}
.tbtn.hist:hover { background:rgba(167,139,250,.38); transform:scale(1.05); }

/* Person summary bar at top of history modal */
.hist-person-bar {
  display:flex; flex-wrap:wrap; align-items:center; gap:.7rem;
  background:rgba(244,196,48,.07);
  border:1px solid rgba(244,196,48,.2);
  border-radius:12px; padding:.85rem 1rem;
  margin-bottom:1.2rem; font-size:.88rem;
}
.hpb-item { color:var(--text); }
.hpb-item strong { color:var(--gold); }

/* Timeline container */
.hist-timeline {
  display:flex; flex-direction:column; gap:.7rem;
  max-height:340px; overflow-y:auto;
  padding-right:.2rem;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,.1) transparent;
}

/* Single payment row */
.hist-row {
  display:flex; align-items:flex-start; gap:.8rem;
  background:rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.07);
  border-radius:10px; padding:.75rem .9rem;
  transition:background .18s;
  position:relative;
}
.hist-row:hover { background:rgba(255,255,255,.07); }

.hist-num {
  min-width:26px; height:26px;
  background:linear-gradient(135deg,var(--gold),var(--gold2));
  color:#000; font-weight:900; font-size:.78rem;
  border-radius:50%; display:flex; align-items:center; justify-content:center;
  flex-shrink:0; margin-top:.1rem;
}

.hist-info { flex:1; display:flex; flex-direction:column; gap:.35rem; }

.hist-row-top {
  display:flex; justify-content:space-between; align-items:center;
  flex-wrap:wrap; gap:.4rem;
}

.hist-date { color:#a78bfa; font-size:.82rem; font-weight:700; }

.hist-amt {
  font-size:1.05rem; font-weight:900; color:#34d399;
  background:rgba(52,211,153,.12);
  border:1px solid rgba(52,211,153,.25);
  border-radius:999px; padding:.15rem .7rem;
}

.hist-note { font-size:.8rem; color:var(--muted); }

.hist-running {
  font-size:.78rem; color:var(--muted);
  padding:.2rem .5rem; background:rgba(255,255,255,.03);
  border-radius:6px;
}
.hist-running strong { color:var(--text); }

/* Delete button inside history row */
.hist-del {
  background:rgba(244,67,94,.15);
  border:1px solid rgba(244,67,94,.25);
  color:#fb7185; border-radius:6px;
  width:26px; height:26px; cursor:pointer;
  font-size:1rem; display:flex; align-items:center; justify-content:center;
  flex-shrink:0; transition:all .2s;
  align-self:center;
}
.hist-del:hover { background:rgba(244,67,94,.35); }

/* Empty state */
.hist-empty {
  text-align:center; padding:2.5rem 1rem;
  color:var(--muted); font-size:.9rem; line-height:1.8;
}
.hist-empty small { font-size:.8rem; opacity:.7; }

/* Total footer */
.hist-total { margin-top:1rem; }
.hist-total-row {
  display:flex; justify-content:space-between; align-items:center;
  padding:.65rem 1rem;
  background:rgba(244,196,48,.08);
  border:1px solid rgba(244,196,48,.2);
  border-radius:10px; font-size:.88rem;
}
.hist-total-row strong { color:var(--gold); }

/* ── PWA Install Button ── */
.htext {
  flex: 1;
}

.install-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 1rem;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  color: #000;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(244, 196, 48, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(244, 196, 48, 0.5);
}

.install-btn:active {
  transform: translateY(1px);
}

/* ── Reno 15 Pro Mobile Specific Styling (<= 480px) ── */
@media (max-width: 480px) {
  .header {
    padding: 0.8rem 1rem;
  }
  
  .hico {
    font-size: 2.2rem;
  }

  .htitle {
    font-size: 1.3rem;
  }

  .hsub {
    font-size: 0.75rem;
  }

  .install-btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
  }

  /* Compact grid cards on Reno 15 Pro */
  .stats-wrap {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.6rem !important;
    padding: 0 0.8rem !important;
    margin: 1rem auto !important;
  }

  .sc {
    padding: 0.8rem 0.6rem !important;
    gap: 0.5rem !important;
    border-radius: 10px !important;
  }

  .si {
    font-size: 1.6rem !important;
  }

  .sl {
    font-size: 0.68rem !important;
  }

  .sv {
    font-size: 1.15rem !important;
  }

  /* Spacing and control bar */
  .main {
    padding: 0 0.8rem 2rem !important;
  }

  .cbar {
    padding: 0.8rem !important;
    border-radius: 10px !important;
    gap: 0.7rem !important;
    margin-bottom: 0.8rem !important;
  }

  .sbox {
    padding: 0.4rem 0.7rem !important;
    min-width: 100% !important;
  }

  .ftabs {
    gap: 0.3rem !important;
    width: 100%;
    justify-content: flex-start !important;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 0.3rem;
    scrollbar-width: none; /* Hide scrollbar for clean tab layout */
  }

  .ftabs::-webkit-scrollbar {
    display: none;
  }

  .ftab {
    padding: 0.3rem 0.65rem !important;
    font-size: 0.75rem !important;
    flex-shrink: 0;
  }

  .abtns {
    width: 100%;
    gap: 0.5rem !important;
  }

  .abtn {
    flex: 1;
    padding: 0.5rem 0.8rem !important;
    font-size: 0.8rem !important;
    text-align: center;
    border-radius: 8px !important;
  }

  /* Table styling for mobile touch targets */
  #tbl {
    font-size: 0.78rem !important;
  }

  #tbl thead th {
    padding: 0.7rem 0.5rem !important;
    font-size: 0.75rem !important;
  }

  #tbl tbody td {
    padding: 0.65rem 0.5rem !important;
  }

  .tname {
    font-size: 0.82rem !important;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .tamt {
    font-size: 0.88rem !important;
  }

  .tbadge {
    padding: 0.15rem 0.45rem !important;
    font-size: 0.7rem !important;
  }

  .tocc {
    padding: 0.15rem 0.4rem !important;
    font-size: 0.7rem !important;
  }

  .tactions {
    gap: 0.25rem !important;
  }

  .tbtn {
    padding: 0.25rem 0.45rem !important;
    font-size: 0.7rem !important;
    border-radius: 4px !important;
  }

  /* Modals on portrait display */
  .modal {
    padding: 1.2rem !important;
    border-radius: 16px !important;
    margin: 0.5rem !important;
  }

  .modal-title, .mhdr h2 {
    font-size: 1.1rem !important;
  }

  .fg label {
    font-size: 0.78rem !important;
  }

  .fg input, .fg select, .fg textarea {
    padding: 0.55rem 0.75rem !important;
    font-size: 0.85rem !important;
  }

  .fbtns {
    gap: 0.5rem !important;
  }

  .sbtn, .cbtn {
    padding: 0.55rem !important;
    font-size: 0.85rem !important;
  }

  /* History list in modal */
  .hist-person-bar {
    padding: 0.6rem 0.8rem !important;
    font-size: 0.78rem !important;
    gap: 0.5rem !important;
    border-radius: 8px !important;
  }

  .hist-row {
    padding: 0.6rem 0.7rem !important;
    gap: 0.5rem !important;
  }

  .hist-num {
    min-width: 22px !important;
    height: 22px !important;
    font-size: 0.7rem !important;
  }

  .hist-amt {
    font-size: 0.88rem !important;
    padding: 0.1rem 0.5rem !important;
  }

  .hist-running {
    font-size: 0.72rem !important;
    padding: 0.15rem 0.4rem !important;
  }
}

/* Custom button for adding received gifts */
.tbtn.add-rec {
  background: rgba(244, 196, 48, 0.15);
  color: var(--gold);
  border: 1px solid rgba(244, 196, 48, 0.3);
}
.tbtn.add-rec:hover {
  background: rgba(244, 196, 48, 0.35);
  transform: scale(1.05);
}

/* Incoming cash badges in modals */
.rh-amt.amt-in {
  color: #fbbf24 !important;
}
.tocc-small {
  font-size: 0.72rem !important;
  padding: 0.1rem 0.4rem !important;
}