/* =========================================
   1. VARIABLES & RESET (Enriched UI Palette)
========================================= */
:root {
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --primary: #7F00FF; 
    --primary-soft: #f5f0ff;
    --input-bg: #ffffff;
    --sidebar-width: 260px;
    --header-height: 70px;
    
    /* Modern FinTech Accents */
    --accent-success: #10b981;
    --accent-success-soft: #dcfce7;
    --accent-error: #ef4444;
    --accent-error-soft: #fee2e2;
    --card-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.03), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
}

body.dark-mode {
    --bg-body: #0b0f19;
    --bg-card: #131c2e;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: #1e293b;
    --primary-soft: rgba(127, 0, 255, 0.15);
    --input-bg: #0b0f19;
    
    --accent-success-soft: rgba(16, 185, 129, 0.15);
    --accent-error-soft: rgba(239, 68, 68, 0.15);
    --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* =========================================
   2. AUTHENTICATION LAYOUT
========================================= */
.auth-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.admin-card {
    background: var(--bg-card);
    width: 100%;
    max-width: 420px;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.admin-card.large {
    max-width: 850px;
}

.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.auth-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

/* =========================================
   3. DASHBOARD & SIDEBAR LAYOUT
========================================= */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
}

.sidebar .logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    gap: 12px;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: -0.025em;
}

.nav-menu {
    padding: 1.25rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow-y: auto;
    flex: 1;
}

.nav-menu a {
    color: var(--text-muted);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.925rem;
    white-space: nowrap;
}

.nav-menu a i { font-size: 1.2rem; min-width: 1.2rem; }
.nav-menu a.active, .nav-menu a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

/* Sidebar Collapsed State (Desktop) */
.sidebar.collapsed { width: 80px; }
.sidebar.collapsed .logo span, 
.sidebar.collapsed .nav-menu a span,
.sidebar.collapsed .caret-icon {
    display: none !important;
}
.sidebar.collapsed .logo { justify-content: center; padding: 0; }
.sidebar.collapsed .nav-menu a { justify-content: center; padding: 0.75rem 0; }
.sidebar.collapsed .dropdown-menu { display: none !important; }

/* Main Content Wrapper */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; 
}

/* =========================================
   4. HEADER & METRIC CARDS
========================================= */
.top-nav {
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
}

.header-left, .header-right { display: flex; align-items: center; gap: 1.25rem; }
.toggle-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: 6px;
}
.toggle-btn:hover { background: var(--primary-soft); }

.content-body { padding: 2rem; flex: 1; }
.section-title { margin-bottom: 1.5rem; font-size: 1.5rem; font-weight: 700; letter-spacing: -0.02em; }

/* API Analytics Metrics Grid */
.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Unified API Volume Graphic and Metrics Styling */
.metric-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
}

.metric-info span { display: block; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; margin-bottom: 0.5rem; text-transform: uppercase; letter-spacing: 0.05em; }
.metric-info h3 { font-size: 1.75rem; font-weight: 700; color: var(--text-main); letter-spacing: -0.03em; }
.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--primary-soft);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* =========================================
   5. RESPONSIVE & MANAGED TABLES
========================================= */
.table-wrapper {
    background: var(--bg-card);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    width: 100%;
    overflow-x: auto;
    box-shadow: var(--card-shadow);
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 800px;
}

th {
    background: rgba(0, 0, 0, 0.01);
    padding: 1rem 1.5rem;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
}

body.dark-mode th { background: rgba(255, 255, 255, 0.02); }

td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-main);
}

tr:hover td { background-color: rgba(0, 0, 0, 0.005); }
body.dark-mode tr:hover td { background-color: rgba(255, 255, 255, 0.01); }
tr:last-child td { border-bottom: none; }

/* Status Badges */
.badge {
    padding: 6px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
}
.badge.active { background: var(--accent-success-soft); color: var(--accent-success); }
.badge.inactive { background: var(--accent-error-soft); color: var(--accent-error); }

.table-controls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.table-search-box { position: relative; max-width: 320px; width: 100%; }
.table-search-box input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    background-color: var(--input-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
}
.table-search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}
.table-search-box svg {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.pagination-row { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; width: 100%; }
.pagination { display: flex; gap: 0.35rem; align-items: center; }
.pagination .page-link, .pagination .page-link-active {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 6px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}
.pagination .page-link { color: var(--text-main); background: var(--bg-card); border: 1px solid var(--border); }
.pagination .page-link:hover { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.pagination .page-link-active { color: #ffffff; background: var(--primary); border: 1px solid var(--primary); cursor: default; }

/* =========================================
   6. FORMS & UTILITIES
========================================= */
.input-group { margin-bottom: 1.25rem; }
.input-group label { display: block; font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--text-main); }
.input-wrapper { position: relative; display: flex; align-items: center; width: 100%; }
.input-wrapper i { position: absolute; left: 14px; color: var(--text-muted); font-size: 1.1rem; pointer-events: none; }

input, textarea, select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--input-bg);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.input-wrapper input { padding-left: 2.75rem; }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.btn-primary {
    width: 100%;
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary:hover { opacity: 0.95; }
.btn-auto { width: auto; }

.admin-footer {
    padding: 2rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: auto;
}
.alerterror { color: var(--accent-error); font-weight: 500; }
.alertsuccess { color: var(--accent-success); font-weight: 500; }

/* =========================================
   7. INTERACTIVE DROPDOWNS & SIDEBAR SUBMENU
========================================= */
.nav-dropdown { display: flex; flex-direction: column; }
.dropdown-toggle { justify-content: space-between; }
.toggledisplay { display: flex; align-items: center; gap: 12px; }
.caret-icon { font-size: 1rem !important; transition: transform 0.2s ease; }

.dropdown-menu {
    display: none;
    flex-direction: column;
    padding-left: 2.5rem;
    margin-top: 0.25rem;
    gap: 0.25rem;
}
.dropdown-menu a { padding: 0.5rem 1rem; font-size: 0.85rem; color: var(--text-muted); }
.dropdown-menu a:hover { background: transparent; color: var(--primary); transform: translateX(4px); }

.nav-dropdown.active .dropdown-menu { display: flex; }
.nav-dropdown.active .caret-icon { transform: rotate(180deg); }

/* =========================================
   8. MODERN COMPONENT GRAPHS & LABELS
========================================= */
.umb-dashboard-container { width: 100%; max-width: 1200px; margin: 0 auto; }
.umb-charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(450px, 1fr)); gap: 1.5rem; width: 100%; }
.umb-chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--card-shadow);
}
.umb-chart-card h3 { margin-bottom: 1.25rem; font-size: 0.85rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.umb-chart-wrapper { position: relative; height: 320px; width: 100%; }

/* =========================================
   9. MOBILE RESPONSIVE ADAPTABILITY
========================================= */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
}

/* =========================================
   10. merchantid start / my css
========================================= */
 .merchantid{
    padding: 10px;
    margin-left: 20px;
    font-size: 16px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: solid #000;
    text-decoration: underline;
}

.norecord{
    text-align: center; padding: 20px;
}
.key-group {
    margin-bottom: 20px;
}

.key-label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.key-wrapper {
    display: flex;
    gap: 8px;
    max-width: 500px;
}

.key-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.action-btn {
    padding: 8px 14px;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background-color: #e2e6ea;
}

/* State change for copy feedback */
.action-btn.btn-copied {
    background-color: #28a745;
    color: #ffffff;
    border-color: #28a745;
}
/* =========================================
   merchantid end / my css
========================================= */


/* =========================================
   10. CSP CLEAN COMPONENT EXTRACTIONS
========================================= */
/* Auth Custom Modifiers */
.auth-logo-icon { font-size: 2.5rem; color: var(--primary); margin-bottom: 0.5rem; text-align: center; }
.auth-actions-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; font-size: 0.85rem; }
.remember-me-label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.remember-me-label input { width: auto; margin: 0; }
.forgot-password-link { color: var(--primary); font-weight: 500; }
.auth-signup-footer { text-align: center; margin-top: 1.5rem; font-size: 0.9rem; color: var(--text-muted); }
.auth-signup-footer a { color: var(--primary); font-weight: 600; }

/* Dashboard Structural Classes */
.environment-badge { font-weight: 500; color: var(--text-muted); }
.user-avatar-initials { width: 35px; height: 35px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: bold; }
.metric-icon.success-variant { background-color: var(--accent-success-soft); color: var(--accent-success); }

/* Placeholders graphic frames */
.placeholders-fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-muted); text-align: center; }
.placeholders-fallback i { font-size: 2.5rem; display: block; margin-bottom: 10px; }

/* Form Layout Modifiers */
.dashboard-form-block { margin: 0 auto; width: 100%; }
.form-section-subtitle { margin-bottom: 1.5rem; font-size: 1.1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; color: var(--text-main); }
.form-responsive-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.form-submit-container { display: flex; justify-content: flex-end; margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1.5rem; }
.merchant-id-display { font-weight: 500; }


@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        left: -100%;
        height: 100vh;
        z-index: 1000;
        box-shadow: none;
    }
    
    .sidebar.mobile-active { left: 0; box-shadow: 0 0 30px rgba(0,0,0,0.2); }
    .sidebar-overlay.mobile-active { display: block; }
    
    .umb-charts-grid { grid-template-columns: 1fr; }
    .content-body { padding: 1.25rem; }
    .top-nav { padding: 0 1.25rem; }
    .metric-grid { grid-template-columns: 1fr; gap: 1rem; }
}

@media (max-width: 480px) {
    .auth-main { padding: 1rem; }
    .admin-card { padding: 1.5rem; }
    .umb-chart-wrapper { height: 240px; }
    .pagination-row { flex-direction: column; gap: 1rem; text-align: center; }
}