/* ============================================================
   Developer Auth Suite — Dashboard CSS v4
   Version: 2.0.0
   Fully responsive: mobile / tablet / desktop
   Sidebar: flows in page (no fixed/sticky overlap)
   ============================================================ */

/* ── Universal reset inside wrapper ── */
.das-dashboard-wrapper *, .das-dashboard-wrapper *::before, .das-dashboard-wrapper *::after {
    box-sizing: border-box; margin: 0; padding: 0;
}

/* ── Remove ALL theme constraints from page content ── */
.das-dashboard-page .entry-header,
.das-dashboard-page .page-header,
.das-dashboard-page .entry-title,
.das-dashboard-page h1.entry-title { display: none !important; }

.das-dashboard-page .entry-content,
.das-dashboard-page .post-content,
.das-dashboard-page .page-content,
.das-dashboard-page .site-main,
.das-dashboard-page main.site-main,
.das-dashboard-page #content,
.das-dashboard-page #primary,
.das-dashboard-page .content-area,
.das-dashboard-page article.page,
.das-dashboard-page article.post,
.das-dashboard-page .wp-block-post-content,
.das-dashboard-page .container,
.das-dashboard-page .container-fluid,
.das-dashboard-page .row {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    float: none !important;
    overflow-x: hidden !important;
}

/* Prevent any theme images/logos bleeding into dashboard area */
.das-dashboard-page .site-logo,
.das-dashboard-page .custom-logo-link,
.das-dashboard-page .navbar-brand img,
.das-dashboard-page .header-logo { max-height: none; }

/* ═══════════════════════════════════════
   WRAPPER — full bleed, flex row
═══════════════════════════════════════ */
.das-dashboard-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    display: flex;
    align-items: stretch;
    background: #f0f4f8;
    color: #0A2540;
    line-height: 1.5;
    min-height: 60vh;
    /* Full width without positional tricks that break theme layout */
    width: 100%;
    position: relative;
}

/* ═══════════════════════════════════════
   SIDEBAR — position:relative so it NEVER
   overlaps theme header or footer
═══════════════════════════════════════ */
.das-sidebar {
    position: relative;
    width: 240px;
    min-width: 240px;
    flex-shrink: 0;
    background: #0A2540;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.07);
    /* Hidden on mobile — shown as overlay instead */
}

/* ── Sidebar Header ── */
.das-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 22px 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.das-sidebar-logo {
    height: 34px; width: 34px; min-width: 34px;
    object-fit: contain; border-radius: 8px; flex-shrink: 0;
}

.das-sidebar-logo-placeholder {
    width: 34px; height: 34px; min-width: 34px;
    background: rgba(99,91,255,.3); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.das-sidebar-logo-placeholder svg { width: 16px; height: 16px; }

.das-sidebar-brand {
    font-size: 14px; font-weight: 700; color: #fff;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1;
    letter-spacing: -.2px;
}

/* ── Sidebar User ── */
.das-sidebar-user {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.das-sidebar-avatar {
    width: 36px; height: 36px; min-width: 36px;
    border-radius: 50%; object-fit: cover;
    border: 2px solid rgba(99,91,255,.5); flex-shrink: 0;
    cursor: pointer;
}

.das-sidebar-user-info { display: flex; flex-direction: column; overflow: hidden; flex: 1; }
.das-sidebar-name  { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.das-sidebar-email { font-size: 11px; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Navigation ── */
.das-sidebar-nav {
    flex: 1; padding: 12px 10px;
    display: flex; flex-direction: column; gap: 2px;
    overflow-y: auto;
}
.das-sidebar-nav::-webkit-scrollbar { width: 3px; }
.das-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 2px; }

.das-nav-item {
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: 8px;
    font-size: 13.5px; font-weight: 500;
    color: rgba(255,255,255,.65);
    text-decoration: none !important; cursor: pointer;
    transition: background .15s, color .15s;
    position: relative; flex-shrink: 0;
    white-space: nowrap; overflow: hidden;
}
.das-nav-item:link, .das-nav-item:visited,
.das-nav-item:hover, .das-nav-item:active,
.das-nav-item:focus { text-decoration: none !important; }

.das-nav-item svg { width: 18px; height: 18px; min-width: 18px; flex-shrink: 0; stroke-width: 1.8; }
.das-nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.das-nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.das-nav-item.das-nav-active { background: rgba(99,91,255,.28); color: #fff; }
.das-nav-item.das-nav-active svg { stroke: #a5b4fc; }
.das-nav-item.das-nav-active::before {
    content: ''; position: absolute;
    left: 0; top: 20%; bottom: 20%;
    width: 3px; background: #635BFF; border-radius: 0 3px 3px 0;
}

.das-nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 8px 12px; flex-shrink: 0; }

.das-nav-logout { margin-top: auto; color: rgba(255,255,255,.45); }
.das-nav-logout:hover { color: #fca5a5; background: rgba(220,38,38,.15); }

/* ═══════════════════════════════════════
   MOBILE HEADER BAR (shown < 768px)
═══════════════════════════════════════ */
.das-mobile-header {
    display: none;
    height: 56px;
    background: #0A2540;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.das-mobile-toggle {
    background: none; border: none; cursor: pointer;
    padding: 6px; color: rgba(255,255,255,.85);
    display: flex; align-items: center;
}
.das-mobile-toggle svg { width: 22px; height: 22px; }
.das-mobile-logo { height: 22px; width: auto; }
.das-mobile-brand { font-size: 14px; font-weight: 700; color: #fff; }
.das-mobile-avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(99,91,255,.5); cursor: pointer; object-fit: cover; }

/* Mobile overlay */
.das-sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(10,37,64,.55); z-index: 95;
    backdrop-filter: blur(2px);
}
.das-sidebar-overlay.das-overlay-visible { display: block; }

/* ═══════════════════════════════════════
   MAIN CONTENT AREA
═══════════════════════════════════════ */
.das-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.das-content { flex: 1; padding: 32px 36px 56px; }

/* ── Page Header ── */
.das-page-header { margin-bottom: 26px; }
.das-page-title  { font-size: 22px; font-weight: 700; color: #0A2540; letter-spacing: -.5px; margin-bottom: 4px; line-height: 1.2; }
.das-page-desc   { font-size: 14px; color: #425466; }

/* ── Stats Grid ── */
.das-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px; margin-bottom: 22px;
}
.das-stat-card {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 18px; display: flex; align-items: center; gap: 13px;
    transition: border-color .18s, box-shadow .18s;
}
.das-stat-card:hover { border-color: #c7d2dc; box-shadow: 0 2px 8px rgba(10,37,64,.06); }
.das-stat-icon { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.das-stat-icon svg { width: 20px; height: 20px; }
.das-stat-blue   { background: #eff6ff; color: #2563eb; }
.das-stat-green  { background: #ecfdf5; color: #16a34a; }
.das-stat-purple { background: #ede9fe; color: #635BFF; }
.das-stat-gold   { background: #fffbeb; color: #d97706; }
.das-stat-content { display: flex; flex-direction: column; min-width: 0; }
.das-stat-value   { font-size: 22px; font-weight: 700; color: #0A2540; letter-spacing: -.3px; line-height: 1.2; }
.das-stat-label   { font-size: 12px; color: #8898aa; font-weight: 500; margin-top: 2px; }

/* ── Info Grid ── */
.das-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── Cards ── */
.das-card, .das-info-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; overflow: hidden; }
.das-card-header, .das-info-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 16px 22px; border-bottom: 1px solid #e2e8f0;
}
.das-card-header h3, .das-info-card-header h3 { font-size: 14.5px; font-weight: 600; color: #0A2540; }

.das-link-btn {
    font-size: 13px; font-weight: 500; color: #635BFF;
    background: none; border: none; cursor: pointer;
    font-family: inherit; padding: 0; text-decoration: none !important; transition: color .15s;
}
.das-link-btn:hover { color: #5449e6; }

/* ── Info Rows ── */
.das-info-rows { padding: 4px 0; }
.das-info-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 22px; }
.das-info-row + .das-info-row { border-top: 1px solid #f1f5f9; }
.das-info-label { font-size: 13px; color: #8898aa; font-weight: 500; flex-shrink: 0; }
.das-info-value { font-size: 13px; color: #0A2540; font-weight: 500; text-align: right; padding-left: 12px; word-break: break-word; }

/* ── Mini Orders ── */
.das-mini-orders { padding: 4px 0; }
.das-mini-order { display: flex; justify-content: space-between; align-items: center; padding: 12px 22px; }
.das-mini-order + .das-mini-order { border-top: 1px solid #f1f5f9; }
.das-mini-order-info { display: flex; flex-direction: column; gap: 2px; }
.das-mini-order-id   { font-size: 13px; font-weight: 600; color: #635BFF; }
.das-mini-order-date { font-size: 11px; color: #8898aa; }
.das-mini-order-right { display: flex; align-items: center; gap: 10px; }
.das-mini-order-total { font-size: 13px; font-weight: 600; color: #0A2540; }

/* ── Order Badge ── */
.das-order-badge {
    display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 20px;
    font-size: 11px; font-weight: 600; color: var(--badge-color, #8898aa);
    background: rgba(99,91,255,.08); white-space: nowrap;
}

/* ── Orders Table ── */
.das-card-table { overflow: visible; }
.das-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.das-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 500px; }
.das-table th {
    text-align: left; padding: 10px 16px;
    font-size: 11px; font-weight: 600; color: #8898aa;
    text-transform: uppercase; letter-spacing: .06em;
    background: #fafbfc; border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.das-table td { padding: 12px 16px; color: #0A2540; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.das-table tbody tr:hover { background: #fafbfc; }
.das-table tbody tr:last-child td { border-bottom: none; }
.das-order-num { font-weight: 600; color: #635BFF; white-space: nowrap; }
.das-order-items { color: #425466; font-size: 12.5px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.das-order-view-btn {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12px; font-weight: 500; color: #635BFF;
    text-decoration: none !important; padding: 4px 10px;
    border: 1px solid #e2e8f0; border-radius: 6px; background: #fff;
    transition: all .15s; white-space: nowrap;
}
.das-order-view-btn:hover { background: #ede9fe; border-color: #635BFF; color: #5449e6; }

/* ── Address Grid ── */
.das-address-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

/* ── Dashboard Forms ── */
.das-dashboard-form { padding: 22px; }
.das-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.das-dashboard-wrapper .das-form-group { margin-bottom: 14px; }
.das-dashboard-wrapper .das-form-label { display: block; font-size: 12.5px; font-weight: 600; color: #0A2540; margin-bottom: 5px; }
.das-dashboard-wrapper .das-form-input {
    width: 100%; height: 40px; padding: 0 13px;
    border: 1.5px solid #e2e8f0; border-radius: 9px;
    font-size: 14px; font-family: inherit; color: #0A2540;
    background: #fafbfc; outline: none; transition: all .17s;
    -webkit-appearance: none; appearance: none;
}
.das-dashboard-wrapper .das-form-input:hover { border-color: #c7d2dc; }
.das-dashboard-wrapper .das-form-input:focus { border-color: #635BFF; box-shadow: 0 0 0 3px rgba(99,91,255,.12); background: #fff; }
.das-dashboard-wrapper .das-form-input:disabled { background: #f1f5f9; color: #8898aa; cursor: not-allowed; }

/* Password input wrap */
.das-dashboard-wrapper .das-input-wrap { position: relative; display: flex; align-items: center; }
.das-dashboard-wrapper .das-input-wrap .das-input-icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 17px; height: 17px; color: #9ca3af; pointer-events: none; z-index: 1;
}
.das-dashboard-wrapper .das-input-wrap .das-form-input { padding-left: 40px; padding-right: 40px; }

/* Eye toggle button */
.das-dashboard-wrapper .das-toggle-password {
    position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer; padding: 4px;
    color: #9ca3af; z-index: 2; display: flex; align-items: center; line-height: 1;
}
.das-dashboard-wrapper .das-toggle-password:hover { color: #0A2540; }
.das-dashboard-wrapper .das-eye-icon { width: 17px; height: 17px; display: block; }

.das-dash-input { padding-left: 13px !important; padding-right: 13px !important; }
.das-field-hint { font-size: 12px; color: #8898aa; margin-top: 5px; line-height: 1.4; }

.das-form-actions { margin-top: 6px; padding-top: 18px; border-top: 1px solid #f1f5f9; display: flex; gap: 10px; }

/* ── Avatar Upload ── */
.das-avatar-upload-section {
    display: flex; align-items: center; gap: 20px;
    padding: 20px; margin-bottom: 16px;
    background: #f8fafc; border-radius: 10px;
    border: 1.5px dashed #e2e8f0;
}
.das-avatar-preview-wrap { position: relative; flex-shrink: 0; }
.das-avatar-preview-large {
    width: 80px; height: 80px; border-radius: 50%; object-fit: cover;
    border: 3px solid #fff; box-shadow: 0 2px 12px rgba(10,37,64,.12);
    display: block; cursor: pointer;
}
.das-avatar-edit-btn {
    position: absolute; bottom: 0; right: 0;
    width: 26px; height: 26px; background: #635BFF;
    border: 2px solid #fff; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .18s; padding: 0; z-index: 1;
}
.das-avatar-edit-btn:hover { background: #5449e6; }
.das-avatar-edit-btn svg { width: 12px; height: 12px; color: #fff; }
.das-avatar-info { flex: 1; }
.das-avatar-name { font-size: 15px; font-weight: 600; color: #0A2540; margin-bottom: 4px; }
.das-avatar-hint { font-size: 12.5px; color: #8898aa; line-height: 1.5; margin-bottom: 8px; }
.das-upload-bar { height: 4px; background: #e2e8f0; border-radius: 2px; overflow: hidden; margin-top: 8px; width: 180px; }
.das-upload-bar-fill { height: 100%; background: #635BFF; border-radius: 2px; width: 0; transition: width .3s; }

/* ── Buttons ── */
.das-dashboard-wrapper .das-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 0 20px; height: 40px; border: none; border-radius: 9px;
    font-size: 13.5px; font-weight: 600; font-family: inherit; cursor: pointer;
    transition: all .17s; text-decoration: none !important;
    outline: none; position: relative; white-space: nowrap;
}
.das-dashboard-wrapper .das-btn-primary { background: #635BFF; color: #fff; }
.das-dashboard-wrapper .das-btn-primary:hover { background: #5449e6; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,91,255,.3); }

/* Spinner */
.das-dashboard-wrapper .das-btn-spinner {
    width: 18px; height: 18px; display: none !important;
    position: absolute; left: 50%; top: 50%; margin-left: -9px; margin-top: -9px;
    border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff;
    border-radius: 50%; pointer-events: none;
    animation: das-spin .7s linear infinite; animation-play-state: paused;
}
.das-dashboard-wrapper .das-btn.das-btn-loading .das-btn-spinner { display: block !important; animation-play-state: running !important; }
.das-dashboard-wrapper .das-btn.das-btn-loading .das-btn-text { opacity: 0; }
.das-dashboard-wrapper .das-btn.das-btn-loading { pointer-events: none; opacity: .82; }

/* ── Alerts ── */
.das-dashboard-wrapper .das-auth-alert {
    padding: 11px 14px; border-radius: 9px; font-size: 13px;
    font-weight: 500; margin-bottom: 18px; line-height: 1.4; border: 1px solid transparent;
}
.das-dashboard-wrapper .das-alert-error   { background: #fef2f2; color: #c0392b; border-color: #fecaca; }
.das-dashboard-wrapper .das-alert-success { background: #ecfdf5; color: #15803d; border-color: #bbf7d0; }

/* ── Tabs ── */
.das-tab { display: none; animation: das-tab-in .24s ease; }
.das-tab-active { display: block; }
@keyframes das-tab-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── Empty State ── */
.das-empty-state { text-align: center; padding: 52px 20px; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; }
.das-empty-state svg { width: 44px; height: 44px; color: #c7d2dc; margin-bottom: 14px; }
.das-empty-state h3 { font-size: 16px; font-weight: 600; color: #0A2540; margin-bottom: 7px; }
.das-empty-state p  { font-size: 13px; color: #425466; margin-bottom: 18px; }
.das-empty-state .das-btn { text-decoration: none !important; }

@keyframes das-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   Desktop  : ≥ 1025px  — sidebar visible, 4-col stats
   Tablet   : 768–1024px — sidebar visible, 2-col stats
   Mobile   : < 768px   — sidebar hidden (overlay), 1-col
═══════════════════════════════════════════════════════════ */

/* ── Large desktop: cap content width for readability ── */
@media (min-width: 1400px) {
    .das-content { padding: 36px 48px 64px; }
}

/* ── Tablet: 768px – 1024px ── */
@media (max-width: 1024px) {
    .das-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .das-content { padding: 24px 24px 48px; }
}

/* ── Tablet narrower: collapse side-by-side address/info grids ── */
@media (max-width: 900px) {
    .das-info-grid     { grid-template-columns: 1fr; }
    .das-address-grid  { grid-template-columns: 1fr; }
    .das-sidebar { width: 200px; min-width: 200px; }
    .das-sidebar-brand { font-size: 13px; }
}

/* ── Mobile: < 768px ── */
@media (max-width: 767px) {

    /* Wrapper stacks vertically */
    .das-dashboard-wrapper {
        flex-direction: column;
        min-height: auto;
    }

    /* Sidebar becomes a fixed overlay drawer */
    .das-sidebar {
        position: fixed !important;
        top: 0; left: 0; bottom: 0;
        height: 100% !important;
        width: 260px !important;
        min-width: 260px !important;
        transform: translateX(-100%);
        transition: transform .28s ease;
        z-index: 200;
        box-shadow: none;
    }
    .das-sidebar.das-sidebar-open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(10,37,64,.3);
    }

    /* Show mobile sticky top bar */
    .das-mobile-header { display: flex; }

    /* Content takes full width */
    .das-main { width: 100%; }

    .das-content { padding: 16px 14px 40px; }

    .das-page-title { font-size: 18px; }
    .das-page-desc  { font-size: 13px; }

    /* Single column stats */
    .das-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 16px;
    }

    .das-stat-card { padding: 14px 12px; gap: 10px; }
    .das-stat-icon { width: 38px; height: 38px; }
    .das-stat-icon svg { width: 18px; height: 18px; }
    .das-stat-value { font-size: 18px; }
    .das-stat-label { font-size: 11px; }

    /* Single column grids */
    .das-info-grid    { grid-template-columns: 1fr; }
    .das-address-grid { grid-template-columns: 1fr; }

    /* Cards */
    .das-card-header, .das-info-card-header { padding: 14px 16px; }
    .das-info-row  { padding: 10px 16px; flex-wrap: wrap; gap: 4px; }
    .das-info-value { text-align: left; padding-left: 0; }
    .das-mini-order { padding: 10px 16px; flex-wrap: wrap; gap: 6px; }

    /* Forms */
    .das-dashboard-form { padding: 16px; }
    .das-form-row { grid-template-columns: 1fr; gap: 0; }

    /* Avatar upload: stack vertically on mobile */
    .das-avatar-upload-section { flex-direction: column; align-items: flex-start; padding: 16px; gap: 12px; }
    .das-avatar-info { width: 100%; }
    .das-upload-bar { width: 100%; }

    /* Buttons full width on mobile */
    .das-form-actions .das-btn { width: 100%; justify-content: center; }

    /* Table horizontal scroll */
    .das-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: 0 0 12px 12px; }
}

/* ── Very small phones: 360px and below ── */
@media (max-width: 380px) {
    .das-stats-grid { grid-template-columns: 1fr; }
    .das-content { padding: 12px 10px 32px; }
    .das-page-title { font-size: 17px; }
}
