/* Dashboard Main Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Only apply fixed positioning to main dashboard frame */
html:has(.dashboard-container) {
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
    position: fixed;
    width: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #fafafa;
    color: #353740;
}

/* Fixed positioning only for dashboard container page */
body:has(.dashboard-container) {
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

/* Prevent iOS auto-zoom on input focus */
input,
textarea,
select {
    font-size: 16px;
}

.dashboard-container {
    display: flex;
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

/* Sidebar Styles */
.sidebar {
    width: 220px;
    background-color: #f7f7f8;
    border-right: 1px solid #ececf1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
    height: 100%;
}

.sidebar-header {
    padding: 17px 20px 16px 20px;
    border-bottom: 1px solid #ececf1;
    box-sizing: border-box;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 16px;
    color: #202123;
}

.logo i {
    font-size: 14px;
    font-style: normal;
    background-color: #333;
    color: #fff;
    width: 25px;
    height: 25px;
    line-height: 25px;
    border-radius: 25px;
    text-align: center;
}

.project-selector {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #353740;
}

.project-selector:hover {
    border-color: #acacbe;
}

.project-selector i {
    font-size: 12px;
    color: #6e6e80;
}

/* Navigation Styles */
.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.section-title {
    padding: 8px 20px;
    font-size: 11px;
    font-weight: 600;
    color: #6e6e80;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin: 2px 8px;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    color: #353740;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    font-size: 14px;
}

.nav-item a:hover {
    background-color: #ececf1;
}

.nav-item.active a {
    background-color: #ececf1;
    font-weight: 500;
}

.nav-item a i {
    width: 18px;
    text-align: center;
    color: #6e6e80;
    font-size: 12px;
}

.nav-item.active a i {
    color: #353740;
}

/* Main Content Area */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 32px;
    border-bottom: 1px solid #ececf1;
    background-color: white;
    box-sizing: border-box;
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.header-left h1 {
    font-size: 18px;
    font-weight: normal;
    color: #999;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #353740;
    font-size: 20px;
    border-radius: 6px;
    transition: all 0.2s;
}

.mobile-menu-btn:hover {
    background-color: #f7f7f8;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right .login-btn {
    background-color: #000000;
    color: #ffffff;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    margin-left: 18px;
}

.header-link {
    color: #6e6e80;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.header-link:hover {
    color: #353740;
}

.settings-btn {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6e6e80;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.settings-btn:hover {
    background-color: #f7f7f8;
    color: #353740;
}

.settings-btn i {
    font-size: 18px;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    background-color: #ffffff;
}

/* Content Iframe */
#content-iframe {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border: none;
    display: block;
}

/* Loading State */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6e6e80;
}

.loading i {
    font-size: 32px;
    margin-bottom: 16px;
}

.loading p {
    font-size: 14px;
}

/* Error State */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #6e6e80;
}

.error-state i {
    font-size: 48px;
    color: #ef4444;
    margin-bottom: 16px;
}

.error-state h3 {
    font-size: 20px;
    color: #353740;
    margin-bottom: 8px;
}

.error-state p {
    font-size: 14px;
    margin-bottom: 4px;
}

.error-detail {
    color: #ef4444;
    font-size: 12px;
    font-family: monospace;
}

/* Scrollbar Styles */
.sidebar-nav::-webkit-scrollbar,
.content-area::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb,
.content-area::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover,
.content-area::-webkit-scrollbar-thumb:hover {
    background: #acacbe;
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-area>* {
    animation: fadeIn 0.3s ease-out;
}

/* Page Container - for iframe content pages */
.page-container {
    padding: 58px;
    margin: 0 auto;
    min-height: 100vh;
    box-sizing: border-box;
    width: 100%;
}

/* Ensure iframe pages can scroll */
body:not(:has(.dashboard-container)) {
    overflow-y: auto;
    height: auto;
    min-height: 100vh;
}

/* Legacy support */
.api-keys-container {
    padding: 0;
    max-width: 100%;
}

.api-keys-content {
    padding: 0;
}

.page-header {
    margin-bottom: 40px;
    padding-bottom: 32px;
    border-bottom: 1px solid #e5e5e5;
}

.page-header h2 {
    font-size: 28px;
    font-weight: 600;
    color: #0d0d0d;
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.header-content>div:first-child {
    flex: 1;
    min-width: 0;
}

.header-content>div:last-child {
    flex-shrink: 0;
    display: flex;
    gap: 24px;
}

.stat-box {
    text-align: center;
    padding: 15px 33px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    min-width: 110px;
    transition: all 0.2s ease;
}

.stat-box:hover {
    border-color: #d0d0d0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat-label {
    font-size: 11px;
    color: #6e6e80;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: #0d0d0d;
    letter-spacing: -0.01em;
}

.stat-value.balance {
    color: #10a37f;
}

.header-content h2 {
    font-size: 20px;
    font-weight: 600;
    color: #202123;
    margin: 0;
}

.info-box {
    background-color: #f7f7f8;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 3px solid #6e6e80;
}

.info-text {
    margin: 0;
    font-size: 14px;
    color: #353740;
}

.warning-box {
    background-color: #fff9e6;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 3px solid #f5c542;
}

.warning-text {
    margin: 0;
    font-size: 14px;
    color: #353740;
    line-height: 1.5;
}

.usage-info {
    margin-bottom: 24px;
}

.usage-info p {
    margin: 0;
    font-size: 14px;
    color: #6e6e80;
}

.text-link {
    color: #10a37f;
    text-decoration: none;
}

.text-link:hover {
    text-decoration: underline;
}

.list-table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

/* Table wrapper for scroll */
.table-wrapper {
    position: relative;
    overflow: hidden;
}

.table-scroll {
    overflow-x: auto;
    overflow-y: visible;
}

.table-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background-color: #f7f7f8;
    border-bottom: 1px solid #ececf1;
}

.table-header-content {
    display: flex;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.table-header-actions {
    width: 60px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.table-col {
    font-size: 12px;
    font-weight: 600;
    color: #6e6e80;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.table-col.col-wide {
    flex: 2;
}

.table-col.col-narrow {
    flex: 0.8;
}

.table-col.col-actions {
    flex: none;
    width: auto;
    justify-content: center;
}

.table-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #ececf1;
    transition: background-color 0.2s;
}

.table-row-content {
    display: flex;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.table-row-actions {
    width: 60px;
    flex-shrink: 0;
    background-color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.2s;
}

.table-row:hover {
    background-color: #f7f7f8;
}

.table-row:hover .table-row-actions {
    background-color: #f7f7f8;
}

.table-row .table-col {
    font-size: 14px;
    font-weight: 400;
    color: #353740;
    text-transform: none;
    letter-spacing: 0;
}

.table-row span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tooltip-icon {
    color: #acacbe;
    cursor: help;
}

.btn-primary {
    background-color: #10a37f;
    color: white;
    border: none;
    padding: 18px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.01em;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #2d2d2d;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-secondary {
    background-color: white;
    color: #353740;
    border: 1px solid #d1d5db;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 7px;
    text-decoration: none;
}

.btn-secondary:hover {
    border-color: #9ca3af;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.btn-secondary:active {
    transform: translateY(0);
}

.btn-icon {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #6e6e80;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-icon:hover {
    background-color: #f7f7f8;
    color: #353740;
}

.btn-delete:hover {
    color: #ef4444;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background-color: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header {
    padding: 24px 24px 16px;
    border-bottom: 1px solid #ececf1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #202123;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #6e6e80;
    cursor: pointer;
    padding: 4px;
}

.modal-close:hover {
    color: #353740;
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #353740;
}

.form-input,
.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    color: #353740;
    transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: #10a37f;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #ececf1;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Pagination Styles */
.pager-container {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 24px 20px;
    margin-top: 16px;
}

.pager-container button {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #353740;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pager-container button:hover:not(.disabled) {
    background-color: #f7f7f8;
    border-color: #acacbe;
    color: #353740;
}

.pager-container button.active {
    background-color: #353740;
    color: white;
    border-color: #353740;
}

.pager-container button.active:hover {
    background-color: #202123;
    color: white;
}

.pager-container button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pager-container button.cursor-not-allowed {
    cursor: not-allowed;
}

.pager-container .prevPage,
.pager-container .nextPage {
    padding: 0;
    width: 36px;
}

.pager-container svg {
    width: 16px;
    height: 16px;
}

.pager-container .w-4 {
    width: 16px;
}

.pager-container .h-4 {
    height: 16px;
}

@media (max-width: 768px) {
    .page-container {
        padding: 16px 16px 88px 16px;
    }

    .page-header {
        margin-bottom: 20px;
    }

    .header-content {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .header-content>div:last-child {
        display: flex;
        gap: 16px;
        justify-content: space-between;
    }

    .header-content h2 {
        font-size: 20px;
    }

    .table-header-actions {
        width: 20px;
    }

    .table-row-actions {
        width: 20px;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        position: fixed;
        left: -220px;
        top: 0;
        bottom: 0;
        z-index: 1000;
        transition: left 0.3s;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        left: 0;
    }

    /* ÃƒÆ’Ã‚Â¦Ãƒâ€šÃ‚Â·Ãƒâ€šÃ‚Â»ÃƒÆ’Ã‚Â¥Ãƒâ€¦Ã‚Â Ãƒâ€šÃ‚Â ÃƒÆ’Ã‚Â©Ãƒâ€šÃ‚ÂÃƒâ€šÃ‚Â®ÃƒÆ’Ã‚Â§Ãƒâ€šÃ‚Â½Ãƒâ€šÃ‚Â©ÃƒÆ’Ã‚Â¥Ãƒâ€šÃ‚Â±ÃƒÂ¢Ã¢â€šÂ¬Ã…Â¡ */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .top-header {
        padding: 12px 16px;
    }

    .header-left h1 {
        font-size: 18px;
    }

    .header-right {
        gap: 12px;
    }

    .header-link {
        display: none;
    }

    .content-area {
        padding: 0;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
}

/* Welcome Page Styles */
.welcome-page {
    padding: 58px;
    margin: 0 auto;
    background-color: #fafafa;
}

.welcome-section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-title-simple {
    font-size: 22px;
    font-weight: 600;
    color: #0d0d0d;
    margin: 0;
}

.view-all-link {
    font-size: 14px;
    color: #6e6e80;
    text-decoration: none;
    transition: color 0.2s;
}

.view-all-link:hover {
    color: #0d0d0d;
}

/* Models Grid */
.models-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.model-item {
    display: block;
}

.model-item .model-card {
    margin-bottom: 16px;
}

.model-card {
    position: relative;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 180px;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e5e5e5;
    box-shadow: none;
}

.model-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.model-card-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 1;
}

.model-gradient-1 .model-card-bg {
    background: linear-gradient(135deg, #ff9a8b 0%, #ff6a88 50%, #ff99ac 100%);
    opacity: 0.9;
}

.model-gradient-2 .model-card-bg {
    background: linear-gradient(135deg, #ee9ae5 0%, #dd7cda 50%, #c963cf 100%);
    opacity: 0.85;
}

.model-gradient-3 .model-card-bg {
    background: linear-gradient(135deg, #74b9ff 0%, #6ba6f5 50%, #5e92eb 100%);
    opacity: 0.85;
}

.model-card-content {
    position: relative;
    padding: 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.model-name {
    font-size: 36px;
    font-weight: 500;
    color: white;
    margin: 0;
    text-align: center;
    letter-spacing: -0.5px;
}

/* Models Info Section */
.models-info {
    display: none;
}

.model-info-item {
    padding: 0;
}

.model-info-title {
    font-size: 16px;
    font-weight: 600;
    color: #0d0d0d;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-info-badge {
    display: inline-block;
    background-color: #10a37f;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.model-info-desc {
    font-size: 14px;
    color: #6e6e80;
    margin: 0;
    line-height: 1.6;
}

/* Links Section */
.links-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 40px;
}

.info-link-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 24px 20px;
    text-decoration: none;
    transition: all 0.2s;
    text-align: center;
    box-shadow: none;
}

.info-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-color: #d0d0d0;
}

.info-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0d0d0d;
}

.info-icon svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.5;
}

.info-title {
    font-size: 16px;
    font-weight: 600;
    color: #0d0d0d;
    margin: 0 0 8px 0;
}

.info-desc {
    font-size: 13px;
    color: #6e6e80;
    margin: 0;
    line-height: 1.5;
}

/* Dashboard Page Styles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.dashboard-card {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 32px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #0d0d0d;
    margin: 0;
    display: flex;
    align-items: center;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    color: #6e6e80;
    min-width: 100px;
}

.info-value {
    font-size: 14px;
    color: #0d0d0d;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.stat-item {
    background: #fafafa;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
}

.stat-item:hover {
    border-color: #d0d0d0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #0d0d0d;
    margin-bottom: 8px;
}

.stat-desc {
    font-size: 12px;
    color: #6e6e80;
}

/* Tabs Styles */
.tabs-container {
    margin-top: 24px;
}

.tabs-header {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e5e5e5;
    margin-bottom: 24px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #6e6e80;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -1px;
}

.tab-btn:hover {
    color: #0d0d0d;
}

.tab-btn.active {
    color: #0d0d0d;
    border-bottom-color: #0d0d0d;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table Styles */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead th {
    text-align: left;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #6e6e80;
    border-bottom: 1px solid #e5e5e5;
}

.data-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #fafafa;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody td {
    padding: 16px;
    font-size: 14px;
    color: #0d0d0d;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background-color: #f0f0f0;
    color: #0d0d0d;
}

.btn-table {
    background: white;
    color: #353740;
    border: 1px solid #d1d5db;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-table:hover {
    border-color: #9ca3af;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Status Badge Styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
}

.status-badge.status-0 {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-badge.status-1 {
    background-color: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.status-badge.status-2 {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.status-badge.status-3 {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Filter Section Styles */
.filter-section select.form-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236e6e80' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .links-section {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .welcome-page {
        padding: 20px;
    }

    .models-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .model-item {
        display: block;
    }

    .model-item .model-card {
        margin-bottom: 16px;
    }

    .model-item .model-info-item {
        display: block;
    }

    .links-section {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .section-title-simple {
        font-size: 20px;
    }

    .model-name {
        font-size: 28px;
    }

    .model-card {
        height: 160px;
    }

    /* Dashboard Responsive */
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .dashboard-card {
        padding: 24px;
        grid-column: 1 / -1 !important;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .card-header h3 {
        font-size: 16px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .stat-item {
        padding: 16px;
    }

    .stat-number {
        font-size: 20px;
    }

    .tabs-header {
        overflow-x: auto;
    }

    .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
        white-space: nowrap;
    }

    .data-table {
        font-size: 13px;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 12px 8px;
    }

    .table-container {
        margin: 0 -24px;
        padding: 0 24px;
    }
}

/* Product Page Styles */
.product-form-container {
    background: #fefefe;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 33px;
}

.form-group:last-of-type {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0d0d0d;
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}

.form-input {
    width: 100%;
    padding: 15px 18px;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
    font-size: 14px;
    color: #0d0d0d;
    background: white;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1.5;
}

.form-input:hover {
    border-color: #9ca3af;
}

.form-input:focus {
    outline: none;
    border-color: #0d0d0d;
    box-shadow: 0 0 0 3px rgba(13, 13, 13, 0.05);
}

.form-input::placeholder {
    color: #9ca3af;
}

.radio-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.radio-button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    border-radius: 28px;
    background: white;
    color: #353740;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.radio-button:hover {
    border-color: #9ca3af;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.radio-button.active {
    background-color: #333;
    border-color: #0d0d0d;
    color: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.radio-button:active {
    transform: translateY(0);
}

/* Result Container */
.result-container {
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 32px;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 40px;
    border-bottom: 1px solid #e5e5e5;
    background-color: white;
}

.result-content {
    padding: 40px;
    background-color: white;
}

.result-text {
    font-size: 15px;
    line-height: 1.8;
    color: #1a1a1a;
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0;
}

.result-text br {
    display: block;
    content: "";
    margin: 8px 0;
}


.pager {
    padding: 0.8vw 0;
    text-align: right;
    font-size: 1vw;
    border-width: 0.1vw;
    border-style: solid;
    border-color: #fff;
}

.pager .detail {
    background-color: #eee;
    border-radius: 0.2vw;
    color: #666;
    margin: 0 0.1vw;
    padding: 0 1vw;
    display: inline-block;
    vertical-align: top;
    height: 2.6vw;
    line-height: 2.6vw;
}

.pager .detail i {
    color: #09c;
    padding: 0 0.2vw;
    font-weight: bold;
    font-size: 0.9vw;
}

.pager .jump {
    overflow: hidden;
    display: inline-block;
    vertical-align: top;
}

.pager .jump .textbox {
    display: inline-block;
    vertical-align: top;
    width: 4vw;
    border: 0.1vw solid #ddd;
    border-radius: 0.2vw;
    text-align: center;
    color: #666;
    background-color: #fff;
    box-sizing: border-box;
    font-size: 1vw;
    height: 2.6vw;
    line-height: 2.6vw;
}

.pager .jump .button {
    height: 2.6vw;
    line-height: 2.6vw;
    background-color: #eee;
    color: #09c;
    font-size: 1vw;
    padding: 0 1vw;
    margin-left: 0.5vw;
}

.pager a {
    background-color: #eee;
    border-radius: 0.2vw;
    color: #666;
    display: inline-block;
    height: 2.6vw;
    line-height: 2.6vw;
    margin: 0 0.1vw;
    vertical-align: top;
    text-align: center;
    padding: 0 1vw;
    min-width: 3vw;
    box-sizing: border-box;
    text-decoration: none;
}

.pager .current,
.pager a:hover {
    background-color: #34C5E2;
    border-color: #34C5E2;
    color: white;
    font-weight: bold;
}


.bottom-user {
    display: none;
    overflow: hidden;
    padding: 10px 8px;
}


.bottom-user .thumbnail {
    width: 28px;
    height: 24px;
    border-radius: 50%;
    margin-top: 2px;
    display: block;
    float: left;
}

.bottom-user .info {
    float: left;
}

.bottom-user .nickname {
    font-size: 12px;
    line-height: 1;
    padding-left: 8px;
    color: #000;
}

.bottom-user .balance {
    font-size: 12px;
    padding-left: 8px;
    cursor: pointer;
}

.bottom-user .balance i {
    font-style: normal;
    color: #666;
}

.bottom-user .balance span {
    font-size: 10px;
    color: #0061ff;
}

.bottom-user .logout {
    border: none;
    background: transparent;
    cursor: pointer;
    float: right;
    overflow: hidden;
    display: block;
}

.bottom-user .logout svg {
    width: 20px;
    height: auto;
    color: #666;
    vertical-align: top;
    margin: 3px 5px 0 0;
}

.sidebar-bottom {
    margin-top: auto;
    padding: 20px 20px;
    border-top: 1px solid #e5e5e5;
    transition: padding 0.3s ease;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-bottom {
    padding: 20px 12px;
}

.footer-links {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.footer-links li {
    color: #9ca3af;
    text-decoration: none;
    font-size: 10px;
    display: block;
    cursor: pointer;
}

.footer-links li:hover {
    color: #666666;
}

/* Responsive for Product Page */
@media (max-width: 768px) {
    .product-form-container {
        padding: 16px;
    }

    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .result-content {
        padding: 16px;
    }

    .radio-button-group {
        gap: 8px;
    }

    .radio-button {
        flex: 1;
        min-width: calc(50% - 4px);
        text-align: center;
    }
}