/* ============================================
   THÔNG TIN THANH TOÁN & XUẤT HÓA ĐƠN
   Premium Infographic Stylesheet + QR Tabs
   ============================================ */

/* CSS Custom Properties */
:root {
    --blue-50: #eef4ff;
    --blue-100: #d8e8fc;
    --blue-200: #b8d4f8;
    --blue-300: #89b8f0;
    --blue-400: #5a9ae5;
    --blue-500: #3575d0;
    --blue-600: #2160be;
    --blue-700: #1d4ed8;
    --blue-800: #1e40af;
    --blue-900: #1e3a8a;

    --gradient-main: linear-gradient(180deg, #b8d4f2 0%, #8db8e8 12%, #6da0de 30%, #4d88d2 55%, #3570c0 80%, #2560b0 100%);

    --white: #ffffff;
    --white-90: rgba(255, 255, 255, 0.9);
    --white-80: rgba(255, 255, 255, 0.8);
    --white-70: rgba(255, 255, 255, 0.7);
    --white-60: rgba(255, 255, 255, 0.6);
    --white-40: rgba(255, 255, 255, 0.4);
    --white-20: rgba(255, 255, 255, 0.2);
    --white-10: rgba(255, 255, 255, 0.1);

    --green-500: #22c55e;
    --green-600: #16a34a;
    --red-500: #ef4444;
    --red-600: #dc2626;
    --amber-500: #f59e0b;

    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-icon: 0 4px 16px rgba(30, 64, 175, 0.2);
    --shadow-number: 0 4px 20px rgba(30, 64, 175, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 50%;

    --font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Reset & Base */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: linear-gradient(180deg, #e8f0fe 0%, #d0e2f7 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    color: #1a365d;
}

/* Page Wrapper */
.page-wrapper {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: var(--gradient-main);
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(30, 64, 175, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.1);
    padding-bottom: 0;
}

/* Decorative Dots */
.deco-dots {
    position: absolute;
    display: grid;
    grid-template-columns: repeat(3, 8px);
    gap: 6px;
    z-index: 2;
    opacity: 0.5;
}

.deco-dots.top-left { top: 20px; left: 20px; }
.deco-dots.top-right { top: 20px; right: 20px; }

.deco-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--white-40);
}

/* Background Circles */
.bg-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.bg-circle--1 {
    width: 200px; height: 200px;
    background: radial-gradient(circle, var(--white-10) 0%, transparent 70%);
    top: -60px; right: -60px;
    animation: float 8s ease-in-out infinite;
}

.bg-circle--2 {
    width: 160px; height: 160px;
    background: radial-gradient(circle, var(--white-10) 0%, transparent 70%);
    bottom: 200px; left: -40px;
    animation: float 10s ease-in-out infinite reverse;
}

.bg-circle--3 {
    width: 120px; height: 120px;
    background: radial-gradient(circle, var(--white-10) 0%, transparent 70%);
    top: 50%; right: -30px;
    animation: float 7s ease-in-out infinite 2s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(10px, -15px) scale(1.05); }
    66% { transform: translate(-5px, 10px) scale(0.95); }
}

/* ============================================
   HEADER
   ============================================ */
.header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 24px 20px;
}

.main-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.title-line {
    display: block;
    color: var(--white);
    font-weight: 900;
    font-size: 1.6rem;
    letter-spacing: 0.06em;
    text-shadow: 0 3px 12px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.15);
    line-height: 1.25;
}

.title-line--large { font-size: 1.7rem; }

.ampersand {
    color: #fbbf24;
    font-weight: 900;
}

/* ============================================
   TAB NAVIGATION
   ============================================ */
.tab-nav {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 6px;
    padding: 0 16px 16px;
    justify-content: center;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: 2px solid var(--white-20);
    border-radius: var(--radius-lg);
    background: var(--white-10);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--white-70);
    font-family: var(--font-family);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
    letter-spacing: 0.02em;
}

.tab-btn:hover {
    background: var(--white-20);
    color: var(--white);
    border-color: var(--white-40);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: var(--white);
    color: var(--blue-700);
    border-color: var(--white);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.tab-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ============================================
   TAB CONTENTS
   ============================================ */
.tab-content {
    display: none;
    position: relative;
    z-index: 1;
    animation: fadeTabIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeTabIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================
   PAYMENT METHODS (Tab 1)
   ============================================ */
.payment-methods {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 0 16px 28px;
    flex-wrap: wrap;
}

.method-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: default;
    transition: var(--transition-bounce);
    animation: fadeInUp 0.6s ease-out backwards;
}

.method-item[data-delay="0"] { animation-delay: 0.1s; }
.method-item[data-delay="1"] { animation-delay: 0.2s; }
.method-item[data-delay="2"] { animation-delay: 0.3s; }
.method-item[data-delay="3"] { animation-delay: 0.4s; }
.method-item[data-delay="4"] { animation-delay: 0.5s; }

.method-item:hover { transform: translateY(-4px) scale(1.05); }

.method-icon {
    width: 56px;
    height: 56px;
    background: var(--white-20);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    border: 1.5px solid var(--white-40);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: var(--transition-smooth);
}

.method-item:hover .method-icon {
    background: var(--white-40);
    box-shadow: var(--shadow-icon);
}

.method-icon svg { width: 32px; height: 32px; }

.method-label {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.05em;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 80px;
}

/* ============================================
   INFO SECTIONS (Tab 1)
   ============================================ */
.info-section {
    position: relative;
    z-index: 1;
    margin: 0 16px 20px;
    background: var(--white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.8s ease-out backwards;
}

.info-section--01 { animation-delay: 0.3s; }
.info-section--02 { animation-delay: 0.5s; }

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 20px 14px;
    background: linear-gradient(135deg, #e8f0fe 0%, #dbeafe 100%);
    border-bottom: 2px solid var(--blue-100);
    position: relative;
}

.section-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-number);
    position: relative;
}

.section-number::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-full);
    border: 2px solid var(--blue-300);
    opacity: 0.5;
}

.number-text {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -0.02em;
}

.section-title {
    flex: 1;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--blue-800);
    line-height: 1.5;
    letter-spacing: -0.01em;
}

.section-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.3);
}

.section-icon svg { width: 26px; height: 26px; }

.section-body {
    padding: 16px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.info-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f5ff 100%);
    border-radius: var(--radius-lg);
    border: 1px solid var(--blue-100);
    transition: var(--transition-smooth);
    position: relative;
}

.info-item::before {
    content: '●';
    position: absolute;
    top: 16px;
    left: -4px;
    font-size: 0.5rem;
    color: var(--blue-500);
    font-weight: 900;
}

.info-item:hover {
    border-color: var(--blue-300);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.1);
    transform: translateX(4px);
}

.info-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--blue-50), var(--blue-100));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blue-600);
    border: 1.5px solid var(--blue-200);
    transition: var(--transition-smooth);
}

.info-item:hover .info-icon {
    background: linear-gradient(135deg, var(--blue-100), var(--blue-200));
    color: var(--blue-700);
}

.info-icon svg { width: 30px; height: 30px; }

.info-content { flex: 1; min-width: 0; }

.info-content p {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #334155;
    font-weight: 450;
}

.highlight {
    color: var(--blue-700);
    font-weight: 700;
    position: relative;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--blue-400), var(--blue-600));
    border-radius: 1px;
    opacity: 0.4;
}

.highlight-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
    color: var(--white);
    font-weight: 800;
    font-size: 1.05rem;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.25);
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.highlight-amount {
    color: var(--blue-800);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.badge-warning {
    display: inline-block;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: var(--white);
    font-weight: 700;
    font-size: 0.8rem;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.25);
    letter-spacing: 0.02em;
}

/* ============================================
   QR SECTION (Tab 2 & 3)
   ============================================ */
.qr-section {
    padding: 0 16px 20px;
}

.qr-header {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.5s ease-out backwards;
}

.qr-header-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--blue-500), var(--blue-700));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.qr-header-icon--company {
    background: linear-gradient(135deg, #0d9488, #0f766e);
    box-shadow: 0 4px 14px rgba(13, 148, 136, 0.3);
}

.qr-header-icon svg {
    width: 28px;
    height: 28px;
}

.qr-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--blue-800);
    letter-spacing: -0.01em;
}

.qr-subtitle {
    font-size: 0.78rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}

/* QR Form Card */
.qr-form-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 20px;
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.6s ease-out backwards;
    animation-delay: 0.1s;
    margin-bottom: 16px;
}

.qr-form-card.hidden { display: none; }

.form-group {
    margin-bottom: 14px;
}

.form-group:last-of-type {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--blue-800);
    margin-bottom: 6px;
    letter-spacing: 0.01em;
}

.form-optional {
    font-weight: 400;
    color: #94a3b8;
    font-size: 0.72rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--blue-100);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 500;
    color: #1e293b;
    background: linear-gradient(135deg, #f8faff 0%, #f0f5ff 100%);
    transition: var(--transition-smooth);
    outline: none;
}

.form-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.form-input:focus,
.form-select:focus {
    border-color: var(--blue-400);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: var(--white);
}

.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Generate Button */
.btn-generate {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--blue-600), var(--blue-800));
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(30, 64, 175, 0.3);
    letter-spacing: 0.02em;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(30, 64, 175, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

/* QR Display Card */
.qr-display-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    box-shadow: var(--shadow-card);
    text-align: center;
    margin-bottom: 16px;
    animation: fadeInUp 0.5s ease-out;
}

.qr-display-card.hidden { display: none; }

.qr-image-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.qr-image {
    width: 280px;
    height: auto;
    display: block;
    border-radius: var(--radius-lg);
    transition: var(--transition-smooth);
}

.qr-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg);
    font-size: 0.8rem;
    color: var(--blue-600);
    font-weight: 600;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.qr-loading.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--blue-100);
    border-top-color: var(--blue-600);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* QR Info Box */
.qr-info-box {
    background: linear-gradient(135deg, #f8faff, #f0f5ff);
    border: 1px solid var(--blue-100);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 16px;
    text-align: left;
}

.qr-info-box p {
    font-size: 0.78rem;
    line-height: 1.7;
    color: #475569;
    font-weight: 500;
}

.qr-info-box strong {
    color: var(--blue-700);
    font-weight: 700;
}

/* QR Actions */
.qr-actions {
    display: flex;
    gap: 8px;
}

.btn-action {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 12px;
    border: 2px solid var(--blue-100);
    border-radius: var(--radius-md);
    background: var(--white);
    color: var(--blue-700);
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-action:hover {
    background: var(--blue-50);
    border-color: var(--blue-300);
    transform: translateY(-1px);
}

.btn-save {
    border-color: #bbf7d0;
    color: var(--green-600);
}

.btn-save:hover {
    background: #f0fdf4;
    border-color: #86efac;
}

.btn-download {
    border-color: var(--blue-200);
    color: var(--blue-600);
}

.btn-download:hover {
    background: var(--blue-50);
    border-color: var(--blue-300);
}

.btn-new {
    border-color: #fde68a;
    color: #b45309;
}

.btn-new:hover {
    background: #fffbeb;
    border-color: #fbbf24;
}

/* ============================================
   SAVED QR SECTION
   ============================================ */
.saved-qr-section {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 16px 20px;
    box-shadow: var(--shadow-card);
    animation: fadeInUp 0.7s ease-out backwards;
    animation-delay: 0.2s;
}

.saved-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--blue-800);
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--blue-50);
}

.saved-title svg {
    color: var(--blue-500);
}

.saved-qr-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.empty-state {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    font-weight: 500;
    padding: 20px 0;
    font-style: italic;
}

/* Saved QR Item */
.saved-qr-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, #f8faff 0%, #f0f5ff 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--blue-100);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.saved-qr-item:hover {
    border-color: var(--blue-300);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.1);
    transform: translateX(4px);
}

.saved-qr-thumb {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--white);
    border: 1px solid var(--blue-100);
    overflow: hidden;
    flex-shrink: 0;
}

.saved-qr-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saved-qr-info {
    flex: 1;
    min-width: 0;
}

.saved-qr-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--blue-800);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-qr-detail {
    font-size: 0.7rem;
    color: #64748b;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.saved-qr-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.btn-mini {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
    background: var(--white);
}

.btn-mini:hover {
    transform: scale(1.1);
}

.btn-mini--view {
    color: var(--blue-500);
}

.btn-mini--view:hover {
    background: var(--blue-50);
}

.btn-mini--delete {
    color: var(--red-500);
}

.btn-mini--delete:hover {
    background: #fef2f2;
}

.btn-mini svg {
    width: 16px;
    height: 16px;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    position: relative;
    z-index: 1;
    margin: 8px 0 0;
    background: linear-gradient(135deg, #0c3266 0%, #164990 100%);
    padding: 20px 24px;
    animation: fadeInUp 1s ease-out backwards;
    animation-delay: 0.7s;
}

.footer-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-check {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    color: #4ade80;
    filter: drop-shadow(0 2px 6px rgba(74, 222, 128, 0.3));
}

.footer-check svg { width: 100%; height: 100%; }

.footer-text {
    flex: 1;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.04em;
    line-height: 1.7;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.footer-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    color: var(--white-60);
}

.footer-icon svg { width: 100%; height: 100%; }

/* ============================================
   TOAST NOTIFICATION
   ============================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: #1e293b;
    color: var(--white);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 600;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    pointer-events: auto;
    animation: toastIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), toastOut 0.3s ease-in 2.5s forwards;
    white-space: nowrap;
}

.toast--success { background: linear-gradient(135deg, var(--green-500), var(--green-600)); }
.toast--error { background: linear-gradient(135deg, var(--red-500), var(--red-600)); }
.toast--info { background: linear-gradient(135deg, var(--blue-600), var(--blue-800)); }

.toast svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (min-width: 640px) {
    body { padding: 40px 20px; }
    .page-wrapper { max-width: 580px; }
    .title-line { font-size: 1.8rem; }
    .title-line--large { font-size: 2.1rem; }
    .method-icon { width: 64px; height: 64px; }
    .method-icon svg { width: 36px; height: 36px; }
    .method-label { font-size: 0.65rem; }
    .payment-methods { gap: 16px; }
    .section-title { font-size: 0.95rem; }
    .info-content p { font-size: 0.9rem; }
    .footer-text { font-size: 0.72rem; }
    .tab-btn { padding: 12px 20px; font-size: 0.8rem; }
    .qr-image { width: 320px; }
}

@media (max-width: 380px) {
    .header { padding: 40px 16px 16px; }
    .title-line { font-size: 1.2rem; }
    .title-line--large { font-size: 1.4rem; }
    .payment-methods { gap: 8px; padding: 0 12px 20px; }
    .method-icon { width: 48px; height: 48px; }
    .method-icon svg { width: 26px; height: 26px; }
    .method-label { font-size: 0.55rem; }
    .info-section { margin: 0 10px 16px; }
    .section-header { padding: 14px 14px 12px; }
    .section-number { width: 40px; height: 40px; }
    .number-text { font-size: 0.95rem; }
    .section-title { font-size: 0.78rem; }
    .section-icon { width: 36px; height: 36px; }
    .section-icon svg { width: 22px; height: 22px; }
    .section-body { padding: 12px 14px 16px; }
    .info-item { padding: 12px; gap: 10px; }
    .info-icon { width: 44px; height: 44px; }
    .info-icon svg { width: 24px; height: 24px; }
    .info-content p { font-size: 0.78rem; }
    .footer { padding: 16px; }
    .footer-text { font-size: 0.6rem; }
    .tab-btn { padding: 8px 10px; font-size: 0.68rem; gap: 4px; }
    .tab-icon { width: 14px; height: 14px; }
    .qr-section { padding: 0 10px 16px; }
    .qr-image { width: 220px; }
    .qr-actions { flex-wrap: wrap; }
    .btn-action { font-size: 0.68rem; padding: 8px 8px; }
}

/* Print styles */
@media print {
    body { padding: 0; background: white; }
    .page-wrapper { box-shadow: none; border-radius: 0; max-width: 100%; }
    .bg-circle, .tab-nav, .toast-container { display: none; }
    .tab-content { display: block !important; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

*:focus-visible {
    outline: 3px solid var(--blue-400);
    outline-offset: 2px;
}

/* ============================================
   SYNC BAR & BUTTON
   ============================================ */
.sync-bar {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.btn-sync {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: var(--white);
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-family);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
    letter-spacing: 0.02em;
}

.btn-sync:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(99, 102, 241, 0.5);
}

.btn-sync:active {
    transform: translateY(0);
}

/* ============================================
   SYNC MODAL
   ============================================ */
.sync-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 0;
}

.sync-modal-overlay.active {
    opacity: 1;
}

.sync-modal-overlay.hidden {
    display: none !important;
}

.sync-modal {
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    background: var(--white);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.sync-modal-overlay.active .sync-modal {
    transform: translateY(0);
}

.sync-modal-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.sync-modal-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.sync-modal-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    letter-spacing: -0.01em;
}

.sync-modal-subtitle {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    margin-top: 2px;
}

.sync-modal-close {
    margin-left: auto;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border: none;
    border-radius: var(--radius-sm);
    color: #64748b;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.sync-modal-close:hover {
    background: #e2e8f0;
    color: #334155;
}

.sync-modal-body {
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Sync Stats */
.sync-stats {
    display: flex;
    gap: 10px;
}

.sync-stat {
    flex: 1;
    text-align: center;
    padding: 14px 10px;
    background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--blue-100);
}

.sync-stat-number {
    display: block;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--blue-700);
    line-height: 1;
    margin-bottom: 4px;
}

.sync-stat-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Sync Info Card */
.sync-info-card {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    border: 1px solid #fde68a;
    border-radius: var(--radius-md);
}

.sync-info-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.sync-info-text {
    font-size: 0.78rem;
    line-height: 1.6;
    color: #92400e;
}

.sync-info-text strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
    color: #78350f;
}

.sync-info-text p {
    margin: 2px 0;
}

.sync-info-text em {
    font-weight: 700;
    font-style: normal;
    color: #78350f;
}

/* Sync Actions Card */
.sync-actions-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-sync-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    border: none;
    border-radius: var(--radius-lg);
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    letter-spacing: 0.02em;
}

.btn-sync-export {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-sync-export:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-sync-restore {
    background: linear-gradient(135deg, var(--green-500), var(--green-600));
    color: var(--white);
    box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.btn-sync-restore:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.45);
}

/* Sync URL Display */
.sync-url-display {
    width: 100%;
    min-height: 80px;
    padding: 12px;
    border: 2px solid var(--blue-200);
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    color: #334155;
    background: #f8fafc;
    resize: none;
    word-break: break-all;
    line-height: 1.5;
}

.sync-url-display:focus {
    border-color: #6366f1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* Sync Restore Card */
.sync-restore-card {
    padding: 14px 16px;
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-md);
}

.sync-restore-info {
    font-size: 0.78rem;
    color: #166534;
    font-weight: 600;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Sync Danger Zone */
.sync-danger-zone {
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: center;
}

.btn-sync-danger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    color: #dc2626;
    font-family: var(--font-family);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.btn-sync-danger:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* ============================================
   BANK LOGO IN SAVED QR
   ============================================ */
.saved-qr-bank-logo {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    border-radius: 2px;
    margin-right: 4px;
    display: inline-block;
}

/* ============================================
   INVOICE / COMPANY INFO MODAL OVERRIDE
   ============================================ */
.clickable-info {
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    border-color: var(--blue-200);
}
.clickable-info:hover {
    background: #eff6ff;
}
.action-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 3px 12px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-check-api {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #0f766e, #0d9488);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0 20px;
    height: 48px; /* Match form-input height */
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    letter-spacing: 0.02em;
}

.btn-check-api:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
    background: linear-gradient(135deg, #0d9488, #14b8a6);
}

.btn-check-api:active {
    transform: translateY(0);
}

.btn-check-api.btn-loading {
    background: linear-gradient(135deg, #64748b, #475569);
    box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3);
    cursor: not-allowed;
    pointer-events: none;
}

@keyframes spin-slow {
    100% { transform: rotate(360deg); }
}

.icon-spin {
    animation: spin-slow 1s linear infinite;
}

.file-upload-box {
    border: 2px dashed var(--blue-300);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    background: #f8fafc;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.file-upload-box:hover {
    background: #f1f5f9;
    border-color: var(--blue-400);
}
#bill-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #64748b;
    font-size: 0.8rem;
    font-weight: 600;
}
.bill-preview {
    width: 100%;
    height: 140px;
    border-radius: var(--radius-sm);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

/* ============================================
   INVOICE HISTORY
   ============================================ */
.invoice-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.invoice-history-item {
    background: white;
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.invoice-history-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    border-bottom: 1px dashed #cbd5e1;
    padding-bottom: 6px;
}
.inv-time {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}
.inv-emp {
    font-size: 0.72rem;
    color: #0f766e;
    font-weight: 800;
}
.inv-mst {
    font-size: 0.9rem;
    font-weight: 800;
    color: var(--blue-700);
    margin-bottom: 2px;
}
.inv-company {
    font-size: 0.78rem;
    color: #1e293b;
    font-weight: 600;
    margin-bottom: 8px;
}
.inv-actions {
    display: flex;
    gap: 8px;
}

/* ============================================
   EXPORT TEMPLATE (Canvas)
   ============================================ */
.invoice-export-template {
    width: 500px;
    background: white;
    padding: 24px;
    border: 4px solid var(--blue-100);
    border-radius: 16px;
    font-family: var(--font-family);
    position: fixed;
    top: -9999px; /* Hide from viewport */
    left: 0;
    z-index: -1;
}
.export-header {
    text-align: center;
    margin-bottom: 16px;
    border-bottom: 2px solid var(--blue-600);
    padding-bottom: 12px;
}
.export-header h2 {
    color: var(--blue-800);
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 4px;
}
.export-meta {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
}
.export-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.exp-row {
    font-size: 0.9rem;
    line-height: 1.4;
    display: flex;
    gap: 12px;
    padding: 4px 0;
    border-bottom: 1px dashed #e2e8f0;
}
.exp-label {
    font-weight: 600;
    color: #475569;
    flex-shrink: 0;
    width: 105px;
}
.exp-val {
    font-weight: 500;
    color: #1e293b;
    word-break: break-all;
}
#exp-bill-img {
    max-width: 100%;
    max-height: 350px;
    border-radius: 8px;
    border: 2px solid #cbd5e1;
}

/* ============================================
   LOCK SCREEN
   ============================================ */
.lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.4s ease, visibility 0.4s;
    backdrop-filter: blur(8px);
}
.lock-screen.active {
    visibility: visible;
    opacity: 1;
}
.lock-box {
    background: white;
    padding: 32px 24px;
    border-radius: 20px;
    width: 90%;
    max-width: 320px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.lock-screen.active .lock-box {
    transform: translateY(0);
}
.lock-icon {
    width: 48px;
    height: 48px;
    color: #0f766e;
    margin-bottom: 12px;
}
.lock-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 4px;
}
.lock-subtitle {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 24px;
}
.pin-inputs {
    display: flex;
    justify-content: center;
    gap: 12px;
}
.pin-digit {
    width: 45px;
    height: 55px;
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f766e;
    outline: none;
    transition: 0.2s;
}
.pin-digit:focus {
    border-color: #0d9488;
    background: white;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}
.pin-digit.error {
    border-color: #ef4444;
    color: #ef4444;
    animation: shake 0.4s;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.copy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}
.copy-label {
    font-size: 0.8rem;
    color: #64748b;
    margin-bottom: 4px;
}
.copy-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
    word-break: break-all;
}
.btn-copy-line {
    background: #e0f2fe;
    color: #0284c7;
    border: none;
    border-radius: 6px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
}
.btn-copy-line:active {
    background: #bae6fd;
    transform: scale(0.95);
}

.hidden { display: none !important; }
