*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Cairo', sans-serif; background: #eef1f8; color: #1e2a45; min-height: 100vh; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e8f2; border-radius: 4px; }









.app-grid { display: grid; grid-template-columns: 242px 1fr; min-height: 100vh; }




.sidebar {
  background: #ffffff; border-left: 1px solid #e2e8f2;
  height: 100vh; position: sticky; top: 0; overflow-y: auto;
  padding: 24px 0 24px; display: flex; flex-direction: column; gap: 0;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 0 18px 24px; flex-direction: row-reverse; justify-content: flex-end;
}
.logo-icon,
.topbar-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #6c5ce7, #8b5cf6);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(108,92,231,.12);
}
.logo-icon img,
.topbar-logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { font-size: 1.5rem; font-weight: 800; color: #1e2a45; line-height: 1; }
.logo-sub  { font-size: .65rem; color: #8c96b4; margin-top: 3px; }
.nav-section-label {
  font-size: .72rem; font-weight: 600;
  color: #8c96b4; padding: 0 20px 8px; margin-top: 4px;
}
.nav-menu { display: flex; flex-direction: column; gap: 2px; padding: 0 10px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; flex-direction: row-reverse; justify-content: flex-end;
  padding: 11px 12px; border-radius: 9px;
  font-size: .88rem; font-weight: 600; color: #4a5578;
  cursor: pointer; transition: background .17s ease, color .17s ease;
}
.nav-item:hover { background: #f5f7fc; color: #1e2a45; }
.nav-item.active { background: #f5f7fc; color: #1e2a45; font-weight: 700; }
.nav-icon { font-size: 1rem; display: grid; place-items: center; flex-shrink: 0; width: 22px; }
.sidebar-divider { height: 1px; background: #e2e8f2; margin: 14px 18px; }

/* Quick action icons */
.qa-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center; font-size: .9rem; font-weight: 800;
}
.qa-blue   { background: #dbeafe; color: #2563eb; }
.qa-green  { background: #dcfce7; color: #16a34a; font-size: 1.2rem; }
.qa-purple { background: #ede9fe; color: #7c3aed; }
.qa-orange { background: #fff7ed; color: #ea580c; }
.quick-actions .nav-item { gap: 14px; }

.main-wrap { overflow-y: auto; }
.main { padding: 22px 26px 48px; display: grid; gap: 20px; align-content: start; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  background: #ffffff; border: 1px solid #e2e8f2;
  border-radius: 14px; padding: 12px 18px;
  box-shadow: 0 1px 8px rgba(99,115,156,.09), 0 3px 14px rgba(99,115,156,.06); margin-bottom: 4px;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.topbar-logo-icon { font-size: 1.3rem; }
.topbar-brand { font-size: 1.45rem; font-weight: 800; color: #1e2a45; line-height: 1; }
.topbar-sub   { font-size: .7rem; color: #8c96b4; margin-top: 3px; }
.topbar-status {
  display: flex; align-items: center; gap: 6px;
  font-size: .75rem; font-weight: 600; color: #00a878;
  border: 1px solid rgba(0,168,120,.3); border-radius: 20px; padding: 4px 12px;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #00a878; flex-shrink: 0; }
.topbar-left  { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
  width: 40px; height: 40px; border-radius: 10px;
  background: #f5f7fc; border: 1px solid #e2e8f2;
  display: grid; place-items: center; font-size: 1rem; color: #4a5578;
  position: relative; cursor: pointer; transition: background .17s ease;
}
.topbar-btn:hover { background: #e2e8f2; }
.tb-notif-badge {
  position: absolute; top: -5px; left: -5px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #e5383b; color: #fff;
  font-size: .6rem; font-weight: 700; display: grid; place-items: center;
  border: 2px solid #ffffff;
}
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user-name { font-size: .85rem; font-weight: 700; text-align: right; }
.topbar-user-role { font-size: .68rem; color: #8c96b4; text-align: right; margin-top: 2px; }
.topbar-avatar {
  width: 42px; height: 42px; border-radius: 10px;
  background: #f5f7fc; border: 1px solid #e2e8f2;
  display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0;
  overflow: hidden;
}
.topbar-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* STATS */
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.stat-card {
  background: #ffffff; border: 1px solid #e2e8f2; border-radius: 14px;
  padding: 24px 24px 20px; display: grid; gap: 10px; box-shadow: 0 1px 8px rgba(99,115,156,.09), 0 3px 14px rgba(99,115,156,.06);
  transition: transform .17s ease, box-shadow .17s ease;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 22px rgba(99,115,156,.14); }
.stat-label  { font-size: .8rem; font-weight: 600; color: #8c96b4; text-align: right; }
.stat-amount { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.stat-change { font-size: .78rem; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.stat-change.up   { color: #00a878; }
.stat-change.down { color: #e5383b; }

/* DASHBOARD */
.dashboard { display: flex; flex-direction: column; gap: 20px; }

/* Row 1: wide transactions + narrow sidebar */
.dash-row-top {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  align-items: start;
}
.dash-sidebar { display: flex; flex-direction: column; gap: 20px; }

/* Row 2: 3 equal columns */
.dash-row-bottom {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: start;
}
.dash-col-mid { display: flex; flex-direction: column; gap: 20px; }

/* ── Responsive ── */
@media (max-width: 1280px) {
  .dash-row-top    { grid-template-columns: 1fr 340px; }
  .dash-row-bottom { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1060px) {
  .dash-row-top    { grid-template-columns: 1fr; }
  .dash-row-bottom { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app-grid        { grid-template-columns: 1fr; }
  .sidebar         { display: none; }
  .stats-grid      { grid-template-columns: 1fr 1fr; }
  .dash-row-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .stats-grid { grid-template-columns: 1fr; }
  .tx-table thead th:nth-child(3),
  .tx-table tbody td:nth-child(3) { display: none; }
}

/* CARD BASE */
.card { background: #ffffff; border: 1px solid #e2e8f2; border-radius: 14px; box-shadow: 0 1px 8px rgba(99,115,156,.09), 0 3px 14px rgba(99,115,156,.06); overflow: hidden; }
.card-header { display: grid; grid-template-columns: 1fr auto; align-items: center; padding: 16px 18px 0; }
.card-title { font-size: .92rem; font-weight: 700; display: flex; align-items: center; gap: 8px; color: #1e2a45; }
.card-title-icon { width: 28px; height: 28px; border-radius: 8px; background: rgba(108,92,231,.08); color: #6c5ce7; display: grid; place-items: center; font-size: .77rem; }
.card-action { font-size: .73rem; font-weight: 600; color: #6c5ce7; border: 1px solid rgba(108,92,231,.18); padding: 4px 10px; border-radius: 20px; transition: background .17s ease; }
.card-action:hover { background: rgba(108,92,231,.08); }
.card-body { padding: 14px 18px 18px; }

/* TRANSACTIONS TABLE */
.tx-table { width: 100%; border-collapse: collapse; }
.tx-table thead th { font-size: .72rem; font-weight: 600; color: #8c96b4; padding: 8px 10px 12px; text-align: right; border-bottom: 1px solid #e2e8f2; white-space: nowrap; }
.tx-table tbody tr { border-bottom: 1px solid #e2e8f2; transition: background .17s ease; }
.tx-table tbody tr:last-child { border-bottom: none; }
.tx-table tbody tr:hover { background: #f5f7fc; }
.tx-table tbody td { padding: 13px 10px; font-size: .82rem; color: #1e2a45; text-align: right; white-space: nowrap; vertical-align: middle; }
.tx-cell { display: flex; align-items: center; gap: 12px; min-width: 170px; }
.tx-avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: .95rem; font-weight: 700; color: #fff; flex-shrink: 0; overflow: hidden; }
.tx-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tx-avatar.circle { border-radius: 50%; font-size: 1rem; }
.tx-name { font-size: .86rem; font-weight: 700; color: #1e2a45; }
.tx-sub  { font-size: .7rem; color: #8c96b4; margin-top: 2px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; white-space: nowrap; }
.b-green  { background: rgba(0,168,120,.12);  color: #00a878; }
.b-orange { background: rgba(225,112,85,.12); color: #c0582e; }
.b-blue   { background: rgba(26,111,219,.11);  color: #1a6fdb; }
.b-red    { background: rgba(229,56,59,.11);   color: #e5383b; }
.b-purple { background: rgba(108,92,231,.11);  color: #6c5ce7; }
.b-teal   { background: rgba(0,168,120,.12);   color: #00916b; }
.s-ok  { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; background: rgba(0,168,120,.12); color: #00a878; }
.s-pnd { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 700; padding: 4px 12px; border-radius: 20px; background: rgba(201,128,0,.12); color: #c98000; }
.tx-amt { font-size: .86rem; font-weight: 800; }
.tx-amt.plus  { color: #00a878; }
.tx-amt.minus { color: #4a5578; }

/* ACTIVITIES */
.act-list { display: grid; gap: 10px; }
.act-item { display: flex; align-items: flex-start; gap: 12px; background: #f5f7fc; border: 1px solid #e2e8f2; border-radius: 9px; padding: 14px 14px 14px 14px; border-right: 4px solid; }
.act-info { flex: 1; min-width: 0; }
.act-row1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.act-title { font-size: .86rem; font-weight: 700; color: #1e2a45; }
.act-tag { font-size: .64rem; font-weight: 700; padding: 2px 9px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.t-blue   { background: rgba(26,111,219,.09);   color: #1a6fdb; }
.t-green  { background: rgba(0,168,120,.09);  color: #00a878; }
.t-yellow { background: rgba(201,128,0,.09); color: #c98000; }
.t-red    { background: rgba(229,56,59,.09);    color: #e5383b; }
.act-desc { font-size: .76rem; color: #4a5578; margin-bottom: 6px; line-height: 1.45; }
.act-time { font-size: .68rem; color: #8c96b4; }
.act-ico  { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; font-size: .9rem; flex-shrink: 0; }
.act-footer { text-align: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e2e8f2; }
.act-footer a { font-size: .8rem; font-weight: 700; color: #6c5ce7; }

/* BILLS */
.bills-total { text-align: center; padding: 6px 0 18px; }
.bills-total-amount { font-size: 2rem; font-weight: 800; color: #1e2a45; line-height: 1.1; }
.bills-total-label  { font-size: .76rem; color: #8c96b4; margin-top: 4px; }
.bills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bill-card { background: #f5f7fc; border: 1px solid #e2e8f2; border-radius: 9px; padding: 16px 10px 14px; display: grid; justify-items: center; gap: 4px; text-align: center; }
.bill-card-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; margin-bottom: 4px; }
.bill-card-name { font-size: .78rem; color: #8c96b4; }
.bill-card-amt  { font-size: 1rem; font-weight: 800; color: #1e2a45; }
.bill-card-due  { font-size: .68rem; font-weight: 600; color: #8c96b4; }
.bill-card-due.urgent { color: #c98000; font-weight: 700; }
.bill-card-due.ok     { color: #00a878;  font-weight: 700; }

/* CHART */
.chart-legend { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 20px; }
.chart-leg-item { display: flex; align-items: center; gap: 7px; font-size: .78rem; font-weight: 600; color: #4a5578; }
.chart-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex-shrink: 0; }
.dot-green { background: #00a878; }
.dot-red   { background: #e5383b; }
.bar-chart-area { display: flex; align-items: flex-end; justify-content: space-around; height: 180px; gap: 8px; padding: 0 8px; }
.bar-group { display: flex; align-items: flex-end; gap: 6px; flex: 1; justify-content: center; }
.bar { border-radius: 6px 6px 0 0; width: 22px; min-height: 8px; transition: opacity .2s; }
.bar:hover { opacity: .8; }
.income-bar  { background: #00a878; }
.expense-bar { background: #e5383b; }
.bar-labels { display: flex; justify-content: space-around; padding: 10px 8px 0; }
.bar-label  { font-size: .73rem; color: #8c96b4; text-align: center; flex: 1; }

/* BUDGET */
.budget-hero { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.bh-cell { background: #f5f7fc; border: 1px solid #e2e8f2; border-radius: 9px; padding: 14px; }
.bh-label { font-size: .7rem; color: #8c96b4; margin-bottom: 4px; }
.bh-value { font-size: 1.1rem; font-weight: 800; }
.overall-bar-wrap { margin-bottom: 14px; }
.overall-bar { height: 8px; background: #e2e8f2; border-radius: 4px; overflow: hidden; margin: 6px 0 4px; }
.overall-bar-fill { height: 100%; border-radius: 4px; background: #6c5ce7; }
.overall-meta { display: grid; grid-template-columns: 1fr auto; font-size: .72rem; color: #8c96b4; }
.budget-cats { display: grid; gap: 10px; }
.bc { background: #ffffff; border: 1px solid #e2e8f2; border-radius: 9px; padding: 14px; display: grid; gap: 10px; }
.bc-main { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bc-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.bc-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: .95rem; flex-shrink: 0; }
.bc-name   { font-size: .84rem; font-weight: 700; }
.bc-budget { font-size: .67rem; color: #8c96b4; margin-top: 2px; }
.bc-amount { font-size: .92rem; font-weight: 800; white-space: nowrap; }
.bc-bottom { display: flex; align-items: center; gap: 8px; }
.bc-bar  { flex: 1; height: 6px; background: #e2e8f2; border-radius: 3px; overflow: hidden; }
.bc-fill { height: 100%; border-radius: 3px; }
.bc-pill { font-size: .63rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.pill-green  { background: rgba(0,168,120,.13); color: #00a878; }
.pill-red    { background: rgba(229,56,59,.13);  color: #e5383b; }
.pill-orange { background: rgba(234,88,12,.12);  color: #c2410c; }
.f-green  { background: #00a878; }
.f-red    { background: #e5383b; }
.f-orange { background: #f97316; }
.f-pink   { background: #ec4899; }
.f-blue   { background: #1a6fdb; }

/* CREDIT CARDS — FLIP */
.cards-stack { display: grid; gap: 18px; }

/* Flip container */
.flip-card {
  perspective: 1000px;
  height: 170px;
}
.flip-card-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.65s cubic-bezier(.4,0,.2,1);
}
.flip-card:hover .flip-card-inner { transform: rotateY(180deg); }

/* Shared face styles */
.flip-front,
.flip-back {
  position: absolute; inset: 0;
  border-radius: 14px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  padding: 20px;
  color: #fff;
  

  
}



/* ── FRONT ── */
.flip-front { z-index: 2; }
.cc-purple { background: linear-gradient(135deg, #4f46e5, #6d28d9); }
.cc-red    { background: linear-gradient(135deg, #b91c1c, #be123c); }
.cc-blue   { background: linear-gradient(135deg, #1d4ed8, #1e40af); }
.flip-front::before {
  content: ''; position: absolute; top: -40px; right: -40px;
  width: 130px; height: 130px; border-radius: 50%;
  background: rgba(255,255,255,.08); 
  
  
  pointer-events: none;
}
.flip-front::after {
  content: ''; position: absolute; bottom: -30px; left: 10px;
  width: 85px; height: 85px; border-radius: 50%;
  background: rgba(255,255,255,.05); pointer-events: none;
}
.cc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; position: relative; z-index: 1; }
.cc-badge { font-size: .63rem; font-weight: 700; background: rgba(255,255,255,.22); padding: 3px 9px; border-radius: 20px; }
.cc-visa  { font-size: .8rem; font-weight: 800; font-style: italic; background: rgba(255,255,255,.92); color: #1a1a6e; padding: 2px 7px; border-radius: 4px; letter-spacing: .05em; }
.cc-mc    { display: flex; position: relative; width: 30px; height: 20px; flex-shrink: 0; }
.cc-mc div:first-child { width: 18px; height: 18px; border-radius: 50%; background: #eb001b; position: absolute; top: 0; right: 0; }
.cc-mc div:last-child  { width: 18px; height: 18px; border-radius: 50%; background: #f79e1b; opacity: .85; position: absolute; top: 0; left: 0; }
.pp-big-logo { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); display: grid; place-items: center; font-size: 1rem; font-weight: 800; color: #fff; flex-shrink: 0; }
.cc-num { font-size: .95rem; font-weight: 700; letter-spacing: .13em; margin-bottom: 14px; opacity: .9; position: relative; z-index: 1; }
.cc-paypal-name { font-size: .95rem; font-weight: 700; margin-bottom: 14px; position: relative; z-index: 1; }
.cc-foot { display: flex; justify-content: space-between; position: relative; z-index: 1; }
.cc-lbl { font-size: .6rem; opacity: .72; margin-bottom: 3px; }
.cc-val { font-size: .82rem; font-weight: 700; }
.pp-ok  { color: #4ade80; font-weight: 700; }

/* ── BACK ── */
.flip-back {
  transform: rotateY(180deg);
    background: linear-gradient(
        to right,
        #000000,
        #02122f,
        #020d20,
        #020916
    );
  display: flex; flex-direction: column; justify-content: flex-start;
  padding: 0;
  gap: 0;
  overflow: hidden;

}



/* Magnetic stripe */
.cb-stripe {
  width: 100%; height: 32px;
   background: linear-gradient(
        to right,
        #000,
         #222,
        #494747
       
    );


  
  margin-bottom: 7px; flex-shrink: 0;
}
/* Signature strip */
.cb-sig-row {
  width: 100%;
  margin-bottom: 6px;
  padding: 0;
  flex-shrink: 0;
}
.cb-sig {
  display: block;
  width: 100%;
  background: repeating-linear-gradient(
    -45deg, #e8e4dc, #e8e4dc 3px, #d4cfca 3px, #d4cfca 6px
  );
  padding: 3px 10px;
  font-size: .55rem; color: #444; font-style: italic;
  text-align: end;
  direction: rtl;
  line-height: 1.2;
}


/* Number + CVV fields */
.cb-fields {
  padding: 0 10px;
  display: flex; flex-direction: column; gap: 5px;
  flex: 1;
}



.cb-num-field {
  background: #fff; border-radius: 4px; padding: 4px 8px;
  font-size: .75rem; font-weight: 600; color: #1e2340;
  letter-spacing: .06em;
  width: 100%; box-sizing: border-box;
}



.cb-cvv-wrap { display: flex; flex-direction: column; gap: 2px; }
.cb-cvv-label { font-size: .55rem; font-weight: 700; color: rgba(255,255,255,.65); }
.cb-cvv {
  background: #fff; border-radius: 4px; padding: 4px 8px;
  font-size: .75rem; font-weight: 700; color: #1e2340;
  width: 52px;
}




































.acc-list { display: grid; gap: 10px; }
.acc-row { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 13px; background: #f5f7fc; border: 1px solid #e2e8f2; border-radius: 9px; }
.acc-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: .95rem; }
.acc-name { font-size: .86rem; font-weight: 700; }
.acc-bank { font-size: .7rem; color: #8c96b4; margin-top: 2px; }
.acc-amt  { font-size: .9rem; font-weight: 800; white-space: nowrap; color: #1e2a45; }
.acc-amt.neg { color: #e5383b; }


@media (max-width: 1180px) { .dashboard-grid { grid-template-columns: 1fr 320px; } }
@media (max-width: 1020px) { .dashboard-grid { grid-template-columns: 1fr; } .stats-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 780px)  { .app-grid { grid-template-columns: 1fr; } .sidebar { display: none; } .stats-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px)  { .stats-grid { grid-template-columns: 1fr; } }
