/* =========================
   PROFESSIONAL FONT
========================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

*,
*::before,
*::after {
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
}

/* =========================
   VARIABLES
========================= */
:root {
    --primary-blue: #0ea5e9;
    --primary-blue-dark: #0284c7;
    --primary-blue-deep: #0369a1;
    --primary-blue-soft: #38bdf8;
    --primary-blue-light: #e0f2fe;
    --primary-blue-faint: rgba(224, 242, 254, 0.12);

    --white: #ffffff;
    --text-dark: #0f172a;
    --text-light: #f8fafc;
    --text-soft: rgba(255, 255, 255, 0.88);
    --muted: #64748b;
    --muted-light: rgba(255, 255, 255, 0.68);

    --border-soft: rgba(255, 255, 255, 0.16);
    --border-faint: rgba(255, 255, 255, 0.10);

    --shadow-blue: rgba(2, 132, 199, 0.22);
    --shadow-dark: rgba(15, 23, 42, 0.26);

    --danger-red: #dc2626;
    --danger-red-dark: #b91c1c;
    --danger-soft: #fee2e2;

    --success: #16a34a;
    --success-soft: #dcfce7;

    --radius-sm: 14px;
    --radius-md: 18px;
    --radius-lg: 22px;
    --radius-xl: 28px;

    --transition: all 0.28s ease;
}

/* =========================
   GLOBAL
========================= */
a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    background: none;
    outline: none;
}

img {
    display: block;
    max-width: 100%;
}

/* =========================
   OVERLAY
========================= */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.46);
    backdrop-filter: blur(5px);
    z-index: 5000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* =========================
   SIDEBAR
========================= */
.user-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 355px;
    max-width: 90vw;
    height: 100vh;
    z-index: 6000;
    transform: translateX(100%);
    transition: transform 0.35s ease;
    overflow: hidden;
    color: var(--white);
    box-shadow: -20px 0 55px rgba(2, 132, 199, 0.24);
    background:
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.20), transparent 26%),
        radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.08), transparent 22%),
        linear-gradient(180deg, #1ba4df 0%, #1089cd 38%, #0c78bf 68%, #0a689f 100%);
}

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

.user-sidebar::before {
    content: "";
    position: absolute;
    top: 88px;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.14);
    z-index: 1;
}

.user-sidebar::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 20%, transparent 80%, rgba(0,0,0,0.05) 100%);
    pointer-events: none;
}

.sidebar-inner {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* =========================
   HEADER
========================= */
.sidebar-header {
    min-height: 88px;
    padding: 22px 20px 18px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sidebar-header-copy {
    min-width: 0;
}

.sidebar-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: 4px;
}

.sidebar-subtitle {
    font-size: 12.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-close-btn {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--white);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: var(--transition);
}

.sidebar-close-btn:hover {
    background: var(--white);
    color: var(--primary-blue-dark);
    transform: translateY(-1px);
}

/* =========================
   PROFILE WRAP
========================= */
.sidebar-profile-wrap {
    padding: 18px 18px 8px;
}

.profile-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 18px;
    border-radius: 24px;
    color: var(--white);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.profile-link {
    text-decoration: none !important;
}

.profile-link:hover {
    transform: translateY(-2px);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.18), rgba(255,255,255,0.10));
    box-shadow:
        0 20px 42px rgba(0, 0, 0, 0.18),
        0 10px 26px rgba(2, 132, 199, 0.14);
}

.profile-card-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}

.profile-card-right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.profile-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--white);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.66);
    margin-bottom: 2px;
}

.profile-name {
    display: block;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-phone {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.86);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guest-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
}

.profile-arrow {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.82);
    transition: var(--transition);
}

.profile-link:hover .profile-arrow {
    transform: translateX(2px);
}

/* =========================
   BODY
========================= */
.sidebar-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    padding: 4px 0 10px;
}

.sidebar-nav {
    height: 100%;
    overflow-y: auto;
    padding: 4px 0 10px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.26) transparent;
}

.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.26);
    border-radius: 999px;
}

/* =========================
   GROUPS
========================= */
.sidebar-group {
    padding: 8px 14px 4px;
}

.sidebar-group + .sidebar-group {
    margin-top: 2px;
}

.sidebar-group-head {
    padding: 0 8px 8px;
}

.sidebar-section {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.68);
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* =========================
   LINKS
========================= */
.sidebar-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 14px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--white);
    background: transparent;
    border: 1px solid transparent;
    opacity: 0;
    transform: translateX(18px);
    transition:
        background 0.25s ease,
        transform 0.3s ease,
        opacity 0.3s ease,
        box-shadow 0.25s ease,
        border-color 0.25s ease;
}

.user-sidebar.open .sidebar-link {
    opacity: 1;
    transform: translateX(0);
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.10);
    transform: translateX(3px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
}

.sidebar-link.active {
    background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
    color: var(--primary-blue-dark);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.10),
        0 8px 20px rgba(255, 255, 255, 0.12);
}

.sidebar-link.active .sidebar-link-title,
.sidebar-link.active .sidebar-link-subtitle,
.sidebar-link.active .sidebar-link-icon,
.sidebar-link.active .sidebar-link-trail,
.sidebar-link.active .wallet-badge {
    color: var(--primary-blue-dark);
}

.sidebar-link.disabled {
    pointer-events: none;
    opacity: 0.62 !important;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link-icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--white);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

.sidebar-link.active .sidebar-link-icon {
    background: rgba(14, 165, 233, 0.10);
}

.sidebar-link-icon i {
    font-size: 20px;
}

.sidebar-link-icon-image {
    padding: 8px;
}

.net-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-link-content {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-link-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link-subtitle {
    font-size: 11.5px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.70);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-link.active .sidebar-link-subtitle {
    color: rgba(2, 132, 199, 0.78);
}

.sidebar-link-trail {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.74);
}

.sidebar-link-trail-wallet {
    gap: 10px;
}

.arrow {
    font-size: 14px;
    opacity: 0.82;
}

/* =========================
   BADGES
========================= */
.wallet-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: var(--white);
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}

.out-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.sidebar-empty {
    margin: 4px 2px 0;
    min-height: 52px;
    padding: 14px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.78);
    font-size: 13px;
    line-height: 1.5;
}

.sidebar-empty i {
    font-size: 16px;
    flex-shrink: 0;
}

/* =========================
   FOOTER
========================= */
.sidebar-footer {
    padding: 14px 16px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
    backdrop-filter: blur(10px);
}

.sidebar-footer-actions {
    margin-bottom: 10px;
}

.sidebar-footer-copy {
    text-align: center;
}

.sidebar-footer small {
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
}

.logout-btn,
.login-btn {
    width: 100%;
    min-height: 48px;
    padding: 0 16px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);

    /* 🔥 ADDED */
    white-space: nowrap;
    text-align: center;
}

.logout-btn {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
    box-shadow: 0 12px 24px rgba(220, 38, 38, 0.24);
}

.logout-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

.login-btn {
    background: linear-gradient(135deg, #ffffff, #f0f9ff);
    color: var(--primary-blue-dark);
    box-shadow: 0 12px 24px rgba(255, 255, 255, 0.14);
}

.login-btn:hover {
    transform: translateY(-1px);
}

/* =========================
   LOGOUT MODAL
========================= */
.logout-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(5px);
    z-index: 7000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 16px;
}

.logout-modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.logout-modal {
    background: var(--white);
    color: var(--text-dark);
    width: 340px;
    max-width: calc(100vw - 24px);
    border-radius: 22px;
    padding: 24px;
    text-align: center;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    animation: modalPop 0.28s ease;
}

@keyframes modalPop {
    from {
        transform: scale(0.92);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.logout-modal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--danger-red);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 24px;
}

.logout-modal h3 {
    margin: 10px 0 6px;
    font-size: 19px;
    font-weight: 800;
    color: var(--text-dark);
}

.logout-modal p {
    font-size: 14px;
    color: #475569;
    margin-bottom: 18px;
    line-height: 1.55;
}

/* =========================
   LOGOUT MODAL
========================= */

.logout-modal-actions {
    display: flex;
    gap: 12px;
    align-items: stretch; /* 🔥 ADDED */
}

.logout-modal-actions form {
    flex: 1;
    display: flex; /* 🔥 ADDED */
}

.logout-modal-actions button {
    width: 100%;
    padding: 0 16px; /* 🔥 FIXED (no vertical padding) */
    min-height: 52px; /* 🔥 ADDED */
    border-radius: 13px;
    border: none;
    font-weight: 800;
    font-size: 15px; /* 🔥 ADDED */
    cursor: pointer;
    transition: var(--transition);

    /* 🔥 CRITICAL FIX */
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.btn-cancel {
    background: #e2e8f0;
    color: #0f172a;
}

.btn-cancel:hover {
    background: #cbd5e1;
}

.btn-confirm {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.btn-confirm:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 768px) {
    .user-sidebar {
        width: 330px;
        max-width: 90vw;
    }

    .sidebar-header {
        min-height: 82px;
        padding: 20px 18px 16px;
    }

    .sidebar-title {
        font-size: 18px;
    }

    .sidebar-subtitle {
        font-size: 12px;
    }

    .sidebar-profile-wrap {
        padding: 16px 16px 8px;
    }

    .profile-card {
        padding: 16px;
        border-radius: 22px;
    }

    .profile-name {
        font-size: 18px;
    }

    .sidebar-group {
        padding: 8px 12px 4px;
    }

    .sidebar-link {
        padding: 13px;
        border-radius: 16px;
    }

    .sidebar-link-icon {
        width: 40px;
        height: 40px;
    }

    .sidebar-footer {
        padding: 14px 14px 16px;
    }

    .logout-modal {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .user-sidebar {
        width: 300px;
        max-width: 92vw;
    }

    .sidebar-header {
        padding: 18px 16px 14px;
    }

    .sidebar-close-btn {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .profile-card {
        padding: 14px;
        gap: 12px;
    }

    .profile-avatar {
        width: 52px;
        height: 52px;
    }

    .profile-name {
        font-size: 16px;
    }

    .profile-phone {
        font-size: 12px;
    }

    .sidebar-link {
        gap: 11px;
        padding: 12px;
    }

    .sidebar-link-title {
        font-size: 14px;
    }

    .sidebar-link-subtitle {
        font-size: 11px;
    }

    .wallet-badge {
        font-size: 11px;
        padding: 0 9px;
        min-height: 28px;
    }

    .sidebar-section {
        font-size: 10px;
    }

    .logout-btn,
    .login-btn {
        min-height: 46px;
        font-size: 13px;
    }

    .logout-modal {
        padding: 20px 16px;
        border-radius: 18px;
    }

    .logout-modal-actions {
        gap: 10px;
    }
}