@font-face {
  font-family: "Cairo";
  src: url("fonts/Cairo-VariableFont_slnt,wght.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Rubik';
  src: url('fonts/Rubik-Regular.woff2') format('woff2'),
      url('fonts/Rubik-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}
:root{
  --fontFamily: 'Cairo', 'Rubik', Arial, Helvetica, sans-serif;
  --sidebar-w: 0px;
  --page-pad: 10px;
  --data-pad: 10px;
  --pagination-h: 64px;
  --open-list-bg: #d9deec;
  --open-list-bg-deep: #aeb7c8;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--fontFamily);
}
body, html {
  direction: rtl;
  font-family: var(--fontFamily);
  height: 100%;
}

body{
  overflow-y: hidden;
}

/* الحاوية الرئيسية */
#container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow-x: hidden;
}

header{
  background-color: #ffffff;
  display: flex;
  flex-direction: row;
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
  padding: 10px 5px;
  position: relative;
  border-bottom: 2px solid #2c7bf1;
}

#user{
  width: 250px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 1px;
}

#menuToggle{
  border: 0;
  background: #eef4ff;
  color: #1b5ed4;
  font-size: 20px;
  cursor: pointer;
  padding: 6px 5px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  transition: all 0.3s ease;
}
#menuToggle:hover {
  background: #dfeaff;
  transform: scale(1.05);
}
#menuToggle .burger{
  width: 22px;
  height: 16px;
  position: relative;
  display: inline-block;
}
#menuToggle .bar{
  position: absolute;
  right: 0;
  width: 100%;
  height: 1.5px;
  background: #1b5ed4;
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}
#menuToggle .b1{
  top: 0;
  width: 100%;
}

#menuToggle .b2{
  top: 7px;
  width: 40%;
}

#menuToggle .b3{
  top: 14px;
  width: 80%;
}

body.sidebar-open #menuToggle .b1{
  top: 7px;
  transform: rotate(45deg);
}
body.sidebar-open #menuToggle .b2{
  opacity: 0;
  transform: translateX(10px);
}
body.sidebar-open #menuToggle .b3{
  top: 7px;
  width: 100%;
  transform: rotate(-45deg);
}
#topMenuToggle{
  border: 0;
  background: #eef4ff;
  color: #1b5ed4;
  font-size: 18px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
  margin-inline-start: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  transition: all 0.3s ease;
}
#topMenuToggle:hover {
  background: #dfeaff;
  transform: translateY(-50%) scale(1.05);
}
#topMenuToggle .burger{
  width: 20px;
  height: 14px;
  position: relative;
  display: inline-block;
}
#topMenuToggle .bar{
  position: absolute;
  right: 0;
  width: 100%;
  height: 2px;
  background: #1b5ed4;
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}
#topMenuToggle .b1{ top: 0; }
#topMenuToggle .b2{ top: 6px; width: 55% !important; }
#topMenuToggle .b3{ top: 12px; width: 100% !important; }

body.topmenu-open #topMenuToggle .b1{
  top: 6px;
  transform: rotate(45deg);
}
body.topmenu-open #topMenuToggle .b2{
  opacity: 0;
  transform: translateX(8px);
}
body.topmenu-open #topMenuToggle .b3{
  top: 6px;
  width: 100%;
  transform: rotate(-45deg);
}

#sidebar-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 20;
}

body.sidebar-open #sidebar-overlay{
  opacity: 1;
  pointer-events: auto;
}

#user #user-pic{
  background-color: #ccc;
  border-radius: 50%;
  -webkit-border-radius: 50%;
  text-align: center;
}

#user #user-pic svg{
  display: inline-block;
  vertical-align: middle;
  width: 25px;
  height: 25px;
  fill: #fff;
}

#user span{
  color: #181717;
  padding: 0 15px;
  font-size: 11px;
}

nav#top-menu{
  flex: 2;
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background-color: #fff;
  box-shadow: 0 12px 24px rgba(20, 40, 80, 0.12);
  z-index: 45;
}
body.topmenu-open nav#top-menu{
  display: block;
}

nav#top-menu ul{
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 6px;
  padding: 10px;
}

nav#top-menu ul li{
  width: 100%;
}

nav#top-menu ul li a{
  text-align: center;
  text-decoration: none;
  display: inline-block;
  padding: 8px 10px;
  color: #13243e;
  font-family: var(--fontFamily);
  font-size: 13px;
  border-radius: 10px;
  background: #f7f9ff;
  border: 1px solid #e3e9f3;
}
nav#top-menu ul li a:hover{
  background: #eef4ff;
  border-color: #cfd9eb;
}

main{
  flex: 1 1 auto;
  min-height: 0;
  height: calc(100dvh - 76px);
  overflow: hidden;
}
body.home-page main{
  height: 100dvh;
}

#main-content{
  display: flex;
  flex-direction: row;
  background: linear-gradient(45deg, #ffffff, #f0f2f5, #ededed);
  gap: 1px;
  flex: 1 1 auto;
  height: 100%;
  overflow: hidden;
}

#data{
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  min-height: 0;
  height: 100%;
  margin: 5px 0;
  overflow-y: auto;
  padding-bottom: 140px;
  display: flex;
  flex-direction: column;
  position: relative;
  background: linear-gradient(135deg, #f8fafb 0%, #f3f5f8 50%, #ede9e2 100%);
  background-attachment: fixed;
  box-shadow: inset 0 0 60px rgba(123, 155, 196, 0.05);
}
body.home-page #data{
  margin: 0;
  padding-bottom: 0;
  height: 100dvh;
}

#data::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(159, 184, 212, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(143, 168, 199, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

#data .parent-row,
#data > * {
  position: relative;
}

#data .parent-row{
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 2px;
}
#data .parent-row .list{
  flex: 1;
  font-family: var(--fontFamily);
  background-color: #fff;
  border-radius: 9px;
  font-weight: bold;
  padding: 10px;
  margin: 1px;
  border: 1px solid #f0f2f5;
}
#data .parent-row .list a{
  text-decoration: none;
  color: #111;
  font-family: var(--fontFamily);
  font-size: 0.8rem;
}
#data .parent-row #journalForm{
  width: 100%;
}
#main-content #pages-list-tree{
  text-align: center;
  width: auto;
  max-width: calc(100% - 20px);
  border-radius: 7px;
  position: absolute;
  bottom: 2px;
  left: 2%;
  right: calc(var(--sidebar-w) + .5%);
  margin: 0 auto;
  user-select: none;
  border-top: 1px solid #fff;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  background-color: rgba(12, 20, 40, 0.2);
  box-shadow: 0 -6px 16px rgba(20,40,80,0.12);
}
#main-content #pages-list-tree::before{
  content: "";
  position: absolute;
  inset: -28px 0 0 0;
  pointer-events: none;
  border-radius: 10px;
  z-index: -1;
}
#main-content #pages-list-tree.has-entry-buttons{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  box-shadow: 0 -8px 18px rgba(20, 40, 80, 0.12);
}
#main-content #pages-list-tree.has-entry-buttons #entry-buttons{
  width: auto;
  margin: 0;
}
#main-content #pages-list-tree.has-entry-buttons a{
  margin: 0 4px;
}
#main-content #pages-list-tree.has-entry-buttons .pagination-links{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex: 1;
}
#main-content #pages-list-tree.has-entry-buttons #entry-totals{
  display: flex;
  gap: 10px;
  align-items: center;
  background: #ffffff;
  border: 1px solid #e2e8f2;
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
  color: #243b5a;
  box-shadow: 0 6px 16px rgba(20, 40, 80, 0.08);
}
#main-content #pages-list-tree a{
  text-decoration: none;
  padding: 2px 9px;
  margin: 4px;
  border-radius: 12px;
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  color: #1d2e49;
  font-weight: normal;
  border: 1px solid #dfe6f1;
  display: inline-block;
  background: #eef3fa;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
#main-content #pages-list-tree a:hover{
  background-color: #eef4ff;
  border-color: #cfd9eb;
  transform: translateY(-1px);
}
#main-content #pages-list-tree a.active{
  background: linear-gradient(180deg, #2aa874, #1f8b5f);
  color: #fff;
  border-color: #1f8b5f;
  box-shadow: 0 8px 16px rgba(31, 139, 95, 0.25);
}
#main-content #pages-list-tree p{
  padding: 5px 10px;
  margin: 5px;
  border-radius: 25px;
  text-align: center;
  color: #aeaeae;
  display: inline-block;
}

#data .dash-grid{
  width: 98%;
  margin: 10px auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
#data .balance-card{
  width: 98%;
  margin: 10px auto 4px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f2f6ff);
  border: 1px solid #e3e9f3;
  box-shadow: 0 10px 20px rgba(20, 40, 80, 0.06);
}
#data .balance-title{
  font-weight: 800;
  color: #1b2b45;
  margin-bottom: 8px;
}
#data .balance-list{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
#data .balance-item{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8faff;
  border: 1px solid #e6ecf5;
}
#data .balance-label{
  color: #4b5f7a;
  font-weight: 600;
}
#data .balance-value{
  color: #1d2e49;
}
#data .dash-card{
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e1e7f0;
  box-shadow: 0 6px 14px rgba(20, 40, 80, 0.06);
  text-decoration: none;
  color: #1d2e49;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
#data .dash-head{
  display: flex;
  align-items: center;
  gap: 8px;
}
#data .dash-icon{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 14px;
  background: #eef2f7;
  color: #2b3d55;
  box-shadow: inset 0 0 0 1px rgba(30, 50, 80, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#data .dash-icon svg{
  width: 16px;
  height: 16px;
  fill: currentColor;
}
#data .dash-card.balance-card{
  background: #fff;
  border-color: #ccc;
  box-shadow: 0 8px 18px rgba(30, 90, 160, 0.12);
}
#data .dash-card.balance-card .dash-icon{
  background: #e3edff;
  color: #163a77;
}
#data .dash-card.balance-card .dash-title{
  color: #102e52;
}
#data .dash-card.balance-card .dash-summary{
  font-size: 1.1rem;
  color: #0b2950;
}
#data .dash-card.deposit-card{
  background: #fff;
  border-color: #eee;
}
#data .dash-card.deposit-card .dash-icon{
  background: #e1f5ea;
  color: #1a6d44;
}
#data .dash-card.withdraw-card{
  background: #fff;
  border-color: #eee;
}
#data .dash-card.withdraw-card .dash-icon{
  background: #ffe3e3;
  color: #8f2a2a;
}
#data .dash-card.expense-card{
  background: #fff;
  border-color: #eee;
}
#data .dash-card.expense-card .dash-icon{
  background: #ffe6b8;
  color: #7a4a0c;
}
#data .dash-card.entry-card{
  background: #fff;
  border-color: #eee;
}
#data .dash-card.count-card{
  background: #fff;
  border-color: #ccc;
}
#data .page-header{
  position: sticky;
  top: 0;
  z-index: 15;
  font-size: 0.8rem;
  background-color: rgba(255, 255, 255, 0.60);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border: 1px solid #e3e9f3;
  border-radius: 5px;
  padding: 2px 12px;
  margin: 2px auto 12px;
  box-shadow: 0 10px 20px rgba(255, 255, 255, 0.08);
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 15px;
}
#data .header-title{
  font-weight: 800;
  color: #7c8799;
  font-size: 0.7rem;
}
#data .header-breadcrumb{
  margin-top: 0;
  color: #5a6f8b;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}
#data .header-breadcrumb a{
  text-decoration: none;
  color: #2c7bf1;
  font-weight: normal;
}
#data .header-breadcrumb a:hover{
  color: #1d4480;
}
#data .header-breadcrumb .sep{
  color: #8aa0ba;
  font-size: 15px;
}
#data .dash-card:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(20, 40, 80, 0.12);
  border-color: #c9d4e6;
}
#data .dash-card:hover .dash-icon{
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 6px 12px rgba(20, 40, 80, 0.14);
}
#data .dash-title{
  font-weight: 800;
  color: #1b2b45;
  font-size: 0.95rem;
}
#data .dash-summary{
  color: #4b5f7a;
  font-size: 12px;
  line-height: 1.4;
}

#data .simple-table{
  background: #ffffff;
  border: 1px solid #e1e7f0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 16px rgba(20, 40, 80, 0.08);
  width: min(100%, 1200px);
  margin: 0 auto;
  --cols: 7;
}
#data .simple-table.entry-detail-table .simple-thead,
#data .simple-table.entry-detail-table .simple-row{
  grid-template-columns: 0.8fr 2fr 0.9fr 0.9fr;
}
#data .simple-thead,
#data .simple-row{
  display: grid;
  grid-template-columns: repeat(var(--cols, 7), minmax(120px, 1fr));
  align-items: center;
  gap: 0;
}
#data .simple-thead{
  background: #fff;
  font-weight: 700;
  color: #1b2b45;
  font-size: 0.8rem;
  padding: 0;
  border-bottom: 1px solid #e3e9f3;
  text-align: center;
}
#data .simple-tbody{
  max-height: none;
  overflow: visible;
}
#data .simple-row{
  padding: 0;
  border-bottom: 1px solid #eef2f7;
  color: #2b3d55;
  font-size: 13px;
  max-height: none;
  overflow: visible;
}
#data .simple-thead div,
#data .simple-row div{
  padding: 0 12px;
  text-align: center;
}
#data .simple-row div,
#data .simple-thead div{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#data .simple-row div:nth-child(3){
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  font-family: 'Rubik', Arial, Helvetica, sans-serif;
}
#data .simple-row div:nth-child(4){
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: 'Rubik', Arial, Helvetica, sans-serif;
}
#data .simple-row:last-child{
  border-bottom: none;
}
#data .simple-row div:last-child{
  font-weight: 700;
  color: #0f3c6e;
}
#data .simple-row a{
  color: #1f7a4f;
  font-weight: 700;
  text-decoration: none;
}
#data .simple-row a:hover{
  color: #196642;
  text-decoration: underline;
}
#data .date-cell{
  display: flex;
  flex-direction: column;
  gap: 4px;
  white-space: normal;
}
#data .date-cell span{
  white-space: nowrap;
}
#data .date-cell .time{
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
#data .date-cell .time{
  font-size: 0.7em;
  color: #6b7c95;
  display: flex;
  align-items: center;
  gap: 2px;
}
#data .date-cell .time-icon{
  font-size: 0.7em;
}
#data .simple-thead div:nth-child(6),
#data .simple-row div:nth-child(6){
  background: transparent;
  border-radius: 0;
}
#data .simple-thead div:nth-child(7),
#data .simple-row div:nth-child(7){
  background: transparent;
  border-radius: 0;
}
#data .table-empty{
  width: min(85%, 980px);
  margin: 0 auto;
  padding: 18px;
  background: #ffffff;
  border: 1px dashed #d6dde8;
  border-radius: 12px;
  text-align: center;
  color: #6b7c95;
  font-weight: 700;
}
#data .details-table{
  width: min(95%, 1200px);
  font-size: 13px;
  color: #059977;
  text-indent: 20px;
}
#data .details-table span:nth-last-child(2){
  margin: 0 25px 0 0;

}

@media (max-width: 768px){
  #data .simple-table{
    width: 100%;
  }
  #data .simple-thead,
  #data .simple-row{
    grid-template-columns: repeat(var(--cols, 7), minmax(100px, 1fr));
    font-size: 12px;
  }
  #data .simple-row div,
  #data .simple-thead div{
    white-space: normal;
    text-overflow: clip;
  }
  #data .simple-row div:nth-child(5),
  #data .simple-row div:nth-child(6){
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
  #data .simple-table.entry-detail-table .simple-row div:nth-child(3),
  #data .simple-table.entry-detail-table .simple-row div:nth-child(4){
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
  table, th, td{
    white-space: normal;
    word-break: break-word;
  }
}

/* الحالة عند فتح القائمة: توسيع العرض ودفع المحتوى */
body.sidebar-open {
  --sidebar-w: 300px;
}
body.sidebar-open nav#right {
  padding: 0 1px 60px 1px;
}

#data #js-enabled{
  text-align: center;
  font-weight: bold;
  color: #b90707;
  padding: 15px 0;
}

#data #display-error{
  height: 100dvh;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
#data #display-error p{
  color: #8a1f1f;
  font-weight: 700;
  font-size: 1rem;
  background: #fff5f5;
  border: 1px solid #f0caca;
  padding: 12px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(120, 20, 20, 0.12);
  max-width: 80%;
  text-align: center;
}

#data #loading-box,
#msg #loading-box{
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#data #loading{
  width: 80px;
  height: 80px;
}

/* New professional loader */
#data #loading-box.loading-pro,
#msg #loading-box.loading-pro{
  min-height: 140px;
}
#data .loading-card,
#msg .loading-card{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 20px 28px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 40px rgba(20, 40, 80, 0.15);
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
}
#data .loading-ring,
#msg .loading-ring{
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 3px solid rgba(42, 114, 232, 0.2);
  border-top-color: rgba(42, 114, 232, 0.95);
  border-right-color: rgba(127, 170, 255, 0.85);
  animation: loadingSpin 1.1s linear infinite;
}
#data .loading-bars,
#msg .loading-bars{
  display: flex;
  gap: 6px;
  height: 14px;
}
#data .loading-bars span,
#msg .loading-bars span{
  width: 6px;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, #5b8fe8, #a6c0f6);
  animation: loadingBars 1.1s ease-in-out infinite;
}
#data .loading-bars span:nth-child(2),
#msg .loading-bars span:nth-child(2){ animation-delay: 0.15s; }
#data .loading-bars span:nth-child(3),
#msg .loading-bars span:nth-child(3){ animation-delay: 0.3s; }
#data .loading-bars span:nth-child(4),
#msg .loading-bars span:nth-child(4){ animation-delay: 0.45s; }
#data .loading-label,
#msg .loading-label{
  font-size: 0.85rem;
  font-weight: 700;
  color: #2b3d55;
  letter-spacing: 0.3px;
}
@keyframes loadingSpin{
  to{ transform: rotate(360deg); }
}
@keyframes loadingBars{
  0%, 100%{ transform: scaleY(0.5); opacity: 0.6; }
  50%{ transform: scaleY(1.2); opacity: 1; }
}
@media (prefers-reduced-motion: reduce){
  #data .loading-ring,
  #data .loading-bars span,
  #msg .loading-ring,
  #msg .loading-bars span{
    animation: none;
  }
}

nav#right{
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  height: 100dvh;
  background: #fcfdfe;
  padding: 0;
  border-left: 1px solid #edf2f7;
  box-shadow: -4px 0 12px rgba(0, 0, 0, 0.02);
  transition: flex-basis 0.3s ease, width 0.3s ease, padding 0.3s ease;
  z-index: 30;
  overflow: hidden;
  position: sticky;
  top: 0; 
  display: flex;
  flex-direction: column;
}
#barracuda{
  text-align: center;
  font-size: 0.8rem;
  color: #a0aec0;
  padding: 15px 8px;
  border-top: 1px solid #edf2f7;
  background: #fcfdfe;
  margin-top: auto;
  font-weight: 600;
}
nav#right ul{
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  direction: ltr;
}
nav#right ul li,
nav#right ul li a{
  direction: rtl;
}
nav#right ul ul {
  background-color: transparent;
  height: 0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  border-right: 2px solid #edf2f7;
  margin-right: 15px;
}

nav#right ul li.open > ul {
  height: auto;
  opacity: 1;
  padding: 5px 0;
}

nav#right ul li {
  color: #4a5568;
  font-size: 13px;
  font-weight: 600;
  margin: 2px 8px;
  cursor: pointer;
  user-select: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}
nav#right ul li.main-cat{
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2d3748;
  background: rgba(237, 242, 247, 0.4);
}
nav#right ul li.main-cat,
nav#right ul li.li-sub-list,
nav#right ul li.li-sub-list-lv3,
nav#right ul li.li-sub-list-lv4{
  display: block;
}
nav#right ul li.main-cat .prev-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  width: 14px;
  height: 14px;
  align-self: center;
  vertical-align: middle;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12h14' stroke='black' stroke-width='2' stroke-linecap='round'/><path d='M12 5v14' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  color: transparent;
  font-size: 0;
  transition: background-image 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
nav#right ul li.open > .prev-icon{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12h14' stroke='%233a4b63' stroke-width='2' stroke-linecap='round'/></svg>");
}

nav#right ul li a{
  white-space: nowrap;
  color: #4a5568;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.2s ease-in-out, color 0.2s ease, transform 0.1s ease;
}
nav#right ul li a .prev-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  margin-left: 6px;
  flex: 0 0 14px;
}
nav#right ul li a .prev-icon.leaf{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233a4b63' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 7h6l2 2h10a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z'/><path d='M3 7V5a2 2 0 0 1 2-2h4l2 2h9a2 2 0 0 1 2 2v2'/></svg>");
  background-size: 14px 14px;
  background-repeat: no-repeat;
  color: transparent;
  font-size: 0;
}
nav#right ul li a span:not(.prev-icon){
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 1px;
  align-self: center;
  vertical-align: middle;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='6' fill='%233a4b63'/></svg>");
  background-size: 18px 18px;
  background-repeat: no-repeat;
  color: transparent;
  font-size: 0;
}

nav#right ul li.open > a .prev-icon{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12h14' stroke='%233a4b63' stroke-width='2' stroke-linecap='round'/></svg>");
}
nav#right ul li a:hover{
  background-color: #f7fafc;
  color: #2b6cb0;
}
nav#right ul li.main-cat:hover{
  background-color: #edf2f7;
  color: #2b6cb0;
}
nav#right ul li.open > a{
  background-color: #ebf8ff;
  color: #2c5282;
}
nav#right ul li.open > ul{
  background: transparent;
  border-right: 2px solid #bee3f8;
  margin-right: 20px;
  border-radius: 0;
}
/* آخر تاب مفتوح (الأعمق): خلفية قائمة الأبناء أغمق + لون التاب مطابق للخلفية */
nav#right ul li.open.open-last > ul{
  background: rgba(235, 248, 255, 0.5);
  border-radius: 8px;
}
nav#right ul li.open.open-last > a{
  color: #2b6cb0;
  font-weight: 800;
}
nav#right ul li ul.child-menu{
  height: 0;
  overflow: hidden;
  transition: height 0.5s ease;
}
nav#right ul.child-menu li a{
  background-color: transparent;
  font-weight: 600;
  text-decoration: none;
  font-size: 13px;
  font-family: var(--fontFamily);
  display: block;
  color: #2e4363;
  padding: 8px 5px;
  border-radius: 8px;
}

nav#right ul.child-menu li a:hover{
  text-decoration: none;
  background-color: #eef4ff;
}

nav#right ul ul li a{
  font-size: 12px;
}

nav#right ul li ul.child-menu li ul.accounts-tree-list{
  height: 0;
  overflow: hidden;
  transition: height 0.5s ease;
}

nav#right ul li ul.child-menu li ul.accounts-tree-list li a{
  padding-right: 10px;
  font-weight: 600;
}

nav#right ul li ul.child-menu li ul.accounts-tree-list li ul.accounts-tree-child{
  height: 0;
  overflow: hidden;
  transition: height 0.5s ease;
}

nav#right ul li ul.child-menu li ul.accounts-tree-list li ul.accounts-tree-child a{
  padding-right: 10px;
  color: #555;
}

nav#right ul li ul.child-menu li ul.accounts-tree-list li ul.accounts-tree-child li ul.lev_2 {
  height: 0;
  overflow: hidden;
  transition: height 0.5s ease;
}

nav#right ul li ul.child-menu li ul.accounts-tree-list li ul.accounts-tree-child li ul.lev_2 a{
  padding-right: 10px;
  color: #014bd5;
}

*{
  scrollbar-width: thin;
  scrollbar-color: #c3d2e6 #eef2f7;
}
*::-webkit-scrollbar{
  width: 3px;
  height: 3px;
}
*::-webkit-scrollbar-track{
  background: #eef2f7;
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb{
  background: #c3d2e6;
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover{
  background: #a9bfdc;
}

h2{
    margin-bottom:15px;
}
label{
    display: inline-block;
    width: 100px;
}
input,select,button{
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
}
.invalid{
    border: 1px solid #d33 !important;
    background: #fff3f3 !important;
}
.field-error{
  margin-top: 6px;
  font-size: 12px;
  color: #8a1f1f;
  text-align: right;
  background: #fff5f5;
  border: 1px solid #f2c9c9;
  padding: 6px 8px;
  border-radius: 8px;
}
#entry-date{
  width: 98%;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid #e3e9f3;
  border-radius: 12px;
  padding: 10px 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
#entry-date h2{
  margin: 0 0 8px;
  font-size: 20px;
  color: #16253d;
  letter-spacing: 0.2px;
}
#entry-date .entry-date-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
#entry-date .entry-date-field{
  display: flex;
  align-items: center;
  gap: 8px;
}
#entry-date .entry-date-field label{
  margin: 0;
  white-space: nowrap;
}
#entry-date label{
  color: #314a6b;
  font-weight: 600;
}
#entry-date input[type="date"]{
  margin-top: 6px;
  background: #ffffff;
  border: 1px solid #cdd8e6;
  border-radius: 10px;
  padding: 8px 10px;
  font-weight: 600;
}
@media (max-width: 768px){
  #data{
    height: calc(100dvh - var(--pagination-h) - 76px);
    overflow-y: auto;
    padding-bottom: calc(var(--pagination-h) + 80px);
  }
  #main-content #pages-list-tree{
    width: 100%;
    position: sticky;
    bottom: 0;
    left: 0;
    z-index: 20;
    border-radius: 12px;
    margin: 6px 0;
  }
  #main-content #pages-list-tree.has-entry-buttons{
    flex-direction: column;
    gap: 8px;
    padding: 8px;
  }
  #main-content #pages-list-tree.has-entry-buttons .pagination-links{
    order: 2;
    justify-content: center;
  }
  #main-content #pages-list-tree.has-entry-buttons #entry-buttons{
    order: 1;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  #main-content #pages-list-tree.has-entry-buttons #entry-totals{
    order: 3;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }
  #main-content #pages-list-tree a{
    padding: 4px 8px;
    font-size: 12px;
  }
  #entry-date .entry-date-head{
    flex-direction: column;
    align-items: flex-start;
  }
  #entry-date .entry-date-field{
    width: 100%;
    justify-content: space-between;
  }
  #entry-date .entry-date-field input[type="date"]{
    width: 100%;
  }
}
div#entryTable{
    width: calc(100% - 20px);
    border-collapse: collapse;
    background: #f8f9fc;
    margin: 10px 10px;
    table-layout: fixed;
    border-radius: 12px;
    padding: 6px;
    border: 1px solid #e3e9f3;
}
div#thead{
  display: flex;
  border: 1px solid transparent;
  padding: 6px 4px;
  justify-content: center;
  align-items: center;
}
div#thead div{ 
  flex: 1;
  margin: 0 1px;
  text-align: center;
  font-weight: 800;
  color: #233a5a;
}
div#thead div:nth-last-child(1){ 
  flex: 0.3;
}
div#tbody{
  display: block;
  max-height: 500px;
  overflow-y: auto;
  background-color: #fff;
  border-radius: 12px;
}
div#tbody div#row{
  display: flex;
  border: 1px solid #eef2f7;
  padding: 8px 10px;
  justify-content: center;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  margin: 8px 4px;
  transition: all 0.2s;
}
div#tbody div#row:hover {
  border-color: #2a72e8;
  box-shadow: 0 4px 12px rgba(42, 114, 232, 0.08);
}
div#tbody div#row div{
  flex: 1;
  margin: 0 1px;
  text-align: center;
}
div#tbody div#row .account-cell{
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
div#tbody div#row .amount-cell{
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}
div#tbody div#row .amount-cell input[type="number"]{
  width: 100%;
}
div#tbody div#row .amount-cell .credit{
  display: block;
}
div#entryTable select{
  width: 100%;
  padding: 8px 36px 8px 10px;
  border-radius: 12px;
  border: 1px solid #d4deec;
  background-color: #fbfcff;
  font-weight: 600;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #486285 50%),
    linear-gradient(135deg, #486285 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
div#entryTable .selection{
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
div#entryTable .selection select{
  flex: 1;
}
div#entryTable .customer-wrap{
  display: none; /* سيتم التحكم به عبر JS */
  flex-direction: column;
  position: relative;
  margin-top: 5px;
}
div#entryTable .customer-wrap input[type="text"]{
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d4deec;
  background-color: #fbfcff;
  font-weight: 600;
  font-size: 0.8rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
div#entryTable .customer-wrap input[type="text"]:focus{
  border-color: #1d6ade;
  box-shadow: 0 0 0 3px rgba(29, 106, 222, 0.15);
  background-color: #fff;
}
div#entryTable .customer-select {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 100;
  width: 100% !important;
  max-height: 200px;
  background: white;
  border: 1px solid #1d6ade !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 0 0 10px 10px;
}
div#entryTable .customer-select.show-dropdown {
  display: block;
}
div#entryTable select:focus{
  border-color: #1d6ade;
  box-shadow: 0 0 0 3px rgba(29, 106, 222, 0.15);
  background-color: #fff;
}
div#tbody div#row.debit-row .amount-cell .debit{
  background: linear-gradient(180deg, #f1f7ff, #f5ffe8);
  border: 1px solid #566f03;
  font-weight: 700;
  padding: 7px;
  border-radius: 9px;
  text-align: center;
}
div#tbody div#row.credit-row .amount-cell .credit{
  background: linear-gradient(180deg, #f8f9ff, #e8ecff);
  border: 1px solid #b7c0f3;
  font-weight: 600;
  padding: 7px;
  border-radius: 9px;
  text-align: center;
}
div#tbody div#row .amount-cell input[type="number"]::placeholder{
  color: #9aa6b2;
}

@media (max-width: 992px){
  #data{
    height: calc(100dvh - var(--pagination-h) - var(--header-h));
    overflow-y: auto;
    padding-bottom: calc(var(--pagination-h) + 80px);
  }
  div#entryTable{
    width: calc(100% - 12px);
    margin: 8px 6px;
  }
  div#thead div{
    font-size: 14px;
  }
  div#tbody{
    max-height: 260px;
  }
}

@media (max-width: 768px){
  div#entryTable .selection{
    flex-direction: column;
    align-items: stretch;
  }
  div#thead{
    display: none;
  }
  div#tbody div#row{
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    border: 1px solid #e1e5ec;
    border-radius: 10px;
    margin: 6px;
    padding: 8px;
    background-color: #fff;
  }
  div#tbody div#row div{
    margin: 0;
    text-align: right;
  }
  div#tbody div#row .amount-cell{
    align-items: stretch;
  }
  div#tbody div#row div:nth-last-child(1){
    align-self: flex-end;
    flex: 0;
  }
  div#tfoot{
    flex-direction: column;
    gap: 6px;
  }
  div#tfoot div{
    text-align: center;
  }
}

@media (max-width: 480px){
  div#entryTable select{
    padding: 10px 8px;
    font-size: 14px;
  }
  div#tbody div#row .amount-cell input[type="number"]{
    font-size: 14px;
  }
  button#addRow, button#saveEntry{
    width: 100%;
  }
  #entry-buttons{
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
}
div#tbody div#row div:nth-last-child(1){
  flex: 0.3;
}

div#tfoot{
  display: flex;
  border: 1px solid transparent;
  padding: 4px;
  justify-content: center;
  align-items: center;
}
div#tfoot div{
  flex: 1;
  text-align: center;
}
div#tfoot div:nth-last-child(1){
  flex: 0.3;
}
button#addRow, button#saveEntry{
    cursor: pointer;
    border: 0;
    margin: 3px;
    padding: 9px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f0f5ff, #e5edff);
    color: #1d2e49;
    font-weight: bold;
    box-shadow: 0 8px 16px rgba(20, 40, 80, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}
button#addRow:focus-visible, button#saveEntry:focus-visible{
  outline: 3px solid rgba(29, 106, 222, 0.25);
  outline-offset: 2px;
}
button#addRow:hover, button#saveEntry:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(20, 40, 80, 0.16);
}
button#saveEntry{
  background: linear-gradient(180deg, #2a72e8, #1b5ed4);
  color: #fff;
  position: relative;
  padding-left: 34px;
}
button#saveEntry:hover{
  box-shadow: 0 10px 20px rgba(29, 106, 222, 0.28);
}
button#addRow{
  background: transparent;
  border: 2px solid #2a72e8;
  color: #1b5ed4;
  position: relative;
  padding-left: 10px;
  padding-right: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button#addRow::after{
  content: "＋";
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
}
button#saveEntry::before{
  content: "✓";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
}
.removeRow{
  border: 0;
  background-color: transparent;
  cursor: pointer;
}
textarea#description{
  width: 98%;
  display: block;
  margin: 0 auto;
  border: 1px solid #d9e1ee;
  resize: vertical;
  min-height: 40px;
  max-height: 100px;
  overflow-y: auto;
  padding: 10px;
  font-weight: bold;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(20, 40, 80, 0.06);
}
#entry-buttons{
  width: 98%;
  margin: 0 auto;
  position: static;
  background: transparent;
  padding: 0;
  box-shadow: none;
  border-top: 0;
  display: flex;
  gap: 10px;
}

#error,
#success{
  font-weight: 700;
  padding: 14px 18px;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid #e3e8f2;
  box-shadow: 0 10px 22px rgba(20, 40, 80, 0.12);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  line-height: 1.6;
}
#success{
  color: #0f6b3f;
}
#error{
  color: #8f1d1d;
}
#msg{
  position: fixed;
  z-index: 99998;
  padding: 24px;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: rgba(10, 16, 28, 0.22);
  box-shadow: inset 0 0 120px rgba(255, 255, 255, 0.08), 0 20px 50px rgba(10, 20, 40, 0.3);
  backdrop-filter: blur(1px) saturate(130%);
  transition: opacity 0.35s ease;
  -webkit-transition: opacity 0.35s ease;
  overflow: hidden;
  isolation: isolate;
}
#msg.show{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#msg::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 28% 20%, rgba(120, 170, 220, 0.22), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.14), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  pointer-events: none;
  z-index: 0;
}
#msg #success,
#msg #error{
  border-radius: 20px;
  padding: 20px 26px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 24px 50px rgba(12, 20, 40, 0.2);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  max-width: min(560px, 92vw);
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: msgPop 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  z-index: 1;
}
#msg #success::before,
#msg #error::before{
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0));
}
#msg #success::after,
#msg #error::after{
  content: "";
  position: absolute;
  top: -50px;
  right: -60px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  opacity: 0.6;
  pointer-events: none;
}
#msg #error{
  border-color: rgba(244, 170, 170, 0.6);
  color: #8f1d1d;
  background: linear-gradient(135deg, rgba(255, 249, 249, 0.95) 0%, rgba(255, 236, 236, 0.92) 100%);
  box-shadow: 0 24px 50px rgba(140, 30, 30, 0.18);
}
#msg #error::after{
  background: radial-gradient(circle, rgba(255, 120, 120, 0.4), transparent 60%);
}
#msg #success{
  border-color: rgba(164, 220, 190, 0.7);
  color: #0f6b3f;
  background: linear-gradient(135deg, rgba(246, 255, 250, 0.95) 0%, rgba(231, 247, 240, 0.92) 100%);
  box-shadow: 0 24px 50px rgba(18, 120, 70, 0.16);
}
#msg #success::after{
  background: radial-gradient(circle, rgba(88, 200, 140, 0.4), transparent 60%);
}
@keyframes msgPop{
  0%{
    opacity: 0;
    transform: scale(0.98);
  }
  100%{
    opacity: 1;
    transform: scale(1);
  }
}
#confirmOverlay{
  position: fixed;
  inset: 0;
  background: rgba(12, 20, 40, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99997;
  backdrop-filter: blur(4px);
}
#app-header-slot,
#rightmenu-slot{
  min-height: 0;
}
.shell-loading{
  width: min(320px, 90%);
  margin: 12px auto;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(120deg, #f7f9ff, #eef2ff);
  border: 1px solid #e1e7f2;
  box-shadow: 0 12px 24px rgba(20, 40, 80, 0.08);
}
.shell-loading span{
  display: block;
  height: 8px;
  width: 60px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(120, 140, 180, 0.2), rgba(120, 140, 180, 0.55), rgba(120, 140, 180, 0.2));
  background-size: 200% 100%;
  animation: shellShimmer 1.2s ease-in-out infinite;
}
.shell-loading.shell-header span:nth-child(1){
  width: 36px;
}
.shell-loading.shell-header span:nth-child(2){
  width: 80px;
}
.shell-loading.shell-header span:nth-child(3){
  width: 52px;
}
.shell-loading.shell-menu{
  width: min(280px, 86%);
  flex-direction: column;
  align-items: stretch;
}
.shell-loading.shell-menu span{
  height: 10px;
  width: 100%;
}
.shell-loading.shell-menu span:nth-child(2){
  width: 90%;
}
.shell-loading.shell-menu span:nth-child(3){
  width: 80%;
}
.shell-loading.shell-menu span:nth-child(4){
  width: 70%;
}
@keyframes shellShimmer{
  0%{ background-position: 0% 50%; }
  100%{ background-position: 200% 50%; }
}
#confirmOverlay.show{
  display: flex;
}
#confirmBox{
  width: min(720px, 92vw);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(20, 40, 80, 0.2);
  border: 1px solid #e6ecf5;
  overflow: hidden;
}
#confirmHeader{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f7f9ff, #eef3ff);
  border-bottom: 1px solid #e6ecf5;
}
#confirmHeader h3{
  margin: 0;
  font-size: 16px;
  color: #1b2b45;
}
#confirmClose{
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #5a6b86;
}
#confirmBody{
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 60vh;
  overflow: auto;
}
.confirm-row{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #2c3f5c;
}
.confirm-row #confirmDesc{
  max-height: 4.2em;
  overflow: auto;
  line-height: 1.4;
  display: block;
}
.confirm-rows-title{
  font-weight: 700;
  color: #243b5a;
  margin-top: 4px;
}
#confirmRows{
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.confirm-item{
  border: 1px solid #eef2f7;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}
.confirm-item-title{
  font-weight: 700;
  color: #223755;
  margin-bottom: 4px;
}
.confirm-item-amounts{
  display: flex;
  justify-content: space-between;
  color: #445b78;
}
.confirm-totals{
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px dashed #e4eaf4;
  font-weight: 700;
}
#confirmActions{
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid #e6ecf5;
  background: #f9fbff;
}
#confirmActions button{
  border: 0;
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}
#confirmBack{
  background: #eef3ff;
  color: #1e3a5f;
}
#confirmSend{
  background: linear-gradient(180deg, #2a72e8, #1b5ed4);
  color: #fff;
  box-shadow: 0 8px 16px rgba(29, 106, 222, 0.25);
}

/* تنسيق خاص لجدول القيود لتمييز المدين والدائن */
.entries-main-table .simple-row div:nth-last-child(2) {
    color: #dc2626; /* دائن باللون الأحمر الداكن */
    font-weight: 700;
}
.entries-main-table .simple-row div:nth-last-child(3) {
    color: #16a34a; /* مدين باللون الأخضر الداكن */
    font-weight: 700;
}
#form-msg{
  padding: 10px;
  border-radius: 7px;
  background-color: #fff;
  position: absolute;
  bottom: 10%;
  left: 20%;
  z-index: 999999;
  width: fit-content;
}
.not-found-page{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-family: tahoma;
    color: #444;
    padding-top: 20px;
}

.not-found-page h1{
    font-size: 70px;
    margin: 5px 0;
    color: #3a7afe;
}

.not-found-page h2{
    margin: 5px 0 10px;
}

.not-found-page p{
    color: #777;
    max-width: 400px;
}

.nf-icon svg{
    width: 120px;
    height: 120px;
    stroke: #3a7afe;
    stroke-width: 1.5;
    fill: none;
    animation: float 2.5s ease-in-out infinite;
}

@keyframes float{
    0%{transform: translateY(0)}
    50%{transform: translateY(-10px)}
    100%{transform: translateY(0)}
}

.nf-btn{
    margin-top: 20px;
    padding: 10px 20px;
    border: none;
    background: #3a7afe;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.nf-btn:hover{
    background:#2f63d6;
}

@media (max-width: 992px){
  :root{
    --page-pad: 6px;
    --data-pad: 6px;
  }
  header{
    flex-direction: column;
  }
  #user{
    width: 100%;
    padding: 6px 10px;
    justify-content: flex-start;
  }
  #menuToggle{
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  nav#top-menu{
    width: 100%;
    display: none;
  }
  nav#top-menu ul{
    display: flex;
    flex-wrap: wrap;
  }
  nav#top-menu ul li a{
    width: 100%;
    text-align: right;
  }
  #main-content{
    flex-direction: column;
  }
  nav#right,
  #data{
    width: 100%;
    height: auto;
  }
  #data{
    margin: 0 auto;
    padding: 10px 0 60px;
    overflow-y: auto;
  }
  nav#right{
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    width: 300px;
    flex-basis: 300px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  body.sidebar-open nav#right{
    transform: translateX(0);
  }
}

@media (max-width: 768px){
  label{
    width: 100%;
    margin-bottom: 6px;
  }
  #entry-date{
    width: 96%;
  }
  input, select, textarea{
    width: 100%;
  }
  textarea#description{
    width: 96%;
  }
  table{
    width: calc(100% - 20px);
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    table-layout: auto;
  }
  th,td{
    width: auto;
  }
  #entry-buttons{
    width: 96%;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  #data{
    padding-bottom: 190px;
  }
  textarea#description{
    max-height: 140px;
  }
  th,td{
    min-width: 120px;
    padding: 6px;
  }
  #form-msg{
    left: 5%;
    right: 5%;
    width: auto;
  }
}

@media (max-width: 480px){
  nav#top-menu ul li a{
    font-size: 12px;
  }
  nav#right ul li,
  nav#right ul li a{
    font-size: 13px;
  }
  #data h1{
    width: 96%;
  }
  table{
    width: calc(100% - 20px);
  }
  th,td{
    min-width: 100px;
  }
}

/* صفحة تسجيل الدخول */
#login-page {
  width: 100%;
  height: 100%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.login-container {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(123, 155, 196, 0.15);
  overflow: hidden;
  animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 20px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: iconFloat 3s ease-in-out infinite;
}

@keyframes iconFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* الفورم */
#loginForm {
  padding: 35px 25px;
}

/* الحقول */
#loginForm .form-group {
  margin-bottom: 20px;
  position: relative;
}

#loginForm .form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  color: #556b7f;
  font-weight: 500;
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
}

#loginForm .form-group .icon {
  font-size: 16px;
}

#loginForm .form-group input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #e8eff8;
  background-color: #f8fafb;
  border-radius: 8px;
  font-size: 16px;
  color: #333;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}

#loginForm .form-group input::placeholder {
  color: #b3bcc9;
}

#loginForm .form-group input:focus {
  outline: none;
  background-color: white;
  border-color: #9fb8d4;
  box-shadow: 0 0 0 3px rgba(159, 184, 212, 0.1);
}

#loginForm .form-group input:hover {
  border-color: #c5d9e8;
}

.focus-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(135deg, #9fb8d4 0%, #8fa8c7 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
}

#loginForm .form-group input:focus ~ .focus-line {
  width: 100%;
}

/* الزر */
#loginForm button {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, #9fb8d4 0%, #8fa8c7 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 8px 16px rgba(123, 155, 196, 0.2);
  letter-spacing: 0.3px;
  margin-top: 10px;
}

#loginForm button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(123, 155, 196, 0.3);
  background: linear-gradient(135deg, #8fa8c7 0%, #7b9bc4 100%);
}

#loginForm button:active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(123, 155, 196, 0.2);
}

/* تذييل الفورم */
.form-footer {
  margin-top: 20px;
  text-align: center;
}

.forgot-link {
  color: #7b9bc4;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.forgot-link:hover {
  color: #556b7f;
  text-decoration: underline;
}

/* تنسيق صفحة عدم المستخدم - Not User */
#not-user {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f0f4f8 0%, #e8edf2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.not-user-container {
  width: 100%;
  max-width: 900px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.not-user-header {
  background: linear-gradient(135deg, #7b9bc4 0%, #8fa8c7 100%);
  color: #fff;
  padding: 50px 30px;
  text-align: center;
}

.not-user-icon {
  margin-bottom: 20px;
  animation: bounce 2s infinite;
}
.not-user-stats{
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 35px 20px;
  background: #ffffff;
  border-bottom: 1px solid #edf2f7;
}
.stat-item {
  text-align: center;
  flex: 1;
  position: relative;
  transition: transform 0.3s ease;
}
/* إضافة فاصل عمودي أنيق بين العناصر */
.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 0;
  top: 20%;
  height: 60%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, #e2e8f0, transparent);
}
.stat-item:hover {
  transform: translateY(-5px);
}
.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 5px;
  background: linear-gradient(135deg, #6a7594 0%, #3b82f6 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.1));
}
.stat-label {
  font-size: 14px;
  font-weight: 700;
  color: #718096;
  letter-spacing: 0.5px;
}
@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.not-user-icon svg {
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.15));
  stroke: #dbe7f2;
}

.not-user-header h1 {
  font-size: 36px;
  font-weight: 600;
  margin-bottom: 10px;
  letter-spacing: 0.8px;
  color: #2d3748;
}

.not-user-subtitle {
  font-size: 16px;
  opacity: 0.85;
  font-weight: 400;
  color: #4a5568;
}
.not-user-welcome {
  margin-top: 15px;
  font-size: 16px;
  font-weight: 500;
  color: #f5f7fb;
  opacity: 0.95;
}

/* شبكة الميزات */
.not-user-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 40px 30px;
  background-color: #f8faff;
}

.feature-box {
  background: white;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  cursor: pointer;
}

.feature-box:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border-color: #cbd5e0;
}

.feature-icon {
  font-size: 40px;
  margin-bottom: 15px;
  display: inline-block;
  transition: transform 0.3s ease;
}

.feature-box:hover .feature-icon {
  transform: scale(1.1) rotate(3deg);
}

.feature-box h3 {
  color: #2d3748;
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: 600;
}

.feature-box p {
  color: #718096;
  font-size: 14px;
  line-height: 1.5;
}

/* قسم الدعوة للإجراء */
.not-user-cta {
  background: linear-gradient(135deg, #f0f3f8 0%, #ebe7e2 100%);
  padding: 40px 30px;
  text-align: center;
}

.not-user-message {
  color: #2d3748;
  font-size: 18px;
  margin-bottom: 25px;
  font-weight: 500;
}

.login-btn-primary {
  display: inline-block;
  padding: 16px 40px;
  background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 8px 20px rgba(66, 153, 225, 0.25);
  letter-spacing: 0.5px;
}
.login-btn-primary.cta-animated{
  position: relative;
  overflow: hidden;
  animation: ctaPulse 2.6s ease-in-out infinite;
}
.login-btn-primary.cta-animated::after{
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-20deg);
  animation: ctaShine 2.6s ease-in-out infinite;
}
.login-btn-primary.cta-animated:hover{
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px rgba(66, 153, 225, 0.35);
}
@keyframes ctaPulse{
  0%, 100%{ box-shadow: 0 8px 20px rgba(66, 153, 225, 0.25); }
  50%{ box-shadow: 0 14px 28px rgba(66, 153, 225, 0.35); }
}
@keyframes ctaShine{
  0%{ left: -70%; }
  55%{ left: 120%; }
  100%{ left: 120%; }
}

.login-btn-primary:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(66, 153, 225, 0.35);
  background: linear-gradient(135deg, #8fa8c7 0%, #7b9bc4 100%);
}

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

/* تذييل الصفحة */
.not-user-footer {
  background: #4a5568;
  color: white;
  padding: 20px;
  text-align: center;
  font-size: 13px;
  opacity: 0.85;
}

/* استجابة للأجهزة الصغيرة */
@media (max-width: 768px) {
  .not-user-header h1 {
    font-size: 26px;
  }

  .not-user-subtitle {
    font-size: 14px;
  }

  .not-user-content {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    padding: 30px 15px;
  }

  .feature-box {
    padding: 20px;
  }

  .feature-icon {
    font-size: 32px;
  }

  .not-user-cta {
    padding: 30px 15px;
  }

  .login-btn-primary {
    padding: 14px 30px;
    font-size: 14px;
  }
}

/* تنسيقات منطقة عرض المحتوى #data */

#data .table-empty,
#data #display-error {
  background: white;
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  margin: 20px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8f0;
}

#data .table-empty {
  color: #8b9aac;
  font-size: 16px;
}

#data #display-error {
  background: linear-gradient(135deg, #fef5f5 0%, #faf8f8 100%);
  border-color: #fbd3d3;
}

#data #display-error p {
  color: #a85555;
  font-size: 15px;
  line-height: 1.6;
}

/* تأثيرات التحميل */
#data::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #9fb8d4, transparent);
  opacity: 0;
  animation: shimmer 2s infinite;
  pointer-events: none;
}

@keyframes shimmer {
  0%, 100% {
    opacity: 0;
    transform: translateX(-100%);
  }
  50% {
    opacity: 1;
  }
}

/* تنسيق رسائل عدم توفر البيانات */
#data .page-header {
  animation: fadeInDown 0.5s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* تنسيق رسالة JavaScript المعطلة */
#js-enabled {
  background: white;
  border-radius: 16px;
  padding: 50px 40px;
  text-align: center;
  margin: 40px auto;
  max-width: 450px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
  border: 2px solid #f0e8e4;
  animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.noscript-icon {
  font-size: 60px;
  margin-bottom: 20px;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

#js-enabled h2 {
  color: #2d3748;
  font-size: 26px;
  margin-bottom: 15px;
  font-weight: 600;
}

#js-enabled p {
  color: #718096;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 10px;
}

.noscript-hint {
  color: #4299e1;
  font-weight: 500;
  margin-top: 15px;
}

/* تنسيق نموذج إضافة العميل */
.custom-form-wrapper {
  padding: 30px;
  width: 100%;
}
.custom-form-card {
  width: 60%;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.05);
  border: 1px solid #e2e8f0;
}
.form-header {
  margin-bottom: 30px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 15px;
}
.form-header h2 { color: #1e3a8a; margin-bottom: 5px; }
.form-header p { color: #64748b; font-size: 14px; }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 25px;
}
.form-group.full-width { grid-column: span 2; }
.form-group label { display: block; width: 100%; margin-bottom: 10px; font-weight: 700; color: #334155; }
.form-group input, .form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  transition: all 0.3s;
}
.form-group input:focus, .form-group textarea:focus {
  border-color: #3b82f6;
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}
.required { color: #ef4444; }
.form-footer-actions {
  margin-top: 40px;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}
.submit-btn {
  background: linear-gradient(135deg, #2563eb, #1e40af);
  color: #fff;
  border: none;
  padding: 12px 30px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
}
.cancel-btn {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
  padding: 12px 30px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* تنسيقات خاصة بالتابلت (Tablet) */
@media (max-width: 768px) {
  .custom-form-wrapper {
    padding: 20px;
  }
  .custom-form-card {
    width: 90%; /* يزيد العرض قليلاً على التابلت */
    padding: 30px;
  }
  .form-grid {
    gap: 20px;
  }
}

/* تنسيقات خاصة بالموبايل (Mobile) */
@media (max-width: 480px) {
  .custom-form-wrapper {
    padding: 15px;
  }
  .custom-form-card {
    width: 100%; /* يأخذ كامل العرض على الموبايل */
    padding: 20px;
    border-radius: 15px;
  }
  .form-grid {
    grid-template-columns: 1fr; /* يجعل الحقول تتكدس عمودياً */
    gap: 15px;
  }
  .form-group.full-width {
    grid-column: span 1; /* يضمن أن الحقول التي كانت تأخذ عمودين تأخذ عمود واحد */
  }
  .form-footer-actions {
    flex-direction: column;
    gap: 10px;
  }
  .submit-btn, .cancel-btn {
    width: 100%;
    padding: 10px 20px;
    font-size: 15px;
  }
  .form-header h2 {
    font-size: 24px;
  }
  .form-header p {
    font-size: 13px;
  }
}
