.invoice-page {
    min-height: 100vh;
    background: #f8fafc;
    color: #0f172a;
    font-family: "Roboto", "PingFang SC", "Microsoft Yahei", sans-serif;
}

.invoice-header {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.invoice-header-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1rem;
    height: 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.invoice-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.invoice-logo-icon {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #2563eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.invoice-logo h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.invoice-tagline {
    display: none;
    font-size: 0.875rem;
    color: #64748b;
}

@media (min-width: 640px) {
    .invoice-tagline {
        display: block;
    }
}

.invoice-main {
    max-width: 72rem;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .invoice-main {
        flex-direction: row;
        align-items: flex-start;
    }
}

.invoice-sidebar {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .invoice-sidebar {
        width: 16rem;
        max-width: 16rem;
        flex-basis: 16rem;
    }
}

.invoice-search-wrap {
    position: relative;
    box-sizing: border-box;
    max-width: 100%;
}

.invoice-search-sidebar {
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
}

.invoice-search-wrap input {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.invoice-search-wrap input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: inset 0 0 0 1px #3b82f6, 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.invoice-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 0.875rem;
}

.invoice-category-mobile {
    display: none;
}

.invoice-category-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.375rem;
}

.invoice-select-wrap {
    position: relative;
}

.invoice-category-select {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    padding: 0.75rem 2.25rem 0.75rem 0.875rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #0f172a;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.invoice-select-chevron {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
    font-size: 0.75rem;
}

.invoice-categories {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow: visible;
}

@media (max-width: 767px) {
    .invoice-main {
        padding: 1rem 0.75rem 1.5rem;
        gap: 1rem;
    }

    .invoice-header-inner {
        height: 3.5rem;
    }

    .invoice-logo h1 {
        font-size: 1.0625rem;
    }

    .invoice-sidebar {
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 1rem;
        padding: 1rem;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    }

    .invoice-search-sidebar {
        margin-bottom: 1rem;
    }

    .invoice-category-mobile {
        display: block;
    }

    .invoice-categories-desktop {
        display: none !important;
    }

    .invoice-content-head {
        flex-wrap: wrap;
    }

    .invoice-content-head h2 {
        font-size: 1.125rem;
        flex: 1 1 100%;
    }

    .invoice-count {
        flex-shrink: 0;
    }

    .invoice-regions {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.25rem;
        margin-bottom: 1rem;
        gap: 0.375rem;
    }

    .invoice-region-btn {
        flex-shrink: 0;
        padding: 0.5rem 0.875rem;
    }

    .invoice-card {
        padding: 1rem;
        border-radius: 0.875rem;
    }

    .invoice-card-action {
        width: 100%;
        text-align: center;
    }
}

@media (min-width: 768px) {
    .invoice-category-mobile {
        display: none;
    }
}

.invoice-cat-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 0.75rem;
    background: transparent;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    text-align: left;
    transition: background 0.15s, color 0.15s;
    font-size: 0.9375rem;
}

.invoice-cat-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.invoice-cat-btn.active {
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08);
    outline: 1px solid #dbeafe;
}

.invoice-cat-btn i {
    width: 1.25rem;
    text-align: center;
    color: #94a3b8;
}

.invoice-cat-btn.active i {
    color: #2563eb;
}

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

.invoice-content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    min-width: 0;
}

.invoice-content-head h2 {
    margin: 0;
    font-size: 1.25rem;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-count {
    font-size: 0.875rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
}

.invoice-regions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.invoice-region-btn {
    padding: 0.375rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
}

.invoice-region-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.invoice-region-btn.active {
    background: #1e293b;
    border-color: #1e293b;
    color: #fff;
}

.invoice-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 1280px) {
    .invoice-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.invoice-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: box-shadow 0.15s;
}

@media (min-width: 640px) {
    .invoice-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.invoice-card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.invoice-card-body {
    display: flex;
    gap: 1rem;
    min-width: 0;
}

.invoice-card-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: #f8fafc;
    border: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
}

.invoice-card h3 {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.invoice-card-region {
    font-size: 0.75rem;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.invoice-card-tax {
    font-family: ui-monospace, monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.invoice-card-action {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #f8fafc;
    color: #334155;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.invoice-card-action:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.invoice-empty {
    text-align: center;
    padding: 6rem 1rem;
    background: #fff;
    border: 1px dashed #e2e8f0;
    border-radius: 1.5rem;
}

.invoice-empty h3 {
    margin: 0 0 0.25rem;
}

.invoice-empty p {
    color: #64748b;
    margin: 0;
}

.invoice-empty button {
    margin-top: 1.5rem;
    border: none;
    background: none;
    color: #2563eb;
    font-weight: 500;
    cursor: pointer;
}

.invoice-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.invoice-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    z-index: 0;
}

.invoice-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 32rem;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-height: 90vh;
    overflow: auto;
}

.invoice-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.invoice-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
}

.invoice-modal-close {
    border: none;
    background: transparent;
    font-size: 1.25rem;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
}

.invoice-modal-close:hover {
    background: #f8fafc;
    color: #475569;
}

.invoice-modal-body {
    padding: 1.5rem;
}

.invoice-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
    .invoice-field {
        flex-direction: row;
        gap: 1rem;
    }
}

.invoice-field-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #64748b;
    flex-shrink: 0;
    width: 7rem;
    padding-top: 0.25rem;
}

.invoice-field-value {
    flex: 1;
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    align-items: flex-start;
}

.invoice-field-value span {
    word-break: break-all;
    font-weight: 500;
}

.invoice-copy-btn {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.375rem;
    flex-shrink: 0;
}

.invoice-copy-btn:hover {
    color: #2563eb;
    background: #eff6ff;
}

.invoice-modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
}

.invoice-copy-all {
    width: 100%;
    padding: 0.625rem 1rem;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
}

.invoice-copy-all:hover {
    background: #1d4ed8;
}

.invoice-hidden {
    display: none !important;
}
