*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #0a0d14;
    --surface: #111520;
    --surface2: #161b27;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);
    --accent: #25D366;
    --accent-glow: rgba(37, 211, 102, 0.25);
    --accent-dark: #1aab51;
    --blue: #4f8ef7;
    --blue-glow: rgba(79, 142, 247, 0.25);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.25);
    --text-1: #f1f5f9;
    --text-2: #94a3b8;
    --text-3: #475569;
    --font: 'Inter', sans-serif;
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-w: 260px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.6);
}

html,
body {
    height: 100%;
    background: var(--bg);
    color: var(--text-1);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.6;
    overflow: hidden;
}

/* ── Animated BG Blobs ─────────────── */
.bg-blobs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    animation: blobFloat 12s ease-in-out infinite alternate;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: #25D366;
    top: -150px;
    left: -150px;
    animation-delay: 0s;
}

.blob-2 {
    width: 400px;
    height: 400px;
    background: #4f8ef7;
    bottom: -120px;
    right: -120px;
    animation-delay: -4s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: #a855f7;
    top: 40%;
    left: 40%;
    animation-delay: -8s;
}

@keyframes blobFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(40px, 30px) scale(1.1);
    }
}

/* ── Layout ────────────────────────── */
.app {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100vh;
}

/* ── Sidebar ───────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 24px 0;
    gap: 8px;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #25D366, #1aab51);
    border-radius: 10px;
    display: grid;
    place-items: center;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.logo-icon svg {
    width: 24px;
    height: 24px;
}

.logo-text h1 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-1);
}

.logo-text span {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 10px;
    color: var(--text-2);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all .2s ease;
    position: relative;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: var(--surface2);
    color: var(--text-1);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(37, 211, 102, 0.05));
    color: var(--accent);
    border: 1px solid rgba(37, 211, 102, 0.2);
}

.badge {
    margin-left: auto;
    background: var(--accent);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    padding: 0 5px;
}

.sidebar-status {
    margin: 0 12px;
    padding: 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--text-3);
    flex-shrink: 0;
    transition: background .3s, box-shadow .3s;
}

.status-indicator.connected {
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    animation: pulse 2s infinite;
}

.status-indicator.connecting {
    background: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    animation: pulse 1s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.status-text {
    display: flex;
    flex-direction: column;
}

.status-text span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
}

.status-text small {
    font-size: 11px;
    color: var(--text-3);
}

/* ── Main ──────────────────────────── */
.main {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
}

.main::-webkit-scrollbar {
    width: 6px;
}

.main::-webkit-scrollbar-track {
    background: transparent;
}

.main::-webkit-scrollbar-thumb {
    background: var(--border-hover);
    border-radius: 3px;
}

.tab-content {
    display: none;
    animation: fadeIn .3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Page Header ───────────────────── */
.page-header {
    margin-bottom: 32px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-1);
}

.page-header p {
    color: var(--text-2);
    font-size: 14px;
    margin-top: 4px;
}

/* ── Method Cards ──────────────────── */
.method-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    max-width: 780px;
}

.method-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all .25s ease;
    position: relative;
    overflow: hidden;
}

.method-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .25s;
}

#card-qr::before {
    background: radial-gradient(ellipse at 30% 50%, var(--accent-glow), transparent 70%);
}

#card-pairing::before {
    background: radial-gradient(ellipse at 30% 50%, var(--blue-glow), transparent 70%);
}

.method-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.method-card:hover::before {
    opacity: 1;
}

.method-card:active {
    transform: translateY(0);
}

.method-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.method-icon svg {
    width: 26px;
    height: 26px;
}

.qr-icon {
    background: rgba(37, 211, 102, 0.15);
    color: var(--accent);
}

.phone-icon {
    background: rgba(79, 142, 247, 0.15);
    color: var(--blue);
}

.method-info {
    flex: 1;
}

.method-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 4px;
}

.method-info p {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.5;
}

.method-arrow {
    color: var(--text-3);
    flex-shrink: 0;
}

.method-arrow svg {
    width: 20px;
    height: 20px;
    transition: transform .2s;
}

.method-card:hover .method-arrow svg {
    transform: translateX(4px);
}

/* ── Flow Panels ───────────────────── */
.flow-panel {
    animation: fadeIn .3s ease;
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-2);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: var(--font);
    margin-bottom: 24px;
    padding: 0;
    transition: color .2s;
}

.btn-back svg {
    width: 16px;
    height: 16px;
}

.btn-back:hover {
    color: var(--text-1);
}

.flow-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 560px;
}

.flow-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
}

.flow-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.flow-icon svg {
    width: 24px;
    height: 24px;
}

.flow-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-1);
}

.flow-header p {
    font-size: 13px;
    color: var(--text-2);
    margin-top: 2px;
}

/* QR Container */
.qr-container {
    background: #fff;
    border-radius: 12px;
    width: 240px;
    height: 240px;
    margin: 0 auto 28px;
    display: grid;
    place-items: center;
    position: relative;
    overflow: hidden;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #666;
}

.qr-placeholder span {
    font-size: 13px;
}

#qr-image {
    width: 220px;
    height: 220px;
    object-fit: contain;
}

/* Spinner */
.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Phone Form */
.phone-form {
    margin-bottom: 28px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color .2s;
}

.input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-prefix {
    padding: 13px 14px;
    color: var(--text-3);
    font-weight: 600;
    font-size: 16px;
    border-right: 1px solid var(--border);
}

.input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-1);
    font-size: 16px;
    font-family: var(--font);
    padding: 13px 16px;
    letter-spacing: .05em;
}

.input-wrapper input::placeholder {
    color: var(--text-3);
}

.input-hint {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 6px;
}

/* Pairing Code Display */
.pairing-display {
    text-align: center;
    margin-bottom: 28px;
}

.pairing-label {
    font-size: 13px;
    color: var(--text-2);
    font-weight: 500;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.pairing-code {
    font-size: 40px;
    font-weight: 800;
    letter-spacing: .2em;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
    background: rgba(37, 211, 102, 0.08);
    border: 2px solid rgba(37, 211, 102, 0.25);
    border-radius: 12px;
    padding: 16px 24px;
    margin-bottom: 16px;
    animation: codeIn .4s ease;
}

@keyframes codeIn {
    from {
        transform: scale(.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.pairing-timer {
    margin-bottom: 14px;
}

.timer-bar {
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 6px;
}

.timer-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    width: 100%;
    transition: width 1s linear;
}

.pairing-timer span {
    font-size: 12px;
    color: var(--text-3);
}

.pairing-instruction {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
}

/* Steps */
.flow-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    border-top: 1px solid var(--border);
    padding-top: 20px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--surface2);
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
    flex-shrink: 0;
}

.step span {
    font-size: 13px;
    color: var(--text-2);
}

/* ── Connected Panel ───────────────── */
.connected-panel {
    animation: fadeIn .4s ease;
}

.connected-card {
    background: var(--surface);
    border: 1px solid rgba(37, 211, 102, 0.2);
    border-radius: var(--radius);
    padding: 48px 32px;
    max-width: 480px;
    text-align: center;
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.05), var(--surface));
}

.connected-icon {
    font-size: 56px;
    margin-bottom: 16px;
}

.connected-card h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 8px;
}

.connected-card p {
    color: var(--text-2);
    font-size: 14px;
    margin-bottom: 28px;
}

.connected-commands {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 32px;
}

.cmd-chip {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 16px;
    font-size: 13px;
    font-family: 'Courier New', monospace;
    color: var(--accent);
    font-weight: 600;
}

/* ── Buttons ───────────────────────── */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
}

.btn-danger svg {
    width: 16px;
    height: 16px;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

.btn-ghost {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
}

.btn-ghost:hover {
    background: var(--border);
    color: var(--text-1);
}

/* ── Messages ──────────────────────── */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 720px;
}

.messages-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 20px;
    color: var(--text-3);
    text-align: center;
}

.messages-empty svg {
    width: 48px;
    height: 48px;
    opacity: .5;
}

.messages-empty p {
    font-size: 14px;
    max-width: 280px;
    line-height: 1.6;
}

.message-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    animation: slideIn .25s ease;
    transition: border-color .2s;
}

.message-item:hover {
    border-color: var(--border-hover);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 15px;
    color: #000;
    flex-shrink: 0;
}

.msg-body {
    flex: 1;
    min-width: 0;
}

.msg-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.msg-sender {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
}

.msg-time {
    font-size: 11px;
    color: var(--text-3);
}

.msg-text {
    font-size: 14px;
    color: var(--text-1);
    word-break: break-word;
}

/* ── Toast ─────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 14px;
    color: var(--text-1);
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    opacity: 0;
    transition: all .3s ease;
    z-index: 100;
    max-width: 320px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    border-color: rgba(37, 211, 102, 0.3);
    color: var(--accent);
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

/* ── Invoice Tab ────────────────────── */
.invoice-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: flex-start;
}

.invoice-form-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inv-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}

.inv-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 18px;
}

.inv-section-title svg {
    width: 15px;
    height: 15px;
    color: var(--accent);
}

.inv-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.inv-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.inv-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.inv-field label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.inv-field input,
.inv-field select,
.inv-field textarea {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-1);
    font-family: var(--font);
    font-size: 13px;
    padding: 10px 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

.inv-field input:focus,
.inv-field select:focus,
.inv-field textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.inv-field input::placeholder,
.inv-field textarea::placeholder {
    color: var(--text-3);
}

.inv-field select {
    cursor: pointer;
}

.inv-field textarea {
    resize: vertical;
    min-height: 64px;
}

.inv-field input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.5);
    cursor: pointer;
}

/* Items Table */
.items-table-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.items-table-head {
    display: grid;
    grid-template-columns: 1fr 70px 110px 100px 36px;
    gap: 0;
    background: var(--surface2);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.item-row {
    display: grid;
    grid-template-columns: 1fr 70px 110px 100px 36px;
    gap: 0;
    border-top: 1px solid var(--border);
    padding: 8px 12px;
    align-items: center;
    animation: slideIn .2s ease;
}

.item-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.item-row input {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text-1);
    font-family: var(--font);
    font-size: 13px;
    padding: 6px 8px;
    outline: none;
    width: 100%;
    transition: border-color .2s;
}

.item-row input:focus {
    border-color: var(--accent);
    background: var(--surface2);
}

.item-row input::placeholder {
    color: var(--text-3);
}

.item-total-cell {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    padding: 0 8px;
}

.btn-del-item {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: grid;
    place-items: center;
    transition: color .2s;
}

.btn-del-item:hover {
    color: var(--danger);
}

.btn-del-item svg {
    width: 14px;
    height: 14px;
}

.btn-add-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 211, 102, 0.07);
    border: 1px dashed rgba(37, 211, 102, 0.25);
    border-radius: 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font);
    padding: 10px 16px;
    cursor: pointer;
    transition: all .2s;
    width: 100%;
    justify-content: center;
}

.btn-add-item svg {
    width: 15px;
    height: 15px;
}

.btn-add-item:hover {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.4);
}

/* Summary Card */
.invoice-summary-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.inv-summary-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: sticky;
    top: 0;
}

.inv-summary-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 20px;
}

.inv-summary-rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.inv-sum-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-2);
}

.inv-sum-row span:last-child {
    font-weight: 600;
    color: var(--text-1);
}

.inv-sum-divider {
    height: 1px;
    background: var(--border);
}

.inv-sum-grand {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1);
}

.inv-sum-grand span:last-child {
    color: var(--accent);
    font-size: 16px;
}

.text-danger {
    color: var(--danger) !important;
}

.inv-send-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(37, 211, 102, 0.06);
    border: 1px solid rgba(37, 211, 102, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 16px;
}

.inv-send-info svg {
    width: 14px;
    height: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.btn-send-invoice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #000;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 4px 16px var(--accent-glow);
    margin-bottom: 10px;
}

.btn-send-invoice svg {
    width: 16px;
    height: 16px;
}

.btn-send-invoice:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

.btn-send-invoice:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.btn-reset-invoice {
    width: 100%;
    padding: 10px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-3);
    font-size: 13px;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
}

.btn-reset-invoice:hover {
    background: var(--surface2);
    color: var(--text-2);
}

.inv-log-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.inv-log-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-2);
    animation: slideIn .2s ease;
}

.inv-log-item:last-child {
    border-bottom: none;
}

.inv-log-item strong {
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
}

/* ── Multi-Recipient UI ─────────────── */
.recipients-count {
    font-size: 11px;
    font-weight: 500;
    color: var(--accent);
    margin-left: 6px;
    text-transform: none;
    letter-spacing: 0;
}

.recipients-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
}

.recipient-row {
    display: flex;
    align-items: center;
    gap: 8px;
    animation: slideIn .2s ease;
}

.recipient-row .rec-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-size: 10px;
    font-weight: 800;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.recipient-row input {
    flex: 1;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-1);
    font-family: var(--font);
    font-size: 13px;
    padding: 9px 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.recipient-row input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.recipient-row input::placeholder {
    color: var(--text-3);
}

.recipient-row .rec-label {
    font-size: 11px;
    color: var(--text-3);
    font-weight: 600;
    min-width: 44px;
}

.btn-del-recipient {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 5px;
    border-radius: 6px;
    display: grid;
    place-items: center;
    transition: color .2s, background .2s;
    flex-shrink: 0;
}

.btn-del-recipient:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.08);
}

.btn-del-recipient svg {
    width: 14px;
    height: 14px;
}

.btn-add-recipient {
    display: flex;
    align-items: center;
    gap: 7px;
    background: rgba(79, 142, 247, 0.07);
    border: 1px dashed rgba(79, 142, 247, 0.3);
    border-radius: 8px;
    color: var(--blue);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    padding: 8px 14px;
    cursor: pointer;
    transition: all .2s;
    margin-bottom: 6px;
}

.btn-add-recipient svg {
    width: 13px;
    height: 13px;
}

.btn-add-recipient:hover {
    background: rgba(79, 142, 247, 0.12);
    border-color: rgba(79, 142, 247, 0.5);
}

/* ── API Docs Tab ───────────────────── */
.inline-code {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 5px;
    padding: 2px 7px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--accent);
}

.api-base-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
}

.dot-green {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
    display: inline-block;
    flex-shrink: 0;
    animation: pulse 2s infinite;
}

.docs-layout {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 24px;
    align-items: flex-start;
}

/* Docs Left Nav */
.docs-sidebar {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 12px;
    position: sticky;
    top: 0;
}

.docs-group-label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 8px 6px;
}

.docs-link {
    display: block;
    padding: 8px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    color: var(--text-2);
    text-decoration: none;
    transition: background .15s, color .15s;
    word-break: break-all;
}

.docs-link:hover {
    background: var(--surface2);
    color: var(--accent);
}

/* Endpoint Cards */
.docs-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ep-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    scroll-margin-top: 20px;
    transition: border-color .2s;
}

.ep-card:hover {
    border-color: var(--border-hover);
}

.ep-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 10px;
}

.method-badge {
    font-size: 11px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: .04em;
    flex-shrink: 0;
}

.method-badge.get {
    background: rgba(79, 142, 247, 0.15);
    color: var(--blue);
}

.method-badge.post {
    background: rgba(37, 211, 102, 0.15);
    color: var(--accent);
}

.method-badge.del {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.ep-path {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
}

.ep-desc {
    font-size: 13px;
    color: var(--text-3);
    margin-left: auto;
}

.ep-body {
    padding: 20px;
}

.ep-section-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 16px 0 8px;
}

.ep-body>.ep-section-title:first-child {
    margin-top: 0;
}

.code-block {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 14px 16px;
    font-family: 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.7;
    color: #a8b4c0;
    overflow-x: auto;
    margin: 0;
    white-space: pre;
}

.ep-note {
    background: rgba(79, 142, 247, 0.07);
    border: 1px solid rgba(79, 142, 247, 0.2);
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 12px;
    color: var(--blue);
    margin: 12px 0;
}

.ep-note-warn {
    background: rgba(239, 68, 68, 0.07);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

/* Params Table */
.params-table {
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.params-head {
    display: grid;
    grid-template-columns: 140px 80px 70px 1fr;
    gap: 0;
    background: var(--surface2);
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.params-row {
    display: grid;
    grid-template-columns: 140px 80px 70px 1fr;
    gap: 0;
    padding: 9px 14px;
    border-top: 1px solid var(--border);
    font-size: 12.5px;
    color: var(--text-2);
    align-items: center;
}

.params-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.params-row code {
    font-family: 'Courier New', monospace;
    color: var(--accent);
    font-size: 12px;
}

.req {
    color: var(--accent);
    font-weight: 700;
}

/* Try It */
.try-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 14px 0 10px;
}

.try-input {
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-1);
    font-family: var(--font);
    font-size: 13px;
    padding: 9px 12px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
    resize: vertical;
}

.try-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.try-input::placeholder {
    color: var(--text-3);
}

.btn-try {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: #000;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all .2s;
    box-shadow: 0 3px 12px var(--accent-glow);
    margin-top: 4px;
}

.btn-try:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 18px var(--accent-glow);
}

.btn-try:active {
    transform: translateY(0);
}

.btn-try:disabled {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}

.btn-try-danger {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    box-shadow: 0 3px 12px var(--danger-glow);
}

.btn-try-danger:hover {
    box-shadow: 0 5px 18px var(--danger-glow);
}

.try-response {
    margin-top: 12px;
    border-radius: 8px;
    overflow: hidden;
    animation: fadeIn .2s ease;
}

.try-response:empty {
    display: none;
}

.try-res-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
}

.try-res-bar.ok {
    background: rgba(37, 211, 102, 0.12);
    color: var(--accent);
    border-bottom: 1px solid rgba(37, 211, 102, 0.2);
}

.try-res-bar.err {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
}

.try-res-body {
    background: #0d1117;
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.7;
    color: #a8b4c0;
    overflow-x: auto;
    white-space: pre;
}

.try-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

/* ── AUTH & ADMIN VIEWS ── */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
    position: relative;
    z-index: 10;
}

.auth-card {
    background: var(--surface);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border);
    width: 380px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.auth-card h2 {
    margin-bottom: 10px;
    color: var(--text-base);
}

.auth-card p {
    margin-bottom: 30px;
    color: var(--text-muted);
    font-size: 14px;
}

.auth-form input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-base);
}

.auth-divider {
    margin: 20px 0;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.auth-divider span {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    padding: 0 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.admin-wrapper {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 30px;
    color: var(--text-base);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h2 {
    font-size: 28px;
}

.admin-stats {
    display: flex;
    gap: 20px;
}

.stat-card {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    flex: 1;
    text-align: center;
}

.stat-card h3 {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
}

.stat-card h1 {
    font-size: 36px;
    color: var(--text-base);
}

.admin-users-list {
    background: var(--surface);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.admin-users-list h3 {
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th,
td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border);
}

th {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

tr:last-child td {
    border-bottom: none;
}