﻿/* Site styles */
:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-alt: #eef2f7;
    --text: #172033;
    --muted: #667085;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --border: rgba(23, 32, 51, 0.1);
    --shadow: 0 18px 42px rgba(23, 32, 51, 0.1);
    --shadow-sm: 0 10px 24px rgba(23, 32, 51, 0.07);
}

* {
    box-sizing: border-box;
    letter-spacing: 0;
}

html {
    color-scheme: light;
    overflow-x: hidden;
}

html.dark-mode {
    color-scheme: dark;
}

body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0) 360px),
        var(--bg);
    color: var(--text);
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -4rem;
    z-index: 2000;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    padding: 0.65rem 1rem;
    text-decoration: none;
}

.skip-link:focus {
    top: 1rem;
    color: #fff;
}

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.45);
    outline-offset: 3px;
}

a {
    color: var(--primary);
}

img,
svg,
canvas,
video {
    max-width: 100%;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
span,
strong,
small,
label,
.btn,
.badge,
.card,
.alert {
    min-width: 0;
}

.container {
    max-width: min(1180px, calc(100vw - 1.5rem));
}

html.dark-mode body,
html.dark-mode {
    --bg: #0f172a;
    --surface: #111827;
    --surface-alt: #1f2937;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --border: rgba(148, 163, 184, 0.2);
    --shadow: 0 20px 45px rgba(0, 0, 0, 0.35);
    --shadow-sm: 0 10px 26px rgba(0, 0, 0, 0.28);
}

html.dark-mode a,
html.dark-mode .navbar,
html.dark-mode .card,
html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode .input-group-text,
html.dark-mode .btn,
html.dark-mode .table {
    border-color: var(--border);
}

html.dark-mode .form-control,
html.dark-mode .form-select,
html.dark-mode .input-group-text,
html.dark-mode .table {
    background-color: #111827;
    color: var(--text);
}

html.dark-mode .card,
html.dark-mode .hero-search-panel,
html.dark-mode .bg-white {
    background-color: var(--surface) !important;
}

html.dark-mode .navbar,
html.dark-mode .footer {
    background: rgba(15, 23, 42, 0.94) !important;
}

html.dark-mode .text-muted {
    color: var(--muted) !important;
}

html.dark-mode .dropdown-menu {
    background: var(--surface);
    border-color: var(--border);
}

html.dark-mode .dropdown-item,
html.dark-mode .nav-link,
html.dark-mode .navbar-brand {
    color: var(--text);
}

html.dark-mode .dropdown-item:hover,
html.dark-mode .dropdown-item:focus {
    background: var(--surface-alt);
    color: var(--text);
}

html.dark-mode .navbar .nav-link:hover,
html.dark-mode .navbar .nav-link:focus {
    background: rgba(148, 163, 184, 0.14);
    color: #93c5fd !important;
}

html.dark-mode .tools-menu {
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.42);
}

html.dark-mode .tools-menu-icon {
    background: rgba(37, 99, 235, 0.18);
}

html.dark-mode .tools-menu-search-wrap {
    background: var(--surface);
}

html.dark-mode .tools-menu-search .input-group-text,
html.dark-mode .tools-menu-search .form-control {
    background: var(--surface-alt);
    color: var(--text);
}

html.dark-mode .tools-menu .dropdown-item:hover,
html.dark-mode .tools-menu .dropdown-item:focus,
html.dark-mode .tools-menu .dropdown-item.active {
    background: rgba(37, 99, 235, 0.18);
    color: #bfdbfe;
}

html.dark-mode .tools-menu .dropdown-item.active .tools-menu-category,
html.dark-mode .tools-menu .dropdown-item:hover .tools-menu-category,
html.dark-mode .tools-menu .dropdown-item:focus .tools-menu-category {
    color: #bfdbfe;
}

html.dark-mode .btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}

html.dark-mode .bg-light {
    background-color: var(--surface-alt) !important;
}

html.dark-mode .text-dark {
    color: var(--text) !important;
}

html.dark-mode .form-text {
    color: var(--muted);
}

html.dark-mode .modal-content {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

html.dark-mode .modal-header,
html.dark-mode .modal-footer {
    border-color: var(--border);
}

html.dark-mode .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

html.dark-mode .pagination .page-link {
    border-color: var(--border);
    background: var(--surface);
    color: #93c5fd;
}

html.dark-mode .pagination .disabled .page-link {
    background: var(--surface-alt);
    color: var(--muted);
}

html.dark-mode .accordion-button::after {
    filter: invert(1) grayscale(100%) brightness(170%);
}

.navbar {
    backdrop-filter: blur(14px);
    background: rgba(255, 255, 255, 0.94) !important;
    box-shadow: 0 8px 24px rgba(23, 32, 51, 0.05);
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
}

.nav-admin-logout {
    display: flex;
    align-items: center;
    margin: 0 0 0 0.5rem;
}

.nav-link {
    position: relative;
    border-radius: 8px;
    font-weight: 600;
    transition: color 0.18s ease, background 0.18s ease;
}

.navbar .nav-link.active {
    color: var(--primary) !important;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary) !important;
}

.tools-menu {
    width: min(390px, calc(100vw - 2rem));
    max-height: min(620px, calc(100vh - 130px));
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.55rem;
    box-shadow: 0 18px 48px rgba(23, 32, 51, 0.16);
}

.tools-menu .dropdown-item {
    white-space: normal;
    border-radius: 8px;
    padding: 0;
}

.tools-menu-search-wrap {
    position: sticky;
    top: -0.55rem;
    z-index: 2;
    margin: -0.55rem -0.55rem 0.45rem;
    padding: 0.65rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.tools-menu-search .input-group-text,
.tools-menu-search .form-control {
    background: var(--surface-alt);
}

.tools-menu-search .form-control {
    min-height: 38px;
    font-size: 0.92rem;
}

.tools-menu-empty {
    padding: 1rem 0.75rem;
    color: var(--muted);
    text-align: center;
}

.tools-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tools-menu-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tools-menu-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0.62rem 0.75rem 0.62rem 0;
}

.tools-menu-title {
    color: inherit;
    font-weight: 700;
    line-height: 1.25;
}

.tools-menu-category {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.2;
}

.tools-menu .dropdown-item:hover,
.tools-menu .dropdown-item:focus {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    transform: translateX(3px);
}

.tools-menu .dropdown-item:hover .tools-menu-icon,
.tools-menu .dropdown-item:focus .tools-menu-icon,
.tools-menu .dropdown-item.active .tools-menu-icon {
    background: var(--primary);
    color: #fff;
    transform: scale(1.03);
}

.tools-menu .dropdown-item.active,
.tools-menu .dropdown-item:active {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.tools-menu .dropdown-item.active .tools-menu-category,
.tools-menu .dropdown-item:hover .tools-menu-category,
.tools-menu .dropdown-item:focus .tools-menu-category {
    color: var(--primary);
}

.tools-menu::-webkit-scrollbar {
    width: 10px;
}

.tools-menu::-webkit-scrollbar-track {
    background: transparent;
}

.tools-menu::-webkit-scrollbar-thumb {
    border: 3px solid var(--surface);
    border-radius: 999px;
    background: rgba(102, 112, 133, 0.45);
}

.tools-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.65);
}

.hero-banner {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        radial-gradient(circle at top right, rgba(22, 163, 74, 0.14), transparent 34%),
        linear-gradient(135deg, rgba(37, 99, 235, 0.16), rgba(255, 255, 255, 0.72));
    box-shadow: var(--shadow-sm);
}

.hero-banner .btn {
    white-space: normal;
}

.hero-search-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: var(--shadow-sm);
}

.section-heading {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tool-breadcrumb {
    color: var(--muted);
    font-size: 0.92rem;
}

.tool-breadcrumb .breadcrumb {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 0.75rem 1rem;
}

.header-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.card {
    border-color: var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(23, 32, 51, 0.04);
}

.tool-card,
.popular-tool {
    color: var(--text);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.related-tool-card {
    color: var(--text);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tool-card .card-body {
    display: flex;
    min-height: 240px;
    flex-direction: column;
}

.tool-card .btn {
    align-self: flex-start;
    margin-top: auto;
}

.favorite-tool-button {
    position: relative;
    z-index: 2;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: var(--warning);
}

.favorite-tool-button.is-favorite {
    background: rgba(217, 119, 6, 0.14);
    color: var(--warning);
}

.favorite-tool-button.is-favorite i::before {
    content: "\f005";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
}

.mini-tool-card {
    color: var(--text);
}

.tool-group-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.04);
    padding: 1.25rem;
}

.tool-group-list {
    display: grid;
    gap: 0.75rem;
}

.tool-group-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    padding: 0.8rem;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.tool-group-item:hover,
.tool-group-item:focus {
    background: var(--surface-alt);
    border-color: rgba(37, 99, 235, 0.32);
    color: var(--text);
    transform: translateY(-2px);
}

.tool-group-item span:last-child {
    display: grid;
    min-width: 0;
}

.tool-group-item small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.invoice-preview {
    color: var(--text);
}

.invoice-logo {
    max-height: 72px;
    max-width: 180px;
    object-fit: contain;
}

.color-preview {
    min-height: 120px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.markdown-preview {
    overflow-wrap: anywhere;
}

.tool-card:hover,
.popular-tool:hover,
.related-tool-card:hover,
.tool-card:focus-within,
.popular-tool:focus,
.related-tool-card:focus {
    color: var(--text);
    transform: translateY(-3px);
    border-color: rgba(37, 99, 235, 0.32);
    box-shadow: var(--shadow);
}

.tool-card:hover .header-icon,
.popular-tool:hover .header-icon,
.related-tool-card:hover .header-icon,
.tool-card:focus-within .header-icon,
.popular-tool:focus .header-icon,
.related-tool-card:focus .header-icon {
    background: var(--primary);
    color: #fff;
    transform: scale(1.04);
}

.badge-soft {
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.btn {
    border-radius: 8px;
    font-weight: 600;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.18);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 8px;
    border-color: var(--border);
}

.input-group .form-control,
.input-group .form-select,
.input-group .input-group-text {
    border-radius: 0;
}

.input-group > :first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.input-group > :last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(37, 99, 235, 0.55);
    box-shadow: 0 0 0 0.25rem rgba(37, 99, 235, 0.12);
}

.form-section {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 2rem;
}

textarea.form-control {
    min-height: 140px;
}

.alert {
    border-radius: 8px;
}

.table {
    --bs-table-bg: transparent;
    margin-bottom: 0;
    min-width: 620px;
}

.table thead th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.copy-button {
    min-width: 100px;
}

.qr-preview {
    width: 180px;
    height: 180px;
    max-width: 100%;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.5rem;
}

.qr-local-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qr-local-code canvas,
.qr-local-code img {
    width: 100% !important;
    height: 100% !important;
}

.admin-url-cell {
    max-width: 360px;
    overflow-wrap: anywhere;
}

.stat-card {
    min-height: 150px;
}

.admin-hero {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(22, 163, 74, 0.08)),
        var(--surface);
}

.admin-hero-actions {
    justify-content: flex-end;
}

.admin-hero-actions form {
    margin: 0;
}

.admin-hero-actions .btn {
    min-height: 42px;
}

.admin-stat-grid .stat-card {
    height: 100%;
}

.admin-stat-card .header-icon {
    color: #fff;
}

.admin-stat-blue .header-icon {
    background: var(--primary);
}

.admin-stat-green .header-icon {
    background: var(--success);
}

.admin-stat-orange .header-icon {
    background: var(--warning);
}

.admin-stat-purple .header-icon {
    background: #7c3aed;
}

.account-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(22, 163, 74, 0.08)),
        var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.account-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.account-avatar {
    display: inline-flex;
    width: 56px;
    height: 56px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.2);
}

.account-profile h1,
.account-profile p {
    overflow-wrap: anywhere;
}

.account-hero-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.account-stat-grid .stat-card,
.account-stat-card {
    height: 100%;
}

.account-stat-card .header-icon {
    background: var(--primary);
    color: #fff;
}

.account-panel {
    overflow: hidden;
}

.account-reset-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

.account-reset-alert span {
    overflow-wrap: anywhere;
}

.account-security-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.account-security-strip > div {
    display: grid;
    gap: 0.25rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.account-security-strip span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.account-security-strip i {
    color: var(--success);
}

.account-security-strip strong {
    color: var(--text);
    overflow-wrap: anywhere;
}

.account-security-strip small {
    color: var(--muted);
}

.account-security-panel {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(22, 163, 74, 0.04)),
        var(--surface);
}

.account-security-header {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.account-security-header > span {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
}

.account-security-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.75fr);
    gap: 1rem;
}

.account-security-card {
    display: grid;
    align-content: start;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 1rem;
}

.account-security-card-title {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.account-security-card-title > i {
    display: inline-flex;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.account-security-note {
    display: grid;
    gap: 0.5rem;
}

.account-security-note span {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.account-security-note i {
    color: var(--primary);
}

.account-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.account-record-filters {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.account-record-filters .btn {
    white-space: nowrap;
}

.account-record-list {
    display: grid;
    gap: 0.85rem;
}

.account-record-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    padding: 1rem;
}

.account-record-title {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    min-width: 0;
}

.account-record-title > span {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
}

.account-record-title strong {
    overflow-wrap: anywhere;
}

.admin-security-panel {
    display: flex;
    flex-direction: column;
}

.admin-security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
}

.admin-security-metric,
.admin-security-note,
.admin-credential-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
}

.admin-security-metric {
    display: grid;
    gap: 0.25rem;
    padding: 0.85rem;
}

.admin-security-metric span {
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-security-metric strong {
    overflow-wrap: anywhere;
}

.admin-security-note {
    display: grid;
    gap: 0.4rem;
    padding: 0.85rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-credential-box {
    padding: 1rem;
}

.admin-totp-card {
    display: grid;
    gap: 1rem;
}

.admin-totp-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.admin-totp-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--muted);
    padding: 0.35rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.admin-totp-status.is-on {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.admin-totp-status.is-off {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.admin-totp-setup {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 0.9rem;
}

.admin-totp-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 220px);
    min-height: 220px;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 0.6rem;
}

.admin-totp-qr .qr-local-code {
    width: 100%;
    max-width: 180px;
    aspect-ratio: 1;
}

.admin-totp-details {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

.admin-totp-step {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    color: var(--text);
}

.admin-totp-step span {
    display: inline-flex;
    width: 1.45rem;
    height: 1.45rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 800;
}

.admin-totp-secret {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.admin-totp-secret code {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
    line-height: 1.45;
    word-break: break-word;
}

.admin-totp-secret .btn {
    align-self: flex-start;
    min-width: 96px;
}

.admin-totp-confirm {
    border-top: 1px solid var(--border);
    padding-top: 1rem;
}

.admin-totp-empty,
.admin-totp-enabled {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--muted);
    padding: 0.85rem;
}

.admin-totp-empty i {
    color: var(--primary);
}

.admin-totp-enabled {
    border-color: rgba(22, 163, 74, 0.25);
    background: rgba(22, 163, 74, 0.08);
    color: var(--text);
}

.admin-totp-enabled i {
    color: var(--success);
}

.admin-recovery-codes {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
    gap: 0.5rem;
}

.admin-recovery-codes code {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    padding: 0.55rem 0.65rem;
    text-align: center;
    overflow-wrap: anywhere;
}

.admin-bar-row {
    display: grid;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.admin-bar-row:last-child {
    margin-bottom: 0;
}

.admin-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-alt);
}

.admin-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--success));
}

.admin-empty-state {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    text-align: center;
}

.admin-empty-state.compact {
    min-height: 150px;
    padding: 1.25rem;
}

.admin-empty-state i {
    color: var(--primary);
    font-size: 2.25rem;
}

.admin-log-list {
    display: grid;
    gap: 0.75rem;
}

.admin-log-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    padding: 0.9rem;
}

.admin-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    padding: 0.75rem;
}

.admin-card-table {
    border-radius: 8px;
}

.admin-card-table td,
.admin-card-table th {
    vertical-align: middle;
}

.admin-card-table td {
    overflow-wrap: anywhere;
}

.admin-link-table .table {
    min-width: 920px;
}

.admin-link-table td[data-label="Actions"] .btn {
    min-height: 34px;
}

.admin-message-card {
    overflow: hidden;
}

.admin-log-item .btn,
.admin-log-item .form-select,
.admin-log-item .form-control {
    min-height: 36px;
}

.admin-log-item p,
.admin-log-item a {
    overflow-wrap: anywhere;
}

.admin-user-bulk-controls,
.admin-user-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-user-table {
    overflow-x: auto;
}

.admin-user-table .table {
    min-width: 1120px;
}

.admin-user-table th,
.admin-user-table td {
    white-space: nowrap;
}

.admin-user-table th:nth-child(1),
.admin-user-table td:nth-child(1) {
    width: 64px;
}

.admin-user-table th:nth-child(2),
.admin-user-table td:nth-child(2) {
    min-width: 180px;
}

.admin-user-table th:nth-child(3),
.admin-user-table td:nth-child(3) {
    min-width: 230px;
    white-space: normal;
}

.admin-user-table th:nth-child(8),
.admin-user-table td:nth-child(8) {
    min-width: 450px;
}

.admin-user-control-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    padding: 0.9rem 1rem;
}

.admin-user-control-summary > div:first-child {
    display: grid;
    gap: 0.2rem;
}

.admin-user-control-summary span {
    color: var(--muted);
    font-size: 0.9rem;
}

.admin-user-status-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.admin-user-status-summary span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    padding: 0.35rem 0.65rem;
    font-weight: 700;
    white-space: nowrap;
}

.admin-user-status-summary span:first-child i {
    color: var(--success);
}

.admin-user-status-summary span:last-child i {
    color: var(--warning);
}

.admin-user-bulk-bar {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(22, 163, 74, 0.05));
}

.admin-user-filter,
.account-record-search {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    padding: 1rem;
}

.admin-settings-subpanel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.05), rgba(22, 163, 74, 0.04)),
        var(--surface-alt);
    padding: 1rem;
}

.admin-user-reset-alert {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
}

.admin-user-reset-alert span {
    overflow-wrap: anywhere;
}

.admin-user-bulk-controls .form-select,
.admin-user-actions .form-select {
    width: auto;
    min-width: 140px;
}

.admin-user-bulk-controls {
    justify-content: flex-end;
}

.admin-user-cell {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 150px;
}

.admin-user-cell span {
    display: inline-flex;
    width: 2rem;
    height: 2rem;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.12);
    color: var(--primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.admin-user-cell strong {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 78px;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 800;
    white-space: nowrap;
}

.admin-user-status.is-active {
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.admin-user-status.is-suspended {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.admin-user-actions .btn {
    min-height: 34px;
    white-space: nowrap;
}

.daily-list {
    display: grid;
    gap: 0.75rem;
}

.daily-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    background: var(--surface);
}

.daily-list-item.is-complete .form-check-label {
    color: var(--muted);
    text-decoration: line-through;
}

.daily-list-item .form-check {
    min-width: 0;
}

.daily-list-item .form-check-label {
    overflow-wrap: anywhere;
}

.contact-unread {
    border-color: rgba(37, 99, 235, 0.35);
    background: rgba(37, 99, 235, 0.06);
}

.admin-section-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.admin-section-tabs .btn {
    white-space: nowrap;
}

.admin-traffic-section {
    overflow: hidden;
}

.admin-traffic-header > div:first-child {
    min-width: min(100%, 320px);
}

.admin-traffic-header .btn {
    white-space: nowrap;
}

.admin-traffic-stats .admin-stat-card {
    height: 100%;
}

.admin-traffic-table {
    overflow-x: auto;
}

.admin-traffic-table .table {
    min-width: 720px;
}

.admin-traffic-table td,
.admin-traffic-table th {
    vertical-align: middle;
}

.admin-traffic-table td {
    overflow-wrap: anywhere;
}

.admin-traffic-table-heading,
.admin-traffic-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.admin-traffic-pager {
    margin-top: 0.9rem;
    margin-bottom: 0;
}

.admin-traffic-pager .btn.disabled {
    pointer-events: none;
}

.admin-traffic-referrer {
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-hero,
.tool-result-panel,
.tool-empty,
.bmi-hero,
.bmi-result-panel,
.bmi-empty {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.tool-empty,
.bmi-empty {
    display: flex;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bmi-empty {
    min-height: 520px;
}

.tool-empty i,
.bmi-empty i {
    color: var(--primary);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tool-main-card {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #16a34a);
    color: #fff;
    padding: 1.5rem;
}

.tool-main-card strong,
.tool-output-card strong {
    overflow-wrap: anywhere;
}

.tool-main-card strong {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
}

.tool-output-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 1rem;
}

.tool-tutorial {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.tutorial-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-alt);
    padding: 1.25rem;
}

.tutorial-steps,
.tutorial-tips {
    padding-left: 1.25rem;
}

.tutorial-steps li,
.tutorial-tips li {
    margin-bottom: 0.55rem;
    color: var(--text);
}

.tutorial-steps li:last-child,
.tutorial-tips li:last-child {
    margin-bottom: 0;
}

.tutorial-benefits {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.tutorial-faq {
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.tutorial-faq .accordion-item,
.tutorial-faq .accordion-button {
    border-color: var(--border);
    background: var(--surface);
    color: var(--text);
}

.tutorial-faq .accordion-button:not(.collapsed) {
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
}

.tutorial-faq .accordion-body {
    color: var(--muted);
}

.tutorial-benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.06);
    padding: 1rem;
}

.tutorial-benefit-item i {
    display: inline-flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--success);
    color: #fff;
    font-size: 0.8rem;
}

.tutorial-benefit-item span {
    color: var(--text);
    line-height: 1.45;
}

.tool-output-box {
    min-height: 220px;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tool-qr-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    padding: 1rem;
}

.qr-result-panel {
    display: flex;
    flex-direction: column;
}

.qr-display-frame {
    display: flex;
    width: 100%;
    min-height: 300px;
    align-items: center;
    justify-content: center;
}

.form-control-color {
    min-height: 42px;
    padding: 0.35rem;
}

.strength-meter {
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-alt);
}

.strength-meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.strength-weak span {
    width: 34%;
    background: var(--danger);
}

.strength-moderate span {
    width: 67%;
    background: var(--warning);
}

.strength-strong span {
    width: 100%;
    background: var(--success);
}

.bmi-score-card {
    display: flex;
    min-height: 230px;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    border: 1px solid rgba(37, 99, 235, 0.22);
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #16a34a);
    color: #fff;
    padding: 1.5rem;
}

.bmi-score-card strong {
    font-size: 4rem;
    line-height: 1;
    overflow-wrap: anywhere;
}

.bmi-scale-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    padding: 1.25rem;
}

.bmi-scale {
    position: relative;
    height: 16px;
    border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8 0 12%, #16a34a 12% 34%, #f59e0b 34% 50%, #ef4444 50% 100%);
}

.bmi-marker {
    position: absolute;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translate(-50%, -50%);
}

.calorie-card strong {
    font-size: 1.8rem;
    line-height: 1.15;
}

.emi-hero,
.emi-result-panel,
.emi-empty {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.emi-empty {
    display: flex;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.emi-empty i {
    color: var(--primary);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.emi-main-card {
    display: flex;
    min-height: 180px;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), #16a34a);
    color: #fff;
    padding: 1.5rem;
}

.emi-main-card strong {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    overflow-wrap: anywhere;
}

.emi-split {
    display: flex;
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-alt);
}

.emi-split span {
    display: block;
    background: var(--primary);
}

.emi-split em {
    display: block;
    background: var(--warning);
}

.gst-hero,
.gst-result-panel,
.gst-empty {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
}

.gst-empty {
    display: flex;
    min-height: 420px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.gst-empty i {
    color: var(--primary);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.gst-main-card {
    display: flex;
    min-height: 220px;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
    border-radius: 8px;
    background: linear-gradient(135deg, #0f766e, var(--primary));
    color: #fff;
    padding: 1.5rem;
}

.gst-main-card strong {
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1;
    overflow-wrap: anywhere;
}

.gst-split {
    display: flex;
    height: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-alt);
}

.gst-split span {
    display: block;
    background: #0f766e;
}

.gst-split em {
    display: block;
    background: var(--warning);
}

.pagination .page-link {
    border-color: var(--border);
    color: var(--primary);
}

.pagination .active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

.footer {
    border-top: 1px solid var(--border);
    background:
        linear-gradient(180deg, rgba(37, 99, 235, 0.04), rgba(22, 163, 74, 0.03)),
        var(--surface);
    color: var(--muted);
}

.footer-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(22, 163, 74, 0.08)),
        var(--surface);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.75rem;
    padding: 1rem;
}

.footer-cta > div:first-child {
    display: grid;
    gap: 0.15rem;
}

.footer-cta strong {
    color: var(--text);
    font-size: 1.05rem;
}

.footer-cta span {
    color: var(--muted);
}

.footer-cta > div:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, 1fr));
    gap: 2rem;
}

.footer-brand {
    display: grid;
    align-content: start;
    gap: 0.75rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--text);
    text-decoration: none;
}

.footer-logo:hover {
    color: var(--primary);
}

.footer-logo span {
    display: inline-flex;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
}

.footer-logo strong {
    font-size: 1.2rem;
}

.footer-brand p {
    max-width: 360px;
    line-height: 1.55;
}

.footer-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.footer-trust span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--muted);
    padding: 0.28rem 0.55rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.footer-trust i {
    color: var(--primary);
}

.footer-block {
    display: grid;
    align-content: start;
    gap: 0.45rem;
}

.footer-block h2 {
    margin: 0 0 0.35rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
    text-transform: uppercase;
}

.footer-block > a,
.footer-categories a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-size: 0.92rem;
    text-decoration: none;
    transition: color 0.18s ease, transform 0.18s ease;
}

.footer-block > a i {
    width: 1rem;
    color: var(--primary);
    text-align: center;
}

.footer-block > a:hover,
.footer-categories a:hover {
    color: var(--primary);
    transform: translateX(2px);
}

.footer-categories > div {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.footer-categories a {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    padding: 0.28rem 0.6rem;
    font-size: 0.82rem;
    font-weight: 700;
}

.footer-categories a span {
    color: var(--muted);
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-top: 1px solid var(--border);
    margin-top: 1.75rem;
    padding-top: 1rem;
    font-size: 0.9rem;
}

@media (max-width: 991.98px) {
    .navbar .container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .navbar-collapse {
        padding-top: 1rem;
    }

    .navbar-nav {
        align-items: stretch !important;
        gap: 0.25rem;
    }

    .navbar .nav-link {
        border-radius: 8px;
        padding: 0.65rem 0.75rem;
    }

    .navbar .nav-link:hover,
    .navbar .nav-link:focus {
        background: var(--surface-alt);
    }

    .navbar .nav-item.d-flex {
        margin-left: 0 !important;
        padding: 0.65rem 0.75rem;
    }

    .nav-admin-logout {
        margin: 0.5rem 0;
        padding: 0 0.75rem;
    }

    .nav-admin-logout .btn {
        width: 100%;
    }

    .dropdown-menu.tools-menu {
        width: 100%;
        max-height: 55vh;
        margin-top: 0.25rem;
        border-radius: 8px;
        box-shadow: none;
    }

    .tools-menu .dropdown-item:hover,
    .tools-menu .dropdown-item:focus {
        transform: none;
    }

    .tool-empty,
    .emi-empty,
    .gst-empty {
        min-height: 300px;
    }

    .bmi-empty {
        min-height: 360px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .footer-cta {
        align-items: stretch;
        flex-direction: column;
    }

    .footer-cta > div:last-child {
        justify-content: flex-start;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .tool-result-panel,
    .bmi-result-panel,
    .emi-result-panel,
    .gst-result-panel,
    .form-section {
        height: auto !important;
    }
}

@media (max-width: 768px) {
    main .container {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }

    .hero-banner {
        padding: 1.25rem !important;
    }

    .hero-banner .btn,
    .hero-search-panel .input-group {
        width: 100%;
    }

    .display-5 {
        font-size: 2rem;
    }

    .header-icon {
        width: 38px;
        height: 38px;
    }

    .form-section {
        padding: 1.25rem;
    }

    .tool-card .card-body {
        min-height: auto;
    }

    .tool-hero,
    .tool-result-panel,
    .tool-empty,
    .tool-tutorial,
    .bmi-hero,
    .bmi-result-panel,
    .bmi-empty,
    .emi-hero,
    .emi-result-panel,
    .emi-empty,
    .gst-hero,
    .gst-result-panel,
    .gst-empty {
        padding: 1.25rem;
    }

    .tool-main-card,
    .bmi-score-card,
    .emi-main-card,
    .gst-main-card {
        min-height: 150px;
        padding: 1.25rem;
    }

    .bmi-score-card strong {
        font-size: 3rem;
    }

    .tool-output-box {
        min-height: 180px;
        max-height: 320px;
    }

    .table-responsive {
        border: 1px solid var(--border);
        border-radius: 8px;
    }

    .table-responsive .table {
        border: 0;
    }

    .admin-hero {
        padding: 1.25rem !important;
    }

    .admin-hero-actions {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .account-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 1.25rem;
    }

    .account-hero-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .account-hero-actions .btn {
        width: 100%;
    }

    .admin-hero-actions form,
    .admin-hero-actions .btn {
        width: 100%;
    }

    .admin-hero-actions .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .admin-section-tabs {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding: 0 0.25rem 0.45rem;
        scroll-snap-type: x proximity;
    }

    .admin-section-tabs .btn {
        scroll-snap-align: start;
    }

    .admin-stat-grid > [class*="col-"] {
        width: 50%;
    }

    .account-stat-grid > [class*="col-"] {
        width: 50%;
    }

    .admin-stat-grid .stat-card {
        min-height: 132px;
    }

    .account-record-item > .d-flex {
        align-items: stretch !important;
        flex-direction: column;
    }

    .account-record-item form .btn {
        width: 100%;
    }

    .account-reset-alert {
        grid-template-columns: 1fr;
    }

    .account-reset-alert .btn {
        width: 100%;
    }

    .account-security-strip {
        grid-template-columns: 1fr;
    }

    .account-security-grid {
        grid-template-columns: 1fr;
    }

    .account-security-card .btn {
        width: 100%;
    }

    .admin-card-table table,
    .admin-card-table thead,
    .admin-card-table tbody,
    .admin-card-table th,
    .admin-card-table td,
    .admin-card-table tr {
        display: block;
        min-width: 0;
    }

    .admin-card-table .table {
        min-width: 0;
    }

    .admin-card-table thead {
        display: none;
    }

    .admin-card-table tr {
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        padding: 0.85rem;
    }

    .admin-card-table tbody tr + tr {
        margin-top: 0.75rem;
    }

    .admin-card-table td {
        display: grid;
        grid-template-columns: 110px minmax(0, 1fr);
        gap: 0.75rem;
        border: 0;
        padding: 0.35rem 0;
        white-space: normal;
    }

    .admin-card-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 700;
    }

    .admin-card-table td[colspan] {
        display: block;
    }

    .admin-card-table td[colspan]::before {
        content: none;
    }

    .admin-link-table td[data-label="Actions"] > div {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-link-table td[data-label="Actions"] .btn,
    .admin-link-table td[data-label="Short URL"] .copy-button {
        width: 100%;
    }

    .admin-traffic-section {
        padding: 1rem !important;
    }

    .admin-traffic-header {
        align-items: stretch !important;
    }

    .admin-traffic-header > div,
    .admin-traffic-header .btn {
        width: 100%;
    }

    .admin-traffic-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-traffic-stats > [class*="col-"] {
        width: auto;
    }

    .admin-traffic-stats .stat-card {
        min-height: 128px;
    }

    .admin-traffic-section .admin-bar-row .d-flex {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.15rem !important;
    }

    .admin-traffic-table {
        border: 0;
        overflow: visible;
    }

    .admin-traffic-table-heading,
    .admin-traffic-pager {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-traffic-pager .btn {
        width: 100%;
    }

    .admin-traffic-table table,
    .admin-traffic-table thead,
    .admin-traffic-table tbody,
    .admin-traffic-table th,
    .admin-traffic-table td,
    .admin-traffic-table tr {
        display: block;
        min-width: 0;
    }

    .admin-traffic-table .table {
        min-width: 0;
    }

    .admin-traffic-table thead {
        display: none;
    }

    .admin-traffic-table tr {
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        padding: 0.85rem;
    }

    .admin-traffic-table tr + tr {
        margin-top: 0.75rem;
    }

    .admin-traffic-table td {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 0.75rem;
        border: 0;
        padding: 0.35rem 0;
        white-space: normal;
    }

    .admin-traffic-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 700;
    }

    .admin-traffic-table td[colspan] {
        display: block;
    }

    .admin-traffic-table td[colspan]::before {
        content: none;
    }

    .admin-traffic-referrer {
        max-width: none;
        overflow: visible;
        text-overflow: clip;
        white-space: normal;
    }

    .admin-bulk-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-bulk-actions .btn {
        width: 100%;
    }

    .admin-security-grid {
        grid-template-columns: 1fr;
    }

    .admin-credential-box {
        padding: 0.85rem;
    }

    .admin-totp-header,
    .admin-totp-setup {
        align-items: flex-start;
        flex-direction: column;
    }

    .admin-totp-header {
        display: grid;
    }

    .admin-totp-setup {
        grid-template-columns: 1fr;
    }

    .admin-totp-qr {
        width: 100%;
    }

    .admin-totp-secret .btn {
        width: 100%;
    }

    .admin-log-item > .d-flex,
    .admin-log-item form.d-flex {
        align-items: stretch !important;
        flex-direction: column;
    }

    .admin-log-item .btn,
    .admin-log-item form.d-flex .btn {
        width: 100%;
    }

    .admin-user-bulk-controls,
    .admin-user-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .admin-user-control-summary {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-user-filter .btn,
    .account-record-search .btn {
        width: 100%;
    }

    .account-record-search .col-md-auto {
        width: 100%;
    }

    .admin-user-reset-alert {
        grid-template-columns: 1fr;
    }

    .admin-user-reset-alert .btn {
        width: 100%;
    }

    .admin-user-status-summary {
        justify-content: flex-start;
    }

    .admin-user-bulk-controls .form-select,
    .admin-user-actions .form-select {
        width: 100%;
        min-width: 0;
    }

    .admin-user-actions .btn {
        width: 100%;
    }

    .copy-button {
        min-width: 0;
    }
}

@media (max-width: 575.98px) {
    body {
        background:
            linear-gradient(180deg, rgba(37, 99, 235, 0.06), rgba(37, 99, 235, 0) 260px),
            var(--bg);
    }

    main.pb-5 {
        padding-bottom: 1.5rem !important;
    }

    .container {
        max-width: calc(100vw - 1rem);
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .admin-hero-actions,
    .account-hero-actions,
    .admin-link-table td[data-label="Actions"] > div {
        grid-template-columns: 1fr;
    }

    .admin-stat-grid > [class*="col-"] {
        width: 100%;
    }

    .account-stat-grid > [class*="col-"] {
        width: 100%;
    }

    .account-profile {
        align-items: flex-start;
    }

    .admin-card-table td,
    .admin-traffic-table td {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .admin-card-table td::before,
    .admin-traffic-table td::before {
        font-size: 0.78rem;
    }

    .admin-section-tabs .btn {
        min-width: 96px;
    }

    .admin-user-bulk-controls,
    .admin-user-actions {
        grid-template-columns: 1fr;
    }

    .navbar-brand {
        max-width: calc(100vw - 96px);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero-banner {
        margin-left: 0;
        margin-right: 0;
    }

    .hero-banner,
    .hero-search-panel,
    .form-section,
    .tool-hero,
    .tool-result-panel,
    .tool-empty,
    .tool-tutorial,
    .bmi-hero,
    .bmi-result-panel,
    .bmi-empty,
    .emi-hero,
    .emi-result-panel,
    .emi-empty,
    .gst-hero,
    .gst-result-panel,
    .gst-empty {
        padding: 1rem;
        box-shadow: none;
    }

    .hero-banner .lead {
        font-size: 1rem;
    }

    .display-5 {
        font-size: 1.75rem;
        line-height: 1.15;
    }

    .h3,
    h1.h3 {
        font-size: 1.35rem;
    }

    .h4,
    h2.h4 {
        font-size: 1.15rem;
    }

    .d-flex.align-items-start.gap-3 {
        gap: 0.75rem !important;
    }

    .header-icon {
        width: 36px;
        height: 36px;
        font-size: 0.95rem;
    }

    .tools-menu {
        padding: 0.35rem;
    }

    .tools-menu-item {
        gap: 0.6rem;
    }

    .tools-menu-icon {
        width: 34px;
        height: 34px;
    }

    .tools-menu-copy {
        padding: 0.55rem 0.65rem 0.55rem 0;
    }

    .tools-menu-category {
        font-size: 0.76rem;
    }

    .btn-lg,
    .form-control-lg,
    .input-group-lg > .form-control,
    .input-group-lg > .input-group-text,
    .input-group-lg > .btn {
        min-height: 46px;
        padding: 0.625rem 0.875rem;
        font-size: 1rem;
    }

    .btn-group {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .btn-group > .btn {
        width: 100%;
    }

    .daily-list-item {
        align-items: stretch;
        flex-direction: column;
    }

    .daily-list-item .btn {
        width: 100%;
    }

    .input-group {
        flex-wrap: nowrap;
    }

    .input-group-text {
        flex: 0 0 auto;
    }

    .input-group > .form-control,
    .input-group > .form-select {
        min-width: 0;
    }

    .tool-main-card strong,
    .emi-main-card strong,
    .gst-main-card strong {
        font-size: clamp(1.6rem, 9vw, 2.3rem);
    }

    .tool-main-card .fs-2,
    .tool-main-card .fs-3,
    .tool-main-card .fs-4 {
        font-size: clamp(1.25rem, 7vw, 1.75rem) !important;
    }

    .bmi-score-card strong {
        font-size: 2.6rem;
    }

    .tool-empty,
    .emi-empty,
    .gst-empty {
        min-height: 240px;
    }

    .bmi-empty {
        min-height: 280px;
    }

    .tool-empty i,
    .bmi-empty i,
    .emi-empty i,
    .gst-empty i {
        font-size: 2.25rem;
    }

    .tool-output-card {
        padding: 0.875rem;
    }

    .admin-traffic-stats {
        grid-template-columns: 1fr;
    }

    .admin-traffic-table td {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 0.6rem;
    }

    .tutorial-panel {
        padding: 1rem;
    }

    .tool-output-box {
        min-height: 150px;
        max-height: 260px;
        font-size: 0.875rem;
    }

    .qr-preview {
        width: min(220px, 100%) !important;
        height: auto !important;
        aspect-ratio: 1;
    }

    .tool-qr-frame {
        width: 100%;
        padding: 0.75rem;
    }

    .tool-card .btn,
    form .btn-primary.w-100,
    .hero-banner .btn {
        width: 100%;
    }

    .popular-tool .d-flex,
    .card .d-flex.justify-content-between {
        align-items: flex-start !important;
    }

    .footer {
        text-align: left;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 1.35rem;
    }

    .footer-cta .btn {
        width: 100%;
    }

    .footer-cta > div:last-child {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .footer-bottom {
        align-items: flex-start;
        flex-direction: column;
    }

    .footer-categories > div {
        gap: 0.4rem;
    }
}

@media (max-width: 380px) {
    .container {
        max-width: calc(100vw - 0.5rem);
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }

    .hero-banner,
    .hero-search-panel,
    .form-section,
    .tool-hero,
    .tool-result-panel,
    .tool-empty,
    .tool-tutorial,
    .bmi-hero,
    .bmi-result-panel,
    .bmi-empty,
    .emi-hero,
    .emi-result-panel,
    .emi-empty,
    .gst-hero,
    .gst-result-panel,
    .gst-empty {
        padding: 0.875rem;
    }

    .badge {
        white-space: normal;
        text-align: left;
    }
}

@media print {
    body * {
        visibility: hidden;
    }

    #invoicePreview,
    #invoicePreview * {
        visibility: visible;
    }

    #invoicePreview {
        position: absolute;
        inset: 0;
        padding: 2rem;
        background: #fff;
        color: #111827;
    }
}

