/* ═══════════════════════════════════════════════════
   Subscriber Dashboard – dashboard.css
   Theme: Clean editorial / refined minimal
═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=Instrument+Serif:ital@0;1&display=swap');

:root {
    --ink:     #0f1117;
    --ink-2:   #4a4f5e;
    --ink-3:   #9398a5;
    --surface: #f7f7f9;
    --card:    #ffffff;
    --border:  #e4e5ec;
    --accent:  #3b5bdb;
    --accent-h:#2f4ac2;
    --danger:  #e03131;
    --success: #2f9e44;
    --warn:    #f08c00;
    --sidebar-w: 240px;
    --radius:  10px;
    --shadow:  0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'DM Sans', sans-serif; color: var(--ink); background: var(--surface); }

/* ── Layout ─────────────────────────────────────── */

#sbd-wrap {
    display: flex;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Sidebar ─────────────────────────────────────── */

#sbd-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sbd-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sbd-brand img {
    border-radius: 50%;
    width: 72px;
    height: 72px;
    object-fit: cover;
}

.sbd-username {
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink);
}

.sbd-role {
    font-size: .75rem;
    color: var(--ink-3);
    background: var(--surface);
    padding: .15rem .6rem;
    border-radius: 20px;
    letter-spacing: .04em;
}

.sbd-nav {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    flex: 1;
}

.sbd-nav-btn {
    display: flex;
    align-items: center;
    gap: .65rem;
    width: 100%;
    padding: .65rem .85rem;
    background: none;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .9rem;
    color: var(--ink-2);
    cursor: pointer;
    transition: background .15s, color .15s;
    text-align: left;
}

.sbd-nav-btn svg {
    width: 18px; height: 18px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
    flex-shrink: 0;
}

.sbd-nav-btn:hover,
.sbd-nav-btn.active {
    background: var(--surface);
    color: var(--accent);
}

.sbd-logout {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .65rem .85rem;
    margin-top: auto;
    border-radius: var(--radius);
    font-size: .88rem;
    color: var(--danger);
    text-decoration: none;
    transition: background .15s;
}

.sbd-logout:hover { background: #fff0f0; }

.sbd-logout svg {
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ── Main ────────────────────────────────────────── */

#sbd-main {
    flex: 1;
    padding: 2.5rem 2rem;
    min-width: 0;
}

.sbd-tab { display: none; }
.sbd-tab.active { display: block; animation: fadein .2s ease; }

@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.sbd-tab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.sbd-tab-header h2 {
    font-family: 'Instrument Serif', serif;
    font-size: 1.75rem;
    font-weight: 400;
    color: var(--ink);
}

/* ── Buttons ─────────────────────────────────────── */

.sbd-btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    padding: .6rem 1.2rem;
    font-family: inherit;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s, transform .1s;
}

.sbd-btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); }
.sbd-btn-primary:active { transform: none; }

.sbd-btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: .35rem;
    border-radius: 6px;
    display: flex;
    align-items: center;
    transition: background .15s;
}

.sbd-btn-icon svg {
    width: 16px; height: 16px;
    stroke: currentColor; fill: none;
    stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.sbd-btn-icon.del { color: var(--danger); }
.sbd-btn-icon:hover { background: var(--surface); }

/* ── Drop zone ───────────────────────────────────── */

#sbd-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: border-color .2s, background .2s;
    background: var(--card);
}

#sbd-dropzone.drag-over {
    border-color: var(--accent);
    background: #eef2ff;
}

.sbd-dropzone-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    text-align: center;
    color: var(--ink-2);
}

.sbd-dropzone-inner svg {
    width: 40px; height: 40px;
    stroke: var(--ink-3); fill: none;
    stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}

.sbd-browse-link {
    color: var(--accent);
    cursor: pointer;
    text-decoration: underline;
}

.sbd-hint { font-size: .78rem; color: var(--ink-3); }

#sbd-file-input { display: none; }

/* Progress */

#sbd-upload-progress { margin-top: 1rem; }

#sbd-progress-bar {
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: .5rem;
}

#sbd-progress-bar span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent);
    border-radius: 99px;
    transition: width .2s;
}

#sbd-progress-text { font-size: .82rem; color: var(--ink-2); text-align: center; }

/* ── File list ───────────────────────────────────── */

#sbd-file-list { display: flex; flex-direction: column; gap: .75rem; }

.sbd-file-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1rem;
    box-shadow: var(--shadow);
    transition: box-shadow .15s;
    animation: fadein .25s ease;
}

.sbd-file-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.1); }

.sbd-file-icon {
    width: 40px; height: 40px;
    border-radius: 8px;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: .65rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: var(--accent);
    text-transform: uppercase;
}

.sbd-file-info { flex: 1; min-width: 0; }

.sbd-file-name {
    font-weight: 500;
    font-size: .9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .2rem;
}

.sbd-file-meta { font-size: .77rem; color: var(--ink-3); }

.sbd-file-actions { display: flex; gap: .25rem; }

.sbd-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--ink-3);
}

.sbd-empty svg {
    width: 48px; height: 48px;
    stroke: var(--border); fill: none;
    stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round;
    display: block; margin: 0 auto 1rem;
}

.sbd-loading { text-align: center; padding: 2rem; color: var(--ink-3); font-size: .9rem; }

/* ── Alerts ──────────────────────────────────────── */

.sbd-alert {
    padding: .8rem 1rem;
    border-radius: var(--radius);
    font-size: .88rem;
    margin-bottom: 1.25rem;
}

.sbd-alert.success { background: #d3f9d8; color: #1a6b2a; }
.sbd-alert.error   { background: #ffe3e3; color: #9b1a1a; }
.sbd-alert.info    { background: #e7f5ff; color: #1863ab; }

/* ── Profile form ────────────────────────────────── */

.sbd-form { max-width: 600px; }

.sbd-form-row.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.sbd-form-group { margin-bottom: 1.25rem; }

.sbd-form-group label {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: var(--ink-2);
    margin-bottom: .4rem;
    letter-spacing: .02em;
}

.sbd-form-group input,
.sbd-form-group textarea {
    width: 100%;
    padding: .65rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .9rem;
    color: var(--ink);
    background: var(--card);
    transition: border-color .15s, box-shadow .15s;
    outline: none;
}

.sbd-form-group input:focus,
.sbd-form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,91,219,.12);
}

.sbd-form-group textarea { resize: vertical; min-height: 90px; }

.sbd-divider { border: none; border-top: 1px solid var(--border); margin: 2rem 0 1.5rem; }

.sbd-form h3 { font-size: 1rem; font-weight: 600; color: var(--ink); margin-bottom: 1rem; }

.sbd-optional { font-size: .78rem; font-weight: 400; color: var(--ink-3); }

/* ── Notice ──────────────────────────────────────── */

.sbd-notice {
    padding: 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    color: var(--ink-2);
}

/* ── Utilities ───────────────────────────────────── */

.sbd-hidden { display: none !important; }

/* ── Responsive ──────────────────────────────────── */

@media (max-width: 700px) {
    #sbd-wrap { flex-direction: column; }

    #sbd-sidebar {
        width: 100%;
        height: auto;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 1rem;
        gap: .75rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .sbd-brand { flex-direction: row; border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

    .sbd-nav { flex-direction: row; flex: unset; }

    .sbd-logout { margin-top: 0; }

    #sbd-main { padding: 1.5rem 1rem; }

    .sbd-form-row.two-col { grid-template-columns: 1fr; }
}

/* ── Wallet mini (sidebar) ───────────────────────── */

.sbd-wallet-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent) 0%, #2846c0 100%);
    border-radius: 999px;
    padding: .75rem 1rem;
    margin-bottom: 1.25rem;
    text-align: center;
    box-sizing: border-box;
}

.sbd-wallet-label {
    display: block;
    font-size: .7rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255,255,255,.75);
    margin-bottom: .2rem;
}

.sbd-wallet-amount {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}

/* ── Wallet tab ──────────────────────────────────── */

.sbd-wallet-card {
    background: linear-gradient(135deg, #1a1f3c 0%, #2e3a8c 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.sbd-wallet-card::before {
    content: '';
    position: absolute;
    right: -30px; top: -30px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: rgba(255,255,255,.06);
}

.sbd-wallet-card::after {
    content: '';
    position: absolute;
    right: 40px; top: 40px;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: rgba(255,255,255,.04);
}

.sbd-wallet-card-label {
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.65);
    margin-bottom: .5rem;
}

.sbd-wallet-card-amount {
    font-family: 'Instrument Serif', serif;
    font-size: 2.75rem;
    font-weight: 400;
    line-height: 1;
    margin-bottom: .5rem;
}

.sbd-wallet-card-currency {
    font-size: .78rem;
    color: rgba(255,255,255,.5);
    letter-spacing: .08em;
}

/* ── Top-up box ──────────────────────────────────── */

.sbd-topup-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.sbd-topup-box h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--ink);
}

.sbd-topup-amounts {
    display: flex;
    gap: .65rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.sbd-preset-btn {
    padding: .5rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    color: var(--ink);
}

.sbd-preset-btn:hover,
.sbd-preset-btn.selected {
    border-color: var(--accent);
    background: #eef2ff;
    color: var(--accent);
}

.sbd-topup-custom { max-width: 280px; margin-bottom: 1.25rem; }

.sbd-input-prefix {
    display: flex;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    transition: border-color .15s, box-shadow .15s;
}

.sbd-input-prefix:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,91,219,.12);
}

.sbd-input-prefix span {
    padding: .65rem .75rem;
    background: var(--surface);
    color: var(--ink-2);
    font-size: .88rem;
    font-weight: 500;
    border-right: 1px solid var(--border);
    flex-shrink: 0;
}

.sbd-input-prefix input {
    border: none !important;
    box-shadow: none !important;
    padding: .65rem .9rem;
    flex: 1;
    min-width: 0;
    font-family: inherit;
    font-size: .9rem;
    background: transparent;
    outline: none;
}

.sbd-topup-note {
    font-size: .78rem;
    color: var(--ink-3);
    margin-top: .75rem;
}

/* ── Transactions ────────────────────────────────── */

.sbd-txn-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--ink);
}

.sbd-txn-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1rem;
    margin-bottom: .6rem;
    animation: fadein .2s ease;
}

.sbd-txn-icon {
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.sbd-txn-icon.credit { background: #d3f9d8; }
.sbd-txn-icon.debit  { background: #ffe3e3; }

.sbd-txn-info { flex: 1; min-width: 0; }

.sbd-txn-note {
    font-size: .88rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: .15rem;
}

.sbd-txn-meta { font-size: .75rem; color: var(--ink-3); }

.sbd-txn-amount {
    font-weight: 600;
    font-size: .95rem;
    flex-shrink: 0;
}

.sbd-txn-amount.credit { color: var(--success); }
.sbd-txn-amount.debit  { color: var(--danger); }

.sbd-txn-status {
    font-size: .7rem;
    padding: .2rem .55rem;
    border-radius: 99px;
    font-weight: 500;
}

.sbd-txn-status.success { background: #d3f9d8; color: #1a6b2a; }
.sbd-txn-status.pending { background: #fff3bf; color: #7d5a00; }
.sbd-txn-status.failed  { background: #ffe3e3; color: #9b1a1a; }

/* ── Field hint ──────────────────────────────────── */

.sbd-field-hint {
    font-size: .74rem;
    color: var(--ink-3);
    display: block;
    margin-top: .3rem;
}

/* ══════════════════════════════════════════════
   CLOUD STORAGE TAB
══════════════════════════════════════════════ */

/* ── Provider connect cards ──────────────────── */

.sbd-cloud-providers {
    display: flex;
    flex-direction: column;
    gap: .85rem;
    margin-bottom: 2rem;
}

.sbd-cloud-provider-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow .15s;
}

.sbd-cloud-provider-card:hover { box-shadow: 0 4px 18px rgba(0,0,0,.09); }

.sbd-cloud-provider-logo {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: var(--surface);
    padding: 6px;
}

.sbd-cloud-provider-logo svg { width: 100%; height: 100%; }

.sbd-cloud-provider-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: .2rem;
}

.sbd-cloud-provider-info strong { font-size: .95rem; color: var(--ink); }

.sbd-cloud-status {
    font-size: .75rem;
    font-weight: 500;
}

.sbd-cloud-status.connected    { color: var(--success); }
.sbd-cloud-status.disconnected { color: var(--ink-3); }

.sbd-cloud-provider-actions {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}

.sbd-cloud-not-configured {
    font-size: .75rem;
    color: var(--warn);
}

.sbd-btn-cloud-browse {
    padding: .45rem 1rem;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .83rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    color: var(--ink);
}

.sbd-btn-cloud-browse:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: #eef2ff;
}

.sbd-btn-danger-sm {
    padding: .38rem .75rem;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: .78rem;
    color: var(--danger);
    cursor: pointer;
    transition: background .15s;
}

.sbd-btn-danger-sm:hover { background: #fff0f0; border-color: var(--danger); }

/* ── File browser panel ──────────────────────── */

#sbd-cloud-browser {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    animation: fadein .2s ease;
}

.sbd-cloud-browser-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.1rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

/* ── Breadcrumb ──────────────────────────────── */

.sbd-breadcrumb {
    display: flex;
    align-items: center;
    gap: .3rem;
    font-size: .83rem;
    flex-wrap: wrap;
}

.sbd-breadcrumb-item {
    background: none;
    border: none;
    font-family: inherit;
    font-size: .83rem;
    color: var(--accent);
    cursor: pointer;
    padding: .1rem .25rem;
    border-radius: 4px;
    transition: background .12s;
}

.sbd-breadcrumb-item:hover { background: #eef2ff; }
.sbd-breadcrumb-item.current { color: var(--ink-2); cursor: default; }
.sbd-breadcrumb-item.current:hover { background: none; }

.sbd-breadcrumb-sep {
    color: var(--ink-3);
    font-size: .7rem;
    user-select: none;
}

/* ── File grid ───────────────────────────────── */

#sbd-cloud-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1px;
    background: var(--border);
    min-height: 180px;
}

.sbd-cloud-file-item {
    background: var(--card);
    padding: 1rem .75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .55rem;
    cursor: pointer;
    transition: background .12s;
    text-align: center;
    user-select: none;
}

.sbd-cloud-file-item:hover { background: #f0f4ff; }

.sbd-cloud-file-item.is-folder { cursor: pointer; }
.sbd-cloud-file-item.is-file   { cursor: default; }
.sbd-cloud-file-item.is-file:hover { background: var(--surface); }

.sbd-cloud-file-thumb {
    width: 52px; height: 52px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--surface);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.sbd-cloud-file-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.sbd-cloud-file-thumb svg {
    width: 28px; height: 28px;
    stroke: var(--ink-3); fill: none;
    stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
}

.sbd-cloud-file-thumb.folder-icon {
    background: #fff3cd;
}

.sbd-cloud-file-thumb.folder-icon svg { stroke: #d4a017; }

.sbd-cloud-file-name {
    font-size: .75rem;
    color: var(--ink);
    word-break: break-word;
    line-height: 1.3;
    max-width: 120px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sbd-cloud-file-size {
    font-size: .68rem;
    color: var(--ink-3);
}

.sbd-cloud-file-actions {
    display: flex;
    gap: .3rem;
    margin-top: .1rem;
}

.sbd-cloud-open-btn {
    font-size: .7rem;
    padding: .2rem .55rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
    transition: background .12s;
}

.sbd-cloud-open-btn:hover { background: var(--accent-h); }

#sbd-cloud-load-more {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* ── Admin setup steps ───────────────────────── */
.sbd-admin-setup-steps {
    background: #f8f9ff;
    border: 1px solid #d8def8;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: .88rem;
    line-height: 1.7;
}

.sbd-admin-setup-steps ol { margin: .5rem 0 0 1.2rem; }
.sbd-admin-setup-steps code {
    background: #e8ecff;
    padding: .1rem .4rem;
    border-radius: 4px;
    font-size: .82rem;
    word-break: break-all;
}

/* ══════════════════════════════════════════════════
   CLOUD SETTINGS TAB
══════════════════════════════════════════════════ */

.sbd-cloud-settings-intro {
    color: var(--text-muted);
    font-size: .9rem;
    margin-bottom: 1.25rem;
    line-height: 1.6;
}

.sbd-cloud-settings-notice {
    margin-bottom: 1.5rem;
    font-size: .875rem;
}

/* Credential card */
.sbd-cloud-cred-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: box-shadow .15s;
}
.sbd-cloud-cred-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.07);
}

.sbd-cloud-cred-header {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: 1.2rem;
}
.sbd-cloud-cred-header strong {
    display: block;
    font-size: 1.05rem;
}
.sbd-cloud-cred-subtitle {
    font-size: .78rem;
    color: var(--text-muted);
}

.sbd-cloud-cred-logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 8px;
}
.sbd-cloud-cred-logo.gdrive  { background: #f0f4ff; }
.sbd-cloud-cred-logo.dropbox { background: #eef4ff; }
.sbd-cloud-cred-logo svg { width: 100%; height: 100%; }

/* Collapsible setup steps */
.sbd-cred-help {
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    font-size: .855rem;
}
.sbd-cred-help summary {
    padding: .65rem 1rem;
    cursor: pointer;
    font-weight: 500;
    background: var(--sidebar-bg, #f8f9fc);
    list-style: none;
    user-select: none;
}
.sbd-cred-help summary::-webkit-details-marker { display: none; }
.sbd-cred-help summary::before {
    content: '▶ ';
    font-size: .7rem;
    margin-right: .3rem;
    transition: transform .15s;
}
.sbd-cred-help[open] summary::before { content: '▼ '; }
.sbd-cred-help ol {
    margin: .75rem 1rem .75rem 2rem;
    line-height: 1.8;
    color: var(--text);
}
.sbd-cred-help code {
    background: #e8ecff;
    padding: .1rem .4rem;
    border-radius: 4px;
    font-size: .82rem;
    word-break: break-all;
}

/* Redirect URI row with copy button */
.sbd-cred-redirect-info {
    margin-bottom: 1.1rem;
}
.sbd-cred-redirect-info label {
    display: block;
    font-size: .78rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: .35rem;
}
.sbd-cred-copy-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    flex-wrap: wrap;
}
.sbd-cred-copy-row code {
    flex: 1;
    min-width: 0;
    background: var(--sidebar-bg, #f4f5f8);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: .45rem .75rem;
    font-size: .8rem;
    word-break: break-all;
    color: var(--accent);
}
.sbd-btn-copy {
    padding: .4rem .85rem;
    font-size: .8rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
    transition: background .12s;
}
.sbd-btn-copy:hover { background: var(--accent-h); }

/* Save button spacing */
.sbd-cred-save-btn {
    margin-top: .5rem;
}

/* ── OAuth "Sign in with" branded buttons ──────── */
.sbd-btn-oauth {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    padding: .55rem 1.1rem;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: box-shadow .15s, border-color .15s, background .12s;
    color: var(--text);
    white-space: nowrap;
}
.sbd-btn-oauth:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,.12);
    border-color: #aaa;
}
.sbd-btn-oauth:disabled {
    opacity: .6;
    cursor: not-allowed;
}
.sbd-btn-oauth-google:hover { border-color: #4285F4; }
.sbd-btn-oauth-dropbox:hover { border-color: #0061FF; }

.sbd-cloud-not-configured {
    display: block;
    font-size: .78rem;
    margin-top: .4rem;
}
.sbd-cloud-not-configured a {
    color: var(--accent);
    text-decoration: none;
}
.sbd-cloud-not-configured a:hover { text-decoration: underline; }

/* ── PediGuide Button ── */
.sbd-pediguide-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .3rem;
    width: 100%;
    background: linear-gradient(135deg, #f08c00 0%, #e67700 100%);
    border: none;
    border-radius: 999px;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    text-align: center;
    font-size: .88rem;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    cursor: pointer;
    transition: opacity .15s, box-shadow .15s;
    box-sizing: border-box;
}
.sbd-pediguide-btn:hover {
    opacity: .9;
    box-shadow: 0 4px 14px rgba(240,140,0,.4);
}
.sbd-pediguide-btn .material-icons {
    color: #fff;
    line-height: 1;
}

/* ── Wallet mini icon ── */
.sbd-wallet-mini-icon {
    display: block;
    color: rgba(255,255,255,.9);
    line-height: 1;
    margin: 0 auto .3rem;
}

/* ══════════════════════════════════════════════════
   CLOUD ACCORDION
══════════════════════════════════════════════════ */

.sbd-cloud-accordion {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: box-shadow .15s;
}
.sbd-cloud-accordion + .sbd-cloud-accordion {
    margin-top: .85rem;
}
.sbd-cloud-accordion:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.09);
}

/* The top bar row */
.sbd-cloud-accordion-bar {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1rem 1.25rem;
    cursor: default;
}

/* Chevron toggle button */
.sbd-accordion-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: .35rem .45rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, border-color .12s;
    color: var(--text-muted, #888);
    flex-shrink: 0;
}
.sbd-accordion-toggle:hover {
    background: var(--surface, #f4f5f8);
    border-color: var(--accent);
    color: var(--accent);
}

.sbd-chevron {
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .22s ease;
}
.sbd-chevron.open {
    transform: rotate(180deg);
}

/* Inline file panel */
.sbd-cloud-inline-panel {
    display: none;  /* toggled by jQuery slideDown/slideUp */
    border-top: 1px solid var(--border);
    background: var(--card);
}

.sbd-cloud-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1.1rem;
    background: var(--surface, #f8f9fc);
    border-bottom: 1px solid var(--border);
}

/* File grid inside accordion */
.sbd-cloud-file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1px;
    background: var(--border);
    min-height: 120px;
}

/* Reuse existing file item styles — targets class .sbd-cloud-file-item */

.sbd-cloud-load-more {
    padding: 1rem;
    text-align: center;
    border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════
   ADMIN TOGGLE SWITCH
══════════════════════════════════════════════════ */

.sbd-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    gap: .6rem;
}
.sbd-toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
/* hide the hidden-value input visually but keep it in DOM */
.sbd-toggle-switch input[type="hidden"] {
    display: none;
}
.sbd-toggle-slider {
    display: inline-block;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 999px;
    position: relative;
    transition: background .2s;
    flex-shrink: 0;
}
.sbd-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.25);
    transition: transform .2s;
}
.sbd-toggle-switch input[type="checkbox"]:checked + .sbd-toggle-slider {
    background: #4CAF50;
}
.sbd-toggle-switch input[type="checkbox"]:checked + .sbd-toggle-slider::after {
    transform: translateX(20px);
}

/* ── Wallet mini icon SVG fix ──────────────────── */
.sbd-wallet-mini-icon {
    display: block;
    stroke: rgba(255,255,255,.9);
    fill: none;
    margin: 0 auto .3rem;
    line-height: 1;
}
