/* style.css - Sci-Fi Holographic Dark UI System */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-dark: #05050b;
    --bg-sidebar: #090916;
    --panel-bg: rgba(12, 12, 28, 0.6);
    --panel-border: rgba(255, 255, 255, 0.05);
    
    --text-primary: #ffffff;
    --text-secondary: #718096;
    --text-muted: #4a5568;
    
    --accent-blue: #2b6cb0;
    --accent-cyan: #00f2fe;
    --accent-purple: #b927fc;
    --accent-pink: #f5576c;
    --accent-magenta: #e040fb;
    --accent-green: #00e676;
    
    --gradient-primary: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-pink) 100%);
    --gradient-blue-cyan: linear-gradient(135deg, #0052d4 0%, #4364f7 50%, #6fb1fc 100%);
    --gradient-card: linear-gradient(180deg, rgba(16, 16, 35, 0.8) 0%, rgba(8, 8, 20, 0.9) 100%);
    
    --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

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

/* Sidebar Navigation (Left vertical stripe) */
.sidebar-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 20px;
    padding-right: 20px;
    justify-content: space-between;
    padding-top: 30px;
    padding-bottom: 20px;
    z-index: 100;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--panel-border);
    overflow: hidden;
}

.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-cyan) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    color: #ffffff;
    flex-shrink: 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: flex-start;
    margin: 30px 0 10px 0;
    width: 100%;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar-menu::-webkit-scrollbar {
    display: none;
}

.sidebar-item {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 15px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 1px solid transparent;
    flex-shrink: 0;
    gap: 12px;
}

.sidebar-item:hover, .sidebar-item.active {
    color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.1);
}

.sidebar-profile {
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 12px;
    border: 1px solid transparent;
    border-top: 1px solid var(--panel-border);
    overflow: hidden;
    cursor: pointer;
    margin-top: auto;
    margin-bottom: 10px;
    padding: 15px 15px 10px 15px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-smooth);
    gap: 12px;
    flex-shrink: 0;
}
.sidebar-profile:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(245, 87, 108, 0.2);
    color: #fff;
}

.logout-icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(245, 87, 108, 0.1);
    border: 1px solid rgba(245, 87, 108, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(245, 87, 108, 0.15);
    transition: all 0.3s ease;
    flex-shrink: 0;
}
.sidebar-profile:hover .logout-icon-wrapper {
    background: rgba(245, 87, 108, 0.25);
    border-color: var(--accent-pink);
    box-shadow: 0 0 15px rgba(245, 87, 108, 0.5);
    transform: scale(1.05);
}
.sidebar-profile img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--accent-purple);
}

.sidebar-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Master Layout Wrapper */
.app-container {
    margin-left: 260px; /* shift right to make space for sidebar */
    min-height: 100vh;
    padding: 30px;
    display: grid;
    grid-template-columns: 1.2fr 1.8fr 1fr;
    gap: 30px;
    position: relative;
}

@media (max-width: 1300px) {
    .app-container {
        grid-template-columns: 1fr 1.2fr;
    }
}

@media (max-width: 950px) {
    .app-container {
        grid-template-columns: 1fr;
    }
}

/* Glass panel styled widget containers */
.glass-widget {
    background: var(--gradient-card);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: var(--transition-smooth);
}

.glass-widget:hover {
    border-color: rgba(255, 255, 255, 0.08);
}

/* Columns positioning */
.left-col {
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 10;
}

.center-col {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    min-height: 500px;
}

.right-col {
    display: flex;
    flex-direction: column;
    gap: 25px;
    z-index: 10;
}

/* ThreeJS Canvas wrapper (takes center-stage) */
.canvas-wrapper {
    position: absolute;
    top: 5%;
    left: 0;
    width: 100%;
    height: 80%;
    z-index: 1;
    pointer-events: none; /* Let clicks pass to items below */
}

#canvas3d-container {
    width: 100%;
    height: 100%;
}

/* Typography styles matching image */
.stat-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.currency-symbol {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-right: 5px;
    font-weight: 500;
}

.large-balance {
    font-size: 3.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-top: 10px;
    background: linear-gradient(180deg, #ffffff 0%, #a0aec0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.activity-bar-container {
    margin-top: 20px;
    margin-bottom: 25px;
}

.activity-bar-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.activity-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
    display: flex;
}

.activity-bar-fill-in {
    height: 100%;
    background: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.5);
    transition: width 0.5s ease-in-out;
}

.activity-bar-fill-out {
    height: 100%;
    background: var(--accent-pink);
    box-shadow: 0 0 10px rgba(245, 87, 108, 0.5);
    transition: width 0.5s ease-in-out;
}

/* Country list styled denomination breakdown */
.denom-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 5px;
}

.denom-list::-webkit-scrollbar {
    width: 4px;
}
.denom-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
}

.denom-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
    border-left: 3px solid transparent;
}

.denom-row.note { border-left-color: var(--accent-purple); }
.denom-row.coin { border-left-color: var(--accent-cyan); }

.denom-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.denom-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.note .denom-dot { background: var(--accent-purple); box-shadow: 0 0 8px var(--accent-purple); }
.coin .denom-dot { background: var(--accent-cyan); box-shadow: 0 0 8px var(--accent-cyan); }

.denom-name {
    font-size: 0.95rem;
    font-weight: 500;
}

.denom-count {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: 10px;
}

.denom-val-total {
    font-weight: 600;
    font-size: 0.95rem;
}

/* bottom widget cards style (like line chart/ring in image) */
.bottom-cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    z-index: 10;
    width: 100%;
}

@media (max-width: 1300px) {
    .bottom-cards-grid {
        grid-template-columns: 1fr;
    }
}

.card-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.card-big-value {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

/* CSS Bar columns widget */
.bar-chart-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 70px;
    margin-top: 15px;
}

.bar-column {
    width: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    height: 100%;
    position: relative;
}

.bar-column-fill {
    width: 100%;
    position: absolute;
    bottom: 0;
    left: 0;
    border-radius: 4px;
    background: linear-gradient(0deg, var(--accent-purple) 0%, var(--accent-pink) 100%);
    box-shadow: 0 0 10px rgba(185, 39, 252, 0.4);
}

.bar-column-fill.blue {
    background: linear-gradient(0deg, #0052d4 0%, var(--accent-cyan) 100%);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.4);
}

/* Circular Progress ring widget */
.progress-ring-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 5px;
}

.progress-ring-circle {
    position: relative;
    width: 70px;
    height: 70px;
}

.progress-ring-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
    overflow: visible;
}

.progress-ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.04);
    stroke-width: 6;
}

.progress-ring-fill {
    fill: none;
    stroke: var(--accent-cyan);
    stroke-width: 6;
    stroke-linecap: round;
    stroke-dasharray: 220;
    stroke-dashoffset: 220;
    transition: stroke-dashoffset 0.8s ease-in-out;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

/* Trend sparkline svg line widget */
.sparkline-container {
    height: 60px;
    margin-top: 15px;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
}

.sparkline-line {
    fill: none;
    stroke: var(--accent-pink);
    stroke-width: 2.5;
    stroke-linecap: round;
}

.sparkline-fill {
    fill: url(#sparkline-grad);
    stroke: none;
}

/* Right sidebar items */
.right-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-secondary);
}

.engaged-user-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(255,255,255,0.02);
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    margin-bottom: 12px;
}

.engaged-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.engaged-icon-box.purple { background: rgba(185, 39, 252, 0.15); color: var(--accent-purple); }
.engaged-icon-box.cyan { background: rgba(0, 242, 254, 0.15); color: var(--accent-cyan); }

.engaged-details {
    flex: 1;
}

.engaged-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.engaged-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.engaged-count {
    font-weight: 700;
    font-size: 0.95rem;
}

.forecast-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.forecast-item:last-child {
    border-bottom: none;
}

.forecast-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.forecast-value {
    font-weight: 700;
    font-size: 1rem;
}

/* Modals Refined (Sci-Fi Glass style) */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 4, 8, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: var(--transition-smooth);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-card {
    width: 100%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(10, 10, 24, 0.9);
    border: 1px solid rgba(185, 39, 252, 0.2);
    box-shadow: 0 0 40px rgba(185, 39, 252, 0.15);
    border-radius: 24px;
    padding: 30px;
    transform: translateY(30px);
    transition: var(--transition-smooth);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 15px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.modal-close:hover {
    color: #ffffff;
}

/* Form inputs styling */
.form-input {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 12px;
    color: #ffffff;
    outline: none;
    width: 100%;
    font-family: inherit;
    transition: var(--transition-smooth);
}

.form-input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0,242,254,0.15);
}

.btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-cyan) 100%);
    color: #04040a;
}
.btn-primary:hover {
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--panel-border);
    color: #ffffff;
}
.btn-secondary:hover {
    background: rgba(255,255,255,0.08);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-pink) 100%);
    color: #ffffff;
}
.btn-accent:hover {
    box-shadow: 0 0 15px rgba(185, 39, 252, 0.4);
    transform: translateY(-1px);
}

/* Denomination grid and count fields */
.denom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.denom-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.denom-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    background: rgba(255,255,255,0.01);
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid rgba(255,255,255,0.02);
}

.denom-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.9rem;
}

.badge-denom {
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
}
.badge-note { background: rgba(185, 39, 252, 0.15); color: var(--accent-purple); }
.badge-coin { background: rgba(0, 242, 254, 0.15); color: var(--accent-cyan); }

.denom-count-input {
    width: 60px;
    padding: 5px;
    text-align: center;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: #ffffff;
}

.denom-total {
    min-width: 90px;
    text-align: right;
    font-size: 0.9rem;
    font-weight: 600;
}

.form-grand-total {
    padding: 15px;
    background: rgba(0,0,0,0.3);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border: 1px solid var(--panel-border);
}

.form-grand-total-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.form-grand-total-val {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-cyan);
}

/* Audit Ledger Section (Positioned at bottom spanning columns) */
.ledger-widget {
    grid-column: 1 / span 3;
    z-index: 10;
}

@media (max-width: 1300px) {
    .ledger-widget {
        grid-column: 1 / span 2;
    }
}
@media (max-width: 950px) {
    .ledger-widget {
        grid-column: 1;
    }
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
}

.custom-table th {
    padding: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.custom-table td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.02);
    font-size: 0.9rem;
}

.custom-table tr:hover td {
    background: rgba(255,255,255,0.01);
}

.badge-tx-type {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}
.tx-opening_balance { background: rgba(185, 39, 252, 0.12); color: var(--accent-purple); }
.tx-deposit { background: rgba(0, 230, 118, 0.12); color: var(--accent-green); }
.tx-withdrawal { background: rgba(245, 87, 108, 0.12); color: var(--accent-pink); }

.tx-breakdown-details {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.breakdown-chip {
    padding: 1px 5px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Switch toggle button */
.switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 18px;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.08);
    transition: .3s;
    border-radius: 18px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 12px;
    width: 12px;
    left: 3px;
    bottom: 3px;
    background-color: #a0aec0;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-cyan);
}

input:checked + .slider:before {
    transform: translateX(18px);
    background-color: #ffffff;
}

/* Admin currency/user registry panels layout */
.admin-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
}

.admin-panel {
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    padding: 20px;
}

.admin-panel-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
    padding-bottom: 8px;
}

/* ═══════════════════════════════════════════════════════════════
   PROFESSIONAL ANIMATION ENHANCEMENTS
   ═══════════════════════════════════════════════════════════════ */

/* Scanline overlay on the 3D canvas for CRT/hologram effect */
#canvas3d-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent,
        transparent 2px,
        rgba(0, 0, 0, 0.06) 2px,
        rgba(0, 0, 0, 0.06) 4px
    );
    pointer-events: none;
    z-index: 2;
    border-radius: inherit;
}

/* Animated gradient border glow on glass widgets */
@keyframes borderPulse {
    0%   { border-color: rgba(185, 39, 252, 0.10); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
    33%  { border-color: rgba(0, 242, 254, 0.16);  box-shadow: 0 10px 40px rgba(0,242,254,0.08); }
    66%  { border-color: rgba(245, 87, 108, 0.12); box-shadow: 0 10px 40px rgba(245,87,108,0.06); }
    100% { border-color: rgba(185, 39, 252, 0.10); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }
}

.glass-widget {
    animation: borderPulse 8s ease-in-out infinite;
}

/* Offset each widget so they don't all pulse together */
.left-col  .glass-widget:nth-child(1) { animation-delay: 0s;   }
.right-col .glass-widget:nth-child(1) { animation-delay: 1.5s; }
.right-col .glass-widget:nth-child(2) { animation-delay: 3.0s; }
.right-col .glass-widget:nth-child(3) { animation-delay: 4.5s; }
.bottom-cards-grid .glass-widget:nth-child(1) { animation-delay: 0.5s; }
.bottom-cards-grid .glass-widget:nth-child(2) { animation-delay: 2.0s; }
.bottom-cards-grid .glass-widget:nth-child(3) { animation-delay: 3.5s; }

/* Pulsing balance number */
@keyframes balanceGlow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(0,242,254,0.0));  }
    50%       { filter: drop-shadow(0 0 18px rgba(0,242,254,0.55)); }
}
.large-balance {
    animation: balanceGlow 4s ease-in-out infinite;
}

/* Sidebar items — neon flare on hover */
.sidebar-item {
    position: relative;
    overflow: hidden;
}
.sidebar-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, rgba(0,242,254,0.18), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: inherit;
}
.sidebar-item:hover::before { opacity: 1; }

/* Animated cyan underline on sidebar active item */
.sidebar-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--accent-cyan);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--accent-cyan);
    animation: activeDot 2s ease-in-out infinite alternate;
}
@keyframes activeDot {
    from { width: 12px; opacity: 0.6; }
    to   { width: 24px; opacity: 1.0; }
}

/* Floating "LIVE" badge on the ledger header */
.ledger-widget .right-section-title::after {
    content: '● LIVE';
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent-green);
    letter-spacing: 1px;
    margin-left: 12px;
    animation: liveFlash 1.8s ease-in-out infinite;
    vertical-align: middle;
}
@keyframes liveFlash {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}

/* Transaction table row slide-in */
@keyframes rowSlideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: translateX(0); }
}
#transactions-table-body tr {
    animation: rowSlideIn 0.35s ease-out both;
}
#transactions-table-body tr:nth-child(2)  { animation-delay: 0.04s; }
#transactions-table-body tr:nth-child(3)  { animation-delay: 0.08s; }
#transactions-table-body tr:nth-child(4)  { animation-delay: 0.12s; }
#transactions-table-body tr:nth-child(5)  { animation-delay: 0.16s; }
#transactions-table-body tr:nth-child(6)  { animation-delay: 0.20s; }
#transactions-table-body tr:nth-child(7)  { animation-delay: 0.24s; }
#transactions-table-body tr:nth-child(8)  { animation-delay: 0.28s; }
#transactions-table-body tr:nth-child(9)  { animation-delay: 0.32s; }
#transactions-table-body tr:nth-child(10) { animation-delay: 0.36s; }

/* Modal entrance — scale up from 0.92 */
.modal-overlay.active .modal-card {
    transform: translateY(0) scale(1);
}
.modal-card {
    transform: translateY(30px) scale(0.92);
    transition: transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

/* Glowing submit buttons */
.btn-primary {
    position: relative;
    overflow: hidden;
}
.btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.18) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
}
.btn-primary:hover::after { opacity: 1; }

/* Denomination inventory items — shimmer */
@keyframes denomShimmer {
    0%   { background: rgba(255,255,255,0.010); }
    50%  { background: rgba(255,255,255,0.025); }
    100% { background: rgba(255,255,255,0.010); }
}
.denom-row {
    animation: denomShimmer 5s ease-in-out infinite;
}
.denom-row:nth-child(even) { animation-delay: 1.5s; }
.denom-row:nth-child(odd)  { animation-delay: 3.0s; }

/* Progress ring pulse */
.progress-ring-fill {
    filter: drop-shadow(0 0 4px var(--accent-cyan));
}

/* Engaged user cards — hover lift */
.engaged-user-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.engaged-user-card:hover {
    transform: translateX(4px);
    box-shadow: -4px 0 16px rgba(0,242,254,0.12);
}

/* Canvas wrapper corner brackets (HUD frame) */
.canvas-wrapper::before,
.canvas-wrapper::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 28px;
    border-color: rgba(0,242,254,0.4);
    border-style: solid;
    pointer-events: none;
    z-index: 5;
    animation: hudFlicker 4s ease-in-out infinite alternate;
}
.canvas-wrapper::before {
    top: 10px; left: 10px;
    border-width: 2px 0 0 2px;
}
.canvas-wrapper::after {
    bottom: 22%; right: 10px;
    border-width: 0 2px 2px 0;
    border-color: rgba(245,87,108,0.4);
}
@keyframes hudFlicker {
    0%   { opacity: 0.4; }
    80%  { opacity: 1.0; }
    100% { opacity: 0.6; }
}

/* Sparkline glow */
.sparkline-line {
    filter: drop-shadow(0 0 3px var(--accent-pink));
}

/* Bar chart fill shimmer */
.bar-column-fill {
    position: relative;
}
.bar-column-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 40%;
    background: rgba(255,255,255,0.15);
    border-radius: 4px 4px 0 0;
}

/* Sidebar logo spinning border */
@keyframes logoBorderSpin {
    from { box-shadow: 0 0 12px rgba(185,39,252,0.4), 0 0 0 2px rgba(0,242,254,0.2); }
    to   { box-shadow: 0 0 20px rgba(0,242,254,0.6), 0 0 0 2px rgba(185,39,252,0.3); }
}
.sidebar-logo {
    animation: logoBorderSpin 3s ease-in-out infinite alternate;
}

/* Modal card glowing border */
.modal-card {
    box-shadow: 0 0 40px rgba(185,39,252,0.15), 0 0 80px rgba(0,242,254,0.05), inset 0 0 30px rgba(0,0,0,0.5);
}

/* ── Employee Real-Time Search Bar ─────────────────────────────── */
.emp-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 242, 254, 0.18);
    border-radius: 20px;
    padding: 5px 10px 5px 30px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    min-width: 190px;
}

.emp-search-wrap:focus-within {
    border-color: rgba(0, 242, 254, 0.55);
    box-shadow: 0 0 12px rgba(0, 242, 254, 0.18);
}

.emp-search-icon {
    position: absolute;
    left: 10px;
    color: var(--text-secondary);
    pointer-events: none;
    transition: color 0.25s;
}

.emp-search-wrap:focus-within .emp-search-icon {
    color: var(--accent-cyan);
}

.emp-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.82rem;
    width: 100%;
    caret-color: var(--accent-cyan);
}

.emp-search-input::placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.emp-search-clear {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.75rem;
    line-height: 1;
    padding: 2px 3px;
    border-radius: 50%;
    opacity: 0;                      /* hidden until there's text */
    transition: opacity 0.2s ease, color 0.2s ease;
    user-select: none;
    flex-shrink: 0;
}

.emp-search-clear:hover {
    color: var(--accent-pink);
}

/* Highlight matching text — applied via JS if needed */
.emp-search-highlight {
    background: rgba(0, 242, 254, 0.22);
    border-radius: 2px;
    padding: 0 1px;
}

/* Row fade when hidden by filter */
#employee-table-body tr {
    transition: opacity 0.15s ease;
}

/* ── "Same as Contact" custom checkbox ─────────────────────────── */
.wa-tick-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    flex-shrink: 0;
}

#emp_wa_same:checked + .wa-tick-box,
.wa-tick-box.checked {
    background: rgba(0, 242, 254, 0.18);
    border-color: #00f2fe;
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.35);
}

.wa-same-label:hover .wa-tick-box {
    border-color: rgba(0, 242, 254, 0.5);
    background: rgba(0, 242, 254, 0.06);
}

/* WhatsApp number field readonly state */
#emp_whatsapp[readonly] {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: rgba(0, 242, 254, 0.25);
    background: rgba(0, 242, 254, 0.03);
}

/* IOU & Bill Settlement Tabs */
.tab-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--panel-border);
    padding-bottom: 10px;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 16px;
    cursor: pointer;
    transition: color 0.25s, border-color 0.25s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #fff;
}

.tab-btn.active {
    color: #fff;
    font-weight: 700;
    border-bottom: 2px solid var(--accent-cyan);
}

.tab-content {
    display: none;
}

.tab-content.active-tab {
    display: block;
}

/* Badges for IOU Statuses */
.badge-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-status.pending {
    background: rgba(0, 242, 254, 0.12);
    color: var(--accent-cyan);
    border: 1px solid rgba(0, 242, 254, 0.2);
}

.badge-status.overdue {
    background: rgba(245, 87, 108, 0.12);
    color: var(--accent-pink);
    border: 1px solid rgba(245, 87, 108, 0.2);
    animation: pulseRed 2s infinite alternate;
}

.badge-status.settled {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes pulseRed {
    from { box-shadow: 0 0 4px rgba(245, 87, 108, 0.2); }
    to { box-shadow: 0 0 10px rgba(245, 87, 108, 0.5); }
}

/* Overdue row highlight */
tr.overdue-row td {
    background: rgba(245, 87, 108, 0.04) !important;
}

/* Settle bill list items styling */
.settle-bill-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 6px;
}

.settle-bill-row input {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 6px;
    color: #fff;
    padding: 6px;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
}

.settle-bill-row .bill-desc-input {
    flex: 1.5;
}

.settle-bill-row .bill-amt-input {
    flex: 1;
    font-family: monospace;
}

.settle-bill-row .btn-remove-row {
    background: none;
    border: 1px solid rgba(245, 87, 108, 0.3);
    color: var(--accent-pink);
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.settle-bill-row .btn-remove-row:hover {
    background: rgba(245, 87, 108, 0.1);
}

/* WhatsApp badges and confirmation buttons */
.badge-wa {
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
}
.badge-wa.confirmed {
    background: rgba(37, 211, 102, 0.12);
    color: #25D366;
    border: 1px solid rgba(37, 211, 102, 0.2);
}
.badge-wa.pending {
    background: rgba(255, 193, 7, 0.12);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.2);
}
.btn-wa-confirm {
    background: #25D366;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    line-height: 1.2;
}
.btn-wa-confirm:hover {
    background: #20ba5a;
}
.btn-wa-confirm svg {
    fill: #fff;
    width: 12px;
    height: 12px;
}

/* Custom Searchable Select Dropdown */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}
.custom-select-trigger {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 12px;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    transition: var(--transition-smooth);
}
.custom-select-trigger:hover {
    border-color: rgba(255, 255, 255, 0.15);
}
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0,242,254,0.15);
}
.custom-select-trigger .arrow {
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.custom-select-wrapper.open .custom-select-trigger .arrow {
    transform: rotate(-135deg);
}
.custom-select-options {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: rgb(20, 20, 35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 9999;
    padding: 10px;
    flex-direction: column;
    gap: 8px;
}
.custom-select-wrapper.open .custom-select-options {
    display: flex;
}
.custom-select-search {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    padding: 8px 12px;
    color: #ffffff;
    outline: none;
    font-family: inherit;
    font-size: 0.85rem;
    width: 100%;
}
.custom-select-search:focus {
    border-color: var(--accent-cyan);
}
.custom-options-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.custom-option {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: all 0.2s;
}
.custom-option:hover {
    background: rgba(0, 242, 254, 0.1);
    color: #ffffff;
}
.custom-option.selected {
    background: rgba(0, 242, 254, 0.2);
    color: var(--accent-cyan);
    font-weight: 600;
}



/* ==========================================================================
   MOBILE RESPONSIVENESS OVERHAUL (max-width: 768px)
   ========================================================================== */
@media (max-width: 768px) {
    /* Main Layout */
    .app-container {
        margin-left: 0 !important;
        padding: 15px !important;
        padding-bottom: 90px !important; /* Space for bottom nav */
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    /* Bottom Navigation Bar (formerly sidebar) */
    .sidebar-nav {
        top: auto !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 70px !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        align-items: center !important;
        padding: 0 15px !important;
        border-right: none !important;
        border-top: 1px solid var(--panel-border) !important;
        background: rgba(9, 9, 22, 0.95) !important;
        backdrop-filter: blur(15px) !important;
        -webkit-backdrop-filter: blur(15px) !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
    }

    .sidebar-logo {
        display: none !important;
    }

    .sidebar-menu {
        flex-direction: row !important;
        margin: 0 !important;
        height: 100% !important;
        gap: 15px !important;
    }

    .sidebar-item {
        width: 44px !important;
        height: 44px !important;
        flex-shrink: 0 !important;
    }

    .sidebar-profile {
        margin: 0 0 0 15px !important;
        width: 40px !important;
        height: 40px !important;
        flex-shrink: 0 !important;
    }

    /* Disable 3D Globe on mobile to save battery and space */
    .center-col .canvas-wrapper,
    #canvas3d-container {
        display: none !important;
    }

    /* Center col empty space removal */
    .center-col > div:nth-child(2) {
        display: none !important;
    }

    /* Modals */
    .modal-card {
        width: 95% !important;
        padding: 15px !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        -webkit-transform: translate3d(0,0,0) !important;
        transform: translate3d(0,0,0) !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
    }

    /* Tables */
    .table-container {
        overflow-x: auto !important;
        display: block !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .styled-table th, .styled-table td {
        white-space: nowrap !important;
    }

    /* Form Inputs (Touch targets) */
    .form-input, .btn {
        min-height: 44px !important;
        font-size: 16px !important; /* Prevents iOS auto-zoom */
    }

    /* Glass Widgets */
    .glass-widget {
        padding: 15px !important;
        -webkit-transform: translate3d(0,0,0) !important;
        transform: translate3d(0,0,0) !important;
        -webkit-backface-visibility: hidden !important;
        backface-visibility: hidden !important;
    }

    /* Text Adjustments */
    .large-balance {
        font-size: 2.5rem !important;
    }
    
    .stat-title {
        font-size: 1.3rem !important;
    }
}
.sidebar-item-text { font-size: 0.9rem; font-weight: 500; white-space: nowrap; }
@media (max-width: 768px) {
    .sidebar-item-text { display: none !important; }
    .app-container { margin-left: 0 !important; }
}
