:root {
    --gp-ink: #17212b;
    --gp-muted: #64717f;
    --gp-line: #d8e0e7;
    --gp-soft: #f4f7f6;
    --gp-panel: #ffffff;
    --gp-accent: #13cfc1;
    --gp-accent-dark: #0d746f;
    --gp-warm: #f2b84b;
    --gp-danger: #b44242;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #eef3f1;
    color: var(--gp-ink);
    font-family: Inter, Montserrat, Roboto, Arial, sans-serif;
    letter-spacing: 0;
}

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

.gp-topbar {
    align-items: center;
    background: #1f262d;
    border-bottom: 4px solid var(--gp-accent);
    display: flex;
    min-height: 64px;
    justify-content: space-between;
    padding: 10px 28px;
}

.gp-brand img {
    display: block;
    height: 42px;
    width: auto;
}

.gp-nav {
    display: flex;
    gap: 18px;
}

.gp-nav a {
    color: #f5fbfa;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
}

.gp-shell {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(190px, 240px) minmax(0, 1fr) minmax(280px, 360px);
    min-height: calc(100vh - 64px);
    padding: 16px;
}

.gp-panel,
.gp-workspace {
    background: var(--gp-panel);
    border: 1px solid var(--gp-line);
    border-radius: 6px;
}

.gp-sidebar,
.gp-catalog {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

.gp-panel {
    min-width: 0;
    overflow: hidden;
}

.gp-panel-head {
    align-items: center;
    border-bottom: 1px solid var(--gp-line);
    display: flex;
    justify-content: space-between;
    min-height: 48px;
    padding: 10px 12px;
}

.gp-panel-head h2 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
}

.gp-icon-button,
.gp-toolbar button,
.gp-segmented button {
    background: #e8efed;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    color: var(--gp-ink);
    cursor: pointer;
    font-weight: 700;
    min-height: 36px;
    padding: 0 12px;
}

.gp-icon-button {
    font-size: 22px;
    line-height: 1;
    width: 36px;
}

.gp-primary,
.gp-toolbar .gp-primary {
    background: var(--gp-accent);
    border-color: var(--gp-accent);
    color: #062c2a;
}

.gp-list {
    display: flex;
    flex-direction: column;
}

.gp-list button {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #edf1f0;
    color: var(--gp-ink);
    cursor: pointer;
    padding: 12px;
    text-align: left;
}

.gp-list button:hover,
.gp-list button.is-active {
    background: #edf9f7;
}

.gp-list strong,
.gp-list span {
    display: block;
}

.gp-list span {
    color: var(--gp-muted);
    font-size: 12px;
    margin-top: 4px;
}

.gp-workspace {
    min-width: 0;
    overflow: hidden;
}

.gp-pack-head {
    align-items: stretch;
    border-bottom: 1px solid var(--gp-line);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 18px;
}

.gp-title-input,
.gp-description-input,
.gp-filter-row input,
.gp-filter-row select,
.gp-toolbar select,
.gp-row input,
.gp-row select {
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    color: var(--gp-ink);
    min-height: 38px;
    padding: 8px 10px;
}

.gp-title-input {
    border-color: transparent;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.1;
    padding-left: 0;
    width: 100%;
}

.gp-description-input {
    display: block;
    margin-top: 8px;
    resize: vertical;
    width: 100%;
}

.gp-summary {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(88px, 1fr));
}

.gp-summary div {
    background: var(--gp-soft);
    border: 1px solid #e1e8e6;
    border-radius: 6px;
    padding: 10px;
}

.gp-summary span {
    color: var(--gp-muted);
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.gp-summary strong {
    display: block;
    font-size: 19px;
    margin-top: 5px;
    white-space: nowrap;
}

.gp-toolbar,
.gp-filter-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 18px;
}

.gp-toolbar {
    border-bottom: 1px solid var(--gp-line);
}

.gp-segmented {
    display: inline-flex;
}

.gp-segmented button {
    border-radius: 0;
}

.gp-segmented button:first-child {
    border-radius: 6px 0 0 6px;
}

.gp-segmented button:last-child {
    border-radius: 0 6px 6px 0;
}

.gp-segmented button.is-active {
    background: #1f262d;
    border-color: #1f262d;
    color: #fff;
}

.gp-bars {
    display: grid;
    gap: 8px;
    padding: 14px 18px;
}

.gp-bar {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 120px minmax(0, 1fr) 74px;
}

.gp-bar span {
    color: var(--gp-muted);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gp-bar-track {
    background: #e8efed;
    border-radius: 999px;
    height: 9px;
    overflow: hidden;
}

.gp-bar-fill {
    background: linear-gradient(90deg, var(--gp-accent), var(--gp-warm));
    height: 100%;
}

.gp-pack-table {
    overflow-x: auto;
    padding: 0 18px 18px;
}

.gp-table-head,
.gp-row {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(160px, 1.5fr) minmax(96px, .8fr) 86px 64px 76px 76px 40px;
    min-width: 760px;
}

.gp-table-head {
    border-bottom: 1px solid var(--gp-line);
    color: var(--gp-muted);
    font-size: 11px;
    font-weight: 800;
    padding: 8px 0;
    text-transform: uppercase;
}

.gp-category {
    margin-top: 16px;
}

.gp-category-title {
    align-items: center;
    background: #f5f8f7;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 10px 12px;
}

.gp-category-title h3 {
    font-size: 16px;
    margin: 0;
}

.gp-row {
    align-items: center;
    border-bottom: 1px solid #edf1f0;
    padding: 7px 0;
}

.gp-row input[type="checkbox"] {
    height: 18px;
    width: 18px;
}

.gp-remove {
    background: transparent;
    border: 0;
    color: var(--gp-danger);
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
}

.gp-filter-row input {
    flex: 1 1 150px;
    min-width: 0;
}

.gp-filter-row select {
    flex: 0 0 120px;
}

.gp-catalog-list {
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 190px);
    overflow: auto;
    padding: 12px;
}

.gp-catalog-item {
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    display: grid;
    gap: 10px;
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 8px;
}

.gp-catalog-item img {
    aspect-ratio: 1;
    background: #edf1f0;
    border-radius: 5px;
    object-fit: cover;
    width: 72px;
}

.gp-catalog-item h3 {
    font-size: 14px;
    line-height: 1.25;
    margin: 0;
}

.gp-catalog-item p {
    color: var(--gp-muted);
    font-size: 12px;
    margin: 4px 0 8px;
}

.gp-catalog-item button {
    background: var(--gp-accent);
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    min-height: 32px;
    padding: 0 10px;
}

.gp-empty {
    color: var(--gp-muted);
    padding: 12px;
}

.gp-toast {
    background: #1f262d;
    border-left: 4px solid var(--gp-accent);
    border-radius: 6px;
    bottom: 18px;
    color: #fff;
    max-width: min(360px, calc(100vw - 32px));
    padding: 12px 14px;
    position: fixed;
    right: 18px;
    z-index: 20;
}

.gp-button {
    align-items: center;
    background: #e8efed;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    color: var(--gp-ink);
    cursor: pointer;
    display: inline-flex;
    font-weight: 800;
    justify-content: center;
    min-height: 38px;
    padding: 0 13px;
    text-decoration: none;
}

.gp-button:hover,
.gp-nav a:hover,
.gp-gear-actions a:hover,
.gp-admin-actions a:hover {
    text-decoration: underline;
}

.gp-button-muted {
    background: #fff;
}

.gp-admin-page,
.gp-explore-page {
    background: #eef3f1;
}

.gp-admin-shell,
.gp-explore-shell {
    margin: 0 auto;
    max-width: 1240px;
    padding: 18px;
}

.gp-admin-hero,
.gp-explore-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 16px;
}

.gp-admin-hero h1,
.gp-explore-head h1 {
    font-size: 34px;
    line-height: 1.1;
    margin: 0;
}

.gp-admin-hero p,
.gp-explore-head p {
    color: var(--gp-muted);
    margin: 7px 0 0;
}

.gp-alert {
    border-radius: 6px;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.gp-alert-success {
    background: #ddf7ef;
    border: 1px solid #9edfc8;
}

.gp-alert-error {
    background: #fde8e8;
    border: 1px solid #e6b0b0;
}

.gp-admin-stats,
.gp-category-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-bottom: 16px;
}

.gp-admin-stats div,
.gp-category-strip a {
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    color: var(--gp-ink);
    padding: 12px;
    text-decoration: none;
}

.gp-admin-stats span,
.gp-category-strip span {
    color: var(--gp-muted);
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.gp-admin-stats strong,
.gp-category-strip strong {
    display: block;
    font-size: 24px;
    margin-top: 5px;
}

.gp-admin-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    margin-bottom: 16px;
}

.gp-admin-panel {
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    min-width: 0;
}

.gp-admin-panel-head {
    align-items: center;
    border-bottom: 1px solid var(--gp-line);
    display: flex;
    justify-content: space-between;
    min-height: 48px;
    padding: 12px 14px;
}

.gp-admin-panel-head h2,
.gp-admin-source-list h3 {
    font-size: 15px;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
}

.gp-admin-panel-head a {
    color: var(--gp-accent-dark);
    font-weight: 800;
}

.gp-admin-form,
.gp-admin-filters,
.gp-explore-filters {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.gp-admin-two {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gp-admin-form label {
    display: grid;
    gap: 6px;
}

.gp-admin-form label span {
    color: var(--gp-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.gp-admin-form input,
.gp-admin-form select,
.gp-admin-form textarea,
.gp-admin-filters input,
.gp-admin-filters select,
.gp-explore-filters input,
.gp-explore-filters select {
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    color: var(--gp-ink);
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}

.gp-admin-form textarea {
    font-family: Consolas, Monaco, monospace;
    min-height: 140px;
    resize: vertical;
}

.gp-admin-source-list {
    border-top: 1px solid var(--gp-line);
    padding: 14px;
}

.gp-admin-source-list p {
    align-items: center;
    border-bottom: 1px solid #edf1f0;
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 9px 0;
}

.gp-admin-source-list span {
    color: var(--gp-muted);
}

.gp-admin-filters,
.gp-explore-filters {
    align-items: center;
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 180px)) auto auto;
    margin-bottom: 16px;
}

.gp-explore-filters input[type="hidden"] {
    display: none;
}

.gp-admin-filters {
    border: 0;
    border-bottom: 1px solid var(--gp-line);
    border-radius: 0;
    grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(140px, 180px)) auto auto;
    margin: 0;
}

.gp-viewbar {
    align-items: center;
    display: flex;
    justify-content: flex-end;
    margin: -6px 0 14px;
}

.gp-view-toggle {
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    display: inline-flex;
    overflow: hidden;
}

.gp-view-toggle a {
    color: var(--gp-ink);
    font-size: 13px;
    font-weight: 800;
    min-width: 74px;
    padding: 9px 12px;
    text-align: center;
    text-decoration: none;
}

.gp-view-toggle a + a {
    border-left: 1px solid var(--gp-line);
}

.gp-view-toggle a.is-active {
    background: #1f262d;
    color: #fff;
}

.gp-admin-table-wrap {
    overflow-x: auto;
}

.gp-admin-table {
    border-collapse: collapse;
    min-width: 900px;
    width: 100%;
}

.gp-admin-table th,
.gp-admin-table td {
    border-bottom: 1px solid #edf1f0;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

.gp-admin-table th {
    color: var(--gp-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.gp-admin-gear-cell {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 48px minmax(0, 1fr);
}

.gp-admin-gear-cell img,
.gp-admin-thumb-empty {
    aspect-ratio: 1;
    background: #edf1f0;
    border-radius: 5px;
    display: block;
    object-fit: cover;
    width: 48px;
}

.gp-admin-gear-cell strong,
.gp-admin-gear-cell span {
    display: block;
}

.gp-admin-gear-cell span {
    color: var(--gp-muted);
    font-size: 12px;
    margin-top: 3px;
}

.gp-admin-actions {
    align-items: center;
    display: flex;
    gap: 9px;
}

.gp-admin-actions a,
.gp-admin-actions button {
    background: transparent;
    border: 0;
    color: var(--gp-accent-dark);
    cursor: pointer;
    font-weight: 800;
    padding: 0;
}

.gp-admin-actions button {
    color: var(--gp-danger);
}

.gp-gear-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.gp-gear-list-wrap {
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    overflow-x: auto;
}

.gp-gear-list {
    border-collapse: collapse;
    min-width: 980px;
    width: 100%;
}

.gp-gear-list th,
.gp-gear-list td {
    border-bottom: 1px solid #edf1f0;
    padding: 10px 12px;
    text-align: left;
    vertical-align: middle;
}

.gp-gear-list th {
    background: #f7faf9;
    color: var(--gp-muted);
    font-size: 11px;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 1;
}

.gp-list-gear-cell {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: 54px minmax(0, 1fr);
    min-width: 320px;
}

.gp-list-gear-cell img,
.gp-list-thumb-empty {
    aspect-ratio: 1;
    background: #edf1f0;
    border-radius: 5px;
    display: block;
    object-fit: cover;
    width: 54px;
}

.gp-list-gear-cell strong,
.gp-list-gear-cell span,
.gp-list-gear-cell small {
    display: block;
}

.gp-list-gear-cell strong {
    line-height: 1.25;
}

.gp-list-gear-cell span,
.gp-list-gear-cell small {
    color: var(--gp-muted);
    font-size: 12px;
    margin-top: 3px;
}

.gp-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gp-list-actions a {
    color: var(--gp-accent-dark);
    font-weight: 800;
    text-decoration: none;
}

.gp-gear-card {
    background: #fff;
    border: 1px solid var(--gp-line);
    border-radius: 6px;
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    min-height: 166px;
    overflow: hidden;
}

.gp-gear-media {
    align-items: center;
    background: #e8efed;
    display: flex;
    justify-content: center;
    min-height: 166px;
}

.gp-gear-media img {
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.gp-gear-media span {
    color: var(--gp-muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.gp-gear-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 12px;
}

.gp-gear-title-row {
    align-items: flex-start;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.gp-gear-title-row h2 {
    font-size: 17px;
    line-height: 1.2;
    margin: 0;
}

.gp-gear-title-row > span {
    background: #edf9f7;
    border-radius: 999px;
    color: var(--gp-accent-dark);
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
}

.gp-gear-metrics {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gp-gear-metrics p {
    background: var(--gp-soft);
    border-radius: 5px;
    margin: 0;
    padding: 8px;
}

.gp-gear-metrics span {
    color: var(--gp-muted);
    display: block;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.gp-gear-metrics strong {
    display: block;
    font-size: 13px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.gp-spec-list,
.gp-gear-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.gp-spec-list span {
    background: #fff9e8;
    border: 1px solid #f2deb0;
    border-radius: 999px;
    font-size: 12px;
    padding: 4px 8px;
}

.gp-gear-actions {
    margin-top: auto;
}

.gp-gear-actions a {
    color: var(--gp-accent-dark);
    font-weight: 800;
    text-decoration: none;
}

@media (max-width: 1120px) {
    .gp-shell {
        grid-template-columns: minmax(180px, 230px) minmax(0, 1fr);
    }

    .gp-catalog {
        grid-column: 1 / -1;
    }

    .gp-catalog-list {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        max-height: none;
    }

    .gp-admin-grid {
        grid-template-columns: 1fr;
    }

    .gp-admin-filters,
    .gp-explore-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .gp-viewbar {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .gp-topbar,
    .gp-pack-head {
        align-items: flex-start;
        grid-template-columns: 1fr;
    }

    .gp-topbar {
        flex-direction: column;
        gap: 10px;
        padding: 10px 14px;
    }

    .gp-shell {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .gp-summary {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .gp-title-input {
        font-size: 24px;
    }

    .gp-admin-shell,
    .gp-explore-shell {
        padding: 12px;
    }

    .gp-admin-hero,
    .gp-explore-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .gp-admin-hero h1,
    .gp-explore-head h1 {
        font-size: 27px;
    }

    .gp-admin-two,
    .gp-admin-filters,
    .gp-explore-filters,
    .gp-gear-card {
        grid-template-columns: 1fr;
    }

    .gp-gear-media {
        min-height: 190px;
    }
}
