/* ============================================================
   NFXSWAP ADMIN — STYLE
   ============================================================ */
:root {
    --bg: #080e1b;
    --sidebar: #0d1628;
    --panel: #111d31;
    --panel-hover: #172640;
    --input: #0b1527;
    --border: #253550;
    --text: #f1f5ff;
    --muted: #91a1bb;
    --primary: #3485ff;
    --primary-hover: #216bdf;
    --cyan: #47d5f5;
    --success: #2fce99;
    --danger: #ff617c;
    --warning: #f3c66a;
    --radius: 12px;
}
* {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 14px Inter, Arial, sans-serif;
    line-height: 1.5;
}
button,
input,
select,
textarea {
    font: inherit;
}
button {
    cursor: pointer;
}
button:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.hidden {
    display: none !important;
}
h1, h2, h3, p {
    margin-top: 0;
}
h3 {
    font-size: 17px;
    margin-bottom: 18px;
}
p {
    color: var(--muted);
}
code {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    overflow-wrap: anywhere;
}
:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}
/* LOGIN */
.login-screen {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
    background:
        radial-gradient(ellipse at 50% 0%, #173963 0%, transparent 55%),
        var(--bg);
}
.login-card {
    width: 100%;
    max-width: 420px;
    padding: 38px 30px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--panel);
    text-align: center;
    box-shadow: 0 20px 65px #0005;
}
.brand-icon {
    width: 58px;
    height: 58px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--cyan));
    color: #fff;
    font-size: 32px;
    font-weight: 900;
    box-shadow: 0 8px 30px #3485ff35;
}
.brand-icon.small {
    width: 38px;
    height: 38px;
    margin: 0;
    border-radius: 11px;
    font-size: 22px;
}
.login-card h1 {
    margin-bottom: 4px;
    font-size: 28px;
}
.login-card h1 span {
    color: var(--cyan);
}
.subtitle {
    font-size: 14px;
    color: var(--cyan);
}
.login-description {
    margin: 30px 0 24px;
    color: var(--muted);
    line-height: 1.8;
}
.login-card .btn {
    width: 100%;
    min-height: 46px;
}
.login-footer {
    margin-top: 30px;
    color: var(--muted);
    font-size: 11px;
}
.message {
    margin: 14px 0 0;
    min-height: 20px;
    font-size: 13px;
}
/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 600;
    white-space: nowrap;
    transition: background .2s, border-color .2s;
}
.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}
.btn-outline {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}
.btn-outline:hover:not(:disabled) {
    background: var(--panel-hover);
}
.btn-success {
    background: #146d55;
    color: white;
}
.btn-success:hover:not(:disabled) {
    background: #19896a;
}
.btn-danger {
    background: #9b3048;
    color: white;
}
.btn-danger:hover:not(:disabled) {
    background: #b83a55;
}
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
/* APP LAYOUT */
.admin-app {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}
.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 240px;
    display: flex;
    flex-direction: column;
    padding: 24px 14px;
    background: var(--sidebar);
    border-right: 1px solid var(--border);
    z-index: 20;
}
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 10px 30px;
}
.sidebar-brand strong {
    display: block;
    font-size: 18px;
}
.sidebar-brand small {
    display: block;
    margin-top: 2px;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: var(--muted);
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.nav-item {
    width: 100%;
    padding: 13px 15px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    text-align: left;
    font-weight: 500;
}
.nav-item:hover {
    background: var(--panel-hover);
    color: var(--text);
}
.nav-item.active {
    background: #1c3a64;
    color: #fff;
}
.sidebar-footer {
    margin-top: auto;
    padding: 15px 10px 0;
    color: var(--muted);
    font-size: 11px;
}
.main-content {
    width: calc(100% - 240px);
    margin-left: 240px;
    padding: 28px 32px 60px;
    min-width: 0;
}
/* TOP BAR */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 30px;
}
.topbar h2 {
    margin-bottom: 3px;
    font-size: 25px;
}
.topbar p {
    margin-bottom: 0;
}
.wallet-area {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.network-badge {
    padding: 8px 12px;
    border: 1px solid #1c6856;
    border-radius: 8px;
    background: #10372f;
    color: var(--success);
    font-size: 12px;
    font-weight: 600;
}
.wallet-address {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
    font-family: monospace;
    font-size: 12px;
}
/* PAGE SECTIONS */
.page-section {
    display: none;
}
.page-section.active {
    display: block;
}
.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
}
.section-heading h3 {
    margin-bottom: 4px;
    font-size: 20px;
}
.section-heading p {
    margin-bottom: 0;
}
/* DASHBOARD */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}
.stat-card {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}
.stat-card span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.stat-card strong {
    display: block;
    margin-top: 10px;
    font-size: 30px;
    line-height: 1.2;
}
/* PANELS */
.panel {
    padding: 24px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel);
}
.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 13px 0;
    border-bottom: 1px solid var(--border);
}
.info-row:last-child {
    border-bottom: none;
}
.info-row span {
    color: var(--muted);
}
.info-row strong,
.info-row code {
    text-align: right;
}
/* FORMS */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
}
.form-group label {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--input);
    color: var(--text);
    outline: none;
}
input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
}
input::placeholder,
textarea::placeholder {
    color: #6c7e9a;
}
textarea {
    min-height: 140px;
    resize: vertical;
}
select {
    cursor: pointer;
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    cursor: pointer;
}
.checkbox-row input {
    width: 17px;
    height: 17px;
    min-height: auto;
    accent-color: var(--primary);
}
/* TABLES */
.table-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}
.table-toolbar input {
    flex: 1;
}
.table-toolbar select {
    width: 190px;
}
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}
table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
th {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .6px;
    white-space: nowrap;
}
td {
    font-size: 13px;
}
tbody tr:hover {
    background: #ffffff05;
}
td code {
    font-size: 11px;
    color: var(--muted);
}
.token-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.token-cell img {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 50%;
}
.token-cell strong,
.token-cell small {
    display: block;
}
.token-cell small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}
.status-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.status-badge.enabled {
    background: #123e32;
    color: var(--success);
}
.status-badge.disabled {
    background: #4b2634;
    color: var(--danger);
}
.status-badge.pending {
    background: #4b3b21;
    color: var(--warning);
}
.action-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}
.action-buttons .btn {
    min-height: 30px;
    padding: 5px 10px;
    font-size: 11px;
}
/* CONTRACT RESULT */
.result-box {
    margin-top: 18px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--input);
    overflow-wrap: anywhere;
    line-height: 1.8;
}
/* MODALS */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: #000b;
    backdrop-filter: blur(5px);
}
.modal-card {
    width: 100%;
    max-width: 510px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: 0 25px 80px #0008;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}
.modal-header h3 {
    margin: 0;
    font-size: 20px;
}
.close-btn {
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 28px;
    line-height: 1;
}
.close-btn:hover {
    color: var(--text);
}
.modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}
/* TOAST NOTIFICATIONS */
.toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(360px, calc(100vw - 40px));
    pointer-events: none;
}
.toast {
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 10px;
    background: #182841;
    color: white;
    box-shadow: 0 10px 35px #0007;
    overflow-wrap: anywhere;
}
.toast.success {
    border-left-color: var(--success);
}
.toast.error {
    border-left-color: var(--danger);
}
.toast.warning {
    border-left-color: var(--warning);
}
/* RESPONSIVE */
@media (max-width: 1100px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .main-content {
        padding: 24px;
    }
}
@media (max-width: 760px) {
    .admin-app {
        display: block;
    }
    .sidebar {
        position: relative;
        inset: auto;
        width: 100%;
        padding: 15px;
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }
    .sidebar-brand {
        padding: 0 0 15px;
    }
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 5px;
        scrollbar-width: thin;
    }
    .nav-item {
        width: auto;
        flex: 0 0 auto;
        padding: 10px 12px;
        white-space: nowrap;
        font-size: 12px;
    }
    .sidebar-footer {
        display: none;
    }
    .main-content {
        width: 100%;
        margin-left: 0;
        padding: 20px 15px 50px;
    }
    .topbar h2 {
        font-size: 22px;
    }
    .wallet-area {
        width: 100%;
    }
    .wallet-address {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .panel {
        padding: 17px;
    }
    .table-toolbar {
        flex-direction: column;
    }
    .table-toolbar select {
        width: 100%;
    }
    .info-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 5px;
    }
    .info-row strong,
    .info-row code {
        text-align: left;
    }
    .login-card {
        padding: 30px 22px;
    }
}
@media (max-width: 420px) {
    .stats-grid {
        gap: 10px;
    }
    .stat-card {
        padding: 15px;
    }
    .stat-card strong {
        font-size: 25px;
    }
    .modal-card {
        padding: 18px;
    }
}
