:root {
    --brand-color: #E0EC89;
    --brand-color-dark: #c5d470;
    --brand-color-light: #f5f9e0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: #f1f5f9;
    color: #1e293b;
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1920px;
    margin: 0 auto;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo svg {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(34, 149, 204, 0.2));
}

.logo img {
    height: 40px;
    width: auto; /* 保持原始宽高比 */
}

.nav-title {
    color: var(--brand-color);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 15px;
}

.user-role {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.logout-button {
    padding: 10px 20px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-button:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Main Container */
.main-container {
    display: flex;
    max-width: 1920px;
    margin: 0 auto;
    min-height: calc(100vh - 73px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: white;
    border-right: 1px solid #e2e8f0;
    padding: 24px 0;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 16px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.menu-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.menu-item.active {
    background: var(--brand-color);
    color: #000000;
    font-weight: 700;
}

.menu-item.active svg {
    color: #000000;
}

.menu-item.active:hover {
    background: var(--brand-color);
    color: #000000;
}

.menu-item svg {
    flex-shrink: 0;
}

/* Content */
.content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
}

.welcome-section {
    max-width: 1200px;
    margin: 0 auto;
}

.welcome-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
}

.welcome-section > p {
    color: #64748b;
    font-size: 16px;
    margin-bottom: 40px;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.info-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    border-color: var(--brand-color);
}

.card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--brand-color) 0%, var(--brand-color-dark) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.card-icon svg {
    color: white;
}

.info-card h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.info-card p {
    color: #64748b;
    font-size: 15px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    
    .content {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 16px 20px;
    }
    
    .nav-title {
        font-size: 20px;
    }
    
    .user-info {
        display: none;
    }
    
    .sidebar {
        position: fixed;
        left: -260px;
        height: 100vh;
        transition: left 0.3s ease;
        z-index: 50;
    }
    
    .content {
        padding: 20px;
    }
    
    .welcome-section h2 {
        font-size: 24px;
    }
    
    .info-cards {
        grid-template-columns: 1fr;
    }
}

/* Under Development Page */
.under-development {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 60px 20px;
}

.dev-icon {
    color: var(--brand-color);
    opacity: 0.8;
    margin-bottom: 32px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.under-development h2 {
    font-size: 36px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
}

.under-development p {
    font-size: 18px;
    color: #64748b;
    max-width: 500px;
    line-height: 1.6;
    margin: 0;
}

/* Submenu Styles */
.menu-group {
    display: flex;
    flex-direction: column;
}

.menu-item.has-submenu {
    position: relative;
    display: flex;
    justify-content: flex-start;
}

.submenu-icon {
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: auto;
}

.menu-item.has-submenu.expanded .submenu-icon {
    transform: rotate(90deg);
}

.submenu {
    display: none;
    flex-direction: column;
    gap: 2px;
    padding-left: 32px;
    margin-top: 4px;
}

.submenu.open {
    display: flex;
}

.submenu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #64748b;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.submenu-item:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.submenu-item.active {
    background: var(--brand-color);
    color: #000000;
    font-weight: 700;
}

.submenu-item.active svg {
    color: #000000;
}

.submenu-item.active:hover {
    background: var(--brand-color);
    color: #000000;
}

/* Page Containers */
.page-container {
    display: none;
}

.page-container.active {
    display: block;
}

/* Sales Page Styles */
.sales-page {
    max-width: 1400px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

/* Update Time Display */
.update-time-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #64748b;
    background: #f8fafc;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 8px;
}

.update-label {
    font-weight: 600;
    color: #475569;
}

.update-value {
    font-weight: 500;
    color: #64748b;
}

.sales-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
}

.sales-page .page-header h1 {
    flex: 1;
}

.sales-page .update-time-display {
    margin-top: 0;
}

.products-page .header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.inventory-page .header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

/* Time Range Controls */
.time-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 24px;
    flex-wrap: wrap;
}

/* Country Selector */
.country-selector {
    display: flex;
    align-items: center;
    gap: 12px;
}

.country-label {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

/* Custom Select Dropdown */
.custom-select {
    position: relative;
    min-width: 200px;
    user-select: none;
}

.select-selected {
    padding: 10px 40px 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.select-selected:after {
    content: "▼";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #64748b;
    transition: transform 0.2s ease;
}

.select-selected.select-arrow-active:after {
    transform: translateY(-50%) rotate(180deg);
}

.select-selected:hover {
    border-color: #cbd5e1;
}

.custom-select:focus-within .select-selected {
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(224, 236, 137, 0.1);
}

.select-items {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 99;
    max-height: 300px;
    overflow-y: auto;
}

.select-items.select-hide {
    display: none;
}

.select-option {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #1e293b;
    transition: all 0.15s ease;
}

.select-option:hover {
    background: #f8fafc;
    color: #000000;
}

.select-option.selected {
    background: var(--brand-color);
    color: #000000;
    font-weight: 600;
}

/* Scrollbar for select items */
.select-items::-webkit-scrollbar {
    width: 6px;
}

.select-items::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.select-items::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.select-items::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.time-range-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.time-btn {
    padding: 10px 24px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #475569;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.time-btn:hover {
    border-color: var(--brand-color);
    color: #1e293b;
    background: #f8fafc;
}

.time-btn.active {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #000000;
    box-shadow: 0 2px 4px rgba(224, 236, 137, 0.3);
}

/* Custom Date Range */
.custom-date-range {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.date-input {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: white;
    transition: all 0.2s ease;
    cursor: pointer;
    min-width: 150px;
}

.date-input:hover {
    border-color: #cbd5e1;
}

.date-input:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(224, 236, 137, 0.1);
}

.date-separator {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.query-btn {
    padding: 10px 32px;
    background: var(--brand-color);
    color: #000000;
    border: 2px solid var(--brand-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(224, 236, 137, 0.2);
}

.query-btn:hover {
    background: #d4e070;
    border-color: #d4e070;
    box-shadow: 0 4px 6px rgba(224, 236, 137, 0.3);
}

.query-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(224, 236, 137, 0.2);
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chart-container canvas {
    height: 500px !important;
    max-height: 500px;
}

/* Products Page Styles */
.products-page {
    max-width: 1800px;
    margin: 0 auto;
}

.products-page .page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.products-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-input {
    padding: 10px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: white;
    transition: all 0.2s ease;
    min-width: 300px;
}

.search-input:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(224, 236, 137, 0.1);
}

.page-size-select {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    color: #1e293b;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
}

.page-size-select:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(224, 236, 137, 0.1);
}

.page-size-select:hover {
    border-color: var(--brand-color);
}

.products-table-container {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.products-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

.products-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.products-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #000000;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #f8fafc;
    z-index: 10;
}

/* Fixed columns */
.products-table th:nth-child(1),
.products-table th:nth-child(2),
.products-table th:nth-child(3),
.products-table td:nth-child(1),
.products-table td:nth-child(2),
.products-table td:nth-child(3) {
    position: sticky;
    background: white;
    z-index: 5;
}

.products-table th:nth-child(1),
.products-table td:nth-child(1) {
    left: 0;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
}

.products-table th:nth-child(2),
.products-table td:nth-child(2) {
    left: 80px;
    width: 120px;
    min-width: 120px;
    box-shadow: 1px 0 0 #e2e8f0;
}

.products-table th:nth-child(3),
.products-table td:nth-child(3) {
    left: 200px;
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.products-table thead th:nth-child(1),
.products-table thead th:nth-child(2),
.products-table thead th:nth-child(3) {
    background: #f8fafc;
    z-index: 15;
}

.products-table tbody tr:hover td:nth-child(1),
.products-table tbody tr:hover td:nth-child(2),
.products-table tbody tr:hover td:nth-child(3) {
    background: #f8fafc;
}

.products-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.products-table th.sortable:hover {
    background: #f1f5f9;
}

.products-table th.sortable::after {
    content: "⇅";
    font-size: 12px;
    color: #000000;
    margin-left: 6px;
    opacity: 0.4;
    display: inline-block;
    transition: opacity 0.2s ease;
}

.products-table th.sortable:hover::after {
    opacity: 0.8;
    color: #000000;
}

.products-table th.sort-asc::after {
    content: " ▲";
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    margin-left: 6px;
    opacity: 1;
    display: inline-block;
}

.products-table th.sort-desc::after {
    content: " ▼";
    font-size: 14px;
    font-weight: 700;
    color: #000000;
    margin-left: 6px;
    opacity: 1;
    display: inline-block;
}

.products-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b;
    white-space: nowrap;
    background: white;
}

.products-table tbody tr {
    transition: background 0.15s ease;
}

.products-table tbody tr:hover {
    background: #f8fafc;
}

.products-table .image-cell {
    width: 80px;
    padding: 8px;
}

.product-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    font-size: 10px;
    color: #94a3b8;
    text-align: center;
}

.product-name-cell {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.price-cell {
    font-weight: 600;
    color: #059669;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: 13px;
}

.number-cell {
    text-align: right;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
}

.level-cell {
    text-align: center;
}

.sales-level {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
}

.sales-level.s {
    background: #dcfce7;
    color: #166534;
}

.sales-level.a {
    background: #dbeafe;
    color: #1e40af;
}

.sales-level.b {
    background: #fef3c7;
    color: #92400e;
}

.sales-level.c {
    background: #fee2e2;
    color: #991b1b;
}

.loading-cell,
.empty-cell,
.error-cell {
    text-align: center;
    padding: 40px;
    color: #64748b;
    font-size: 14px;
}

.error-cell {
    color: #ef4444;
}

.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 16px 24px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 16px;
}

.pagination-info {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #475569;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--brand-color);
    color: #1e293b;
    background: #f8fafc;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

.page-number-btn {
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #475569;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 36px;
}

.page-number-btn:hover {
    border-color: var(--brand-color);
    color: #1e293b;
    background: #f8fafc;
}

.page-number-btn.active {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #000000;
}

@media (max-width: 1400px) {
    .products-table-container {
        overflow-x: auto;
    }
    
    .products-table {
        min-width: 1400px;
    }
}

/* Overview Page Styles */
.overview-page {
    max-width: 1400px;
    margin: 0 auto;
}

.overview-page .page-header {
    margin-bottom: 24px;
}

.todo-list-container {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
}

.todo-list-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e2e8f0;
}

.todo-list-title {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    transition: all 0.2s ease;
}

.todo-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.todo-item.updating {
    opacity: 0.6;
    pointer-events: none;
    border-color: var(--brand-color);
}

.todo-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.todo-item-image {
    flex-shrink: 0;
}

.product-image-small {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.no-image-small {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    font-size: 9px;
    color: #94a3b8;
    text-align: center;
}

.todo-item-info {
    flex: 1;
    min-width: 150px;
}

.todo-item-sku {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2px;
}

.todo-item-name {
    font-size: 11px;
    color: #475569;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.todo-item-price {
    font-size: 11px;
    color: #64748b;
}

.todo-item-cost-input {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.todo-item-cost-input label {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.cost-input {
    padding: 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #1e293b;
    background: white;
    width: 100px;
    transition: all 0.2s ease;
}

.cost-input:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px rgba(224, 236, 137, 0.1);
}

.cost-input:disabled {
    background: #f8fafc;
    cursor: not-allowed;
}

.update-cost-btn {
    padding: 6px 16px;
    background: var(--brand-color);
    color: #000000;
    border: 1px solid var(--brand-color);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.update-cost-btn:hover:not(:disabled) {
    background: #d4e070;
    border-color: #d4e070;
    box-shadow: 0 2px 4px rgba(224, 236, 137, 0.3);
}

.update-cost-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #000000;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

@media (max-width: 768px) {
    .todo-item-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .todo-item-cost-input {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .cost-input {
        width: 100%;
    }
    
    .update-cost-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Inventory Page Styles */
.inventory-page {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.inventory-page .page-header {
    margin-bottom: 32px;
}

.inventory-page .page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    margin: 0;
}

.inventory-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.summary-card {
    background: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--brand-color);
}

.summary-card:hover::before {
    opacity: 1;
}

.summary-card.card-primary {
    border-left: 4px solid #3b82f6;
}

.summary-card.card-primary:hover {
    border-left-color: #2563eb;
}

.summary-card.card-success {
    border-left: 4px solid #10b981;
}

.summary-card.card-success:hover {
    border-left-color: #059669;
}

.summary-card.card-warning {
    border-left: 4px solid #f59e0b;
}

.summary-card.card-warning:hover {
    border-left-color: #d97706;
}

.summary-card.card-info {
    border-left: 4px solid #06b6d4;
}

.summary-card.card-info:hover {
    border-left-color: #0891b2;
}

.summary-card.card-purple {
    border-left: 4px solid #8b5cf6;
}

.summary-card.card-purple:hover {
    border-left-color: #7c3aed;
}

.summary-label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: none;
    letter-spacing: 0.3px;
    line-height: 1.4;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    text-align: center;
}

.summary-value.summary-currency {
    color: #059669;
    font-size: 22px;
}

.monthly-table-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.monthly-table-container .table-header {
    padding: 24px 32px;
    border-bottom: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.monthly-table-container .table-header h2 {
    margin: 0 0 4px 0;
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
}

.table-subtitle {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    font-weight: 500;
}

.table-wrapper {
    overflow-x: auto;
}

.inventory-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.inventory-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.inventory-table th {
    padding: 14px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.inventory-table th.text-right {
    text-align: right;
}

.inventory-table td {
    padding: 14px 24px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #1e293b;
}

.inventory-table tbody tr {
    transition: background-color 0.2s ease;
}

.inventory-table tbody tr:hover {
    background: #f8fafc;
}

.inventory-table tbody tr:last-child td {
    border-bottom: none;
}

.inventory-table .number-cell {
    text-align: right;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
    color: #334155;
    padding-right: 24px;
}

.inventory-table .number-cell:has-text("¥") {
    color: #059669;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .inventory-summary {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 20px;
    }
    
    .summary-card {
        padding: 24px;
    }
    
    .summary-value {
        font-size: 28px;
    }
    
    .summary-value.summary-currency {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .inventory-page {
        padding: 20px;
    }
    
    .inventory-summary {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .monthly-table-container {
        border-radius: 12px;
    }
    
    .monthly-table-container .table-header {
        padding: 20px;
    }
    
    .inventory-table {
        font-size: 12px;
    }
    
    .inventory-table th,
    .inventory-table td {
        padding: 12px 8px;
    }
}

/* Finance Page Styles */
.finance-page {
    padding: 32px;
    max-width: 1600px;
    margin: 0 auto;
}

.finance-page .page-header {
    margin-bottom: 32px;
}

.finance-page .page-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
}

.finance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.finance-card {
    background: white;
    padding: 20px 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.finance-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--brand-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.finance-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: var(--brand-color);
}

.finance-card:hover::before {
    opacity: 1;
}

.finance-card.card-primary {
    border-left: 4px solid #3b82f6;
}

.finance-card.card-primary:hover {
    border-left-color: #2563eb;
}

.finance-card.card-success {
    border-left: 4px solid #10b981;
}

.finance-card.card-success:hover {
    border-left-color: #059669;
}

.finance-card.card-warning {
    border-left: 4px solid #f59e0b;
}

.finance-card.card-warning:hover {
    border-left-color: #d97706;
}

.finance-card.card-info {
    border-left: 4px solid #06b6d4;
}

.finance-card.card-info:hover {
    border-left-color: #0891b2;
}

.finance-card.card-secondary {
    border-left: 4px solid #64748b;
}

.finance-card.card-secondary:hover {
    border-left-color: #475569;
}

.finance-card.card-purple {
    border-left: 4px solid #8b5cf6;
}

.finance-card.card-purple:hover {
    border-left-color: #7c3aed;
}

.finance-card.card-purple .finance-value {
    color: #7c3aed;
}

.finance-card.card-orange {
    border-left: 4px solid #f97316;
}

.finance-card.card-orange:hover {
    border-left-color: #ea580c;
}

.finance-card.card-orange .finance-value {
    color: #ea580c;
}

.finance-card.card-green-dark {
    border-left: 4px solid #16a34a;
}

.finance-card.card-green-dark:hover {
    border-left-color: #15803d;
}

.finance-card.card-green-dark .finance-value {
    color: #15803d;
}

.finance-label {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.finance-value {
    font-size: 28px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
    margin-bottom: 8px;
}

.finance-card.card-success .finance-value {
    color: #059669;
}

.finance-card.card-warning .finance-value {
    color: #d97706;
}

.finance-card.card-info .finance-value {
    color: #0891b2;
}

.finance-card.card-secondary .finance-value {
    color: #475569;
}

.finance-description {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.5;
    margin-top: auto;
}

.finance-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.finance-table thead {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.finance-table th {
    padding: 14px 24px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.finance-table th.text-right {
    text-align: right;
}

.finance-table td {
    padding: 14px 24px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    color: #1e293b;
}

.finance-table tbody tr {
    transition: background-color 0.2s ease;
}

.finance-table tbody tr:hover {
    background: #f8fafc;
}

.finance-table tbody tr:last-child td {
    border-bottom: none;
}

.finance-table .text-right {
    text-align: right;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    font-weight: 500;
    color: #334155;
}

/* Responsive Finance Page */
@media (max-width: 1024px) {
    .finance-cards {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
    }
    
    .finance-card {
        padding: 18px 20px;
    }
    
    .finance-value {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .finance-page {
        padding: 20px;
    }
    
    .finance-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .finance-table {
        font-size: 12px;
    }
    
    .finance-table th,
    .finance-table td {
        padding: 12px 8px;
    }
}

