:root {
    --ui-green: #16a34a;
    --ui-green-dark: #15803d;
    --ui-green-soft: #ecfdf3;
    --ui-bg: #f4f6f8;
    --ui-panel: #ffffff;
    --ui-line: #e5e7eb;
    --ui-text: #111827;
    --ui-muted: #6b7280;
    --ui-danger: #dc2626;
}

body {
    background: var(--ui-bg) !important;
    color: var(--ui-text);
    letter-spacing: 0;
}

button, input, select, textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

.brand-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    display: block;
}

.poster-logo {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    object-fit: cover;
    display: block;
}

.nav-glass,
.header-fixed {
    background: rgba(255,255,255,.96) !important;
    border-bottom: 1px solid var(--ui-line) !important;
    box-shadow: none !important;
}

.btn-top-green,
.tag-link.primary,
.submit-btn,
.save-btn {
    background: var(--ui-green) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.tag-link,
.btn-ghost,
.btn-opt,
.btn-text,
.modal-btn {
    border-radius: 8px;
}

.main-wrapper,
.content-wrapper {
    max-width: 1320px !important;
}

.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

.v3-admin-root {
    min-height: calc(100vh - 92px);
}

.v3-admin-desktop {
    display: grid;
    grid-template-columns: 236px minmax(0, 1fr);
    gap: 10px;
}

.v3-side,
.v3-main,
.v3-detail,
.v3-table {
    background: var(--ui-panel);
    border: 1px solid var(--ui-line);
}

.v3-side,
.v3-main,
.v3-detail {
    border-radius: 8px;
    overflow: hidden;
}

.v3-side-head {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border-bottom: 1px solid var(--ui-line);
}

.v3-side-head strong,
.v3-section-head strong {
    font-size: 18px;
    font-weight: 900;
}

.v3-side-head span,
.v3-section-head span,
.v3-row small,
.v3-project-meta,
.v3-mobile-list-head span {
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 800;
}

.v3-search {
    width: calc(100% - 24px);
    height: 36px;
    margin: 14px 12px 10px;
    padding: 0 12px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
}

.v3-project-menu {
    display: grid;
}

.v3-project-menu button {
    min-height: 46px;
    display: grid;
    grid-template-columns: minmax(0,1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 0 14px;
    border: 0;
    border-left: 3px solid transparent;
    background: transparent;
    color: #4b5563;
    text-align: left;
}

.v3-project-menu button.active {
    border-left-color: var(--ui-green);
    background: var(--ui-green-soft);
    color: var(--ui-green-dark);
}

.v3-project-menu b,
.v3-project-menu span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v3-project-menu span {
    font-weight: 850;
}

.v3-new-project {
    width: 100%;
    height: 42px;
    margin-top: 12px;
    border: 0;
    border-top: 1px solid var(--ui-line);
    background: transparent;
    color: var(--ui-text);
    font-weight: 850;
}

.v3-section-head {
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--ui-line);
}

.v3-section-head h2 {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.25;
}

.v3-head-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.v3-btn {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dfe3ea;
    border-radius: 7px;
    background: #fff;
    color: #374151;
    font-weight: 850;
}

.v3-btn.primary {
    color: #fff;
    border-color: var(--ui-green);
    background: var(--ui-green);
}

.v3-btn.danger,
.v3-link.danger {
    color: var(--ui-danger);
    border-color: #fecaca;
    background: #fff7f7;
}

.v3-toolbar {
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(240px,360px) minmax(20px,1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 18px;
    border-bottom: 1px solid var(--ui-line);
}

.v3-toolbar input {
    height: 36px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    padding: 0 12px;
    outline: none;
}

.v3-toolbar b {
    color: var(--ui-muted);
    font-size: 13px;
}

.v3-table {
    border-width: 0 0 1px;
    overflow: hidden;
}

.v3-table-head,
.v3-row {
    display: grid;
    grid-template-columns: minmax(150px,1.15fr) 90px 130px 110px minmax(150px,1fr) minmax(150px,1fr);
    align-items: center;
}

.v3-table-head {
    min-height: 44px;
    background: #fafafa;
    border-bottom: 1px solid var(--ui-line);
    color: #374151;
    font-size: 13px;
    font-weight: 900;
}

.v3-row {
    min-height: 50px;
    border-bottom: 1px solid #e9edf2;
    color: #1f2937;
    font-size: 13px;
}

.v3-row.selected {
    background: #f0fdf4;
}

.v3-table-head span,
.v3-row span {
    min-width: 0;
    padding: 0 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.v3-detail {
    margin: 12px;
    padding: 16px;
}

.v3-detail-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px 18px;
    margin-top: 12px;
}

.v3-detail-grid label {
    display: grid;
    gap: 7px;
    color: #374151;
    font-size: 13px;
    font-weight: 850;
}

.v3-detail-grid input {
    min-height: 38px;
    border: 1px solid #dfe3ea;
    border-radius: 6px;
    padding: 0 10px;
    background: #fff;
}

.v3-empty {
    min-height: 180px;
    display: grid;
    place-items: center;
    color: var(--ui-muted);
}

.v3-data-shell {
    padding: 84px 16px 40px;
}

.v3-data-table {
    background: #fff;
    border: 1px solid var(--ui-line);
    border-radius: 8px;
    overflow: hidden;
}

.v3-data-head,
.v3-data-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr 1.4fr 1fr 138px;
    gap: 14px;
    align-items: center;
}

.v3-data-head {
    padding: 14px 18px;
    background: #fafafa;
    color: var(--ui-muted);
    font-size: 12px;
    font-weight: 900;
}

.v3-data-row {
    padding: 16px 18px;
    border-top: 1px solid var(--ui-line);
}

.v3-data-row b,
.v3-data-row small,
.v3-data-row em {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.v3-data-row small,
.v3-data-row em {
    color: var(--ui-muted);
    font-size: 12px;
    font-style: normal;
    line-height: 1.5;
}

.v3-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.v3-link {
    min-height: 32px;
    padding: 0 10px;
    border: 1px solid #dfe3ea;
    border-radius: 7px;
    background: #fff;
    color: #374151;
    font-size: 13px;
    font-weight: 850;
}

.v3-link.primary {
    color: #fff;
    border-color: var(--ui-green);
    background: var(--ui-green);
}

@media (max-width: 860px) {
    body {
        background: var(--ui-bg) !important;
    }

    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: block !important;
    }

    .nav-glass,
    .header-fixed {
        height: 62px !important;
        background: rgba(244,246,248,.96) !important;
        backdrop-filter: blur(18px);
    }

    .nav-container,
    .nav-content,
    .header-fixed {
        padding: 0 14px !important;
    }

    .nav-title-pc,
    .nav-center-title,
    #p-name {
        font-size: 21px !important;
        font-weight: 950 !important;
    }

    .main-wrapper,
    .content-wrapper {
        width: calc(100% - 24px) !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .v3-admin-root,
    .v3-data-shell {
        padding-bottom: 92px;
    }

    .v3-mobile-overview {
        padding: 16px;
        margin: 10px 0 12px;
        border: 1px solid var(--ui-line);
        border-radius: 20px;
        background: #fff;
        box-shadow: 0 10px 26px rgba(17,24,39,.05);
    }

    .v3-mobile-overview span {
        display: block;
        color: var(--ui-muted);
        font-size: 12px;
        font-weight: 850;
    }

    .v3-mobile-overview strong {
        display: block;
        margin-top: 4px;
        color: var(--ui-text);
        font-size: 22px;
        line-height: 1.22;
        font-weight: 950;
    }

    .v3-mobile-metrics {
        display: grid;
        grid-template-columns: repeat(3,minmax(0,1fr));
        margin-top: 14px;
        border: 1px solid var(--ui-line);
        border-radius: 16px;
        overflow: hidden;
        background: #f9fafb;
    }

    .v3-mobile-metrics div {
        padding: 11px 8px;
        border-right: 1px solid var(--ui-line);
        text-align: center;
    }

    .v3-mobile-metrics div:last-child {
        border-right: 0;
    }

    .v3-mobile-metrics b {
        display: block;
        font-size: 19px;
    }

    .v3-mobile-metrics small {
        display: block;
        margin-top: 2px;
        color: var(--ui-muted);
        font-size: 12px;
        font-weight: 800;
    }

    .v3-mobile-search,
    .search-bar,
    .form-input,
    .field-input,
    .edit-input,
    .input-bare {
        width: 100% !important;
        min-height: 42px;
        border: 1px solid var(--ui-line) !important;
        border-radius: 12px !important;
        background: #fff !important;
        box-shadow: none !important;
        box-sizing: border-box;
    }

    .v3-mobile-list-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin: 14px 2px 10px;
    }

    .v3-mobile-list-head strong {
        font-size: 16px;
        font-weight: 950;
    }

    .v3-mobile-card,
    .info-item,
    .setting-card,
    .card {
        border: 1px solid var(--ui-line) !important;
        border-radius: 18px !important;
        background: #fff !important;
        box-shadow: 0 10px 26px rgba(17,24,39,.05) !important;
    }

    .v3-mobile-card {
        padding: 14px;
        margin-bottom: 12px;
    }

    .v3-card-head {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
    }

    .v3-card-title {
        font-size: 16px;
        font-weight: 950;
    }

    .v3-card-meta {
        margin-top: 6px;
        color: var(--ui-muted);
        font-size: 12px;
    }

    .v3-count-pill,
    .idx-badge {
        color: var(--ui-green-dark) !important;
        border: 1px solid #bbf7d0 !important;
        background: #f0fdf4 !important;
        border-radius: 999px !important;
        padding: 5px 9px !important;
        white-space: nowrap;
        font-size: 12px;
        font-weight: 900;
    }

    .v3-card-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        padding-top: 12px;
        margin-top: 12px;
        border-top: 1px solid #eef0f3;
    }

    .v3-mini-actions {
        display: grid;
        grid-template-columns: repeat(3,minmax(0,1fr));
        gap: 6px;
    }

    .v3-mini-actions button {
        height: 34px;
        border: 1px solid var(--ui-line);
        border-radius: 10px;
        background: #f9fafb;
        color: #4b5563;
        font-size: 12px;
        font-weight: 850;
    }

    .v3-mobile-bottom {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        z-index: 1200;
        display: grid;
        grid-template-columns: repeat(3,1fr);
        gap: 5px;
        padding: 6px;
        border: 1px solid rgba(229,231,235,.95);
        border-radius: 20px;
        background: rgba(255,255,255,.96);
        box-shadow: 0 12px 28px rgba(17,24,39,.1);
        backdrop-filter: blur(18px);
    }

    .v3-mobile-bottom a {
        display: grid;
        place-items: center;
        height: 40px;
        border-radius: 14px;
        color: #667085;
        text-decoration: none;
        font-size: 12px;
        font-weight: 850;
    }

    .v3-mobile-bottom a.active {
        color: #fff;
        background: var(--ui-green);
    }
}
