.box {
    /* height: 110px; */
    flex: 1 0 0;
    display: block;
    flex-basis: 50%;
    padding: 15px;
    align-items: center;
    transition: all 0.3s ease;
    text-decoration: none;
    color: black;
    border-radius: 10px;
}
@media (min-width: 708px) {
    .box {
        flex-basis: 20%;
    }
}
.box:hover{
    transform: scale(0.93);
}

.skeleton-line,
.skeleton-circle {
    animation: skeletonPulse 1.2s ease-in-out infinite;
    background: linear-gradient(90deg, #eef1f5 0%, #f8fafc 45%, #eef1f5 100%);
    background-size: 220% 100%;
    display: block;
}

.skeleton-line {
    border-radius: 999px;
    height: 12px;
}

.skeleton-circle {
    border-radius: 50%;
    flex: 0 0 34px;
    height: 34px;
    width: 34px;
}
@keyframes skeletonPulse {
    0% {
        background-position: 100% 0;
    }

    100% {
        background-position: -100% 0;
    }
}

.cdx {
    flex: 1 0 0;
    justify-content: left;
    align-items: center;
    border-radius: 10.431px;
}
.cdx-success {
    border: 1.5px solid #16DD65 !important;
}
.cdx-danger {
    border: 1.5px solid #F73434 !important;
}
.cdx-warning {
    border: 1.5px solid #F7AE34 !important;
}
.cdx-content {
    display: flex; 
    flex-direction: column; 
    /* border: 1.5px solid #16DD65 !important;
    border-width: 5px; */
    align-items: center; 
    justify-content: center
}


.spinner-border {
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    margin-bottom: -3px;
    border: 0.15em solid rgb(119 135 224);
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}
  
@keyframes spinner-border {
    to {
        transform: rotate(360deg);
    }
}


.picture-upload{
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 225px;
    justify-content: center;
    min-height:150px;
    background-image: url('');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;                             
}

.row_ {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    align-items: flex-start;
    gap: 20px;
  }
  
  .row__ {
      display: flex;
      flex-wrap: wrap;
      /* width: 60%; */
      gap: 20px;
  }
  
  .di1 .di2 .di3 {
      display: flex;
  }
  
  @media (max-width: 708px) {
      .di3{
          display: none;
      }
  }
  @media (max-width: 450px) {
      .di2{
          display: none;
      }
  }
  @media (max-width: 400px) {
      .di1{
          display: none;
      }
  }

#camera-container {
    position: relative;
    /* width: 100%; */
    height: 300px;
}

#camera {
    background-color: black;
    background-position: center;
    height: 300px;
    /* transform: scaleX(-1); */
    width: 100%;
    object-fit: cover;
    border-radius: 15px;
}

#camera video {
    position: absolute;
    border: 3px solid #062433 !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scaleX(-1);
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures it fills the container */
    border-radius: 15px; /* Ensures video itself has rounded corners */
}

.scanning-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: rgba(0, 255, 102, 0.7);
    animation: scan 1.5s linear infinite;
    filter: blur(4px); /* Apply blur effect */
    pointer-events: none; /* Ensures the line doesn't block other interactions */
}

@keyframes scan {
    0% {
        top: 0%;
        filter: blur(4px); /* Start with blur */
    }
    50% {
        top: 50%;
        filter: blur(4px); /* Maintain blur effect */
    }
    100% {
        top: 100%;
        filter: blur(4px); /* Maintain blur effect */
    }
}



/* Dashboard Chart Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out forwards;
    opacity: 0;
}

/* Chart Loader Styles */
.chart-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 15px;
}

.chart-loader .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

.chart-loader-text {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

/* Revenue Expense Chart Styles */
#revenueExpenseChart {
    min-height: 200px;
    max-height: 250px;
    position: relative;
    transition: opacity 0.5s ease-in;
}

/* Weekly Chart Styles */
#transaction_weekly_chart {
    min-height: 280px;
    max-height: 320px;
    position: relative;
    transition: opacity 0.5s ease-in;
}

/* Payment Metrics Card Enhancements */
.payment-metrics {
    transition: opacity 0.5s ease-in;
}

.metric-cell {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s ease;
}

.metric-cell:hover::before {
    left: 100%;
}

.metric-cell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Mini bars animation */
.mini-bars span {
    display: inline-block;
    transition: all 0.3s ease;
}

.metric-cell:hover .mini-bars span {
    transform: scaleY(1.1);
}

/* Card styles for charts */
.card .card-body {
    position: relative;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #revenueExpenseChart {
        min-height: 180px;
        max-height: 220px;
    }
    
    #transaction_weekly_chart {
        min-height: 250px;
        max-height: 280px;
    }
}

/* Skeleton loader for charts */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

.skeleton-loader {
    background: linear-gradient(90deg, #f0f0f0 0px, #f8f8f8 40px, #f0f0f0 80px);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 8px;
}

/* AJAX page transition */
.ajax-page-loader {
    display: flex;
    min-height: min(70vh, 680px);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.25rem;
    text-align: center;
    transition: opacity .18s ease, transform .18s ease;
}

.ajax-page-loader--complete {
    opacity: 0;
    transform: scale(.98);
}

.ajax-page-loader__visual {
    position: relative;
    display: grid;
    width: 150px;
    height: 150px;
    place-items: center;
    margin-bottom: 1.6rem;
}

.ajax-page-loader__ring {
    position: absolute;
    border: 1px solid rgba(93, 101, 207, .2);
    border-radius: 50%;
}

.ajax-page-loader__ring--one {
    width: 126px;
    height: 126px;
    border-top-color: #5d65cf;
    animation: ajaxLoaderSpin 2.2s linear infinite;
}

.ajax-page-loader__ring--two {
    width: 148px;
    height: 148px;
    border-right-color: rgba(93, 101, 207, .55);
    animation: ajaxLoaderSpin 3.1s linear infinite reverse;
}

.ajax-page-loader__logo {
    position: relative;
    z-index: 1;
    display: grid;
    width: 104px;
    height: 104px;
    place-items: center;
    padding: 35px;
    animation: ajaxLoaderFloat 2.4s ease-in-out infinite;
}

.ajax-page-loader__logo img {
    width: 100%;
    height: auto;
    max-height: 66px;
    object-fit: contain;
}

.ajax-page-loader__title {
    color: #292d48;
    font-size: 1rem;
    font-weight: 750;
}

.ajax-page-loader__subtitle {
    margin-top: .35rem;
    color: #8a8fa7;
    font-size: .78rem;
}

.ajax-page-loader__dots {
    display: flex;
    gap: .35rem;
    margin-top: .9rem;
}

.ajax-page-loader__dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #6871d5;
    animation: ajaxLoaderDot 1.15s ease-in-out infinite;
}

.ajax-page-loader__dots span:nth-child(2) { animation-delay: .14s; }
.ajax-page-loader__dots span:nth-child(3) { animation-delay: .28s; }

.ajax-page-loaded { animation: ajaxPageReveal .38s ease both; }

.ajax-page-error {
    display: flex;
    min-height: 55vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.ajax-page-error__icon {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    margin-bottom: 1rem;
    border-radius: 20px;
    background: #fff0f2;
    color: #d94b66;
    font-size: 1.7rem;
}

.ajax-page-error h3 { margin-bottom: .35rem; color: #292d48; }
.ajax-page-error p { margin-bottom: 1.25rem; color: #8a8fa7; }

@keyframes ajaxLoaderSpin { to { transform: rotate(360deg); } }
@keyframes ajaxLoaderFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes ajaxLoaderDot { 0%, 60%, 100% { opacity: .3; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-4px); } }
@keyframes ajaxPageReveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
    .ajax-page-loader__ring,
    .ajax-page-loader__logo,
    .ajax-page-loader__dots span,
    .ajax-page-loaded { animation: none !important; }
}

/* Settings hub */
.settings-hub {
    padding: clamp(1.5rem, 3vw, 3rem);
}

.settings-hub__header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.settings-hub__eyebrow {
    color: #7c3aed;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.settings-hub__title {
    margin: .3rem 0 .45rem;
    color: #181c32;
    font-size: clamp(1.65rem, 3vw, 2.25rem);
    font-weight: 750;
    letter-spacing: -.04em;
}

.settings-hub__subtitle {
    margin: 0;
    color: #7e8299;
    font-size: .95rem;
}

.settings-hub__badge {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    flex: 0 0 auto;
    padding: .65rem .9rem;
    border: 1px solid #e9e5f3;
    border-radius: 999px;
    background: #fff;
    color: #5e6278;
    font-size: .78rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(31, 38, 68, .05);
}

.settings-hub__search {
    display: flex;
    align-items: center;
    width: min(100%, 320px);
    flex: 0 0 320px;
    padding: .2rem .45rem .2rem 1rem;
    border: 1px solid #e5e7ef;
    border-radius: .85rem;
    background: #fff;
    color: #7e8299;
    box-shadow: 0 6px 18px rgba(31, 38, 68, .05);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.settings-hub__search:focus-within {
    border-color: #9aa2e8;
    box-shadow: 0 0 0 3px rgba(93, 101, 207, .1);
}

.settings-hub__search > i { font-size: 1rem; }

.settings-hub__search input {
    width: 100%;
    padding: .65rem .75rem;
    border: 0;
    outline: 0;
    background: transparent;
    color: #181c32;
    font-size: .85rem;
}

.settings-hub__search input::-webkit-search-cancel-button { display: none; }

.settings-hub__search button {
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    padding: 0;
    border: 0;
    border-radius: .55rem;
    background: #f1f2fb;
    color: #5d65cf;
}

.settings-hub__empty {
    margin-top: 2rem;
    padding: 3.5rem 1rem;
    border: 1px dashed #dfe2ef;
    border-radius: 1rem;
    text-align: center;
    color: #7e8299;
}

.settings-hub__empty > i { font-size: 2rem; color: #9aa2e8; }
.settings-hub__empty h3 { margin: .8rem 0 .25rem; color: #3f4254; }
.settings-hub__empty p { margin: 0; }

@media (max-width: 767.98px) {
    .settings-hub__search { width: 100%; flex-basis: 100%; }
}

.settings-card {
    --card-accent: #7c3aed;
    --card-soft: #f3e8ff;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    padding: 1.45rem;
    overflow: hidden;
    border: 1px solid #ececf3;
    border-radius: 1.15rem;
    background: #fff;
    box-shadow: 0 8px 28px rgba(31, 38, 68, .06);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.settings-card::after {
    position: absolute;
    top: -45px;
    right: -45px;
    width: 125px;
    height: 125px;
    border-radius: 50%;
    background: var(--card-soft);
    content: "";
    opacity: .65;
    transition: transform .35s ease;
}

.settings-card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--card-accent) 30%, white);
    box-shadow: 0 18px 38px rgba(31, 38, 68, .12);
}

.settings-card:hover::after { transform: scale(1.18); }
.settings-card--blue { --card-accent: #2563eb; --card-soft: #dbeafe; }
.settings-card--emerald { --card-accent: #059669; --card-soft: #d1fae5; }
.settings-card--orange { --card-accent: #ea580c; --card-soft: #ffedd5; }
.settings-card--rose { --card-accent: #e11d48; --card-soft: #ffe4e6; }
.settings-card--indigo { --card-accent: #4f46e5; --card-soft: #e0e7ff; }
.settings-card--cyan { --card-accent: #0891b2; --card-soft: #cffafe; }

.settings-card__icon {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    margin-bottom: 1.35rem;
    border-radius: .95rem;
    background: var(--card-soft);
    color: var(--card-accent);
    font-size: 1.45rem;
}

.settings-card__content { flex: 1; }

.settings-card__label {
    color: var(--card-accent);
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.settings-card h3 {
    margin: .35rem 0 .7rem;
    color: #181c32;
    font-size: 1.08rem;
    font-weight: 750;
    letter-spacing: -.02em;
}

.settings-card p {
    margin: 0 0 1.25rem;
    color: #7e8299;
    font-size: .82rem;
    line-height: 1.65;
}

.settings-card__action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: .8rem 0 0;
    border: 0;
    border-top: 1px solid #eff0f5;
    background: transparent;
    color: #3f4254;
    font-size: .78rem;
    font-weight: 750;
    text-align: left;
    transition: color .2s ease;
}

.settings-card__action i {
    display: grid;
    place-items: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    background: var(--card-soft);
    color: var(--card-accent);
    transition: transform .2s ease;
}

.settings-card__action:hover,
.settings-card__action:focus { color: var(--card-accent); }
.settings-card__action:hover i { transform: translate(2px, -2px); }

@media (max-width: 575.98px) {
    .settings-hub__header { align-items: flex-start; }
    .settings-hub__badge { display: none; }
    .settings-card { min-height: 260px; }
}
