/* GLOBAL */
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
    font-family:'Inter',sans-serif;
}

body{
    background:#f4f7fb;
    color:#0f172a;
}

/* LOGIN PAGE */
.login-box{
    background:#fff;
    padding:30px;
    width:320px;
    border-radius:12px;
    box-shadow:0 10px 25px rgba(0,0,0,0.08);
    text-align:center;
}

.input{
    width:100%;
    padding:12px;
    margin:10px 0;
    border-radius:8px;
    border:1px solid #e2e8f0;
}

.btn{
    width:100%;
    padding:12px;
    border:none;
    border-radius:8px;
    background:#2563eb;
    color:#fff;
    font-weight:600;
}

/* TOPBAR */
.topbar{
    position:sticky;
    top:0;
    background:rgba(255,255,255,0.9);
    backdrop-filter:blur(10px);
    padding:14px 20px;
    display:flex;
    justify-content:space-between;
    border-bottom:1px solid #e5e7eb;
}

.topbar input,
.topbar select{
    padding:10px;
    border-radius:8px;
    border:1px solid #e5e7eb;
    margin-right:5px;
}

#themeToggle{
    padding:8px;
    border:none;
    border-radius:8px;
    background:#e2e8f0;
    cursor:pointer;
}

#refreshTimer{
    font-weight:600;
    color:#2563eb;
    margin-left:10px;
}

/* LAYOUT */
.container{
    display:flex;
    height:calc(100vh - 60px);
}

/* SIDEBAR */
.sidebar{
    width:260px;
    background:linear-gradient(180deg,#ffffff,#f8fafc);
    padding:18px;
    border-right:1px solid #e5e7eb;
}

.sidebar h3{
    font-size:18px;
    font-weight:600;
    margin-bottom:15px;
    color:#0f172a;
}

/* MENU */
.file{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 14px;
    border-radius:12px;
    margin:10px 0;
    background:#f1f5f9;
    transition:all 0.25s ease;
    cursor:pointer;
}

.file a{
    text-decoration:none;
    color:#334155;
    font-weight:500;
    width:100%;
    display:flex;
    align-items:center;
    gap:10px;
}

.file:hover{
    background:linear-gradient(135deg,#2563eb,#4f46e5);
    transform:translateX(4px);
    box-shadow:0 8px 20px rgba(37,99,235,0.2);
}

.file:hover a{
    color:#fff;
}

.file.active{
    background:linear-gradient(135deg,#2563eb,#4f46e5);
    box-shadow:0 6px 15px rgba(37,99,235,0.2);
}

.file.active a{
    color:#fff;
}

/* CONTENT */
.content{
    flex:1;
    padding:20px;
    overflow:auto;
}

/* TABLE */
.table-box{
    background:#fff;
    border-radius:14px;
    box-shadow:0 10px 30px rgba(0,0,0,0.05);
}

table{
    width:100%;
    border-collapse:collapse;
}

th{
    background:#f8fafc;
    padding:14px;
    text-align:left;
    border-bottom:1px solid #e5e7eb;
}

td{
    padding:14px;
    border-bottom:1px solid #f1f5f9;
}

tr:hover{
    background:#f9fbff;
}

/* STATUS */
.success{
    background:#dcfce7;
    color:#16a34a;
    padding:6px 12px;
    border-radius:20px;
}

.failed{
    background:#fee2e2;
    color:#dc2626;
    padding:6px 12px;
    border-radius:20px;
}

.pending{
    background:#fef3c7;
    color:#d97706;
    padding:6px 12px;
    border-radius:20px;
}

.logout-btn{
    padding:10px 16px;
    background:linear-gradient(135deg,#ef4444,#dc2626);
    color:#fff;
    border-radius:10px;
    text-decoration:none;
    font-weight:600;
    transition:0.3s;
}

.logout-btn:hover{
    background:linear-gradient(135deg,#dc2626,#b91c1c);
    box-shadow:0 6px 15px rgba(220,38,38,0.3);
}

/* FULL PAGE CENTER FIX */
body.login-page{
    height:100vh;
    display:flex;
    justify-content:center;
    align-items:center;
    background:linear-gradient(135deg,#667eea,#764ba2);
}

/* LOGIN BOX PREMIUM */
.login-box{
    background:#ffffff;
    padding:35px 30px;
    width:340px;
    border-radius:16px;
    box-shadow:0 15px 40px rgba(0,0,0,0.15);
    text-align:center;
    animation:fadeIn 0.5s ease;
}

/* TITLE */
.login-box h3{
    margin-bottom:20px;
    font-size:22px;
    font-weight:600;
    color:#1e293b;
}

/* INPUT FIELD */
.input{
    width:100%;
    padding:12px;
    margin:10px 0;
    border-radius:10px;
    border:1px solid #e2e8f0;
    background:#f1f5f9;
    transition:0.3s;
}

.input:focus{
    outline:none;
    border-color:#6366f1;
    background:#fff;
    box-shadow:0 0 0 2px rgba(99,102,241,0.2);
}

/* BUTTON */
.btn{
    width:100%;
    padding:12px;
    border:none;
    border-radius:10px;
    background:linear-gradient(135deg,#4f46e5,#2563eb);
    color:#fff;
    font-weight:600;
    cursor:pointer;
    transition:0.3s;
}

.btn:hover{
    transform:translateY(-1px);
    box-shadow:0 8px 20px rgba(79,70,229,0.3);
}

/* ERROR TEXT */
.login-box p{
    margin-top:10px;
    font-size:14px;
}

/* ANIMATION */
@keyframes fadeIn{
    from{
        opacity:0;
        transform:translateY(10px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

/* BUTTON (GLOBAL) */
.btn{
    padding:8px 14px;
    border:none;
    border-radius:8px;
    background:linear-gradient(135deg,#2563eb,#1d4ed8);
    color:#fff;
    cursor:pointer;
    font-weight:500;
    transition:0.3s;
}

.btn:hover{
    transform:translateY(-1px);
    box-shadow:0 6px 15px rgba(37,99,235,0.3);
}

/* LOGOUT BUTTON */
.logout-btn{
    padding:10px 16px;
    background:linear-gradient(135deg,#ef4444,#dc2626);
    color:#fff;
    border-radius:10px;
    text-decoration:none;
    font-weight:600;
    transition:0.3s;
}

.logout-btn:hover{
    background:linear-gradient(135deg,#dc2626,#b91c1c);
    box-shadow:0 6px 15px rgba(220,38,38,0.3);
}

/* TOPBAR FIX (BETTER ALIGNMENT) */
.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

/* BUTTON GROUP SPACING */
.topbar div{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
}

/* INPUT IMPROVE */
.topbar input,
.topbar select{
    background:#fff;
    transition:0.2s;
}

.topbar input:focus,
.topbar select:focus{
    outline:none;
    border-color:#6366f1;
    box-shadow:0 0 0 2px rgba(99,102,241,0.2);
}

/* TABLE SCROLL FIX */
.table-box{
    overflow-x:auto;
}

.api-header{
    background:#eef2ff;
    padding:10px;
    cursor:pointer;
    margin-top:10px;
    font-weight:600;
    border-radius:8px;
}

.api-body{
    display:none;
}

/* TOPBAR FIX (INLINE ALIGN) */
.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
}

.topbar > div{
    display:flex;
    align-items:center;
    gap:10px;
    flex-wrap:nowrap; /* important */
}

/* COMPACT INPUT LIKE AADHAAR STYLE */
.input{
    height:38px;
    padding:6px 10px;
    border-radius:8px;
    border:1px solid #e5e7eb;
    font-size:14px;
    width:250px;            /* remove full width */
    min-width:140px;       /* small size */
}

/* DATE PICKER SMALL */
#datePicker{
    min-width:130px;
}

/* SELECT SMALL */
select.input{
    min-width:160px;
}

/* LOGOUT ALIGN */
.logout-btn{
    margin-left:10px;
}

/* GLOBAL */
body{
    font-family:'Inter',sans-serif;
    background:#f4f7fb;
    margin:0;
}

/* TOPBAR */
.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:15px 20px;
    background:#fff;
    border-bottom:1px solid #eee;
}

/* LOGOUT BUTTON */
.logout-btn{
    display:inline-flex;
    align-items:center;
    gap:6px;
    padding:10px 16px;
    background:linear-gradient(135deg,#ef4444,#dc2626);
    color:#fff;
    border-radius:10px;
    text-decoration:none;
    font-weight:600;
    font-size:14px;
    box-shadow:0 6px 15px rgba(220,38,38,0.25);
    transition:all 0.25s ease;
}

.logout-btn:hover{
    background:linear-gradient(135deg,#dc2626,#b91c1c);
    transform:translateY(-1px);
}

.logout-btn:active{
    transform:scale(0.96);
}

/* LAYOUT */
.container{
    display:flex;
}

.content{
    flex:1;
    padding:20px;
}

/* CARDS */
.cards{
    display:grid;
    grid-template-columns:repeat(4,1fr);
    gap:15px;
}

.card{
    padding:20px;
    border-radius:14px;
    color:#fff;
}

.blue{background:#3b82f6;}
.green{background:#22c55e;}
.red{background:#ef4444;}
.orange{background:#f59e0b;}

/* GRID */
.grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:20px;
    margin-top:20px;
    align-items:stretch;
}

/* BOX */
.box{
    background:#fff;
    border-radius:14px;
    padding:20px;
    display:flex;
    flex-direction:column;
}

/* CHART */
canvas{
    max-height:300px;
}

/* TABLE */
table{
    width:100%;
    border-collapse:collapse;
    margin-top:10px;
}

th{
    background:#f8fafc;
    text-align:left;
    font-weight:600;
}

th,td{
    padding:10px;
    border-bottom:1px solid #eee;
}

.top-api{
    background:#ffef47;
    border-left:4px solid #16a34a;
}

/* 🔥 VIEW BUTTON PREMIUM */
.viewResponse {
    background: linear-gradient(135deg, #4CAF50, #2e7d32);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.viewResponse:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    background: linear-gradient(135deg, #43a047, #1b5e20);
}

.viewResponse:active {
    transform: scale(0.95);
}

/* Pending Highlight */
.yellow-row {
    background: #fff3cd !important;
}

.red-row {
    background: #f8d7da !important;
}

/* ✅ Force 3 boxes in one row */
.grid{
    display:flex !important;
    gap:20px;
    flex-wrap:nowrap;
}

.grid .box{
    flex:1;
    min-width:0;
}

/* Responsive (mobile fix) */
@media(max-width:900px){
    .grid{
        flex-wrap:wrap;
    }
}

.table-wrapper {
    width: 100%;
    overflow-x: auto !important;
    display: block;
}

#logTable {
    min-width: 1400px !important;
    width: max-content !important;
}
td{
    white-space: nowrap;
}

#logTable td:nth-child(2) {
    white-space: normal !important;
    line-height: 1.3;
}
#logTable td:first-child {
    text-align:center;
}

/* FONT SIZE REDUCE */
body {
    font-size: 13px;
}

#logTable th,
#logTable td {
    font-size: 14px;
    padding: 6px 8px;
}

.topbar input,
.topbar select,
.topbar button {
    font-size: 12px;
    padding: 4px 6px;
}
/* MAKE TEXT BOLD */
body {
    font-weight: 600;
}

#logTable th {
    font-weight: 700;
}

#logTable td {
    font-weight: 600;
}

.topbar input,
.topbar select,
.topbar button {
    font-weight: 600;
}

/* PCT & PROFIT COLOR */
.pct {
    color: #007bff; /* Blue */
    font-weight: 600;
}

.profit {
    color: #d97706; /* Green */
    font-weight: 600;
}

/* ===== MOBILE RESPONSIVE TABLE (NO SCROLL) ===== */
@media (max-width: 768px){

#logTable {
    border: 0;
}

#logTable thead {
    display: none;
}

#logTable tr {
    display: block;
    margin-bottom: 12px;
    background: #fff;
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

#logTable td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

#logTable td:last-child {
    border-bottom: none;
}

/* LABELS */
#logTable td:nth-child(1)::before { content: "DateTime"; font-weight: 600; }
#logTable td:nth-child(2)::before { content: "API"; font-weight: 600; }
#logTable td:nth-child(3)::before { content: "Operator"; font-weight: 600; }
#logTable td:nth-child(4)::before { content: "Mobile"; font-weight: 600; }
#logTable td:nth-child(5)::before { content: "Amount"; font-weight: 600; }
#logTable td:nth-child(6)::before { content: "Status"; font-weight: 600; }
#logTable td:nth-child(7)::before { content: "Operator ID"; font-weight: 600; }
#logTable td:nth-child(8)::before { content: "Balance"; font-weight: 600; }
#logTable td:nth-child(9)::before { content: "Remark"; font-weight: 600; }

}

#responseModal button { display:none !important; }

.dark-mode {
    background:#121212;
    color:#fff;
}
.dark-mode table { background:#1e1e1e; color:#fff; }
.dark-mode input, .dark-mode select {
    background:#2a2a2a;
    color:#fff;
    border:1px solid #555;
}

/* TABLE FIX */
.table-wrapper {
    width: 100%;
    overflow-x: auto !important;
    display: block;
}

#logTable {
    min-width: 1400px !important;
    width: max-content !important;
}

/* Read More */
.readMore {
    color: #007bff;
    cursor: pointer;
    font-size: 12px;
    text-decoration: underline;
}
.dark-mode .readMore {
    color: #4da3ff;
}
.pct-new{
    color: #007bff; /* Blue */
    font-weight: 600;
}

.profit-new {
    color: #d97706; /* Green */
    font-weight: 600;
}

/* CONTAINER */
.table-box {
    width: 100%;
    border-radius: 16px;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* TABLE */
table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

/* HEADER */
table th {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: #fff;
    padding: 14px 10px;
    font-weight: 600;
    text-align: center;
    letter-spacing: 0.3px;
}

/* ROW */
table td {
    padding: 12px 10px;
    text-align: center;
    font-weight: 500;
    border-bottom: 1px solid #f1f5f9;
}

/* API NAME */
table td:first-child {
    text-align: left;
    font-weight: 600;
    color: #111827;
}

/* HOVER EFFECT */
table tr {
    transition: all 0.25s ease;
}

table tr:hover {
    background: #f1f5ff;
    transform: scale(1.002);
}

/* SUCCESS */
.success {
    background: rgba(34,197,94,0.12);
    color: #15803d;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
}

/* PENDING */
.pending {
    background: rgba(245,158,11,0.15);
    color: #b45309;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
}

/* FAILED */
.failed {
    background: rgba(239,68,68,0.15);
    color: #dc2626;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
}

/* TOTAL */
.total {
    font-weight: 600;
    color: #1e293b;
}

/* COMAMT */
td:nth-last-child(2) {
    color: #000000;
    font-weight: 600;
}

/* AVG % */
td:last-child {
    font-weight: 700;
    color: #000000;
}

/* TOP API */
.top-api {
    background: linear-gradient(90deg, #fef9c3, #fde68a) !important;
    font-weight: 700;
}

/* GRAND TOTAL */
tr:last-child {
    background: #e0e7ff !important;
    font-weight: 700;
}

/* MOBILE */
@media (max-width: 768px) {

    table {
        font-size: 12px;
    }

    table th, table td {
        padding: 8px 5px;
    }

    .success, .pending, .failed {
        font-size: 11px;
        padding: 5px 8px;
    }
}
/* ===============================
   API REPORT PAGE CUSTOM CSS
   (NO CONFLICT UNIQUE PREFIX)
================================ */

/* TABLE BORDER FIX */
.apiReportNoRadius td,
.apiReportNoRadius th {
    border-radius: 0 !important;
}

/* REMOVE BADGE STYLE */
.apiReportSuccess,
.apiReportPending,
.apiReportFailed {
    border-radius: 0 !important;
    background: transparent !important;
    padding: 0 !important;
}

/* COLORS */
.apiReportSuccess {
    color: #15803d !important;
    font-weight: 600;
}

.apiReportPending {
    color: #b45309 !important;
    font-weight: 600;
}

.apiReportFailed {
    color: #dc2626 !important;
    font-weight: 600;
}

/* ROW DESIGN */
.apiReportNoRadius tr {
    background: #ffffff;
}

.apiReportNoRadius tr:nth-child(even) {
    background: #f8fafc;
}

/* HOVER */
.apiReportNoRadius tr:hover {
    background: #eef2ff;
}

/* TOP API */
.apiReportTop {
    background: #fde68a !important;
}

/* GRAND TOTAL */
.apiReportGrand {
    background: #e2e8f0 !important;
    font-weight: 700;
}
/* ================= ACTION BUTTON ================= */
.actionBtn{
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 5px 10px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
}

.actionBtn:hover{
    background: #1d4ed8;
}

/* ================= MODAL BACKGROUND ================= */
#actionModal{
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 999;
}

/* ================= MODAL BOX ================= */
#actionModal > div{
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    width: 300px;
    margin: 120px auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ================= TITLE ================= */
#actionModal h3{
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* ================= INPUT ================= */
#actionModal input,
#actionModal select{
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 13px;
}

/* FOCUS */
#actionModal input:focus,
#actionModal select:focus{
    border-color: #2563eb;
    outline: none;
}

/* ================= BUTTONS ================= */
#actionModal button{
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
}

/* UPDATE BUTTON */
#actionModal button:first-of-type{
    background: #16a34a;
    color: #fff;
    margin-right: 5px;
}

#actionModal button:first-of-type:hover{
    background: #15803d;
}

/* CANCEL BUTTON */
#actionModal button:last-of-type{
    background: #e5e7eb;
    color: #333;
}

#actionModal button:last-of-type:hover{
    background: #d1d5db;
}