* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    color: #e0e0e0;
    min-height: 100vh;
}

.container {
    display: flex;
    min-height: 100vh;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(90deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #4a7fd7;
}

header h1 {
    font-size: 1.8rem;
    color: #6ba3f5;
    font-weight: 700;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-info {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.status {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid transparent;
    backdrop-filter: blur(10px);
}

.status.connected {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
    border-color: rgba(76, 175, 80, 0.4);
}

.status.disconnected {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border-color: rgba(244, 67, 54, 0.4);
}

.auth-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(107, 163, 245, 0.15);
    color: #6ba3f5;
    border: 1px solid rgba(107, 163, 245, 0.3);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(107, 163, 245, 0.5);
}

.user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(107, 163, 245, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-btn,
.logout-btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(107, 163, 245, 0.4);
    background: rgba(107, 163, 245, 0.2);
    color: #6ba3f5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.login-btn:hover,
.logout-btn:hover {
    background: rgba(107, 163, 245, 0.3);
    border-color: #6ba3f5;
}

.logout-btn {
    background: rgba(244, 67, 54, 0.15);
    color: #ef5350;
    border-color: rgba(244, 67, 54, 0.3);
}

.logout-btn:hover {
    background: rgba(244, 67, 54, 0.25);
    border-color: #ef5350;
}

.auth-error-panel {
    grid-column: 1/-1;
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.1) 0%, rgba(244, 67, 54, 0.05) 100%);
    border: 2px solid rgba(244, 67, 54, 0.4);
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    max-width: 600px;
    margin: 2rem auto;
}

.auth-error-icon {
    font-size: 3rem;
}

.auth-error-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #ef5350;
}

.auth-error-message {
    font-size: 1.1rem;
    color: #b0b0b0;
    line-height: 1.6;
}

.auth-error-details {
    font-size: 0.95rem;
    color: #888;
    line-height: 1.6;
    max-width: 500px;
}

.auth-error-retry {
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    border: 1px solid rgba(107, 163, 245, 0.4);
    background: rgba(107, 163, 245, 0.2);
    color: #6ba3f5;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.auth-error-retry:hover {
    background: rgba(107, 163, 245, 0.3);
    border-color: #6ba3f5;
    transform: translateY(-2px);
}

.sidebar {
    position: fixed;
    left: 0;
    top: 80px;
    width: 220px;
    height: calc(100vh - 80px);
    background: linear-gradient(180deg, #1f1f1f 0%, #252525 100%);
    padding: 2rem 1rem;
    box-shadow: 4px 0 15px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
    z-index: 99;
    border-right: 1px solid #3a3a3a;
}

.nav-section h3 {
    margin-bottom: 1.2rem;
    color: #6ba3f5;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

.nav-btn {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(107, 163, 245, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-align: left;
    color: #b0b0b0;
    font-weight: 500;
}

.nav-btn:hover {
    background: rgba(107, 163, 245, 0.15);
    border-color: #6ba3f5;
    color: #e0e0e0;
    transform: translateX(2px);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(107, 163, 245, 0.3) 0%, rgba(107, 163, 245, 0.1) 100%);
    color: #6ba3f5;
    border-color: #6ba3f5;
    box-shadow: 0 0 10px rgba(107, 163, 245, 0.2);
}

main {
    margin-left: 220px;
    margin-top: 80px;
    flex: 1;
    padding: 2.5rem;
    overflow-y: auto;
}

.view {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    color: #6ba3f5;
    margin-bottom: 2.5rem;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Login Home Page */
.login-home-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 180px);
    padding: 2rem 0;
}

.login-home-card {
    background: linear-gradient(135deg, #252525 0%, #2a2a2a 100%);
    border: 1px solid #3a3a3a;
    border-radius: 16px;
    padding: 4rem 3rem;
    max-width: 1200px;
    width: calc(100% - 2rem);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    text-align: center;
    animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-home-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.login-home-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #6ba3f5;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.login-home-subtitle {
    font-size: 1.1rem;
    color: #a0a0a0;
    margin-bottom: 2.5rem;
    font-weight: 500;
}

.login-home-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

@media (max-width: 1024px) {
    .login-home-features {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .login-home-features {
        grid-template-columns: 1fr;
    }
}

.feature {
    background: rgba(107, 163, 245, 0.08);
    border: 1px solid rgba(107, 163, 245, 0.2);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(107, 163, 245, 0.15);
    border-color: rgba(107, 163, 245, 0.4);
    transform: translateY(-4px);
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.feature-text {
    font-size: 0.9rem;
    color: #b0b0b0;
    font-weight: 500;
    line-height: 1.4;
}

.login-home-btn {
    width: 100%;
    padding: 1.2rem 2rem;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 700;
    border: 2px solid #6ba3f5;
    background: linear-gradient(135deg, rgba(107, 163, 245, 0.2) 0%, rgba(107, 163, 245, 0.1) 100%);
    color: #6ba3f5;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.login-home-btn:hover {
    background: linear-gradient(135deg, rgba(107, 163, 245, 0.3) 0%, rgba(107, 163, 245, 0.2) 100%);
    border-color: #8bc4ff;
    box-shadow: 0 0 20px rgba(107, 163, 245, 0.3);
    transform: translateY(-2px);
}

.login-home-btn:active {
    transform: translateY(0);
}

.login-home-footer {
    font-size: 0.9rem;
    color: #888;
    line-height: 1.6;
}

.back-btn {
    background: rgba(107, 163, 245, 0.2);
    color: #6ba3f5;
    border: 1px solid rgba(107, 163, 245, 0.4);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    font-weight: 600;
    white-space: nowrap;
    width: fit-content;
    flex-shrink: 0;
}

.back-btn:hover {
    background: rgba(107, 163, 245, 0.3);
    border-color: #6ba3f5;
    transform: translateX(-4px);
}

.store-view-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.store-view-toolbar .back-btn {
    margin-bottom: 0;
}

.shop-limit-display {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.shop-limit-badge {
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.store-toolbar-btn {
    background: rgba(107, 163, 245, 0.12);
    color: #6ba3f5;
    border: 1px solid rgba(107, 163, 245, 0.35);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 0.8rem 1.5rem;
    font-size: 0.95rem;
}

.store-toolbar-btn:hover {
    background: rgba(107, 163, 245, 0.2);
    border-color: #6ba3f5;
}

.store-add-shop-panel {
    background: linear-gradient(135deg, #252525 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #3a3a3a;
    margin-bottom: 2rem;
    width: 100%;
    max-width: none;
}

.store-add-shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.store-add-shop-header h3 {
    color: #6ba3f5;
    font-size: 1.4rem;
}

.store-add-shop-close {
    background: rgba(107, 163, 245, 0.12);
    color: #6ba3f5;
    border: 1px solid rgba(107, 163, 245, 0.35);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.store-add-shop-close {
    padding: 0.65rem 1rem;
}

.store-add-shop-close:hover,
.store-toolbar-btn:hover {
    background: rgba(107, 163, 245, 0.2);
    border-color: #6ba3f5;
}

.store-add-shop-context {
    color: #a0a0a0;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.store-add-shop-section-title {
    color: #6ba3f5;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 1.25rem 0 1rem;
}

.store-add-shop-settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.store-add-shop-checkbox {
    margin-bottom: 1.5rem;
    color: #e0e0e0;
}

.store-add-shop-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
}

.store-add-shop-checkbox input {
    width: auto;
}

.card-action-btn {
    margin-top: 1rem;
    padding: 0.7rem 1rem;
    background: rgba(107, 163, 245, 0.12);
    color: #6ba3f5;
    border: 1px solid rgba(107, 163, 245, 0.35);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.card-action-btn:hover {
    background: rgba(107, 163, 245, 0.2);
    border-color: #6ba3f5;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.card {
    background: linear-gradient(135deg, #252525 0%, #2a2a2a 100%);
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 1.8rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card.server-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.server-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    border: 3px solid rgba(107, 163, 245, 0.3);
    object-fit: cover;
    transition: transform 0.3s ease;
}

.card.server-card:hover .server-icon {
    transform: scale(1.1);
    border-color: rgba(107, 163, 245, 0.6);
}

.server-icon-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 1rem;
    background: rgba(107, 163, 245, 0.1);
    border: 3px solid rgba(107, 163, 245, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #6ba3f5 0%, rgba(107, 163, 245, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(107, 163, 245, 0.2);
    border-color: rgba(107, 163, 245, 0.5);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    color: #6ba3f5;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.card-info {
    color: #a0a0a0;
    font-size: 0.9rem;
    line-height: 1.8;
}

.card-info div {
    margin-bottom: 0.5rem;
}

.card-badge {
    display: inline-block;
    background: rgba(107, 163, 245, 0.2);
    color: #6ba3f5;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-top: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(107, 163, 245, 0.3);
}

.card.server-card .card-info {
    text-align: center;
}

.loading {
    text-align: center;
    padding: 3rem;
    color: rgba(224, 224, 224, 0.6);
    font-size: 1.1rem;
}

.search-box {
    width: 100%;
    padding: 0.85rem 1.2rem;
    border: 1px solid rgba(107, 163, 245, 0.3);
    border-radius: 8px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.search-box::placeholder {
    color: rgba(224, 224, 224, 0.4);
}

.search-box:focus {
    outline: none;
    border-color: #6ba3f5;
    background: rgba(107, 163, 245, 0.1);
    box-shadow: 0 0 10px rgba(107, 163, 245, 0.2);
}


.inventory-overview {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(107, 163, 245, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(33, 37, 46, 0.92) 0%, rgba(24, 27, 34, 0.78) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.inventory-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.inventory-heading-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
}

.inventory-heading-group h2 {
    margin: 0;
}

.inventory-back-btn {
    margin: 0;
}

.inventory-controls {
    display: grid;
    gap: 0.75rem;
    width: min(100%, 380px);
}

.inventory-search-box {
    max-width: none;
    width: 100%;
}

.inventory-filter {
    background: rgba(30, 34, 42, 0.95);
    border: 1px solid rgba(107, 163, 245, 0.3);
    color: #e0e0e0;
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    min-width: 150px;
    width: 100%;
}

.inventory-filter:focus {
    outline: none;
    border-color: #6ba3f5;
}

.inventory-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.inventory-stat {
    background: linear-gradient(180deg, rgba(58, 72, 99, 0.26) 0%, rgba(37, 44, 56, 0.38) 100%);
    border: 1px solid rgba(107, 163, 245, 0.2);
    color: #d7e6ff;
    padding: 1rem 1.15rem;
    border-radius: 14px;
    min-height: 92px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.45rem;
}

.inventory-stat-label {
    color: rgba(160, 187, 230, 0.86);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inventory-stat-value {
    color: #70a2ff;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
}

.inventory-stat-value-compact {
    font-size: 0.9rem;
    line-height: 1.35;
    color: #dbeafe;
    font-weight: 700;
}

.inventory-stat-empty {
    color: rgba(224, 224, 224, 0.62);
}

.inventory-stat-space {
    min-width: 0;
}

.inventory-stat-title {
    color: rgba(160, 187, 230, 0.86);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.inventory-space-bar {
    position: relative;
    width: 100%;
    height: 2.1rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.82);
    border: 1px solid rgba(107, 163, 245, 0.16);
}

.inventory-space-bar.no-limit {
    border-style: dashed;
    background: rgba(17, 24, 39, 0.78);
}

.inventory-space-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.95) 0%, rgba(34, 197, 94, 0.9) 100%);
    transition: width 0.25s ease, background 0.25s ease;
}

.inventory-space-bar.over-capacity .inventory-space-bar-fill {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.95) 0%, rgba(248, 113, 113, 0.95) 100%);
}

.inventory-space-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    color: #f8fafc;
    font-size: 0.78rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75);
    letter-spacing: 0.02em;
}

.inventory-space-bar.no-limit .inventory-space-bar-text {
    color: rgba(224, 224, 224, 0.78);
    text-shadow: none;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.inventory-item {
    background: linear-gradient(135deg, #2a2a2a 0%, #252525 100%);
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.inventory-item-favorite-indicator {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.35) 0%, rgba(245, 158, 11, 0.22) 100%);
    border: 1px solid rgba(251, 191, 36, 0.68);
    color: #fde68a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.84rem;
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12);
    pointer-events: none;
    user-select: none;
}

.inventory-item:hover {
    border-color: rgba(107, 163, 245, 0.5);
    box-shadow: 0 0 15px rgba(107, 163, 245, 0.2);
    transform: translateY(-4px);
}

.inventory-item-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-icon-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.item-icon-emoji {
    font-size: 2rem;
    line-height: 1;
}

.item-name {
    font-weight: 600;
    color: #e0e0e0;
    font-size: 0.9rem;
    line-height: 1.2;
    word-break: break-word;
    flex: 1;
}

.inventory-item-owner {
    font-size: 0.7rem;
    letter-spacing: 0.02em;
    color: #86efac;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.28);
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
}

.inventory-item-owner-unassigned {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(248, 113, 113, 0.35);
}

.item-quantity-wrapper {
    display: grid;
    grid-template-columns: 28px 1fr 28px;
    align-items: center;
    width: 100%;
    min-height: 28px;
    column-gap: 0.5rem;
}

.item-quantity {
    background: linear-gradient(135deg, rgba(107, 163, 245, 0.3) 0%, rgba(107, 163, 245, 0.1) 100%);
    color: #6ba3f5;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(107, 163, 245, 0.3);
    justify-self: center;
}

.item-quantity.out-of-stock {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.35) 0%, rgba(220, 38, 38, 0.18) 100%);
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.45);
}

.out-of-stock-label {
    color: #f87171;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border: 1px solid rgba(248, 113, 113, 0.35);
    background: rgba(220, 38, 38, 0.12);
    border-radius: 999px;
}

.inventory-item-stats {
    width: 100%;
    display: grid;
    gap: 0.35rem;
    font-size: 0.74rem;
    color: #c7d2fe;
}

.inventory-item-stat {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.35rem;
}

.inventory-item-stat:first-child {
    border-top: none;
    padding-top: 0;
}

.inventory-item-stat-label {
    color: #8ea5c8;
}

.inventory-item-stat-value {
    color: #f3f4f6;
    font-weight: 600;
    text-align: right;
}

.inventory-item-edit-btn {
    background: rgba(107, 163, 245, 0.2);
    border: 1px solid rgba(107, 163, 245, 0.3);
    color: #6ba3f5;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.7rem;
    justify-self: end;
    opacity: 0;
    pointer-events: none;
}

.inventory-item-favorite-btn {
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.28);
    color: rgba(250, 204, 21, 0.85);
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    justify-self: start;
    opacity: 0;
    pointer-events: none;
}

.inventory-item-favorite-btn:hover {
    background: rgba(250, 204, 21, 0.22);
    border-color: rgba(250, 204, 21, 0.5);
}

.inventory-item-favorite-btn.active {
    background: linear-gradient(135deg, rgba(250, 204, 21, 0.3) 0%, rgba(245, 158, 11, 0.2) 100%);
    border-color: rgba(251, 191, 36, 0.7);
    color: #fcd34d;
}

.inventory-item-favorite {
    border-color: rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15), 0 10px 24px rgba(0, 0, 0, 0.22);
}

.inventory-item:hover .inventory-item-favorite-btn,
.inventory-item:hover .inventory-item-edit-btn,
.inventory-item:focus-within .inventory-item-favorite-btn,
.inventory-item:focus-within .inventory-item-edit-btn {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: none) {
    .inventory-item-favorite-btn,
    .inventory-item-edit-btn {
        opacity: 1;
        pointer-events: auto;
    }
}

.inventory-item-edit-btn:hover {
    background: rgba(107, 163, 245, 0.4);
    border-color: #6ba3f5;
}

.summary-overview {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 1px solid rgba(107, 163, 245, 0.12);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(33, 37, 46, 0.92) 0%, rgba(24, 27, 34, 0.78) 100%);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
}

.summary-topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.summary-heading-group {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.summary-heading-group h2 {
    margin: 0;
}

.summary-back-btn {
    margin: 0;
}

.summary-subtitle {
    margin: 0.45rem 0 0;
    color: rgba(224, 224, 224, 0.68);
    max-width: 720px;
}

.summary-period-toggle {
    display: inline-flex;
    gap: 0.4rem;
    padding: 0.35rem;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.78);
    border: 1px solid rgba(107, 163, 245, 0.16);
}

.summary-period-btn {
    border: none;
    background: transparent;
    color: rgba(224, 224, 224, 0.72);
    padding: 0.65rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s ease;
}

.summary-period-btn.active {
    background: rgba(107, 163, 245, 0.22);
    color: #8bb3ff;
}

.summary-overview-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.summary-metric-card {
    background: linear-gradient(180deg, rgba(58, 72, 99, 0.26) 0%, rgba(37, 44, 56, 0.38) 100%);
    border: 1px solid rgba(107, 163, 245, 0.2);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.45rem;
}

.summary-metric-card-wide {
    grid-column: span 2;
}

.summary-metric-label {
    color: rgba(160, 187, 230, 0.86);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.summary-metric-value {
    color: #70a2ff;
    font-size: 1.65rem;
    font-weight: 800;
    line-height: 1.05;
}

.summary-metric-caption {
    color: rgba(224, 224, 224, 0.58);
    font-size: 0.84rem;
}

.summary-trend-bar {
    display: flex;
    height: 0.9rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.62);
    border: 1px solid rgba(107, 163, 245, 0.1);
}

.summary-trend-bar-shop {
    height: 0.8rem;
}

.summary-trend-segment {
    height: 100%;
}

.summary-trend-segment.sales,
.summary-trend-dot.sales {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
}

.summary-trend-segment.spent,
.summary-trend-dot.spent {
    background: linear-gradient(90deg, #f97316 0%, #fb923c 100%);
}

.summary-trend-segment.bills,
.summary-trend-dot.bills {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
}

.summary-trend-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    color: rgba(224, 224, 224, 0.72);
    font-size: 0.82rem;
}

.summary-trend-legend span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.summary-trend-legend-compact {
    margin-top: 0.6rem;
}

.summary-trend-dot {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    display: inline-block;
}

.summary-shop-grid {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-history-panel {
    background: linear-gradient(180deg, rgba(37, 40, 48, 0.95) 0%, rgba(29, 32, 40, 0.94) 100%);
    border: 1px solid rgba(107, 163, 245, 0.14);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.summary-history-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.summary-history-header h3 {
    margin: 0;
    color: #e8eefc;
}

.summary-history-header p {
    margin: 0;
    color: rgba(224, 224, 224, 0.6);
}

.summary-history-table-wrap {
    overflow-x: auto;
}

.summary-history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.summary-history-table th,
.summary-history-table td {
    padding: 0.85rem 0.9rem;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-history-table thead th {
    border-top: none;
    color: rgba(160, 187, 230, 0.88);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-history-table tbody td {
    color: #eef3ff;
    font-size: 0.92rem;
}

.summary-history-table tbody tr:hover {
    background: rgba(107, 163, 245, 0.05);
}

.summary-shop-card {
    background: linear-gradient(180deg, rgba(37, 40, 48, 0.95) 0%, rgba(29, 32, 40, 0.94) 100%);
    border: 1px solid rgba(107, 163, 245, 0.14);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.summary-shop-card-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.summary-shop-card-top h3 {
    margin: 0;
    color: #e8eefc;
}

.summary-shop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin-top: 0.55rem;
    color: rgba(224, 224, 224, 0.62);
    font-size: 0.88rem;
}

.summary-shop-meta span {
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.summary-shop-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.summary-visual-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.9rem;
    margin-bottom: 1rem;
}

.summary-visual-card {
    padding: 0.95rem;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.34);
    border: 1px solid rgba(107, 163, 245, 0.1);
}

.summary-capacity-bar {
    position: relative;
    height: 2rem;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(17, 24, 39, 0.62);
    border: 1px solid rgba(107, 163, 245, 0.1);
}

.summary-capacity-bar.full .summary-capacity-bar-fill {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
}

.summary-capacity-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6 0%, #22c55e 100%);
}

.summary-capacity-bar-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f8fafc;
    font-size: 0.8rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.summary-shop-stat {
    padding: 0.8rem 0.9rem;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.48);
    border: 1px solid rgba(107, 163, 245, 0.1);
}

.summary-shop-stat span {
    display: block;
    color: rgba(160, 187, 230, 0.8);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.35rem;
}

.summary-shop-stat strong {
    color: #f4f7ff;
    font-size: 1rem;
}

.summary-shop-breakdowns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.9rem;
}

.summary-breakdown-block {
    padding: 0.95rem;
    border-radius: 12px;
    background: rgba(17, 24, 39, 0.34);
    border: 1px solid rgba(107, 163, 245, 0.1);
}

.summary-breakdown-title {
    color: #8bb3ff;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.65rem;
}

.summary-watch-section + .summary-watch-section {
    margin-top: 0.85rem;
}

.summary-watch-heading {
    color: rgba(224, 224, 224, 0.74);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.summary-watch-list {
    display: grid;
    gap: 0.45rem;
}

.summary-watch-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
}

.summary-watch-item.low {
    border-color: rgba(250, 204, 21, 0.2);
    background: rgba(250, 204, 21, 0.08);
}

.summary-watch-item.out {
    border-color: rgba(248, 113, 113, 0.22);
    background: rgba(239, 68, 68, 0.08);
}

.summary-watch-name {
    color: #eef3ff;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-watch-qty {
    color: rgba(224, 224, 224, 0.8);
    font-weight: 700;
}

.summary-item-list {
    display: grid;
    gap: 0.45rem;
}

.summary-owner-list {
    display: grid;
    gap: 0.45rem;
}

.summary-owner-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(245, 158, 11, 0.22);
    background: rgba(245, 158, 11, 0.08);
}

.summary-owner-name {
    color: #fef3c7;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-owner-value {
    color: #fef9c3;
    font-weight: 700;
    white-space: nowrap;
}

.summary-item-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    padding: 0.5rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.summary-item-row:first-child {
    border-top: none;
    padding-top: 0;
}

.summary-item-name {
    color: #eef3ff;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.summary-item-qty,
.summary-item-value {
    color: rgba(224, 224, 224, 0.72);
    font-size: 0.88rem;
    white-space: nowrap;
}

.summary-empty-mini {
    color: rgba(224, 224, 224, 0.52);
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .summary-overview {
        padding: 1.1rem;
    }

    .summary-shop-card-top {
        flex-direction: column;
    }

    .summary-period-toggle {
        width: 100%;
        justify-content: stretch;
    }

    .summary-period-btn {
        flex: 1;
    }

    .summary-metric-card-wide {
        grid-column: span 1;
    }
}

.empty {
    text-align: center;
    padding: 2.5rem;
    color: rgba(224, 224, 224, 0.5);
    font-size: 1rem;
}

.access-denied-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1) 0%, rgba(255, 75, 75, 0.05) 100%);
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: 12px;
    gap: 1.5rem;
    max-width: 500px;
    margin: 0 auto;
}

.access-denied-icon {
    font-size: 3rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.access-denied-card h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.5rem;
}

.access-denied-card p {
    margin: 0;
    color: rgba(224, 224, 224, 0.7);
    font-size: 0.95rem;
    line-height: 1.6;
}

.access-denied-btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.access-denied-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #1c5aa0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.search-results {
    background: linear-gradient(135deg, #252525 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    border: 1px solid #3a3a3a;
}

.result-item {
    padding: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(107, 163, 245, 0.05);
    margin-bottom: 0.8rem;
    border-radius: 6px;
    border-left: 3px solid #6ba3f5;
}

.result-item:last-child {
    border-bottom: none;
}

.result-shop {
    color: #6ba3f5;
    font-weight: 700;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-item-name {
    color: #e0e0e0;
    font-weight: 600;
    margin-bottom: 0.4rem;
    font-size: 1rem;
}

.result-quantity {
    color: #a0a0a0;
    font-size: 0.9rem;
}

.quick-update-panel {
    background: linear-gradient(135deg, #252525 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 550px;
    border: 1px solid #3a3a3a;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    color: #6ba3f5;
    font-weight: 700;
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid rgba(107, 163, 245, 0.3);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

.form-group input::placeholder {
    color: rgba(224, 224, 224, 0.4);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #6ba3f5;
    background: rgba(107, 163, 245, 0.1);
    box-shadow: 0 0 10px rgba(107, 163, 245, 0.2);
}

.submit-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, #4a7fd7 0%, #3a6fb5 100%);
    color: white;
    border: 1px solid rgba(107, 163, 245, 0.4);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 127, 215, 0.4);
    background: linear-gradient(135deg, #5a8fe7 0%, #4a7fc5 100%);
}

.dev-tools-section {
    background: linear-gradient(135deg, #2a2525 0%, #25252a 100%);
    border-radius: 10px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #3a3a3a;
    border-left: 4px solid #f59e0b;
}

.dev-tools-section h3 {
    color: #f59e0b;
    margin-top: 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dev-tool-btn {
    padding: 0.8rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.dev-tool-btn:hover {
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.result-message {
    margin-top: 2rem;
    padding: 1.2rem;
    border-radius: 8px;
    text-align: center;
    display: none;
    font-weight: 600;
    border-left: 4px solid transparent;
}

.result-message.success {
    display: block;
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    border-left-color: #81c784;
}

.result-message.error {
    display: block;
    background: rgba(244, 67, 54, 0.15);
    color: #ef5350;
    border-left-color: #ef5350;
}

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #2a2a2a 0%, #252525 100%);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    border: 2px solid #3a3a3a;
    text-align: center;
}

.modal-item-icon {
    width: 96px;
    height: 96px;
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-item-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.modal-item-icon .item-icon-emoji {
    font-size: 4rem;
}

.modal-item-name {
    color: #e0e0e0;
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}


@media (max-width: 900px) {
    .inventory-overview {
        padding: 1.1rem;
    }

    .inventory-topbar {
        align-items: stretch;
    }

    .inventory-controls {
        width: 100%;
    }

    .inventory-stat-value {
        font-size: 1.55rem;
    }
}
.modal-item-quantity-section {
    margin-bottom: 2rem;
}

.modal-item-quantity-label {
    color: #a0a0a0;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.8rem;
    display: block;
}

.modal-quantity-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-quantity-input {
    width: 120px;
    padding: 0.8rem;
    background: rgba(107, 163, 245, 0.1);
    border: 2px solid #6ba3f5;
    border-radius: 8px;
    color: #6ba3f5;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    font-family: 'Courier New', monospace;
}

.modal-quantity-input:focus {
    outline: none;
    box-shadow: 0 0 15px rgba(107, 163, 245, 0.4);
}

.modal-owner-input-wrapper {
    margin-top: 0.55rem;
    display: flex;
    justify-content: center;
}

.modal-owner-input {
    width: 100%;
    max-width: 280px;
    padding: 0.7rem 0.8rem;
    background: rgba(107, 163, 245, 0.08);
    border: 1px solid rgba(107, 163, 245, 0.45);
    border-radius: 8px;
    color: #dbeafe;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
}

.modal-owner-input:focus {
    outline: none;
    border-color: #6ba3f5;
    box-shadow: 0 0 12px rgba(107, 163, 245, 0.3);
}

.modal-owner-hint {
    margin-top: 0.5rem;
    font-size: 0.74rem;
    color: rgba(191, 219, 254, 0.78);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 120px;
}

.modal-btn-save {
    background: linear-gradient(135deg, #4a7fd7 0%, #3a6fb5 100%);
    color: white;
}

.modal-btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 127, 215, 0.4);
}

.modal-btn-remove {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.modal-btn-remove:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: #ef5350;
}

.modal-btn-cancel {
    background: rgba(107, 163, 245, 0.2);
    color: #6ba3f5;
    border: 1px solid rgba(107, 163, 245, 0.4);
}

.modal-btn-cancel:hover {
    background: rgba(107, 163, 245, 0.3);
    border-color: #6ba3f5;
}

.close {
    color: #6ba3f5;
    float: right;
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #81c784;
}

#modal-title {
    color: #6ba3f5;
    margin-bottom: 1.5rem;
}

/* Config Modal Styles */
.config-modal {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.config-modal-content {
    position: relative;
    z-index: 1;
    background: linear-gradient(135deg, #2a2a2a 0%, #252525 100%);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
    border: 2px solid #3a3a3a;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.config-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.config-modal-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.3rem;
}

.config-modal-close {
    background: none;
    border: none;
    color: #a0a0a0;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-modal-close:hover {
    color: #e0e0e0;
}

.config-modal-body {
    padding: 1.5rem;
}

.config-modal-body .form-group {
    margin-bottom: 1.5rem;
}

.config-modal-body .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #b0b0b0;
    font-weight: 600;
    font-size: 0.9rem;
}

.config-modal-body input,
.config-modal-body select,
.config-modal-body textarea {
    width: 100%;
    padding: 0.75rem;
    background: rgba(107, 163, 245, 0.08);
    border: 1px solid rgba(107, 163, 245, 0.3);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.config-modal-body input:focus,
.config-modal-body select:focus,
.config-modal-body textarea:focus {
    outline: none;
    border-color: #6ba3f5;
    box-shadow: 0 0 12px rgba(107, 163, 245, 0.3);
}

.config-modal-body input:disabled {
    background: rgba(107, 163, 245, 0.04);
    color: #808080;
    cursor: not-allowed;
}

.config-modal-body textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    min-height: 120px;
}

.config-modal-body small {
    display: block;
    margin-top: 0.4rem;
    color: rgba(200, 200, 200, 0.6);
    font-size: 0.8rem;
}

.config-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.submit-btn, .cancel-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.submit-btn {
    background: linear-gradient(135deg, #4a7fd7 0%, #3a6fb5 100%);
    color: white;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 127, 215, 0.4);
}

.cancel-btn {
    background: rgba(107, 163, 245, 0.2);
    color: #6ba3f5;
    border: 1px solid rgba(107, 163, 245, 0.4);
}

.cancel-btn:hover {
    background: rgba(107, 163, 245, 0.3);
    border-color: #6ba3f5;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: rgba(107, 163, 245, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(107, 163, 245, 0.6);
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        top: 100%;
        left: 0;
        display: flex;
        gap: 1rem;
        padding: 1rem;
        overflow-x: auto;
        border-right: none;
        border-bottom: 1px solid #3a3a3a;
    }

    .nav-section {
        display: flex;
        gap: 0.5rem;
        white-space: nowrap;
    }

    .nav-btn {
        margin-bottom: 0;
    }

    header {
        flex-direction: column;
        gap: 1rem;
    }

    main {
        margin-left: 0;
        margin-top: 0;
        padding: 1.5rem;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    h2 {
        font-size: 1.5rem;
    }
}

/* Configuration View Styles */
.config-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid #3a3a3a;
}

.config-tab-btn {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: #a0a0a0;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.config-tab-btn:hover {
    color: #6ba3f5;
}

.config-tab-btn.active {
    color: #6ba3f5;
    border-bottom-color: #6ba3f5;
}

.config-tab {
    display: none;
}

.config-tab.active {
    display: block;
}

.config-panel {
    background: linear-gradient(135deg, #252525 0%, #2a2a2a 100%);
    border-radius: 10px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #3a3a3a;
}

.config-panel h3 {
    color: #6ba3f5;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.config-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.config-item {
    background: linear-gradient(135deg, #2a2a2a 0%, #252525 100%);
    border: 1px solid #3a3a3a;
    border-radius: 10px;
    padding: 1.5rem;
    position: relative;
}

.config-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.config-item h4 {
    color: #6ba3f5;
    margin: 0;
    font-size: 1.1rem;
}

.config-item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-small {
    padding: 0.5rem 1rem;
    background: rgba(107, 163, 245, 0.2);
    color: #6ba3f5;
    border: 1px solid rgba(107, 163, 245, 0.4);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: rgba(107, 163, 245, 0.3);
    border-color: #6ba3f5;
}

.btn-danger {
    background: rgba(244, 67, 54, 0.2);
    color: #ef5350;
    border-color: rgba(244, 67, 54, 0.4);
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 0.3);
    border-color: #ef5350;
}

.config-item-fields {
    display: grid;
    gap: 0.8rem;
    margin-top: 1rem;
}

.config-item-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.config-item-field-label {
    color: #a0a0a0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.config-item-field-value {
    color: #6ba3f5;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-all;
}

/* Space Limit Editor Styles */
.inventory-stat-title-with-edit {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.space-limit-edit-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.space-limit-edit-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.inventory-space-bar-text-red {
    color: #ef4444 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.75) !important;
}

.space-limit-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.space-limit-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.space-limit-modal-content {
    background-color: #1f2937;
    padding: 2rem;
    border-radius: 8px;
    border: 1px solid rgba(107, 163, 245, 0.16);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.space-limit-modal-title {
    color: #f8fafc;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.space-limit-modal-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.space-limit-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.space-limit-input-label {
    color: rgba(160, 187, 230, 0.86);
    font-size: 0.9rem;
    font-weight: 600;
}

.space-limit-input {
    padding: 0.75rem;
    border: 1px solid rgba(107, 163, 245, 0.3);
    border-radius: 6px;
    background: rgba(31, 41, 55, 0.5);
    color: #f8fafc;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.space-limit-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: rgba(31, 41, 55, 0.8);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.space-limit-modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

.space-limit-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.space-limit-btn-save {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.space-limit-btn-save:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.space-limit-btn-cancel {
    background: rgba(107, 163, 245, 0.1);
    color: rgba(160, 187, 230, 0.86);
    border: 1px solid rgba(107, 163, 245, 0.3);
}

.space-limit-btn-cancel:hover {
    background: rgba(107, 163, 245, 0.15);
    border-color: rgba(107, 163, 245, 0.5);
}
