
/* =========================================================
   NIMCO TOOLS — ADMIN WORKSPACE
   Transfer Tools + Digital Products
========================================================= */

:root {
    --tools-bg: #07100d;
    --tools-panel: #0c1813;
    --tools-panel-2: #101f18;
    --tools-border: rgba(155, 205, 177, .13);
    --tools-border-strong: rgba(155, 205, 177, .22);
    --tools-text: #f0fff6;
    --tools-muted: #91a89a;
    --tools-green: #00d68a;
    --tools-green-soft: rgba(0, 214, 138, .10);
    --tools-gold: #e4bc69;
    --tools-danger: #ff7777;
    --tools-radius: 18px;
}

* {
    box-sizing: border-box;
}

.digital-products-section[hidden],
.dp-workspace-view[hidden],
.dp-inventory[hidden] {
    display: none !important;
}

.tools-page {
    width: min(1440px, 100%);
    margin: 0 auto;
    padding: 28px clamp(14px, 3vw, 34px) 60px;
    color: var(--tools-text);
}

.tools-header {
    margin-bottom: 25px;
}

.tools-eyebrow,
.dp-eyebrow {
    display: inline-block;
    color: var(--tools-green);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.8px;
    line-height: 1.5;
}

.tools-header h1 {
    margin: 8px 0 7px;
    color: var(--tools-text);
    font-size: clamp(27px, 4vw, 38px);
    font-weight: 800;
    letter-spacing: -.9px;
}

.tools-header p {
    margin: 0;
    color: var(--tools-muted);
    font-size: 13px;
    line-height: 1.7;
}

/* =========================================================
   MAIN MODE SELECTOR
========================================================= */

.tools-mode-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 26px;
}

.tools-mode-button {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    min-width: 0;
    padding: 17px;
    text-align: left;
    color: var(--tools-muted);
    background: linear-gradient(145deg, #101f18, #0a1510);
    border: 1px solid var(--tools-border);
    border-radius: 17px;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .2s;
}

.tools-mode-button:hover {
    border-color: var(--tools-border-strong);
    transform: translateY(-1px);
}

.tools-mode-button.active {
    color: var(--tools-text);
    border-color: rgba(0, 214, 138, .45);
    background:
        radial-gradient(ellipse at top left, rgba(0, 214, 138, .11), transparent 70%),
        linear-gradient(145deg, #11251a, #0b1711);
    box-shadow: inset 0 0 0 1px rgba(0, 214, 138, .04);
}

.mode-icon {
    display: grid;
    flex: 0 0 43px;
    width: 43px;
    height: 43px;
    place-items: center;
    color: var(--tools-green);
    background: rgba(0, 214, 138, .09);
    border: 1px solid rgba(0, 214, 138, .15);
    border-radius: 13px;
    font-size: 23px;
}

.tools-mode-button strong,
.tools-mode-button small {
    display: block;
}

.tools-mode-button strong {
    margin-bottom: 4px;
    color: inherit;
    font-size: 14px;
}

.tools-mode-button small {
    color: var(--tools-muted);
    font-size: 11px;
    line-height: 1.5;
}

.tools-mode-panel[hidden] {
    display: none !important;
}

/* =========================================================
   TRANSFER TOOL SUMMARY
========================================================= */

.tools-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 13px;
    margin-bottom: 19px;
}

.summary-item {
    min-width: 0;
    padding: 18px 19px;
    background: linear-gradient(145deg, #101e17, #0b1510);
    border: 1px solid var(--tools-border);
    border-radius: 16px;
}

.summary-label {
    display: block;
    margin-bottom: 10px;
    color: var(--tools-muted);
    font-size: 11px;
}

.summary-value {
    display: block;
    color: var(--tools-text);
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -.6px;
}

.summary-value.green {
    color: var(--tools-green);
}

.summary-value.gold {
    color: var(--tools-gold);
}

/* =========================================================
   TRANSFER TOOL SEARCH & FILTER
========================================================= */

.tools-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: 19px;
    background: rgba(12, 24, 18, .85);
    border: 1px solid var(--tools-border);
    border-radius: var(--tools-radius);
}

.tools-toolbar-title {
    min-width: 0;
}

.tools-toolbar-title h2 {
    margin: 0 0 5px;
    color: var(--tools-text);
    font-size: 16px;
    font-weight: 750;
}

.tools-toolbar-title p {
    margin: 0;
    color: var(--tools-muted);
    font-size: 11px;
    line-height: 1.6;
}

.tools-controls {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) 124px;
    align-items: center;
    gap: 10px;
    width: min(420px, 48%);
    min-width: 0;
}

.tools-search,
.tools-filter,
.dp-search,
.dp-view-selector select,
.dp-field input,
.dp-field select,
.dp-field textarea,
#dpInventoryUrls {
    width: 100%;
    min-width: 0;
    color: var(--tools-text);
    background: #09140e;
    border: 1px solid var(--tools-border-strong);
    border-radius: 12px;
    outline: none;
    font: inherit;
    transition: border-color .2s, box-shadow .2s;
}

.tools-search,
.tools-filter {
    height: 45px;
    padding: 0 13px;
    font-size: 16px;
}

.tools-search:focus,
.tools-filter:focus,
.dp-search:focus,
.dp-view-selector select:focus,
.dp-field input:focus,
.dp-field select:focus,
.dp-field textarea:focus,
#dpInventoryUrls:focus {
    border-color: rgba(0, 214, 138, .7);
    box-shadow: 0 0 0 3px rgba(0, 214, 138, .08);
}

.tools-filter {
    cursor: pointer;
}

.tools-filter option,
.dp-view-selector select option,
.dp-field select option {
    color: var(--tools-text);
    background: #0b1710;
}

.tools-list {
    display: grid;
    gap: 12px;
}

.tools-loading,
.tools-empty,
.tools-error {
    padding: 27px 20px;
    color: var(--tools-muted);
    background: rgba(12, 24, 18, .75);
    border: 1px solid var(--tools-border);
    border-radius: 15px;
    font-size: 13px;
    text-align: center;
    overflow-wrap: anywhere;
}

/* =========================================================
   TRANSFER TOOL CARDS
========================================================= */

.tool-card {
    overflow: hidden;
    background: linear-gradient(145deg, #101e17, #0a1510);
    border: 1px solid var(--tools-border);
    border-radius: 16px;
    transition: border-color .2s;
}

.tool-card.open {
    border-color: rgba(0, 214, 138, .28);
}

.tool-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 16px;
    color: inherit;
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.tool-main,
.tool-right {
    display: flex;
    align-items: center;
    min-width: 0;
}

.tool-main {
    gap: 13px;
}

.tool-right {
    flex: 0 0 auto;
    gap: 12px;
}

.tool-logo {
    display: grid;
    flex: 0 0 45px;
    width: 45px;
    height: 45px;
    place-items: center;
    overflow: hidden;
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--tools-border);
    border-radius: 13px;
}

.tool-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tool-logo svg {
    width: 23px;
    height: 23px;
}

.tool-info {
    min-width: 0;
}

.tool-name {
    overflow-wrap: anywhere;
    color: var(--tools-text);
    font-size: 14px;
    font-weight: 750;
}

.tool-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
    color: var(--tools-muted);
    font-size: 10px;
}

.tool-status,
.dp-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 5px 9px;
    color: var(--tools-muted);
    background: rgba(255, 255, 255, .045);
    border: 1px solid var(--tools-border);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.tool-status {
    color: var(--tools-green);
    background: rgba(0, 214, 138, .08);
    border-color: rgba(0, 214, 138, .16);
}

.tool-status.inactive {
    color: var(--tools-gold);
    background: rgba(228, 188, 105, .08);
    border-color: rgba(228, 188, 105, .16);
}

.tool-chevron {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    color: var(--tools-muted);
    transition: transform .2s;
}

.tool-card.open .tool-chevron {
    transform: rotate(180deg);
}

.tool-details {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .25s ease;
}

.tool-card.open .tool-details {
    grid-template-rows: 1fr;
}

.tool-details-inner {
    overflow: hidden;
}

.tool-details-content {
    padding: 0 17px 19px;
    border-top: 1px solid var(--tools-border);
}

.functions-heading,
.pricing-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 9px;
    margin: 18px 0 12px;
}

.functions-heading strong,
.pricing-heading strong {
    color: var(--tools-text);
    font-size: 12px;
}

.functions-heading span,
.pricing-heading span {
    color: var(--tools-muted);
    font-size: 10px;
}

.function-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 9px;
}

.function-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 11px 12px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--tools-border);
    border-radius: 11px;
}

.function-control-name {
    color: #d9e9df;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.function-toggle {
    position: relative;
    flex: 0 0 36px;
    width: 36px;
    height: 21px;
    padding: 0;
    background: #26352c;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 99px;
    cursor: pointer;
}

.function-toggle::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 13px;
    height: 13px;
    content: "";
    background: #b6c4bb;
    border-radius: 50%;
    transition: transform .2s, background .2s;
}

.function-toggle.on {
    background: rgba(0, 214, 138, .24);
    border-color: rgba(0, 214, 138, .45);
}

.function-toggle.on::after {
    background: var(--tools-green);
    transform: translateX(15px);
}

.pricing-list {
    display: grid;
    gap: 8px;
}

.pricing-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(100px, 155px) 38px;
    align-items: center;
    gap: 10px;
    padding: 9px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--tools-border);
    border-radius: 11px;
}

.pricing-name {
    min-width: 0;
    color: #d9e9df;
    font-size: 11px;
    overflow-wrap: anywhere;
}

.pricing-value {
    display: flex;
    align-items: center;
    gap: 7px;
}

.pricing-input {
    width: 100%;
    min-width: 0;
    height: 30px;
    padding: 0 9px;
    color: var(--tools-text);
    background: #08120d;
    border: 1px solid var(--tools-border-strong);
    border-radius: 9px;
    font-size: 16px;
}

.pricing-unit {
    color: var(--tools-muted);
    font-size: 10px;
}

.pricing-save {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: var(--tools-green);
    background: var(--tools-green-soft);
    border: 1px solid rgba(0, 214, 138, .22);
    border-radius: 10px;
    cursor: pointer;
}

.pricing-save svg {
    width: 18px;
    height: 18px;
}

button:disabled {
    opacity: .55;
    cursor: not-allowed !important;
}

/* =========================================================
   DIGITAL PRODUCTS WORKSPACE HEADER
========================================================= */

.digital-products-section {
    min-width: 0;
    padding: clamp(14px, 2.5vw, 25px);
    background:
        radial-gradient(ellipse at top right, rgba(0, 232, 135, .055), transparent 42%),
        linear-gradient(145deg, #0d1b14, #08120d 75%);
    border: 1px solid #203e32;
    border-radius: 22px;
}

.dp-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 23px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--tools-border);
}

.dp-workspace-intro {
    min-width: 0;
}

.dp-workspace-header h2 {
    margin: 7px 0 7px;
    color: var(--tools-text);
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: -.7px;
}

.dp-workspace-header p,
.dp-panel-heading p,
.dp-section-heading p,
.dp-pages-notice p {
    margin: 0;
    color: var(--tools-muted);
    font-size: 12px;
    line-height: 1.7;
}

.dp-view-selector {
    display: grid;
    flex: 0 0 190px;
    gap: 7px;
}

.dp-view-selector label {
    color: var(--tools-muted);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .7px;
    text-transform: uppercase;
}

.dp-view-selector select {
    height: 44px;
    padding: 0 13px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.dp-workspace-view {
    min-width: 0;
}

/* =========================================================
   PANELS & SECTION HEADINGS
========================================================= */

.dp-article-panel,
.dp-pages-panel,
.dp-social-stock,
.dp-inventory {
    min-width: 0;
    padding: clamp(14px, 2vw, 22px);
    background: rgba(7, 17, 12, .67);
    border: 1px solid var(--tools-border);
    border-radius: 17px;
}

.dp-article-panel,
.dp-social-stock {
    margin-bottom: 20px;
}

.dp-panel-heading,
.dp-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 21px;
}

.dp-panel-heading h3,
.dp-section-heading h3 {
    margin: 6px 0 6px;
    color: var(--tools-text);
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.25px;
}

.dp-status-indicator {
    flex: 0 0 auto;
    padding: 7px 10px;
    color: var(--tools-green);
    background: rgba(0, 214, 138, .08);
    border: 1px solid rgba(0, 214, 138, .17);
    border-radius: 99px;
    font-size: 10px;
    font-weight: 750;
}

.dp-status-indicator.error {
    color: var(--tools-danger);
    background: rgba(255, 119, 119, .08);
    border-color: rgba(255, 119, 119, .2);
}

/* =========================================================
   DIGITAL PRODUCT FORMS
========================================================= */

.dp-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.dp-field {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
}

.dp-field.full {
    grid-column: 1 / -1;
}

.dp-field label {
    color: #d8e9df;
    font-size: 11px;
    font-weight: 700;
}

.dp-field input,
.dp-field select {
    height: 40px;
    padding: 0 10px;
    font-size: 16px;
}

.dp-field textarea,
#dpInventoryUrls {
    min-height: 100px;
    padding: 10px;
    resize: vertical;
    line-height: 1.5;
    font-size: 16px;
}

.dp-field textarea.dp-article-content {
    min-height: 250px;
    font-size: 16px;
    line-height: 1.6;
}

.dp-field input::placeholder,
.dp-field textarea::placeholder,
.tools-search::placeholder {
    color: #6f8777;
    opacity: 1;
}

.dp-field-help {
    margin: 0;
    color: var(--tools-muted);
    font-size: 10px;
    line-height: 1.65;
}

.dp-check {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--tools-border);
    border-radius: 11px;
    cursor: pointer;
}

.dp-check input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: var(--tools-green);
}

.dp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

/* =========================================================
   BUTTONS
========================================================= */

.dp-primary,
.dp-secondary,
.dp-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 11px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    text-align: center;
    cursor: pointer;
    transition: transform .18s, background .18s, border-color .18s;
}

.dp-primary {
    color: #04150d;
    background: linear-gradient(135deg, #39efab, #00c982);
    border: 1px solid rgba(0, 214, 138, .5);
    box-shadow: 0 5px 16px rgba(0, 214, 138, .08);
}

.dp-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #62f5bb, #12dc91);
    transform: translateY(-1px);
}

.dp-secondary {
    color: #d9e9df;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--tools-border-strong);
}

.dp-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(155, 205, 177, .35);
}

.dp-danger {
    color: #ffaaaa;
    background: rgba(255, 100, 100, .08);
    border: 1px solid rgba(255, 100, 100, .2);
}

.dp-danger:hover:not(:disabled) {
    background: rgba(255, 100, 100, .14);
}

/* =========================================================
   SOCIAL PLATFORM CARDS — THREE COLUMNS
========================================================= */

.dp-platform-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dp-platform-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 17px;
    background:
        radial-gradient(ellipse at top right, rgba(0, 214, 138, .055), transparent 65%),
        linear-gradient(150deg, #112119, #0a1510);
    border: 1px solid var(--tools-border);
    border-radius: 16px;
    transition: border-color .2s, transform .2s;
}

.dp-platform-card:hover {
    border-color: rgba(0, 214, 138, .27);
    transform: translateY(-2px);
}

.dp-platform-card.not-configured {
    border-style: dashed;
}

.dp-platform-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.dp-platform-top img {
    display: block;
    width: 48px;
    height: 48px;
    padding: 6px;
    object-fit: contain;
    background: rgba(255, 255, 255, .055);
    border: 1px solid var(--tools-border);
    border-radius: 13px;
}

.dp-platform-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 27px;
    padding: 0 7px;
    color: var(--tools-green);
    background: rgba(0, 214, 138, .08);
    border: 1px solid rgba(0, 214, 138, .15);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
}

.dp-platform-card h4,
.dp-page-product h4 {
    margin: 0 0 5px;
    color: var(--tools-text);
    font-size: 15px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.dp-platform-card > p,
.dp-page-product > p {
    margin: 0 0 15px;
    color: var(--tools-muted);
    font-size: 10px;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.dp-platform-price,
.dp-platform-stock {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 0;
    border-top: 1px solid var(--tools-border);
}

.dp-platform-price span,
.dp-platform-stock span {
    color: var(--tools-muted);
    font-size: 10px;
}

.dp-platform-price strong,
.dp-platform-stock strong {
    color: var(--tools-text);
    font-size: 11px;
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.dp-platform-card .dp-platform-edit {
    width: 100%;
    margin-top: 14px;
}

/* =========================================================
   RICH & SURE PAGES
========================================================= */

.dp-pages-notice {
    margin-bottom: 18px;
    padding: 14px 15px;
    background: rgba(0, 214, 138, .045);
    border: 1px solid rgba(0, 214, 138, .15);
    border-radius: 12px;
}

.dp-pages-notice strong {
    display: block;
    margin-bottom: 5px;
    color: #dffff0;
    font-size: 11px;
}

.dp-pages-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.dp-page-product {
    position: relative;
    min-width: 0;
    padding: 17px;
    background: linear-gradient(145deg, #101f18, #0a1510);
    border: 1px solid var(--tools-border);
    border-radius: 15px;
}

.dp-page-product > .dp-platform-number {
    position: absolute;
    top: 15px;
    right: 15px;
}

.dp-page-product-top {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 42px 15px 0;
}

.dp-page-product h4 {
    margin-bottom: 8px;
    padding-right: 15px;
}

.dp-page-product .dp-primary {
    width: 100%;
    margin-top: 14px;
}

/* =========================================================
   SHARED INVENTORY PANEL
========================================================= */

.dp-inventory {
    margin-top: 20px;
    scroll-margin-top: 20px;
}

.dp-inventory .dp-panel-heading {
    align-items: center;
}

.dp-inventory .dp-panel-heading h3 {
    margin-top: 5px;
}

.dp-inventory-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 9px;
    padding: 12px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--tools-border);
    border-radius: 12px;
}

.dp-inventory-row-content {
    min-width: 0;
}

.dp-inventory-url {
    margin-bottom: 8px;
    color: #d8e9df;
    font-size: 11px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.dp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

/* =========================================================
   PLATFORM EDIT MODAL — BLURRED BACKGROUND
========================================================= */

.dp-modal {
    position: fixed;
    z-index: 10050;
    inset: 0;
    display: grid;
    align-items: center;
    justify-items: center;
    padding: 18px;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .22s, visibility .22s;
}

.dp-modal.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.dp-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 8, 5, .76);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.dp-modal-card {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(88dvh, 820px);
    overflow-y: auto;
    padding: clamp(17px, 4vw, 25px);
    color: var(--tools-text);
    background:
        radial-gradient(ellipse at top right, rgba(0, 214, 138, .08), transparent 60%),
        #0b1710;
    border: 1px solid rgba(0, 214, 138, .23);
    border-radius: 20px;
    box-shadow: 0 25px 90px rgba(0, 0, 0, .48);
    transform: translateY(12px) scale(.985);
    transition: transform .22s;
}

.dp-modal.show .dp-modal-card {
    transform: translateY(0) scale(1);
}

.dp-modal-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 23px;
}

.dp-modal-heading h3 {
    margin: 6px 0;
    color: var(--tools-text);
    font-size: 21px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.dp-modal-heading p {
    margin: 0;
    color: var(--tools-muted);
    font-size: 11px;
    line-height: 1.65;
}

.dp-modal-x {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    color: #d8e9df;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--tools-border);
    border-radius: 11px;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}

.dp-modal-x:hover {
    color: var(--tools-green);
    border-color: rgba(0, 214, 138, .3);
}

.dp-modal-card .dp-actions {
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid var(--tools-border);
}

/* =========================================================
   EXISTING TOOL CREATION MODAL
========================================================= */

.tool-modal {
    position: fixed;
    z-index: 10040;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(2, 8, 5, .78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, visibility .2s;
}

.tool-modal.show {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.tool-modal-card {
    width: min(760px, 100%);
    max-height: 90dvh;
    overflow-y: auto;
    color: var(--tools-text);
    background: #0c1812;
    border: 1px solid var(--tools-border-strong);
    border-radius: 19px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, .45);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 21px;
    border-bottom: 1px solid var(--tools-border);
}

.modal-header h2 {
    margin: 0 0 6px;
    color: var(--tools-text);
    font-size: 19px;
}

.modal-header p {
    margin: 0;
    color: var(--tools-muted);
    font-size: 11px;
    line-height: 1.6;
}

.modal-close {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    color: var(--tools-muted);
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--tools-border);
    border-radius: 10px;
    cursor: pointer;
}

.modal-close svg {
    width: 19px;
    height: 19px;
}

.modal-body {
    padding: 21px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.form-field {
    display: grid;
    align-content: start;
    gap: 8px;
    min-width: 0;
}

.form-field.full {
    grid-column: 1 / -1;
}

.form-field > label {
    color: #d8e9df;
    font-size: 11px;
    font-weight: 700;
}

.form-field input:not([type="file"]),
.form-field select,
.form-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 43px;
    padding: 10px 12px;
    color: var(--tools-text);
    background: #08120d;
    border: 1px solid var(--tools-border-strong);
    border-radius: 10px;
    outline: none;
    font: inherit;
    font-size: 12px;
}

.form-field textarea {
    resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: rgba(0, 214, 138, .7);
    box-shadow: 0 0 0 3px rgba(0, 214, 138, .08);
}

.logo-upload {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--tools-border);
    border-radius: 12px;
}

.logo-preview {
    display: grid;
    flex: 0 0 62px;
    width: 62px;
    height: 62px;
    place-items: center;
    overflow: hidden;
    color: var(--tools-muted);
    background: #09140e;
    border: 1px solid var(--tools-border);
    border-radius: 12px;
}

.logo-preview svg,
.logo-preview img {
    width: 100%;
    height: 100%;
}

.logo-preview img {
    object-fit: contain;
}

.logo-preview svg {
    width: 28px;
    height: 28px;
}

.logo-upload-content {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.logo-upload-content strong {
    color: var(--tools-text);
    font-size: 11px;
}

.logo-upload-content span {
    color: var(--tools-muted);
    font-size: 10px;
    line-height: 1.5;
}

.logo-upload-content input {
    width: 100%;
    max-width: 100%;
    color: var(--tools-muted);
    font-size: 10px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 17px 21px;
    border-top: 1px solid var(--tools-border);
}

.modal-button {
    min-height: 41px;
    padding: 0 17px;
    border-radius: 10px;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.modal-button.cancel {
    color: #d8e9df;
    background: rgba(255, 255, 255, .035);
    border: 1px solid var(--tools-border-strong);
}

.modal-button.save {
    color: #04150d;
    background: var(--tools-green);
    border: 1px solid var(--tools-green);
}

/* =========================================================
   STATUS TOAST
========================================================= */

.tools-status-message {
    position: fixed;
    z-index: 11000;
    right: 18px;
    bottom: 20px;
    width: max-content;
    max-width: calc(100vw - 36px);
    padding: 13px 17px;
    color: var(--tools-text);
    background: #10251a;
    border: 1px solid rgba(0, 214, 138, .27);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
    font-size: 12px;
    line-height: 1.6;
    overflow-wrap: anywhere;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s, transform .2s, visibility .2s;
}

.tools-status-message.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* =========================================================
   RESPONSIVE LAYOUT
========================================================= */

@media (max-width: 760px) {
    .tools-page {
        padding-top: 20px;
    }

    .tools-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 16px;
    }

    .tools-controls {
        grid-template-columns: minmax(0, 1fr) 112px;
        width: 100%;
    }

    .dp-workspace-header {
        align-items: stretch;
        flex-direction: column;
        gap: 17px;
    }

    .dp-view-selector {
        flex-basis: auto;
        width: 100%;
    }

    .dp-platform-grid {
        gap: 10px;
    }

    .dp-platform-card {
        padding: 12px;
    }

    .dp-platform-top img {
        width: 40px;
        height: 40px;
    }

    .dp-platform-card h4 {
        font-size: 13px;
    }

    .dp-platform-card > p {
        min-height: 30px;
    }

    .dp-platform-price,
    .dp-platform-stock {
        flex-direction: column;
        gap: 5px;
    }

    .dp-platform-price strong,
    .dp-platform-stock strong {
        text-align: left;
    }

    .dp-platform-card .dp-primary {
        padding: 0 8px;
    }

    .dp-pages-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .tools-page {
        padding-right: 12px;
        padding-left: 12px;
    }

    .tools-mode-switch {
        gap: 8px;
    }

    .tools-mode-button {
        align-items: flex-start;
        gap: 9px;
        padding: 12px 10px;
    }

    .mode-icon {
        flex-basis: 33px;
        width: 33px;
        height: 33px;
        border-radius: 10px;
        font-size: 18px;
    }

    .tools-mode-button strong {
        font-size: 12px;
    }

    .tools-mode-button small {
        font-size: 9px;
    }

    .tools-summary {
        gap: 8px;
    }

    .summary-item {
        padding: 13px 11px;
    }

    .summary-label {
        font-size: 10px;
    }

    .summary-value {
        font-size: 22px;
    }

    .tools-controls {
        grid-template-columns: minmax(0, 1fr) 100px;
        gap: 8px;
    }

    .tools-search,
    .tools-filter {
        height: 43px;
        padding-right: 9px;
        padding-left: 10px;
        font-size: 11px;
    }

    .tool-trigger {
        padding: 12px 10px;
    }

    .tool-logo {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .tool-main {
        gap: 9px;
    }

    .tool-name {
        font-size: 12px;
    }

    .tool-right {
        gap: 7px;
    }

    .tool-status {
        padding: 4px 6px;
        font-size: 9px;
    }

    .tool-chevron {
        width: 16px;
        height: 16px;
        flex-basis: 16px;
    }

    .dp-platform-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
    }

    .dp-platform-card {
        padding: 9px;
        border-radius: 12px;
    }

    .dp-platform-top {
        align-items: flex-start;
        gap: 5px;
        margin-bottom: 10px;
    }

    .dp-platform-top img {
        width: 33px;
        height: 33px;
        padding: 4px;
        border-radius: 9px;
    }

    .dp-platform-number {
        min-width: 23px;
        height: 22px;
        padding: 0 4px;
        font-size: 9px;
    }

    .dp-platform-card h4 {
        font-size: 11px;
    }

    .dp-platform-card > p {
        min-height: 42px;
        margin-bottom: 10px;
        font-size: 9px;
    }

    .dp-platform-price,
    .dp-platform-stock {
        gap: 4px;
        padding: 9px 0;
    }

    .dp-platform-price span,
    .dp-platform-stock span {
        font-size: 9px;
        line-height: 1.45;
    }

    .dp-platform-price strong,
    .dp-platform-stock strong {
        font-size: 10px;
        text-align: left;
    }

    .dp-platform-card .dp-primary {
        min-height: 36px;
        margin-top: 10px;
        padding: 0 5px;
        font-size: 10px;
    }

    .dp-grid,
    .form-grid {
        grid-template-columns: 1fr;
        gap: 13px;
    }

    .dp-field.full,
    .form-field.full {
        grid-column: auto;
    }

    .dp-panel-heading {
        flex-direction: column;
        gap: 12px;
    }

    .dp-article-panel,
    .dp-pages-panel,
    .dp-social-stock,
    .dp-inventory {
        padding: 13px;
    }

    .dp-field textarea.dp-article-content {
        min-height: 240px;
    }

    .dp-actions {
        align-items: stretch;
    }

    .dp-actions > button {
        flex: 1 1 auto;
    }

    .dp-modal {
        padding: 10px;
    }

    .dp-modal-card {
        padding: 16px;
        border-radius: 16px;
    }

    .dp-inventory-row {
        align-items: flex-start;
    }

    .pricing-row {
        grid-template-columns: minmax(0, 1fr) minmax(85px, 110px) 34px;
        gap: 7px;
        padding: 7px;
    }

    .pricing-save {
        width: 32px;
        height: 34px;
    }

    .pricing-input {
        padding: 0 6px;
    }

    .function-grid {
        grid-template-columns: 1fr;
    }

    .modal-body,
    .modal-header {
        padding: 15px;
    }

    .modal-footer {
        padding: 13px 15px;
    }

    .logo-upload {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* iPhone Safari: prevent automatic input zoom */
input,
select,
textarea,
.tools-search,
.tools-filter,
.dp-search,
.dp-view-selector select,
.dp-field input,
.dp-field select,
.dp-field textarea,
#dpInventoryUrls,
.pricing-input,
.form-field input,
.form-field select,
.form-field textarea {
    font-size: 16px !important;
}