:root {
    --bg-main: #ecfdf5;
    --bg-soft: #ffffff;

    --bg-gradient:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.22), transparent 24%),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.24), transparent 26%),
        radial-gradient(circle at 50% 120%, rgba(59, 130, 246, 0.16), transparent 36%),
        linear-gradient(180deg, #f7fffc 0%, #eefcf7 24%, #eef8ff 52%, #f7fbff 100%);

    --line-stripe:
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.38) 0px,
            rgba(255, 255, 255, 0.38) 12px,
            rgba(209, 250, 229, 0.34) 12px,
            rgba(209, 250, 229, 0.34) 24px
        );

    --grid-line:
        linear-gradient(rgba(37, 99, 235, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.035) 1px, transparent 1px);

    --card-bg: rgba(255, 255, 255, 0.82);
    --card-solid: #ffffff;
    --glass-strong: rgba(255, 255, 255, 0.88);

    --primary: #1d4ed8;
    --primary-2: #10b981;
    --primary-3: #0f766e;

    --primary-grad: linear-gradient(135deg, #2563eb 0%, #14b8a6 52%, #22c55e 100%);
    --primary-grad-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.10), rgba(16, 185, 129, 0.10));
    --primary-grad-strong: linear-gradient(135deg, #1d4ed8 0%, #0891b2 42%, #16a34a 100%);

    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-main: #0b1f2a;
    --text-dim: #5b7083;
    --text-soft: #7f94a8;
    --text-on-dark: #f8fffd;

    --border-color: rgba(191, 219, 254, 0.65);
    --border-green: rgba(167, 243, 208, 0.65);

    --shadow-sm:
        0 10px 22px rgba(29, 78, 216, 0.08),
        0 4px 10px rgba(16, 185, 129, 0.05);

    --shadow-md:
        0 20px 44px rgba(29, 78, 216, 0.13),
        0 10px 24px rgba(16, 185, 129, 0.08);

    --shadow-lg:
        0 34px 72px rgba(29, 78, 216, 0.16),
        0 16px 38px rgba(16, 185, 129, 0.10);

    --shadow-inset:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        inset 0 -1px 0 rgba(16, 185, 129, 0.03);

    --radius-xs: 10px;
    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;
    --radius-2xl: 36px;

    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
}

html {
    height: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text-main);
    background: var(--bg-gradient);
    background-attachment: fixed;
    overflow: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: var(--line-stripe);
    opacity: 0.48;
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image: var(--grid-line);
    background-size: 22px 22px, 22px 22px;
    opacity: 0.38;
    pointer-events: none;
    z-index: 0;
}

.app-container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    background: transparent;
    overflow: hidden;
}

.header {
    position: relative;
    z-index: 20;
    height: 76px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.86), rgba(255,255,255,0.74));
    backdrop-filter: blur(18px) saturate(160%);
    border-bottom: 1px solid rgba(191, 219, 254, 0.78);
    box-shadow: 0 8px 26px rgba(37, 99, 235, 0.05);
    overflow: hidden;
}

.header-glow {
    position: absolute;
    inset: auto;
    top: -40px;
    right: -20px;
    width: 160px;
    height: 120px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.22), transparent 70%);
    pointer-events: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.avatar-mock {
    width: 44px;
    height: 44px;
    border-radius: 15px;
    background: var(--primary-grad-strong);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 18px;
    box-shadow:
        0 18px 30px rgba(29, 78, 216, 0.18),
        0 8px 16px rgba(16, 185, 129, 0.16);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.avatar-mock::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.24), transparent 55%);
    pointer-events: none;
}

.user-text {
    min-width: 0;
}

.user-text span {
    display: block;
    font-size: 15px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-online-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 12px;
    margin-top: 2px;
}

.status-online {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.10),
        0 0 12px rgba(16, 185, 129, 0.55);
}

.btn-contact {
    border: 1px solid rgba(191, 219, 254, 0.8);
    background: linear-gradient(180deg, rgba(255,255,255,0.95), rgba(241, 255, 249, 0.92));
    color: var(--text-main);
    border-radius: 14px;
    padding: 10px 13px;
    font-size: 11px;
    font-weight: 900;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px 14px calc(98px + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#admin_layout {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sidebar {
    width: 92px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.82), rgba(247,255,252,0.82));
    backdrop-filter: blur(18px) saturate(150%);
    border-right: 1px solid rgba(191, 219, 254, 0.72);
    padding: 10px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: inset -1px 0 0 rgba(255,255,255,0.6);
}

.admin-content {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 12px calc(94px + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.menu-item,
.nav-item {
    position: relative;
    border: none;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: 0.24s ease;
}

.menu-item {
    width: 100%;
    min-height: 72px;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 8px 6px;
}

.menu-item.active {
    color: var(--primary);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(242,255,249,0.94));
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(167, 243, 208, 0.45);
}

.nav-item.active {
    color: var(--primary);
}

.icon,
.nav-icon {
    font-size: 22px;
    line-height: 1;
}

.menu-item span:last-child,
.nav-item span:last-child {
    font-size: 10px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
}

.badge {
    position: absolute;
    top: 6px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid #fff;
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.28);
}

.hero-card {
    position: relative;
    overflow: hidden;
    background: var(--primary-grad-strong);
    color: var(--text-on-dark);
    border-radius: var(--radius-2xl);
    padding: 22px 18px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 14px;
}

.hero-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.22), transparent 52%),
        radial-gradient(circle at 90% 10%, rgba(255,255,255,0.20), transparent 18%);
    pointer-events: none;
}

.hero-card::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -70px;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
    pointer-events: none;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.6px;
    color: #eafff7;
    background: rgba(255,255,255,0.14);
    border: 1px solid rgba(255,255,255,0.18);
    margin-bottom: 10px;
    backdrop-filter: blur(10px);
}

.hero-card p {
    margin: 0;
    opacity: 0.94;
    font-size: 13px;
    font-weight: 700;
}

.hero-card h1 {
    margin: 10px 0 14px;
    font-size: 34px;
    line-height: 1.08;
    font-weight: 900;
    word-break: break-word;
}

.hero-footer {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
}

.stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255,255,255,0.16);
    border-radius: 18px;
    padding: 12px;
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18);
}

.stat span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    opacity: 0.90;
}

.stat b {
    display: block;
    margin-top: 6px;
    font-size: 14px;
}

.panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head.compact {
    margin-bottom: 10px;
}

.section-title {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: 0.2px;
    line-height: 1.3;
}

.section-subtitle {
    margin: 0;
    font-size: 11px;
    line-height: 1.55;
    color: var(--text-dim);
    font-weight: 700;
}

.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.card,
.quick-action-card,
.form-card,
.item-card,
.admin-form-card,
.history-section {
    background: var(--card-bg);
    backdrop-filter: blur(18px) saturate(150%);
    border: 1px solid rgba(191, 219, 254, 0.55);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card,
.quick-action-card,
.form-card,
.admin-form-card,
.history-section {
    padding: 14px;
    margin-bottom: 12px;
}

.card {
    min-height: 108px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,255,251,0.92)),
        var(--primary-grad-soft);
    box-shadow:
        0 20px 32px rgba(37, 99, 235, 0.08),
        0 10px 18px rgba(16, 185, 129, 0.06),
        inset 0 1px 0 rgba(255,255,255,0.86);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(145deg, rgba(255,255,255,0.28), transparent 46%);
    pointer-events: none;
}

.card h3 {
    margin: 0 0 10px;
    font-size: 12px;
    color: var(--text-dim);
    font-weight: 900;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.card h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
    color: var(--text-main);
    word-break: break-word;
    position: relative;
    z-index: 1;
}

.stat-card {
    padding-top: 12px;
}

.stat-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.stat-card-icon {
    width: 30px;
    height: 30px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 18px rgba(16, 185, 129, 0.10);
    background: linear-gradient(135deg, rgba(37,99,235,0.12), rgba(16,185,129,0.12));
    border: 1px solid rgba(255,255,255,0.75);
}

.accent-blue {
    border-color: rgba(96, 165, 250, 0.45);
}

.accent-blue .stat-card-icon {
    background: linear-gradient(135deg, rgba(37,99,235,0.16), rgba(96,165,250,0.16));
}

.accent-teal {
    border-color: rgba(45, 212, 191, 0.45);
}

.accent-teal .stat-card-icon {
    background: linear-gradient(135deg, rgba(13,148,136,0.16), rgba(45,212,191,0.16));
}

.accent-green {
    border-color: rgba(74, 222, 128, 0.45);
}

.accent-green .stat-card-icon {
    background: linear-gradient(135deg, rgba(16,185,129,0.16), rgba(74,222,128,0.16));
}

.accent-cyan {
    border-color: rgba(34, 211, 238, 0.45);
}

.accent-cyan .stat-card-icon {
    background: linear-gradient(135deg, rgba(8,145,178,0.16), rgba(34,211,238,0.16));
}

.accent-emerald {
    border-color: rgba(52, 211, 153, 0.45);
}

.accent-emerald .stat-card-icon {
    background: linear-gradient(135deg, rgba(5,150,105,0.16), rgba(52,211,153,0.16));
}

.quick-action-card,
.form-card,
.admin-form-card,
.history-section {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.94), rgba(247,255,252,0.88));
    box-shadow:
        0 18px 30px rgba(37, 99, 235, 0.06),
        0 8px 18px rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(167, 243, 208, 0.30);
}

.item-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 15px;
    margin-bottom: 12px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,255,251,0.94));
    box-shadow:
        0 16px 28px rgba(37, 99, 235, 0.06),
        0 6px 14px rgba(16, 185, 129, 0.04);
    border: 1px solid rgba(191, 219, 254, 0.45);
}

.item-main {
    flex: 1;
    min-width: 0;
}

.money-strong {
    font-weight: 900;
    font-size: 15px;
    color: #0f766e;
}

.ctv-name-line {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-main);
    margin-top: 5px;
}

.item-meta-line {
    font-size: 10px;
    color: var(--text-dim);
    margin-top: 5px;
    line-height: 1.5;
    word-break: break-word;
}

.sub-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
    background: linear-gradient(135deg, rgba(219, 234, 254, 0.92), rgba(209, 250, 229, 0.88));
    padding: 4px;
    border-radius: 14px;
    position: relative;
    z-index: 5;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.sub-tab {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text-dim);
    border-radius: 11px;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.22s ease;
    pointer-events: auto;
}

.sub-tab.active {
    background: linear-gradient(180deg, #ffffff, #f3fffb);
    color: var(--primary);
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.10);
}

.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block !important;
    animation: fadeIn 0.25s ease;
}

.input-group {
    margin-bottom: 14px;
}

.input-group label {
    display: block;
    margin: 0 0 8px 4px;
    font-size: 11px;
    font-weight: 900;
    color: var(--text-dim);
}

input,
select,
textarea {
    width: 100%;
    border: 1.5px solid rgba(191, 219, 254, 0.60);
    background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(246,255,251,0.92));
    color: var(--text-main);
    border-radius: 16px;
    padding: 14px 15px;
    outline: none;
    font-size: 14px;
    font-weight: 700;
    transition: 0.22s ease;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.72),
        0 4px 10px rgba(16, 185, 129, 0.03);
}

textarea {
    resize: none;
    line-height: 1.55;
    font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
    border-color: rgba(16, 185, 129, 0.78);
    box-shadow:
        0 0 0 4px rgba(16, 185, 129, 0.12),
        0 12px 22px rgba(37, 99, 235, 0.06);
    background: #fff;
}

.btn-primary-gradient {
    width: 100%;
    border: none;
    border-radius: 16px;
    padding: 16px;
    margin-top: 10px;
    background: var(--primary-grad-strong);
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    box-shadow:
        0 18px 30px rgba(29, 78, 216, 0.18),
        0 10px 22px rgba(16, 185, 129, 0.14);
    transition: transform 0.18s ease, opacity 0.18s ease, box-shadow 0.18s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary-gradient::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, rgba(255,255,255,0.22), transparent 55%);
    pointer-events: none;
}

.btn-primary-gradient:active {
    transform: scale(0.985);
}

.btn-secondary,
.btn-done,
.btn-copy,
.btn-close {
    border: none;
    cursor: pointer;
    transition: 0.2s ease;
}

.btn-secondary {
    width: 100%;
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 13px;
    background: linear-gradient(135deg, #effcff 0%, #ecfff5 100%);
    color: #0f766e;
    font-weight: 900;
    box-shadow: 0 10px 18px rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(167, 243, 208, 0.40);
}

.btn-done {
    padding: 10px 15px;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 12px 20px rgba(16, 185, 129, 0.18);
    flex-shrink: 0;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100%;
    max-width: 540px;
    height: calc(78px + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.88), rgba(244,255,250,0.80));
    backdrop-filter: blur(18px) saturate(155%);
    border-top: 1px solid rgba(191, 219, 254, 0.72);
    display: flex;
    z-index: 30;
    box-shadow: 0 -10px 24px rgba(29, 78, 216, 0.05);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(6, 24, 31, 0.44);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
    padding: 18px;
}

.modal-content {
    width: min(100%, 460px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(245,255,251,0.96));
    border: 1px solid rgba(167, 243, 208, 0.42);
    border-radius: 30px;
    padding: 24px 20px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: modalShow 0.22s ease-out;
}

.success-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.result-box {
    background: linear-gradient(180deg, #f3fffb 0%, #ecfcf5 100%);
    padding: 18px;
    border-radius: 20px;
    margin: 18px 0;
    border: 1.5px dashed rgba(16, 185, 129, 0.50);
    overflow: hidden;
}

.result-box h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 900;
    line-height: 1.2;
    color: #0f766e;
    word-break: break-all;
}

.modal-btns {
    display: flex;
    gap: 10px;
}

.btn-copy,
.btn-close {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    font-weight: 900;
}

.btn-copy {
    background: var(--primary-grad-strong);
    color: #fff;
    box-shadow: 0 14px 24px rgba(16, 185, 129, 0.14);
}

.btn-close {
    background: linear-gradient(180deg, #effcf7, #eef8ff);
    color: var(--text-dim);
    border: 1px solid rgba(191, 219, 254, 0.45);
}

.saved-info-box {
    margin-top: 12px;
    padding: 13px 14px;
    border-radius: 14px;
    background: linear-gradient(180deg, #fbfffd, #f0fff8);
    border: 1px solid rgba(167, 243, 208, 0.42);
    font-size: 13px;
    line-height: 1.72;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.empty-box {
    padding: 18px 14px;
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
    background: rgba(255,255,255,0.68);
    border-radius: 14px;
    border: 1px dashed rgba(167, 243, 208, 0.48);
}

.history-section {
    margin-top: 12px;
}

#recent_va_list,
#all_va_history_list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#recent_va_list {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

#all_va_history_list {
    max-height: 52vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.history-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(191, 219, 254, 0.30);
}

.history-row:last-child {
    border-bottom: none;
}

.history-left {
    flex: 1;
    min-width: 0;
}

.history-name {
    font-size: 13px;
    font-weight: 900;
    color: var(--text-main);
    word-break: break-word;
}

.history-meta {
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.45;
}

.history-account {
    max-width: 44%;
    font-size: 12px;
    font-weight: 900;
    color: #0f766e;
    text-align: right;
    word-break: break-all;
}

.pager-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.pager-row span {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-dim);
}

.modal-pre {
    white-space: pre-wrap;
    background: linear-gradient(180deg, #f4fffb 0%, #eefdf6 100%);
    border-radius: 14px;
    padding: 12px;
    text-align: left;
    max-height: 240px;
    overflow: auto;
    font-size: 13px;
    line-height: 1.55;
    margin-top: 10px;
    border: 1px solid rgba(167, 243, 208, 0.42);
}

.log-container {
    height: 420px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
    border-radius: 20px;
    background:
        linear-gradient(180deg, rgba(240,255,249,0.96), rgba(237,248,255,0.96));
    border: 1px solid rgba(167, 243, 208, 0.38);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.7),
        0 10px 22px rgba(37, 99, 235, 0.05);
    -webkit-overflow-scrolling: touch;
}

.log-item {
    padding: 13px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff, #f6fffb);
    border: 1px solid rgba(191, 219, 254, 0.40);
    margin-bottom: 10px;
    box-shadow:
        0 14px 22px rgba(37, 99, 235, 0.06),
        0 6px 14px rgba(16, 185, 129, 0.04);
}

.log-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.log-time {
    font-size: 11px;
    color: #5b7083;
    font-weight: 800;
}

.log-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.4px;
    white-space: nowrap;
    border: 1px solid transparent;
}

.log-type-va {
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.10);
    border-color: rgba(37, 99, 235, 0.18);
}

.log-type-payment {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.20);
}

.log-type-done {
    color: #b45309;
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.20);
}

.log-type-approved {
    color: #065f46;
    background: rgba(34, 197, 94, 0.13);
    border-color: rgba(34, 197, 94, 0.20);
}

.log-type-revoke {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.18);
}

.log-type-remove {
    color: #7c2d12;
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.18);
}

.log-type-broadcast {
    color: #0f766e;
    background: rgba(20, 184, 166, 0.12);
    border-color: rgba(20, 184, 166, 0.18);
}

.log-type-custom {
    color: #475569;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.18);
}

.log-text {
    font-size: 13px;
    color: #0b1f2a;
    line-height: 1.68;
    word-break: break-word;
    font-weight: 700;
}

.ctv-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
}

.ctv-card .item-main {
    min-width: 0;
}

.ctv-card .status-pill {
    justify-self: end;
    align-self: start;
    margin-top: 2px;
}

.ctv-card > div:last-child {
    grid-column: 1 / -1;
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px !important;
    margin-top: 0 !important;
    width: 100%;
}

.ctv-card .btn-secondary,
.ctv-card .btn-done {
    width: auto;
    margin-top: 0 !important;
    flex: 1 1 160px;
    min-width: 140px;
}

.ctv-row-title {
    font-size: 14px;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.45;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ctv-row-sub {
    font-size: 12px;
    color: #1d4ed8;
    margin-top: 5px;
    font-weight: 800;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.ctv-row-id {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 5px;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.status-pill {
    flex-shrink: 0;
    padding: 9px 12px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
    margin-top: 2px;
}

.status-active {
    color: #047857;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.20);
}

.status-locked {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.16);
}

.admin-grid {
    display: grid;
    gap: 12px;
}

.floating-toast {
    position: fixed;
    left: 50%;
    top: 82px;
    transform: translateX(-50%) translateY(-10px);
    opacity: 0;
    background: linear-gradient(135deg, rgba(11,31,42,0.96), rgba(11,71,58,0.92));
    color: #fff;
    padding: 12px 18px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 800;
    z-index: 10000;
    box-shadow:
        0 18px 34px rgba(29, 78, 216, 0.16),
        0 10px 22px rgba(16, 185, 129, 0.12);
    transition: 0.28s ease;
    max-width: min(92vw, 420px);
    text-align: center;
    pointer-events: none;
}

.floating-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.tab-panel,
.adm-tab {
    display: none;
}

.tab-panel.active,
.adm-tab.active {
    display: block !important;
    animation: fadeIn 0.22s ease forwards;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.24);
    border-radius: 999px;
}

@keyframes modalShow {
    from {
        transform: translateY(12px) scale(0.98);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 520px) {
    .ctv-card {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .ctv-card .status-pill {
        justify-self: start;
    }

    .ctv-card .btn-secondary,
    .ctv-card .btn-done {
        flex: 1 1 100%;
        min-width: 0;
    }
}

@media (max-width: 767px) {
    .app-container {
        max-width: 100vw;
    }

    .sidebar {
        width: 74px;
        padding: 8px 6px;
    }

    .menu-item {
        min-height: 64px;
        gap: 4px;
        margin-bottom: 6px;
        border-radius: 14px;
        padding: 6px 4px;
    }

    .menu-item .icon {
        font-size: 18px;
    }

    .menu-item span:last-child {
        font-size: 8px;
        line-height: 1.15;
    }

    .admin-content {
        padding: 10px 10px calc(88px + var(--safe-bottom));
    }

    .section-title {
        font-size: 12px;
        margin-bottom: 4px;
    }

    .section-subtitle {
        font-size: 10px;
        line-height: 1.45;
    }

    .admin-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .card {
        min-height: 82px;
        padding: 12px;
        border-radius: 20px;
    }

    .card h3 {
        font-size: 11px;
        margin-bottom: 8px;
    }

    .card h1 {
        font-size: 18px;
        line-height: 1.15;
    }

    .stat-card-icon {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .hero-chip {
        font-size: 9px;
        padding: 6px 9px;
    }

    .log-container {
        height: 360px;
        padding: 8px;
    }

    .log-item {
        padding: 11px 12px;
        border-radius: 14px;
    }

    .log-time {
        font-size: 10px;
    }

    .log-text {
        font-size: 12px;
        line-height: 1.58;
    }

    .log-tag {
        font-size: 9px;
        padding: 4px 8px;
    }
}

@media (max-width: 420px) {
    .header {
        padding: 0 12px;
    }

    .hero-card h1 {
        font-size: 30px;
    }

    .history-row,
    .item-card {
        flex-direction: column;
        align-items: stretch;
    }

    .history-account {
        max-width: 100%;
        text-align: left;
    }

    .status-pill {
        align-self: flex-start;
    }

    .sidebar {
        width: 70px;
    }

    .menu-item span:last-child {
        font-size: 8px;
    }

    .admin-content {
        padding: 8px 8px calc(86px + var(--safe-bottom));
    }

    .admin-stats-grid {
        gap: 7px;
    }

    .card {
        min-height: 76px;
        padding: 10px;
    }

    .card h3 {
        font-size: 10px;
    }

    .card h1 {
        font-size: 16px;
    }

    .panel-head {
        margin-bottom: 10px;
    }

    .section-subtitle {
        font-size: 10px;
    }
}

@media (min-width: 768px) {
    .app-container {
        max-width: 1100px;
    }

    .header {
        padding: 0 20px;
    }

    .bottom-nav {
        max-width: 1100px;
    }

    .main-content {
        padding: 20px 20px calc(105px + var(--safe-bottom));
    }

    .admin-content {
        padding: 20px 20px calc(105px + var(--safe-bottom));
    }

    .admin-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sidebar {
        width: 108px;
    }

    .menu-item {
        min-height: 78px;
    }

    .card {
        min-height: 110px;
    }

    .card h1 {
        font-size: 24px;
    }

    .section-subtitle {
        font-size: 12px;
    }
}