html {
  font-size: 14px;
}
@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}
.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}
.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-glow: rgba(59, 130, 246, 0.35);
    --bg-body: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --card-border: #334155;
    --success: #22c55e;
    --radius-sm: 0.4rem;
    --radius-md: 0.65rem;
    --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-lift: 0 10px 25px -8px rgba(0, 0, 0, 0.5);
}

/* 1. Lock the full viewport and disable page-level scrolling */
html, body {
    position: relative;
    min-height: 100%;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    overflow: hidden;
    background-color: #e8edf5;
    background-image:
        radial-gradient(circle at 15% 15%, rgba(59, 130, 246, 0.25), transparent 40%),
        radial-gradient(circle at 85% 25%, rgba(147, 197, 253, 0.25), transparent 45%),
        radial-gradient(circle at 30% 80%, rgba(96, 165, 250, 0.18), transparent 50%),
        radial-gradient(circle at 80% 90%, rgba(59, 130, 246, 0.15), transparent 45%);
    color: var(--text-main);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    display: flex;
    flex-direction: column;
}
h1, h2, h3, h4, h5, h6 {
    color: var(--text-main);
    letter-spacing: -0.01em;
}
.text-muted {
    color: var(--text-muted) !important;
}
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.15s ease;
}
a:hover {
    color: var(--primary-hover);
}

/* Buttons — soften Bootstrap's defaults to match the theme */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.btn:active {
    transform: translateY(1px);
}
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 rgba(59, 130, 246, 0);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Cards */
div.card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    box-shadow: var(--shadow-soft);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
div.card:hover {
    border-color: #3d4f68;
}
div.card-header {
    background-color: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--card-border);
    color: var(--text-main);
    font-weight: 600;
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

/* Tables & Forms */
table.table {
    color: var(--text-main);
    border-color: var(--card-border);
}
.table-light {
    background-color: #1e293b;
    color: var(--text-muted);
    border-color: var(--card-border);
}
.form-control, .input-group-text, .form-select {
    background-color: #0f172a;
    border-color: var(--card-border);
    color: var(--text-main);
    border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
    background-color: #0f172a;
    color: var(--text-main);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem var(--primary-glow);
}
.form-control::placeholder {
    color: #5b6b85;
}

/* Header/Navbar and Footer */
.unified-bar {
    background-color: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-color: var(--card-border) !important;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}
.unified-bar .navbar-brand {
    color: var(--text-main);
    letter-spacing: -0.02em;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(90deg, #f1f5f9, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.unified-bar .nav-link {
    color: var(--text-main);
    font-size: 0.95rem;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
}
.unified-bar .nav-link:hover {
    color: var(--primary-color);
}
.unified-bar .btn-outline-secondary,
.unified-bar .btn-primary {
    font-size: 0.9rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
.unified-bar .btn-outline-secondary {
    color: var(--text-muted);
    border-color: transparent;
    font-weight: 500;
}
.unified-bar .btn-outline-secondary:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.06);
    border-color: var(--card-border);
}
.unified-bar .btn-outline-danger {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.4);
    font-weight: 500;
}
.unified-bar .btn-outline-danger:hover {
    color: #fff;
    background-color: #ef4444;
    border-color: #ef4444;
}

/* Glassy effect for middle panels */
.glass-panel {
    background-color: rgba(30, 41, 59, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
}

/* 2. Fix the Header to the absolute top */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
}

/* 3. Make ONLY the middle content wrapper scrollable */
.page-content-wrapper {
    flex: 1;
    overflow-y: auto;
    width: 100%;
    margin-top: 75px;
    margin-bottom: 60px;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--card-border) transparent;
}
.page-content-wrapper::-webkit-scrollbar {
    width: 8px;
}
.page-content-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--card-border);
    border-radius: 999px;
}

/* 4. Fix the Footer to the absolute bottom */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1030;
    line-height: 40px;
    background-color: rgba(30, 41, 59, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--card-border) !important;
    color: #b6c2d4;
    font-size: 0.85rem;
}
.footer .text-light {
    color: #f1f5f9 !important;
}

/* Status dot */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    70%  { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

/* Balance badge */
.badge.bg-primary-subtle {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #93c5fd !important;
    border-color: rgba(59, 130, 246, 0.35) !important;
    font-weight: 500;
}

/* Login card */
.login-wrapper {
    min-height: calc(100% - 2rem);
}
.login-card {
    position: relative;
    overflow: hidden;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1rem;
}
.login-accent {
    height: 4px;
    width: 100%;
    background: linear-gradient(90deg, var(--primary-color), #93c5fd, var(--primary-color));
}
.login-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: var(--primary-color);
}

/* History table */
.table-dark-custom {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-main);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
    --bs-table-striped-color: var(--text-main);
    --bs-table-hover-bg: rgba(255, 255, 255, 0.06);
    --bs-table-hover-color: var(--text-main);
    --bs-table-border-color: var(--card-border);
    color: var(--text-main);
    border-color: var(--card-border);
    margin-bottom: 0;
}

.table-dark-custom thead th {
    background-color: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--card-border);
    padding: 0.85rem 1rem;
}
.table-dark-custom tbody td {
    padding: 0.85rem 1rem;
    border-color: var(--card-border);
    vertical-align: middle;
}
.table-dark-custom tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.03);
}
.status-badge {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    font-weight: 500;
    padding: 0.35em 0.75em;
}