/* ─── Distributør Portal – Frontend Styles ─── */

:root {
    --dp-primary: #2c3e50;
    --dp-primary-light: #34495e;
    --dp-accent: #3498db;
    --dp-accent-hover: #2980b9;
    --dp-success: #27ae60;
    --dp-danger: #e74c3c;
    --dp-warning: #f39c12;
    --dp-text: #ffffff;
    --dp-text-light: #a0a0a0;
    --dp-bg: #1a1a1a;
    --dp-white: #131313;
    --dp-border: #2a2a2a;
    --dp-radius: 8px;
    --dp-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ─── Registration & Login Forms ─── */
.dp-registration-wrap,
.dp-login-wrap {
    max-width: 560px;
    width: 100%;
    margin: 40px auto;
    padding: 48px;
    background: #131313 !important;
    border: 1px solid #303030 !important;
    border-radius: 20px;
    box-shadow: var(--dp-shadow);
    color: #ffffff !important;
}

.dp-login-wrap .dp-login-form {
    width: 100%;
}

.dp-login-wrap input[type="email"],
.dp-login-wrap input[type="password"] {
    width: 100% !important;
    min-width: 100% !important;
    box-sizing: border-box !important;
    padding: 14px 16px !important;
    font-size: 16px !important;
}

.dp-registration-wrap *,
.dp-login-wrap * {
    color: #ffffff;
}

.dp-registration-wrap .dp-hint,
.dp-login-wrap .dp-hint,
.dp-login-wrap .dp-form-link {
    color: #a0a0a0 !important;
}

.dp-registration-wrap .dp-form-subtitle {
    color: #ffffff !important;
}

.dp-registration-wrap input,
.dp-registration-wrap select,
.dp-login-wrap input {
    background: #1a1a1a !important;
    color: #ffffff !important;
    border: 1px solid #303030 !important;
}

.dp-registration-wrap .dp-submit-btn,
.dp-login-wrap .dp-submit-btn {
    background: linear-gradient(140deg, #FFEB3B 0%, #FF9800 100%) !important;
    color: #000 !important;
    border: none !important;
    border-radius: 100px !important;
}

.dp-form-title {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 16px;
}

.dp-form-subtitle {
    color: #ffffff !important;
    margin-bottom: 28px;
    font-size: 15px;
}

.dp-registration-form {
    margin-top: 20px;
}

.dp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.dp-form-group {
    margin-bottom: 20px;
}

.dp-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #ffffff !important;
    margin-bottom: 6px;
}

.dp-form-group input,
.dp-form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    font-size: 15px;
    color: #ffffff !important;
    background: #1a1a1a !important;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.dp-form-group input:focus,
.dp-form-group select:focus {
    outline: none;
    border-color: var(--dp-accent);
    box-shadow: 0 0 0 3px rgba(52,152,219,0.1);
}

/* ─── Custom Country Dropdown ─── */
.dp-country-select {
    position: relative;
    width: 100%;
}

.dp-country-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid #303030;
    border-radius: 6px;
    background: #1a1a1a !important;
    color: #ffffff !important;
    font-size: 15px;
    cursor: pointer;
    min-height: 42px;
}

.dp-country-selected img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dp-country-placeholder {
    color: #666 !important;
}

.dp-country-arrow {
    margin-left: auto;
    font-size: 10px;
    color: #666;
}

.dp-country-clear {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
}

.dp-country-clear:hover {
    color: #fff;
}

.dp-country-clear + .dp-country-arrow {
    margin-left: 0;
}

.dp-country-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: #1a1a1a !important;
    border: 1px solid #303030;
    border-radius: 6px;
    z-index: 1000;
    max-height: 280px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.dp-country-dropdown.dp-country-open {
    display: block;
}

.dp-country-search {
    width: 100% !important;
    padding: 10px 14px !important;
    border: none !important;
    border-bottom: 1px solid #303030 !important;
    background: #1a1a1a !important;
    color: #ffffff !important;
    font-size: 14px !important;
    border-radius: 6px 6px 0 0 !important;
    box-sizing: border-box;
}

.dp-country-search:focus {
    outline: none !important;
    box-shadow: none !important;
}

.dp-country-list {
    max-height: 230px;
    overflow-y: auto;
}

.dp-country-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    color: #ffffff !important;
    font-size: 14px;
}

.dp-country-option:hover {
    background: #303030;
}

.dp-country-option img {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    flex-shrink: 0;
}

.dp-country-list::-webkit-scrollbar {
    width: 6px;
}

.dp-country-list::-webkit-scrollbar-track {
    background: transparent;
}

.dp-country-list::-webkit-scrollbar-thumb {
    background: #404040;
    border-radius: 3px;
}

.dp-hint {
    display: block;
    font-size: 12px;
    color: var(--dp-text-light);
    margin-top: 4px;
}

.dp-submit-btn {
    display: inline-block;
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(140deg, #FFEB3B 0%, #FF9800 100%) !important;
    color: #000 !important;
    border: none !important;
    border-radius: 100px !important;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, filter 0.3s ease !important;
    margin-top: 8px;
}

.dp-submit-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(255, 152, 0, 0.4);
    filter: brightness(1.1);
}

.dp-form-check {
    margin-bottom: 20px;
}

.dp-form-check label {
    font-size: 14px;
    color: var(--dp-text);
    cursor: pointer;
}

.dp-form-link {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: var(--dp-text-light);
}

.dp-form-link a {
    color: #FFC107 !important;
    text-decoration: none;
    font-weight: 600;
}

.dp-form-link a:hover {
    color: #FFD54F !important;
    text-decoration: underline;
}

/* ─── Messages ─── */
.dp-errors {
    background: #fdf2f2;
    border: 1px solid #fca5a5;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.dp-errors p {
    color: var(--dp-danger);
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* In the success state, widen the box so each sentence fits on one line (2 lines total, not 4) */
.dp-registration-wrap:has(.dp-success-message) {
    max-width: 640px;
}

.dp-success-message {
    text-align: center;
    padding: 40px 12px;
}

.dp-success-icon {
    width: 60px;
    height: 60px;
    background: var(--dp-success);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 20px;
}

.dp-success-message h2 {
    color: var(--dp-text);
    margin-bottom: 12px;
}

.dp-success-message p {
    color: var(--dp-text-light);
    font-size: 15px;
    line-height: 1.6;
}

/* ─── Account Dashboard ─── */
.dp-account-wrap {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px;
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}

.dp-account-sidebar {
    background: #131313 !important;
    border: 1px solid #303030 !important;
    border-radius: 20px 20px 20px 20px;
    box-shadow: var(--dp-shadow);
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 40px;
    color: #ffffff !important;
}

.dp-account-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 20px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--dp-border);
}

.dp-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--dp-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.dp-user-info strong {
    display: block;
    font-size: 14px;
    color: #ffffff !important;
}

.dp-user-info span {
    display: block;
    font-size: 12px;
    color: #a0a0a0 !important;
}

.dp-account-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dp-nav-item {
    display: block;
    padding: 10px 14px;
    border-radius: 6px;
    color: #ffffff !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s;
}

.dp-nav-item:hover {
    background: #1a1a1a;
    text-decoration: none;
    color: #ffffff !important;
}

.dp-nav-item.active {
    background: linear-gradient(140deg, #FFEB3B 0%, #FF9800 100%) !important;
    color: #000 !important;
}

.dp-nav-logout {
    margin-top: 12px;
    color: var(--dp-danger);
}

.dp-nav-logout:hover {
    background: rgba(231,76,60,0.1);
}

.dp-account-content {
    background: #131313 !important;
    border: 1px solid #303030 !important;
    border-radius: 20px 20px 20px 20px;
    box-shadow: var(--dp-shadow);
    padding: 32px;
    min-height: 400px;
    color: #ffffff !important;
}

.dp-account-content h2 {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff !important;
    margin-bottom: 24px;
}

.dp-account-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff !important;
    margin-bottom: 12px;
}

/* ─── Overview Cards ─── */
.dp-overview-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.dp-card {
    background: #1a1a1a !important;
    border-radius: var(--dp-radius);
    padding: 20px;
}

.dp-card-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a0a0a0 !important;
    margin-bottom: 8px;
}

.dp-card-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff !important;
}

/* ─── Quick Links ─── */
.dp-quick-links {
    border-top: 1px solid var(--dp-border);
    padding-top: 24px;
}

.dp-quick-link {
    display: block;
    padding: 12px 0;
    color: #FFC107 !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-bottom: 1px solid var(--dp-border);
}

.dp-quick-link:last-child {
    border-bottom: none;
}

.dp-quick-link:hover {
    color: #FFD54F !important;
    text-decoration: none;
}

/* ─── Profile Form (in dashboard) ─── */
.dp-profile-form {
    max-width: 100%;
}

.dp-profile-form .dp-submit-btn {
    width: auto;
    padding: 10px 32px;
}

.dp-profile-form hr {
    margin: 28px 0 20px;
    border: none;
    border-top: 1px solid var(--dp-border);
}

/* ─── Currency Toggle ─── */
/* ─── Price List Table ─── */
.dp-pricelist-category {
    margin-bottom: 28px;
}

.dp-pricelist-table {
    width: 100%;
    border-collapse: collapse;
}

.dp-pricelist-table th,
.dp-pricelist-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #2a2a2a;
    color: #ffffff !important;
}

.dp-pricelist-table th {
    font-weight: 600;
    color: #a0a0a0 !important;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #1a1a1a !important;
}

.dp-pricelist-table td:last-child {
    font-weight: 700;
    color: #ffffff !important;
}

/* ─── Orders Table ─── */
.dp-orders-table {
    width: 100%;
    border-collapse: collapse;
}

.dp-orders-table th,
.dp-orders-table td {
    padding: 12px 14px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid var(--dp-border);
}

.dp-orders-table th {
    font-weight: 600;
    color: var(--dp-text-light);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--dp-bg);
}

.dp-order-status {
    display: inline-flex;
    align-items: center;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    line-height: 1.4;
}

.dp-status-pending { background: #F5A623; color: #000; }
.dp-status-processing { background: #3B82F6; color: #fff; }
.dp-status-shipped { background: #8B5CF6; color: #fff; }
.dp-status-completed { background: #22C55E; color: #000; }
.dp-status-cancelled { background: #EF4444; color: #fff; }

.dp-empty-state {
    text-align: center;
    padding: 40px;
    color: var(--dp-text-light);
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .dp-account-wrap {
        grid-template-columns: 1fr;
    }

    .dp-account-sidebar {
        position: static;
    }

    .dp-account-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .dp-nav-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .dp-form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

    .dp-registration-wrap,
    .dp-login-wrap {
        box-sizing: border-box;
        width: auto;
        margin: 24px 16px;
        padding: 28px 22px;
    }

    /* 16px inputs stop iOS Safari from auto-zooming when a field is focused */
    .dp-registration-wrap input,
    .dp-registration-wrap select,
    .dp-registration-wrap .dp-country-selected,
    .dp-registration-wrap .dp-country-search {
        font-size: 16px !important;
    }
}

@media (max-width: 480px) {
    .dp-registration-wrap,
    .dp-login-wrap {
        margin: 16px 12px;
        padding: 22px 18px;
        border-radius: 16px;
    }

    .dp-form-title {
        font-size: 22px;
    }

    .dp-success-message {
        padding: 28px 6px;
    }
}

/* ─── Order List ─── */
.dp-order-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dp-order-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.dp-order-card-link:hover {
    text-decoration: none;
}

.dp-order-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border: 1px solid #2a2a2a;
    border-radius: var(--dp-radius);
    background: #1a1a1a !important;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.dp-order-card:hover {
    border-color: #FFC107;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.15);
}

.dp-order-card-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dp-order-card-id {
    font-size: 15px;
    color: #ffffff !important;
}

.dp-order-card-date {
    font-size: 13px;
    color: #a0a0a0 !important;
}

.dp-order-card-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dp-order-card-items {
    font-size: 13px;
    color: var(--dp-text-light);
}

.dp-order-card-total {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff !important;
}

.dp-order-card-right {
    display: flex;
    align-items: center;
}

.dp-order-card-arrow {
    font-size: 18px;
    color: var(--dp-text-light);
    transition: transform 0.15s;
}

.dp-order-card:hover .dp-order-card-arrow {
    transform: translateX(4px);
    color: #FFC107;
}

/* ─── Order Detail View ─── */
.dp-back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #FFC107 !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.dp-back-link:hover {
    color: #FFD54F !important;
    text-decoration: underline;
}

.dp-order-detail-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
}

.dp-order-detail-header h2 {
    margin-bottom: 0;
}

.dp-order-meta {
    display: flex;
    gap: 24px;
    padding: 16px 20px;
    background: #1a1a1a !important;
    border-radius: var(--dp-radius);
    margin-bottom: 28px;
    overflow: visible;
}

.dp-order-meta-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.dp-order-meta-item:first-child {
    min-width: 90px;
}

.dp-order-meta-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a0a0a0 !important;
}

.dp-order-meta-item span:last-child:not(.dp-order-status) {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff !important;
}

.dp-order-meta-item .dp-order-status {
    font-size: 12px !important;
    font-weight: 700 !important;
}

.dp-order-meta-item .dp-status-pending { color: #000 !important; }
.dp-order-meta-item .dp-status-processing { color: #fff !important; }
.dp-order-meta-item .dp-status-shipped { color: #fff !important; }
.dp-order-meta-item .dp-status-completed { color: #000 !important; }
.dp-order-meta-item .dp-status-cancelled { color: #fff !important; }

/* ─── Order Items Table ─── */
.dp-order-items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
}

.dp-order-items-table th,
.dp-order-items-table td {
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
    border-bottom: 1px solid #2a2a2a;
    color: #ffffff !important;
}

.dp-order-items-table th {
    font-weight: 600;
    color: #a0a0a0 !important;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #1a1a1a !important;
}

.dp-order-cfg,
.dp-order-notes {
    margin-top: 20px;
    padding: 20px;
    background: #1a1a1a !important;
    border-radius: 12px;
    border: 1px solid #303030;
}

.dp-order-notes h3 {
    margin: 0 0 16px 0;
    font-size: 16px;
    color: #ffffff !important;
}

.dp-notes-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 20px;
    align-items: baseline;
}

.dp-notes-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a0a0a0 !important;
}

.dp-notes-value {
    font-size: 14px;
    color: #ffffff !important;
}

.dp-order-cfg p {
    margin: 4px 0 0;
    color: #a0a0a0 !important;
    line-height: 1.6;
}
/* ─── Materiale-bibliotek ─────────────────────────────────── */
.dp-materials { margin-top: 4px; }

.dp-mat-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    margin-bottom: 18px;
}
.dp-mat-breadcrumb a {
    color: #cfcfcf !important;
    text-decoration: none;
}
.dp-mat-breadcrumb a:last-child { color: #ffffff !important; }
.dp-mat-breadcrumb a:hover { text-decoration: underline; }
.dp-mat-sep { color: #707070; }

.dp-mat-empty { color: #a0a0a0 !important; padding: 8px 4px; margin: 0; }

.dp-mat-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dp-mat-files {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dp-mat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #1a1a1a;
    border: 1px solid #303030;
    border-radius: 12px;
    padding: 13px 16px;
    text-decoration: none;
}
.dp-mat-folder { cursor: pointer; transition: border-color .15s ease; }
.dp-mat-folder:hover { border-color: #4a4a4a; }

.dp-mat-folder-icon {
    flex-shrink: 0;
    width: 54px;
    box-sizing: border-box;
    height: 30px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #15304a;
    color: #7db8f0;
}
.dp-mat-folder-icon svg { width: 18px; height: 18px; }

.dp-mat-fileicon {
    flex-shrink: 0;
    width: 54px;
    box-sizing: border-box;
    height: 30px;
    padding: 0 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    overflow: hidden;
}
.dp-mat-fileicon svg { flex-shrink: 0; }
.dp-tint-danger  { background: #3a1d1d; color: #f08a8a; }
.dp-tint-accent  { background: #15304a; color: #7db8f0; }
.dp-tint-blue    { background: #15304a; color: #7db8f0; }
.dp-tint-purple  { background: #2a1d3a; color: #b890f0; }
.dp-tint-success { background: #16331f; color: #7fd398; }
.dp-tint-warning { background: #3a2f16; color: #e0b65a; }
.dp-tint-muted   { background: #2a2a2a; color: #b0b0b0; }

.dp-mat-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.dp-mat-title { color: #ffffff !important; font-weight: 500; }
.dp-mat-sub { font-size: 12px; color: #909090 !important; }

.dp-mat-chevron { font-size: 22px; color: #707070; line-height: 1; }

.dp-mat-download {
    flex-shrink: 0;
    white-space: nowrap;
    background: linear-gradient(140deg, #FFEB3B 0%, #FF9800 100%);
    color: #3a2600 !important;
    text-decoration: none;
    padding: 9px 16px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 600;
    transition: filter .15s ease;
}
.dp-mat-download:hover { filter: brightness(1.07); }

/* Tilbage-række øverst i mappe-listen */
.dp-mat-back {
    background: transparent;
    border: 1px dashed #404040;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease;
}
.dp-mat-back:hover {
    border-color: #5a5a5a;
    background: #161616;
}
.dp-mat-back-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0a0a0;
    min-width: 22px;
}
.dp-mat-back .dp-mat-title { color: #c8c8c8 !important; font-weight: 500; }

/* Loading under AJAX-navigation: skeleton-rækker (intet fuldt sidegenindlæs) */
.dp-materials { transition: opacity .12s ease; }

@keyframes dpPulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.7; } }

.dp-skel-neutral {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dp-skel-bar {
    height: 56px;
    width: 100%;
    background: #333;
    border-radius: 12px;
    animation: dpPulse 1.2s ease-in-out infinite;
}

/* ─── Topniveau: galleri af kategori-kort ─────────────────── */
.dp-mat-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 300px));
    gap: 22px;
    justify-content: start;
}
@media (max-width: 780px) { .dp-mat-gallery { grid-template-columns: repeat(2, minmax(0, 300px)); } }
@media (max-width: 520px) { .dp-mat-gallery { grid-template-columns: 1fr; } }

.dp-mat-card { text-decoration: none; display: block; }

.dp-mat-card-img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 14px;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    border: 1px solid #303030;
    transition: transform .18s ease, border-color .18s ease;
}
.dp-mat-card:hover .dp-mat-card-img {
    transform: translateY(-3px);
    border-color: #FF9800;
}

.dp-mat-card-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4a4a4a;
    background: linear-gradient(135deg, #1f1f1f, #121212);
}

.dp-mat-card-title {
    display: block;
    text-align: center;
    color: #ffffff;
    font-size: 20px;
    margin-top: 11px;
}

/* Back-row sidder i egen wrapper (så den virker over både galleri og liste) */
.dp-mat-backwrap { margin-bottom: 10px; }

/* Adskillelse mellem kort-galleri og liste (vises kun når begge findes) */
.dp-mat-divider {
    border-top: 1px solid #2a2a2a;
    margin: 22px 0;
}

/* ─── Billed-thumbnail i liste-rækker ─────────────────────── */
.dp-mat-thumb {
    flex-shrink: 0;
    width: 54px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #1a1a1a;
    position: relative;
}
.dp-mat-thumb.dp-thumb-loading {
    background-color: #333;
    animation: dpPulse 1.2s ease-in-out infinite;
}
/* Blurred, zoomed copy fills the square so there are no dead bars */
.dp-mat-thumb-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
    transform: scale(1.25);
    opacity: 0;
    transition: opacity .3s ease;
}
/* Sharp copy shows the whole image on top */
.dp-materials .dp-mat-thumb .dp-mat-thumb-img,
.dp-materials .dp-mat-thumb-img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    display: block;
    opacity: 0;
    transition: opacity .3s ease;
}
.dp-mat-thumb.dp-thumb-loaded { animation: none; }
.dp-mat-thumb.dp-thumb-loaded .dp-mat-thumb-img,
.dp-mat-thumb.dp-thumb-loaded .dp-mat-thumb-bg { opacity: 1; }

/* View-knap (samme pille-form, men neutral) */
.dp-mat-view {
    flex-shrink: 0;
    white-space: nowrap;
    background: transparent;
    border: 1px solid #4a4a4a;
    color: #ddd !important;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    transition: border-color .15s ease, color .15s ease;
}
.dp-mat-view:hover { border-color: #FF9800; color: #fff !important; }

/* ─── Lightbox ────────────────────────────────────────────── */
.dp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}
.dp-lightbox[hidden] { display: none; }

.dp-lightbox-inner {
    display: flex;
    max-width: 92vw;
    max-height: 90vh;
}
.dp-lightbox-card {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    max-height: 100%;
}
.dp-lightbox-img {
    max-width: 80vw;
    max-height: 74vh;
    object-fit: contain;
    border-radius: 10px;
    background: #111;
    display: block;
}
.dp-lightbox-imgwrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    min-width: 120px;
}
.dp-lightbox-imgwrap .dp-pdf-loading {
    border-radius: 10px;
}
.dp-lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 2px;
}
.dp-lightbox-title { color: #fff; font-size: 15px; font-weight: 500; }
.dp-lightbox-close {
    position: fixed;
    top: 16px;
    right: 22px;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    z-index: 100000;
}
.dp-lightbox-close:hover { opacity: 1; }

/* ─── "Load more"-knap ────────────────────────────────────── */
.dp-mat-loadmore-wrap {
    display: flex;
    justify-content: center;
    margin-top: 18px;
}
.dp-materials .dp-mat-loadmore,
.dp-materials .dp-mat-loadmore:hover,
.dp-materials .dp-mat-loadmore:focus,
.dp-materials .dp-mat-loadmore:active {
    background: transparent;
    background-color: transparent;
    border: 1px solid #4a4a4a;
    box-shadow: none;
    padding: 10px 26px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color .15s ease, color .15s ease;
    text-transform: none;
    letter-spacing: normal;
}
.dp-materials .dp-mat-loadmore { color: #ddd; }
.dp-materials .dp-mat-loadmore:hover,
.dp-materials .dp-mat-loadmore:focus {
    border-color: #FF9800;
    color: #fff;
}
.dp-materials .dp-mat-loadmore:disabled { opacity: .6; cursor: default; }

/* ─── PDF-preview i lightbox ──────────────────────────────── */
.dp-lightbox-pdf {
    width: 80vw;
    max-width: 900px;
    height: 88vh;
}
.dp-lightbox-framewrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
}
.dp-lightbox-frame {
    flex: 1;
    width: 100%;
    border: none;
    border-radius: 10px;
    background: #fff;
    min-height: 0;
}
.dp-pdf-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #1a1a1a;
    border-radius: 10px;
    z-index: 2;
    transition: opacity .3s ease;
}
.dp-pdf-loading-done {
    opacity: 0;
    pointer-events: none;
}
.dp-pdf-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid #333;
    border-top-color: #FF9800;
    border-radius: 50%;
    animation: dpSpin 0.8s linear infinite;
}
@keyframes dpSpin { to { transform: rotate(360deg); } }
.dp-pdf-loading-text {
    color: #999;
    font-size: 14px;
}
.dp-lightbox-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — tablet & mobil
   ═══════════════════════════════════════════════════════════ */

/* Ikon i knapper er skjult som standard (desktop viser tekst) */
.dp-btn-icon { display: none; align-items: center; justify-content: center; }
.dp-btn-icon svg { display: block; }

/* ─── Tablet (≤ 900px) ───────────────────────────────────── */
@media (max-width: 900px) {
    .dp-mat-gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* ─── Mobil (≤ 600px) ────────────────────────────────────── */
@media (max-width: 600px) {
    /* Galleri: 2 kort per række */
    .dp-mat-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .dp-mat-card-title { font-size: 15px; margin-top: 8px; }

    /* Rækker: lidt mindre luft */
    .dp-mat-row {
        gap: 10px;
        padding: 11px 12px;
    }

    /* Titel må ikke skubbe knapper ud — tillad afkortning */
    .dp-mat-body { min-width: 0; }
    .dp-mat-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* View/Download bliver kompakte ikon-knapper */
    .dp-mat-view,
    .dp-mat-download {
        padding: 0;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .dp-mat-view .dp-btn-label,
    .dp-mat-download .dp-btn-label { display: none; }
    .dp-mat-view .dp-btn-icon,
    .dp-mat-download .dp-btn-icon { display: flex; }

    /* Brødkrummer: én linje med vandret scroll i stedet for at wrappe */
    .dp-mat-breadcrumb {
        font-size: 13px;
        gap: 4px;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 2px;
    }
    .dp-mat-breadcrumb::-webkit-scrollbar { display: none; }
    .dp-mat-breadcrumb a { flex-shrink: 0; }

    /* Ikon-badges lidt mindre */
    .dp-mat-folder-icon,
    .dp-mat-fileicon { width: 48px; }
    .dp-mat-thumb { width: 48px; height: 42px; }

    /* Lightbox fylder mere af skærmen */
    .dp-lightbox { padding: 12px; }
    .dp-lightbox-img { max-width: 78vw; max-height: 72vh; }
    .dp-lightbox-pdf { width: 94vw; height: 82vh; }
    .dp-lightbox-close { top: 10px; right: 14px; font-size: 28px; }

    /* Lightbox-bar: stabl titel over knapper så de ikke overlapper */
    .dp-lightbox-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .dp-lightbox-title {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .dp-lightbox-actions {
        justify-content: flex-end;
        gap: 8px;
    }
    .dp-lightbox-bar .dp-mat-download,
    .dp-lightbox-bar .dp-mat-view {
        padding: 9px 16px;
        width: auto;
        height: auto;
        border-radius: 40px;
    }
    /* I lightbox vil vi beholde teksten på knapperne (der er plads når stablet) */
    .dp-lightbox-bar .dp-mat-download .dp-btn-label,
    .dp-lightbox-bar .dp-mat-view .dp-btn-label { display: inline; }
    .dp-lightbox-bar .dp-mat-download .dp-btn-icon,
    .dp-lightbox-bar .dp-mat-view .dp-btn-icon { display: none; }

    /* Load more fylder bredden */
    .dp-materials .dp-mat-loadmore { width: 100%; text-align: center; }
}

/* ─── Vedligeholdelses-besked (frontend) ──────────────────── */
.dp-mat-maintenance {
    text-align: center;
    padding: 60px 24px;
    color: #b0b0b0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}
.dp-mat-maintenance svg { color: #FF9800; opacity: 0.9; }
.dp-mat-maintenance-msg {
    font-size: 17px;
    color: #ddd;
    max-width: 460px;
    line-height: 1.6;
    margin: 0;
}

/* ─── View toggle (list / grid) ───────────────────────────── */
.dp-mat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}
.dp-mat-topbar .dp-mat-breadcrumb { margin-bottom: 0; }
.dp-mat-viewtoggle {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.dp-mat-viewbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: #888;
    transition: color .15s;
}
.dp-materials .dp-mat-viewbtn,
.dp-materials .dp-mat-viewbtn:hover,
.dp-materials .dp-mat-viewbtn:focus,
.dp-materials .dp-mat-viewbtn:active {
    background: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    border-radius: 0 !important;
}
.dp-materials .dp-mat-viewbtn { color: #888; }
.dp-materials .dp-mat-viewbtn:hover { color: #ccc; }
.dp-materials .dp-mat-viewbtn-active,
.dp-materials .dp-mat-viewbtn-active:hover,
.dp-materials .dp-mat-viewbtn-active:focus { color: #FF9800 !important; }
.dp-mat-viewbtn + .dp-mat-viewbtn { border-left: 1px solid rgba(255,255,255,0.18); }

/* ─── Download-folder controls ────────────────────────────── */
.dp-mat-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
/* "Download folder" button in the topbar */
.dp-mat-dlfolder {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 40px;
    background: linear-gradient(140deg, #FFEB3B 0%, #FF9800 100%);
    color: #3a2600 !important;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    transition: filter .15s ease;
}
.dp-mat-dlfolder:hover { filter: brightness(1.07); }
.dp-mat-dlfolder svg { flex-shrink: 0; }

/* List-folder rows: nav-link + round download icon side by side */
.dp-mat-folderrow { position: relative; }
.dp-mat-folderrow .dp-mat-folder { padding-right: 62px; }
.dp-mat-folder-dl {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #c8c8c8;
    background: transparent;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
    z-index: 2;
}
.dp-mat-folder-dl:hover { background: #2a2a2a; color: #FF9800; }

/* Card-folder tiles: round download icon in the top-right corner */
.dp-mat-cardwrap { position: relative; }
.dp-mat-card-dl {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0,0,0,0.55);
    color: #fff;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, transform .15s ease;
    z-index: 3;
}
.dp-mat-card-dl:hover { background: #FF9800; color: #3a2600; transform: scale(1.06); }

@media (max-width: 600px) {
    .dp-mat-dlfolder span { display: none; }
    .dp-mat-dlfolder { padding: 8px 11px; }
}

/* Progress modal shown while a folder is being zipped */
.dp-dlmodal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(0,0,0,0.6);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.dp-dlmodal.dp-dlmodal-open { display: flex; }
.dp-dlmodal-box {
    background: #1a1a1a;
    border: 1px solid #303030;
    border-radius: 14px;
    padding: 24px 24px 20px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    text-align: center;
}
.dp-dlmodal-title { color: #fff; font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.dp-dlmodal-track {
    height: 10px;
    background: #2a2a2a;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #383838;
}
.dp-dlmodal-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #FFEB3B, #FF9800);
    border-radius: 20px;
    transition: width .25s ease;
}
.dp-dlmodal-stat { color: #b0b0b0; font-size: 13px; margin-top: 12px; }
.dp-dlmodal-cancel,
.dp-dlmodal-cancel:link,
.dp-dlmodal-cancel:visited {
    margin-top: 18px;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 1px solid #404040;
    color: #c8c8c8 !important;
    padding: 7px 16px;
    border-radius: 40px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: none !important;
    transition: border-color .15s ease, color .15s ease, background .15s ease, filter .15s ease;
}
.dp-dlmodal-cancel:hover,
.dp-dlmodal-cancel:focus,
.dp-dlmodal-cancel:active {
    background: linear-gradient(140deg, #FFEB3B 0%, #FF9800 100%) !important;
    background-image: linear-gradient(140deg, #FFEB3B 0%, #FF9800 100%) !important;
    border-color: #FF9800 !important;
    color: #3a2600 !important;
    box-shadow: none !important;
    outline: none !important;
}

/* ─── Grid view mode (tight image gallery) ────────────────── */
.dp-materials[data-view="grid"] .dp-mat-files {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}
.dp-materials[data-view="grid"] .dp-mat-thumb-bg { display: none !important; }

/* Each file becomes a plain square tile */
.dp-materials[data-view="grid"] .dp-mat-file {
    position: relative;
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.04);
    aspect-ratio: 1 / 1;
    /* Skip painting off-screen tiles — keeps scrolling smooth. */
    content-visibility: auto;
    contain-intrinsic-size: 200px;
}
.dp-materials[data-view="grid"] .dp-mat-file-previewable { cursor: pointer; }
.dp-materials[data-view="grid"] .dp-mat-file:hover {
    outline: 2px solid #FF9800;
    outline-offset: -2px;
}

/* Image fills the whole square */
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    background-color: #141414;
}
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
}

/* PDF: show first page filling the square, hide list icon */
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-listicon { display: none; }
.dp-mat-pdfpreview { display: none; }
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-pdfpreview {
    display: block;
    position: absolute;
    inset: 0;
    background: #fff;
    overflow: hidden;
}
.dp-materials[data-view="grid"] .dp-mat-pdfpreview iframe {
    width: 100%;
    height: 140%;
    border: 0;
    pointer-events: none;
}
.dp-mat-pdfpreview-overlay { position: absolute; inset: 0; }

/* Non-image files: centered icon on dark tile */
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-fileicon:not(.dp-mat-listicon) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
    background: rgba(255,255,255,0.04);
}
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-fileicon:not(.dp-mat-listicon) svg {
    width: 34px; height: 34px;
}

/* Hide title/sub and the View button; show Download as a corner icon. */
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-body,
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-view { display: none !important; }

.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-download {
    display: inline-flex !important;
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    width: 30px;
    height: 30px;
    min-width: 0;
    padding: 0;
    margin: 0;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.55) !important;
    color: #fff !important;
    backdrop-filter: blur(2px);
}
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-download:hover {
    background: #FF9800 !important;
}
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-download .dp-btn-label { display: none; }
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-download .dp-btn-icon {
    display: inline-flex; align-items: center; justify-content: center;
}
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-download svg { width: 15px; height: 15px; }

/* Filename caption on hover (nice for non-image files especially) */
.dp-mat-title-overlay { display: none; }
.dp-materials[data-view="grid"] .dp-mat-file .dp-mat-title-overlay {
    display: block;
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 14px 8px 6px;
    font-size: 11px;
    line-height: 1.3;
    color: #fff;
    background: linear-gradient(to top, rgba(0,0,0,0.75), rgba(0,0,0,0));
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dp-materials[data-view="grid"] .dp-mat-file:hover .dp-mat-title-overlay { opacity: 1; }

@media (max-width: 900px) {
    .dp-materials[data-view="grid"] .dp-mat-files { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 600px) {
    .dp-materials[data-view="grid"] .dp-mat-files { grid-template-columns: repeat(3, 1fr); gap: 6px; }
}