/* =============================================
   Universal Cashier - Admin Panel Styles
   Dark professional dashboard theme
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #1e2230;
    --bg-hover: #252836;
    --border-color: rgba(255, 255, 255, 0.06);
    --text-primary: #e8ecf1;
    --text-secondary: #8b95a5;
    --text-muted: #5c6370;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.2);
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ====== Login Screen ====== */
.login-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
}

.login-box h1 {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.login-box .login-subtitle {
    font-size: 11px;
    font-weight: 600;
    color: #4b5563;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.login-box .login-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
}

/* ====== Dashboard Layout ====== */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* ====== Modern Sidebar ====== */
.sidebar {
    width: 270px;
    background: rgba(10, 11, 16, 0.9);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 32px 14px;
    flex-shrink: 0;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: none;
}

/* Hide mobile elements on PC */
.mobile-header, 
.mobile-bottom-nav, 
.sidebar-overlay { 
    display: none !important; 
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-logo {
    padding: 0 12px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-logo .logo-main {
    font-size: 22px;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #34d399, #6366f1, #f472b6);
    background-size: 300% auto;
    animation: sidebar-gradient-shift 8s ease infinite;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.8px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

@keyframes sidebar-gradient-shift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* T19: Online users indicator */
.online-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 6px 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--success);
    cursor: default;
    backdrop-filter: blur(4px);
    transition: all 0.3s ease;
}

.online-indicator:hover {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.online-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    animation: pulse-dot-glow 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

@keyframes pulse-dot-glow {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    }

    50% {
        opacity: 0.6;
        transform: scale(0.8);
        box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
    }
}

#onlineCount::after {
    content: ' online';
    font-weight: 500;
    color: rgba(16, 185, 129, 0.7);
}

/* T25: Nav badge for unread items */
.nav-badge {
    margin-left: auto;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    background: linear-gradient(135deg, #f87171, #ef4444);
    color: white;
    border-radius: 11px;
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.sidebar-nav {
    list-style: none;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sidebar-nav li {
    margin: 6px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: 1px solid transparent;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(6px);
    border-color: rgba(255, 255, 255, 0.03);
}

.sidebar-nav a.active {
    background: rgba(99, 102, 241, 0.12);
    color: #fff;
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 10px 25px -10px rgba(99, 102, 241, 0.35);
}

.sidebar-nav a.active span:not(.nav-icon) {
    font-weight: 700;
}

.sidebar-nav .nav-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-nav a:hover .nav-icon {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.sidebar-nav a.active .nav-icon {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border: none;
    box-shadow: 0 6px 15px var(--accent-glow);
    transform: scale(1.1) rotate(2deg);
}

.logout-container {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.logout-container a:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
    border-color: rgba(239, 68, 68, 0.15);
}

.logout-container a:hover .nav-icon {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error);
}

.main-content {
    flex: 1;
    min-width: 0;
    margin-left: 270px;
    padding: 40px 48px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.page-header h2 {
    font-size: 22px;
    font-weight: 600;
}

/* ====== Stats Grid ====== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.stat-card .stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.stat-card .stat-value {
    font-size: 24px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-card.accent .stat-value {
    color: var(--accent-light);
}

.stat-card.success .stat-value {
    color: var(--success);
}

.stat-card.warning .stat-value {
    color: var(--warning);
}

.stat-card.error .stat-value {
    color: var(--error);
}

/* ====== Tables ====== */
.table-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    width: 100%;
    margin-bottom: 24px;
}

.table-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.table-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
}

th {
    padding: 14px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 14px 16px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

/* Specific column styles for better fit */
td strong {
    color: var(--text-primary);
}

td small {
    color: var(--text-muted);
}

/* Prevent very long content from breaking layout */
.td-truncate {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

tr:hover td {
    background: var(--bg-hover);
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-confirmed {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.badge-waiting {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-light);
}

.badge-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

/* ====== Buttons ====== */
.btn {
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-light);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-danger {
    background: var(--error);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-outline:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 14px;
}

.btn-icon:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-icon.danger:hover {
    border-color: var(--error);
    color: var(--error);
}

.btn-group {
    display: flex;
    gap: 6px;
}

/* ====== Forms ====== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent);
}

.form-group select option {
    background: var(--bg-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

/* ====== Modal ====== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 90%;
    max-width: 750px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ====== Filters Bar & Tabs ====== */
.tx-tab-bar {
    display: flex;
    gap: 6px;
    background: rgba(0, 0, 0, 0.15);
    padding: 4px;
    border-radius: var(--radius);
    width: fit-content;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    overflow-x: auto;
    max-width: 100%;
}

.tx-tab {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border-radius: calc(var(--radius) - 2px);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.tx-tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tx-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
}

.tx-tab.active::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent);
}

/* ====== Status Tabs (Fiat/API) ====== */
.tabs {
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: var(--radius);
    width: fit-content;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-btn {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent);
    color: white;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.filters-bar {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.filters-bar input,
.filters-bar select {
    padding: 11px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    min-width: 250px;
}

.filters-bar input:focus,
.filters-bar select:focus {
    border-color: var(--accent);
    background: var(--bg-hover);
}

/* ====== Toggle Switch ====== */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.toggle-label {
    font-size: 14px;
    font-weight: 500;
}

.toggle-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.toggle-switch {
    width: 48px;
    height: 26px;
    background: var(--bg-primary);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.toggle-switch.active {
    background: var(--success);
}

.toggle-switch::after {
    content: '';
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: transform 0.2s;
}

.toggle-switch.active::after {
    transform: translateX(22px);
}

/* ====== Proof Image ====== */
.proof-thumb {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: transform 0.2s;
}

.proof-thumb:hover {
    transform: scale(1.1);
}

.proof-pdflink {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-light);
    cursor: pointer;
    padding: 6px 10px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 4px;
    white-space: nowrap;
}

.proof-pdflink:hover {
    background: rgba(59, 130, 246, 0.2);
}

/* ====== Toast ====== */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    z-index: 2000;
    animation: slideUp 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.toast.success {
    border-left: 3px solid var(--success);
}

.toast.error {
    border-left: 3px solid var(--error);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====== Hidden ====== */
.hidden {
    display: none !important;
}

/* ====== Responsive ====== */

/* ====== Ticket Detail Styles ====== */
.ticket-info {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    background: rgba(15, 23, 42, 0.4);
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 13px;
    border: 1px solid var(--border-color);
}

.ticket-info strong {
    color: var(--text-muted);
    font-weight: 500;
}

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding: 16px;
    background: rgba(15, 23, 42, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.chat-container::-webkit-scrollbar {
    width: 5px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 10px;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}

.chat-msg.msg-admin {
    align-self: flex-end;
}

.chat-msg.msg-client {
    align-self: flex-start;
}

.chat-bubble {
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.msg-admin .chat-bubble {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg-client .chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.chat-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    gap: 8px;
}

.msg-admin .chat-meta {
    justify-content: flex-end;
}

.ticket-reply-box {
    margin-top: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 16px;
}

.ticket-reply-box textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    resize: none;
    min-height: 60px;
    font-size: 14px;
    margin-bottom: 8px;
}

.ticket-reply-box textarea:focus {
    outline: none;
}

.ticket-reply-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
}

.blacklist-btn {
    background: rgba(239, 68, 68, 0.1);
    color: #fb7185;
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blacklist-btn:hover {
    background: #ef4444;
    color: #fff;
}

/* ====== Support Chat Attachments (T40) ====== */
.chat-container {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-msg {
    max-width: 80%;
}

.msg-client {
    align-self: flex-start;
}

.msg-admin {
    align-self: flex-end;
}

.chat-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.msg-client .chat-bubble {
    background: #334155;
    color: #f1f5f9;
    border-top-left-radius: 2px;
}

.msg-admin .chat-bubble {
    background: var(--accent);
    color: #fff;
    border-top-right-radius: 2px;
}

.chat-meta {
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.chat-attachment {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    margin-top: 8px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-attachment:hover {
    background: rgba(0, 0, 0, 0.3);
}

.chat-attachment-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 6px;
    margin-top: 8px;
    cursor: pointer;
    display: block;
}

.attachment-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: all 0.2s;
}

.attachment-label:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

/* ====== Mobile Responsive Adjustments ====== */
.mobile-header {
    display: none;
    height: 60px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 90;
    backdrop-filter: blur(10px);
}

.burger-btn {
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    padding: 10px;
}

.burger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: 0.3s;
}

.mobile-logo {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #60a5fa, #34d399);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 95;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ====== DEFINITIVE MOBILE-APP OPTIMIZATION ====== */
@media (max-width: 1024px) {
    .dashboard {
        flex-direction: column;
        padding-bottom: 70px; /* Room for bottom nav */
    }

    /* Modern Navigation Drawer */
    .sidebar {
        left: -280px;
        width: 280px !important;
        background: #0f1117 !important;
        border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.6);
        z-index: 1100;
        padding: 20px 12px !important;
        transform: translateX(0);
        visibility: visible;
        display: flex !important;
        flex-direction: column !important;
    }

    .sidebar.mobile-active {
        transform: translateX(280px);
    }

    .sidebar-nav {
        margin-top: 24px !important;
    }

    .sidebar-nav a {
        padding: 16px 20px !important;
        margin-bottom: 8px !important;
        background: rgba(255, 255, 255, 0.02) !important;
        border-radius: 16px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 16px !important;
    }

    .sidebar-nav a span:not(.nav-icon) {
        display: block !important; /* Force text visibility */
        font-size: 15px !important;
        font-weight: 500 !important;
        color: var(--text-primary) !important;
    }

    .sidebar-nav a.active {
        background: var(--accent) !important;
        box-shadow: 0 8px 20px var(--accent-glow) !important;
    }

    .sidebar-nav a.active span {
        color: #fff !important;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        z-index: 1099;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
    }

    .sidebar-overlay.active {
        display: block !important;
        opacity: 1;
        visibility: visible;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 16px !important;
        width: 100%;
    }

    /* Fixed App Header */
    .mobile-header {
        display: flex !important;
        position: sticky;
        top: 0;
        height: 64px;
        background: rgba(15, 17, 23, 0.9);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1000;
        padding: 0 16px;
        align-items: center;
        justify-content: space-between;
    }

    .burger-btn {
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 12px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
    }

    .burger-btn span {
        width: 20px;
        height: 2px;
        background: #fff;
        border-radius: 1px;
    }

    /* Ergonomic Bottom Navigation */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70px;
        background: rgba(20, 22, 30, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom);
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
    }

    .nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
        text-decoration: none;
        gap: 4px;
        transition: 0.2s;
        position: relative;
    }

    .nav-item.active {
        color: var(--accent);
    }

    .nav-item .nav-icon {
        font-size: 22px;
    }

    .nav-item .nav-label {
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.3px;
    }

    .nav-item .nav-badge {
        position: absolute;
        top: 8px;
        right: 25%;
        background: #ef4444;
        color: #fff;
        font-size: 9px;
        min-width: 16px;
        height: 16px;
        border-radius: 10px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #14161e;
    }

    /* Dashboard Optimization */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .stat-card {
        padding: 16px !important;
        border-radius: 20px !important;
    }

    .stat-card .stat-value {
        font-size: 18px !important;
    }

    /* Global Mode Card Fix */
    .table-card[style*="display: flex"] {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 16px !important;
        padding: 20px !important;
        background: var(--bg-card) !important;
        border-radius: 20px !important;
    }

    /* Icon + Title block */
    .table-card div[style*="gap:16px"] {
        margin-bottom: 8px !important;
    }

    /* Action container (Toggles + Button) */
    .table-card div[style*="gap:20px"] {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        align-items: stretch !important;
    }

    /* Toggle wrapper */
    .table-card div[style*="align-items:flex-end"] {
        align-items: flex-start !important;
        padding: 12px 16px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        border-radius: 14px !important;
    }

    .table-card div[style*="align-items:flex-end"] div[style*="gap:8px"] {
        width: 100% !important;
        justify-content: space-between !important;
    }

    /* Divider */
    .table-card div[style*="height: 32px"] {
        display: none !important;
    }

    .table-card button {
        height: 52px !important;
        width: 100% !important;
        font-size: 15px !important;
        border-radius: 14px !important;
    }

    /* Transaction Table -> Clean Cards */
    thead { display: none !important; }

    #recentTxBody tr, #txBody tr {
        display: block !important;
        background: #1a1d27 !important;
        border: 1px solid rgba(255, 255, 255, 0.05) !important;
        border-radius: 20px !important;
        padding: 16px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    #recentTxBody td, #txBody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
        min-height: 44px !important;
        text-align: right !important;
        word-break: break-all !important; /* Prevent TX ID overflow */
        font-size: 13px !important;
    }

    #recentTxBody td:before, #txBody td:before {
        content: attr(data-label);
        font-weight: 500;
        color: var(--text-muted);
        text-transform: uppercase;
        font-size: 10px;
        letter-spacing: 0.5px;
        margin-right: 12px;
        flex-shrink: 0;
    }

    #recentTxBody td strong, #txBody td strong {
        color: var(--text-primary);
        font-weight: 600;
    }

    #recentTxBody td:last-child, #txBody td:last-child {
        border-bottom: none !important;
        padding-top: 16px !important;
        justify-content: center !important;
        margin: 12px -16px -16px !important;
        background: rgba(255, 255, 255, 0.03);
        padding: 16px 8px !important;
        border-radius: 0 0 20px 20px;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
    }

    .btn-group { 
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 12px !important; 
        justify-content: center !important;
        width: 100% !important;
    }

    .btn-icon {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        border-radius: 18px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 20px !important;
    }

    /* Modal & Form Fixes */
    .modal {
        width: calc(100% - 24px) !important;
        margin: 12px auto !important;
        border-radius: 24px !important;
    }

    .form-row { grid-template-columns: 1fr !important; }

    input, select, textarea {
        font-size: 16px !important; /* Fix auto-zoom on iOS */
        height: 48px !important;
    }
}

@media (max-width: 600px) {
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
}