:root {
    --db-bg: #f7f8fc;
    --db-surface: #ffffff;
    --db-surface-soft: #f9fbff;
    --db-line: rgba(226, 232, 240, 0.92);
    --db-line-strong: rgba(46, 159, 234, 0.22);
    --db-royal: #2e9fea;
    --db-royal-2: #59b7f1;
    --db-ink: #1f2937;
    --db-text: #4b5563;
    --db-muted: #6b7280;
    --db-muted-2: #9ca3af;
    --db-success: #16a34a;
    --db-danger: #dc2626;
    --db-gold: #d4a44b;
    --db-shadow: 0 18px 42px rgba(15, 23, 42, 0.06);
    --db-shadow-lg: 0 28px 80px rgba(15, 23, 42, 0.10);
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body.db-page,
body.db-auth-page {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--db-text);
}

body.db-page {
    background:
        radial-gradient(circle at top left, rgba(46, 159, 234, 0.10), transparent 24%),
        radial-gradient(circle at bottom right, rgba(212, 164, 75, 0.10), transparent 26%),
        linear-gradient(180deg, #fffdf9 0%, #f8fafc 42%, #f3f6fb 100%);
    overflow-x: hidden;
}

body.db-auth-page {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 24%),
        radial-gradient(circle at bottom right, rgba(200, 164, 90, 0.12), transparent 28%),
        linear-gradient(180deg, #070b14 0%, #101726 100%);
}

body.db-page *,
body.db-auth-page * {
    box-sizing: border-box;
}

body.db-page a,
body.db-auth-page a {
    color: inherit;
}

body.db-page img,
body.db-auth-page img {
    max-width: 100%;
    display: block;
}

.db-shell {
    min-height: 100vh;
    display: flex;
    width: 100%;
}

.db-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(7, 12, 25, 0.28);
    backdrop-filter: blur(4px);
    z-index: 40;
}

.db-sidebar {
    width: min(300px, calc(100vw - 28px));
    max-width: 100vw;
    position: fixed;
    inset: 0 auto 0 0;
    padding: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
    border-right: 1px solid var(--db-line);
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 50;
    overflow-y: auto;
    transition: transform 0.28s ease;
}

.db-sidebar-card,
.db-brand-card,
.db-nav-card,
.db-user-card,
.db-support-card {
    border-radius: 24px;
    border: 1px solid var(--db-line);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.db-brand-card,
.db-user-card,
.db-support-card {
    padding: 18px;
}

.db-nav-card {
    padding: 10px;
}

.db-brand-row,
.db-user-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

.db-brand-logo {
    width: 138px;
    height: 42px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

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

.db-brand-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--db-ink);
    overflow-wrap: anywhere;
}

.db-brand-subtitle,
.db-user-meta span,
.db-support-copy,
.db-nav-title {
    font-size: 12px;
    color: var(--db-muted);
}

.db-brand-subtitle {
    margin-top: 4px;
}

.db-nav-title {
    padding: 10px 12px 6px;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--db-muted-2);
}

.db-sidebar-nav {
    display: grid;
    gap: 4px;
}

.db-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--db-text);
    text-decoration: none;
    transition: 0.2s ease;
}

.db-sidebar-link:hover,
.db-sidebar-link.active {
    color: var(--db-royal);
    background: rgba(46, 159, 234, 0.10);
    border-color: rgba(46, 159, 234, 0.14);
}

.db-sidebar-icon {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(46, 159, 234, 0.10);
    border: 1px solid rgba(46, 159, 234, 0.12);
    color: var(--db-royal);
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.db-sidebar-copy strong {
    display: block;
    font-size: 14px;
    color: var(--db-ink);
}

.db-sidebar-copy span {
    display: block;
    font-size: 12px;
    color: var(--db-muted);
    margin-top: 2px;
}

.db-user-card,
.db-support-card {
    margin-top: auto;
}

.db-user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: rgba(46, 159, 234, 0.12);
    color: var(--db-royal);
    font-weight: 800;
    flex-shrink: 0;
}

.db-user-meta strong {
    display: block;
    font-size: 14px;
    color: var(--db-ink);
}

.db-support-card h3 {
    margin: 0 0 10px;
    font-size: 16px;
    color: var(--db-ink);
}

.db-support-actions {
    display: grid;
    gap: 10px;
}

.db-support-primary,
.db-support-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    text-decoration: none;
    font-weight: 700;
}

.db-support-primary {
    background: linear-gradient(135deg, var(--db-royal), var(--db-royal-2));
    color: #ffffff;
}

.db-support-secondary {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.db-main {
    flex: 1;
    min-width: 0;
    margin-left: 300px;
    padding: 18px 20px 28px;
}

.db-surface,
.db-topbar,
.db-kpi-card,
.db-section-card,
.db-alert,
.db-tabs,
.db-login-card,
.db-card,
.db-modal {
    border-radius: 24px;
    border: 1px solid var(--db-line);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    box-shadow: var(--db-shadow);
}

.db-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px 16px;
    margin-bottom: 14px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.90)),
        url("../images/bg/banner-bg_result.webp") center/cover no-repeat;
    border-color: rgba(46, 159, 234, 0.18);
}

.db-topbar-copy small,
.db-section-head small,
.db-kpi-label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--db-muted-2);
}

.db-topbar-copy small {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(46, 159, 234, 0.14);
    background: rgba(46, 159, 234, 0.08);
    color: var(--db-royal);
}

.db-topbar-copy h1,
.db-page-title {
    margin: 8px 0 0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 30px;
    line-height: 1;
    color: var(--db-ink);
    overflow-wrap: anywhere;
}

.db-topbar-copy p,
.db-section-copy,
.db-empty-copy,
.save-msg {
    margin: 10px 0 0;
    color: var(--db-muted);
    font-size: 14px;
    line-height: 1.7;
}

.db-topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.db-menu-toggle,
.db-topbar-btn,
.db-btn-primary,
.db-btn-outline,
.db-btn-danger,
.db-btn-accent,
.db-save-btn,
.db-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 10px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
    font-family: inherit;
}

.db-menu-toggle {
    display: none;
    width: 44px;
    padding: 0;
    background: #ffffff;
    border-color: var(--db-line);
    color: var(--db-ink);
}

.db-btn-primary,
.db-save-btn,
.db-upload-btn {
    background: linear-gradient(135deg, var(--db-royal), var(--db-royal-2));
    color: #ffffff;
}

.db-btn-accent {
    background: linear-gradient(135deg, #c8a45a, #e0bc71);
    color: #111111;
}

.db-btn-outline {
    background: #ffffff;
    border-color: var(--db-line);
    color: var(--db-ink);
}

.db-btn-danger {
    background: rgba(220, 38, 38, 0.06);
    border-color: rgba(220, 38, 38, 0.12);
    color: var(--db-danger);
}

.db-btn-primary:hover,
.db-save-btn:hover,
.db-upload-btn:hover,
.db-btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(34, 83, 246, 0.18);
}

.db-btn-outline:hover {
    border-color: rgba(46, 159, 234, 0.24);
    color: var(--db-royal);
}

.db-btn-danger:hover {
    background: rgba(211, 75, 75, 0.14);
}

.db-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.db-kpi-card {
    padding: 16px 18px;
    border-radius: 16px;
}

.db-kpi-value {
    display: block;
    margin-top: 8px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 30px;
    color: var(--db-ink);
}

.db-section-card,
.db-card {
    padding: 18px;
    margin-bottom: 14px;
    border-radius: 16px;
}

.db-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.db-section-head h2,
.db-card-title {
    margin: 6px 0 0;
    font-size: 20px;
    color: var(--db-ink);
}

.db-search-wrap {
    position: relative;
    min-width: 260px;
    max-width: 320px;
    width: 100%;
}

.db-search-wrap input,
.search-input,
.db-search {
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid var(--db-line);
    background: #ffffff;
    color: var(--db-ink);
    outline: none;
    box-shadow: none;
}

.db-search-wrap input {
    padding-left: 44px;
}

.db-search-wrap svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--db-muted-2);
}

.db-table-wrap {
    overflow: auto;
    border-radius: 18px;
    border: 1px solid var(--db-line);
}

.db-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
    font-size: 14px;
}

.db-table th,
.db-table td {
    text-align: left;
    padding: 15px 16px;
    vertical-align: middle;
}

.db-table thead th {
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--db-muted-2);
    background: #f9fbff;
    border-bottom: 1px solid var(--db-line);
}

.db-table tbody td {
    border-bottom: 1px solid var(--db-line);
}

.db-table tbody tr:last-child td {
    border-bottom: none;
}

.db-table tbody tr:hover td {
    background: #f9fcff;
}

.db-row-title {
    font-weight: 700;
    color: var(--db-ink);
}

.db-row-subtitle {
    margin-top: 4px;
    font-size: 12px;
    color: var(--db-muted-2);
}

.badge-green,
.badge-red,
.badge-gold,
.badge-gray {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.badge-green {
    background: rgba(34, 197, 94, 0.08);
    border: 1px solid rgba(34, 197, 94, 0.14);
    color: var(--db-success);
}

.badge-red {
    background: rgba(211, 75, 75, 0.08);
    border: 1px solid rgba(211, 75, 75, 0.14);
    color: #b43c3c;
}

.badge-gold {
    background: rgba(200, 164, 90, 0.14);
    border: 1px solid rgba(200, 164, 90, 0.20);
    color: #a96500;
}

.badge-gray {
    background: #f8fafc;
    border: 1px solid var(--db-line);
    color: var(--db-muted);
}

.db-action-group,
.db-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.db-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 14px;
}

.db-alert.success {
    border-color: rgba(34, 197, 94, 0.18);
    color: var(--db-success);
    background: rgba(34, 197, 94, 0.08);
}

.db-alert.error {
    border-color: rgba(211, 75, 75, 0.18);
    color: var(--db-danger);
    background: rgba(211, 75, 75, 0.08);
}

.db-alert.info {
    border-color: rgba(34, 83, 246, 0.14);
    color: var(--db-royal);
    background: rgba(34, 83, 246, 0.08);
}

.db-empty-state {
    text-align: center;
    padding: 48px 20px;
}

.db-empty-icon {
    width: 78px;
    height: 78px;
    margin: 0 auto 16px;
    border-radius: 24px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(34, 83, 246, 0.12), rgba(76, 141, 255, 0.18));
    color: var(--db-royal);
    font-size: 32px;
}

.db-empty-state h2,
.db-empty-state h3 {
    margin: 0 0 8px;
    color: var(--db-ink);
}

.db-client-grid,
.db-shop-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.db-shop-card {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.db-shop-cover {
    width: 100%;
    height: 120px;
    object-fit: contain;
    background: #f4f8fb;
    border-radius: 18px 18px 0 0;
}

.db-shop-body {
    padding: 18px;
}

.db-shop-avatar {
    width: 60px;
    height: 60px;
    margin-top: -38px;
    border-radius: 18px;
    object-fit: contain;
    border: 3px solid #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.10);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(34, 83, 246, 0.12), rgba(76, 141, 255, 0.18));
    color: var(--db-royal);
    font-size: 24px;
}

.db-shop-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.db-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(46, 159, 234, 0.08);
    border: 1px solid rgba(46, 159, 234, 0.12);
    color: var(--db-royal);
    font-size: 12px;
    font-weight: 600;
}

.db-shop-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.db-login-wrap,
.db-auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.db-login-card,
.db-auth-card {
    width: min(100%, 440px);
    padding: 32px 28px;
    background: #ffffff;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.26);
}

.db-auth-logo {
    width: 110px;
    height: auto;
    margin: 0 auto 18px;
}

.db-auth-head {
    text-align: center;
    margin-bottom: 24px;
}

.db-auth-head h1 {
    margin: 0;
    font-size: 28px;
    color: var(--db-ink);
}

.db-auth-head p {
    margin: 8px 0 0;
    color: var(--db-muted);
    font-size: 14px;
}

.db-auth-field {
    margin-bottom: 16px;
}

.db-auth-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--db-muted);
}

.db-auth-field input {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.10);
    background: #ffffff;
    color: var(--db-ink);
    outline: none;
}

.db-auth-note {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    text-align: center;
    color: var(--db-muted);
    font-size: 13px;
}

.db-form-grid,
.db-platform-grid,
.db-gallery-grid,
.db-theme-grid,
.db-upload-grid {
    display: grid;
    gap: 16px;
}

.db-form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.db-platform-grid,
.db-upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.db-gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.db-theme-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.db-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

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

.db-field label,
.db-upload-label {
    font-size: 11px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--db-muted-2);
    font-weight: 700;
}

.db-field input,
.db-field select,
.db-field textarea {
    width: 100%;
    border: 1px solid var(--db-line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--db-ink);
    outline: none;
}

.db-field input,
.db-field select {
    min-height: 48px;
    padding: 0 16px;
}

.db-field textarea {
    min-height: 120px;
    padding: 14px 16px;
    resize: vertical;
}

.db-upload-card,
.db-platform-item,
.db-gallery-slot {
    padding: 16px;
    border-radius: 16px;
    background: var(--db-surface-soft);
    border: 1px solid var(--db-line);
    min-width: 0;
}

.db-upload-preview,
.db-gallery-preview,
.db-theme-preview {
    border-radius: 12px;
    overflow: hidden;
}

.db-upload-preview,
.db-gallery-preview {
    position: relative;
    background: #ffffff;
    border: 1px dashed rgba(46, 159, 234, 0.20);
    display: grid;
    place-items: center;
    color: var(--db-royal);
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.db-upload-preview {
    min-height: 180px;
}

.db-upload-preview--banner {
    aspect-ratio: 3 / 1;
    min-height: 0;
}

.db-gallery-preview {
    aspect-ratio: 4 / 3;
}

.db-platform-item {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 12px;
    align-items: center;
}

.db-platform-item img {
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: #ffffff;
    border: 1px solid var(--db-line);
    padding: 8px;
}

.db-save-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--db-line);
}

.save-msg--ok {
    color: var(--db-success);
}

.save-msg--err {
    color: var(--db-danger);
}

.db-theme-card,
.theme {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--db-line);
    background: #ffffff;
    cursor: pointer;
}

.db-theme-card input,
.theme input {
    position: absolute;
    opacity: 0;
}

.db-theme-card--active,
.db-theme-card.selected,
.theme.sel {
    border-color: var(--db-royal-2);
    box-shadow: 0 0 0 2px rgba(76, 141, 255, 0.18);
}

.db-theme-preview,
.theme-preview {
    min-height: 110px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.db-theme-check,
.db-theme-card--active .db-theme-check,
.db-theme-card.selected .db-theme-check,
.theme-check,
.theme.sel .theme-check {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 26px;
    height: 26px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--db-royal), var(--db-royal-2));
    color: #ffffff;
    font-size: 12px;
}

.db-theme-card--active .db-theme-check,
.db-theme-card.selected .db-theme-check,
.theme.sel .theme-check {
    display: flex;
}

.edit-wrap {
    display: flex;
    min-height: calc(100vh - 72px);
    gap: 18px;
}

.edit-sidenav {
    width: 260px;
    flex-shrink: 0;
    border-radius: 16px;
    border: 1px solid var(--db-line);
    background: linear-gradient(180deg, #ffffff, #fbfdff);
    box-shadow: var(--db-shadow);
    padding: 14px 10px;
    display: block;
}

.edit-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 999px;
    border: 1px solid transparent;
    color: var(--db-text);
    text-decoration: none;
    transition: 0.2s ease;
}

.edit-nav-item:hover,
.edit-nav-item--active {
    color: var(--db-royal);
    background: rgba(46, 159, 234, 0.10);
    border-color: rgba(46, 159, 234, 0.12);
}

.edit-body {
    flex: 1;
    min-width: 0;
}

.edit-mobile-tabs {
    display: none;
}

.edit-mob-tab {
    min-width: max-content;
    width: auto;
    padding: 12px 14px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: #ffffff;
    color: var(--db-muted);
    text-decoration: none;
}

.edit-mob-tab--active {
    color: var(--db-royal);
    background: rgba(46, 159, 234, 0.08);
    border-color: rgba(46, 159, 234, 0.12);
}

.db-modal-overlay {
    position: fixed;
    inset: 0;
    padding: 20px;
    align-items: center;
    justify-content: center;
    z-index: 90;
    background: rgba(7, 12, 25, 0.38);
    backdrop-filter: blur(6px);
    display: none;
}

.db-modal {
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    overflow: auto;
    border-radius: 28px;
    border-color: var(--db-line-strong);
    box-shadow: 0 30px 90px rgba(15, 23, 42, 0.18);
}

.db-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--db-line);
}

.db-modal-header span {
    font-size: 22px;
    font-weight: 700;
    color: var(--db-ink);
}

.db-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid var(--db-line);
    background: #ffffff;
    color: var(--db-muted);
    cursor: pointer;
}

@media (max-width: 1100px) {
    .db-kpi-grid,
    .db-client-grid,
    .db-shop-cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .db-menu-toggle {
        display: inline-flex;
    }

    .db-sidebar {
        transform: translateX(-100%);
    }

    body.db-sidebar-open .db-sidebar {
        transform: translateX(0);
    }

    body.db-sidebar-open .db-sidebar-backdrop {
        display: block;
    }

    .db-main {
        margin-left: 0;
        padding: 16px;
    }

    .db-topbar,
    .db-login-card,
    .db-kpi-card,
    .db-section-card,
    .db-alert,
    .db-card {
        border-radius: 22px;
    }

    .db-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .db-topbar-actions {
        justify-content: stretch;
    }

    .db-topbar-actions .db-btn-primary,
    .db-topbar-actions .db-btn-outline,
    .db-topbar-actions .db-btn-danger,
    .db-topbar-actions .db-btn-accent {
        flex: 1;
    }

    .edit-wrap {
        flex-direction: column;
    }

    .edit-sidenav {
        display: none;
    }

    .edit-mobile-tabs {
        position: sticky;
        bottom: 0;
        display: flex;
        gap: 8px;
        overflow: auto;
        margin-top: 12px;
        padding: 8px;
        border-radius: 22px;
        border: 1px solid var(--db-line);
        background: linear-gradient(180deg, #ffffff, #fbfdff);
        box-shadow: var(--db-shadow);
    }
}

@media (max-width: 820px) {
    .db-kpi-grid,
    .db-form-grid,
    .db-platform-grid,
    .db-upload-grid,
    .db-gallery-grid,
    .db-theme-grid,
    .db-client-grid,
    .db-shop-cards {
        grid-template-columns: 1fr;
    }

    .db-section-head {
        flex-direction: column;
        align-items: stretch;
    }

    .db-search-wrap {
        min-width: 0;
        max-width: none;
    }

    .db-save-row {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 640px) {
    .db-auth-shell,
    .db-login-wrap {
        padding: 16px;
    }

    .db-login-card,
    .db-auth-card {
        border-radius: 24px;
        padding: 24px 20px;
    }

    .db-topbar-copy h1,
    .db-page-title {
        font-size: 24px;
    }

    .db-topbar {
        padding: 16px;
    }

    .db-main {
        padding: 12px;
    }

    .db-sidebar {
        width: min(320px, calc(100vw - 18px));
        padding: 14px 12px 18px;
    }

    .db-brand-card,
    .db-nav-card,
    .db-user-card,
    .db-support-card {
        border-radius: 22px;
    }
}

/* Dashboard UI refresh: visual-only polish */
:root {
    --db-sky: #eff7ff;
    --db-navy: #0f172a;
}

.db-sidebar {
    background:
        radial-gradient(circle at top left, rgba(46, 159, 234, 0.12), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 20px 0 60px rgba(15, 23, 42, 0.06);
}

.db-brand-card,
.db-nav-card,
.db-user-card,
.db-support-card,
.db-topbar,
.db-kpi-card,
.db-section-card,
.db-card,
.db-login-card,
.db-modal,
.edit-sidenav,
.edit-mobile-tabs {
    backdrop-filter: blur(12px);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.06);
}

.db-brand-card {
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.db-brand-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(46, 159, 234, 0.12), rgba(212, 164, 75, 0.08));
    opacity: 0.9;
    pointer-events: none;
}

.db-brand-row,
.db-nav-card,
.db-support-card,
.db-user-card {
    position: relative;
    z-index: 1;
}

.db-brand-logo {
    width: 146px;
    height: 48px;
}

.db-brand-name {
    font-size: 20px;
    letter-spacing: -0.03em;
}

.db-brand-subtitle {
    color: #52607a;
    font-size: 12px;
}

.db-sidebar-link {
    border-radius: 18px;
    padding: 15px;
}

.db-sidebar-link:hover,
.db-sidebar-link.active {
    box-shadow: inset 0 0 0 1px rgba(46, 159, 234, 0.06);
}

.db-sidebar-icon {
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.db-support-card {
    background:
        linear-gradient(180deg, rgba(18, 37, 68, 0.96), rgba(15, 23, 42, 0.98)),
        linear-gradient(135deg, rgba(46, 159, 234, 0.16), transparent);
    border-color: rgba(148, 163, 184, 0.12);
}

.db-support-card h3,
.db-support-card .db-support-copy,
.db-support-card .db-user-meta strong,
.db-support-card .db-user-meta span {
    color: #ffffff;
}

.db-support-primary,
.db-support-secondary {
    min-height: 46px;
    border-radius: 16px;
}

.db-support-secondary {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
}

.db-user-card {
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.db-user-avatar {
    border-radius: 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.db-topbar {
    position: relative;
    overflow: hidden;
    padding: 22px 22px 20px;
}

.db-topbar::after {
    content: "";
    position: absolute;
    inset: auto -40px -80px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(46, 159, 234, 0.16), transparent 68%);
    pointer-events: none;
}

.db-topbar-copy,
.db-topbar-actions {
    position: relative;
    z-index: 1;
}

.db-topbar-copy h1,
.db-page-title {
    font-size: clamp(28px, 3vw, 36px);
    letter-spacing: -0.04em;
}

.db-topbar-copy p,
.db-section-copy,
.db-empty-copy,
.save-msg {
    max-width: 760px;
}

.db-menu-toggle,
.db-topbar-btn,
.db-btn-primary,
.db-btn-outline,
.db-btn-danger,
.db-btn-accent,
.db-save-btn,
.db-upload-btn {
    min-height: 46px;
    border-radius: 14px;
    padding: 0 18px;
}

.db-btn-primary,
.db-save-btn,
.db-upload-btn {
    box-shadow: 0 14px 30px rgba(46, 159, 234, 0.2);
}

.db-btn-outline {
    background: rgba(255, 255, 255, 0.86);
}

.db-kpi-grid {
    gap: 16px;
}

.db-kpi-card {
    position: relative;
    overflow: hidden;
    padding: 18px 20px;
}

.db-kpi-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--db-royal), var(--db-gold));
    opacity: 0.9;
}

.db-kpi-card:nth-child(2)::before {
    background: linear-gradient(90deg, #22c55e, #84cc16);
}

.db-kpi-card:nth-child(3)::before {
    background: linear-gradient(90deg, #f59e0b, #fb7185);
}

.db-kpi-card:nth-child(4)::before {
    background: linear-gradient(90deg, #8b5cf6, #38bdf8);
}

.db-kpi-label {
    margin-top: 6px;
}

.db-kpi-value {
    font-size: clamp(28px, 3vw, 36px);
    letter-spacing: -0.04em;
}

.db-section-card,
.db-card {
    border-radius: 22px;
    padding: 20px;
}

.db-section-head {
    margin-bottom: 18px;
}

.db-search-wrap input,
.search-input,
.db-search,
.db-field input,
.db-field select,
.db-field textarea,
#assignForm input,
#assignForm select,
#createShopForm input {
    border-radius: 14px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.db-search-wrap input:focus,
.search-input:focus,
.db-search:focus,
.db-field input:focus,
.db-field select:focus,
.db-field textarea:focus,
#assignForm input:focus,
#assignForm select:focus,
#createShopForm input:focus {
    border-color: rgba(46, 159, 234, 0.34);
    box-shadow: 0 0 0 4px rgba(46, 159, 234, 0.08);
}

.db-table-wrap {
    border-radius: 20px;
    background: #ffffff;
}

.db-table {
    min-width: 820px;
}

.db-table thead th {
    background: linear-gradient(180deg, #fbfdff, #f4f8fc);
    position: sticky;
    top: 0;
    z-index: 1;
}

.db-table tbody tr {
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.db-table tbody tr:hover td {
    background: #f7fbff;
}

.db-action-group .db-btn-outline,
.db-action-group .db-btn-danger {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
}

.db-shop-cards {
    gap: 18px;
}

.db-shop-card {
    border-radius: 22px;
    overflow: hidden;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.db-shop-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 54px rgba(15, 23, 42, 0.1);
}

.db-shop-cover {
    height: 148px;
    object-fit: cover;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 26%),
        linear-gradient(135deg, #1d4ed8, #38bdf8);
}

.db-shop-body {
    padding: 22px;
}

.db-shop-avatar {
    width: 68px;
    height: 68px;
    margin-top: -46px;
    border-radius: 20px;
}

.db-meta-pill,
.badge-green,
.badge-red,
.badge-gold,
.badge-gray {
    min-height: 34px;
}

.db-shop-actions-row {
    gap: 12px;
}

.db-shop-actions-row .db-btn-primary,
.db-shop-actions-row .db-btn-outline {
    flex: 1 1 180px;
}

.db-login-card,
.db-auth-card {
    width: min(100%, 480px);
    padding: 36px 32px;
    background:
        radial-gradient(circle at top center, rgba(46, 159, 234, 0.1), transparent 34%),
        linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.db-auth-logo {
    width: 126px;
    margin-bottom: 22px;
}

.db-auth-head h1 {
    font-size: 32px;
    letter-spacing: -0.04em;
}

.db-auth-field input {
    border-radius: 16px;
}

.db-auth-note {
    border-top-color: rgba(46, 159, 234, 0.12);
}

.db-form-grid,
.db-platform-grid,
.db-gallery-grid,
.db-theme-grid,
.db-upload-grid {
    gap: 18px;
}

.db-upload-card,
.db-platform-item,
.db-gallery-slot {
    border-radius: 18px;
    background: linear-gradient(180deg, #fbfdff, #f5f9ff);
}

.db-upload-preview,
.db-gallery-preview,
.db-theme-preview {
    border-radius: 16px;
}

.db-upload-preview,
.db-gallery-preview {
    background-color: #ffffff;
    border-color: rgba(46, 159, 234, 0.18);
}

.db-platform-item {
    grid-template-columns: 54px 1fr;
    gap: 14px;
}

.db-platform-item img {
    width: 54px;
    height: 54px;
    border-radius: 14px;
}

.db-theme-card,
.theme {
    border-radius: 18px;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.db-theme-card:hover,
.theme:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.edit-sidenav {
    border-radius: 22px;
    padding: 14px;
}

.edit-nav-item {
    border-radius: 18px;
    font-weight: 600;
}

.edit-nav-item i {
    font-size: 18px;
}

.edit-mobile-tabs {
    padding: 10px;
    border-radius: 20px;
}

.edit-mob-tab {
    border-radius: 16px;
    font-weight: 600;
}

.db-modal {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.db-modal-header {
    padding: 22px 24px;
}

.db-modal-close:hover {
    color: var(--db-royal);
    border-color: rgba(46, 159, 234, 0.2);
}

@media (max-width: 980px) {
    .db-topbar {
        padding: 18px;
    }

    .db-kpi-card,
    .db-section-card,
    .db-card {
        border-radius: 20px;
    }
}

@media (max-width: 640px) {
    .db-brand-logo {
        width: 126px;
        height: 42px;
    }

    .db-topbar-copy h1,
    .db-page-title,
    .db-auth-head h1 {
        font-size: 26px;
    }

    .db-shop-body {
        padding: 18px;
    }

    .db-shop-cover {
        height: 128px;
    }

    .db-shop-avatar {
        width: 62px;
        height: 62px;
    }
}

/* Final dashboard refinements */
.db-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.db-brand-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.db-brand-logo {
    width: min(100%, 170px);
    height: 48px;
}

.db-brand-row > div:last-child {
    min-width: 0;
}

.db-brand-name,
.db-brand-subtitle {
    overflow-wrap: anywhere;
}

.db-field textarea {
    min-height: 120px;
    resize: vertical;
}

@media (min-width: 981px) and (max-width: 1366px) {
    .db-brand-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .db-brand-card {
        padding: 18px;
    }
}

@media (max-width: 980px) {
    .db-topbar-actions {
        display: grid;
        grid-template-columns: 44px repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .db-topbar-actions form {
        display: flex;
    }

    .db-topbar-actions .db-btn-danger {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .db-topbar-actions {
        gap: 8px;
        grid-template-columns: 42px repeat(2, minmax(0, 1fr));
    }

    .db-brand-row {
        align-items: center;
        flex-direction: row;
    }

    .db-brand-logo {
        width: min(100%, 148px);
        height: 42px;
    }
}

/* Final brand logo visibility fix for client + admin dashboards */
.db-brand-card {
    overflow: visible;
}

.db-brand-row {
    align-items: flex-start;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 10px;
}

.db-brand-logo {
    width: min(100%, 188px);
    min-width: 0;
    height: auto;
    min-height: 46px;
    display: flex;
    align-items: center;
}

.db-brand-logo img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 46px;
    object-fit: contain;
    object-position: left center;
}

.db-brand-row > div:last-child {
    min-width: 0;
    width: 100%;
}

.db-brand-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-brand-subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (min-width: 981px) and (max-width: 1366px) {
    .db-brand-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 640px) {
    .db-brand-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .db-brand-logo {
        width: min(100%, 152px);
        min-width: 0;
        min-height: 40px;
    }

    .db-brand-logo img {
        max-height: 40px;
    }

    .db-brand-name {
        font-size: 17px;
    }
}
