/* =============================================
   GALAXY SMART SYSTEM – USER DASHBOARD CSS
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700;800&display=swap');

:root {
    --bg: #060B18;
    --surface: #0D1426;
    --card: rgba(13, 20, 38, 0.9);
    --sidebar-w: 260px;
    --blue: #00C2FF;
    --purple: #7A5FFF;
    --cyan: #00FFD1;
    --green: #00D084;
    --yellow: #FFD200;
    --red: #FF4B4B;
    --orange: #FF9A00;
    --grad: linear-gradient(135deg, #00C2FF, #7A5FFF);
    --grad45: linear-gradient(45deg, #00C2FF, #7A5FFF);
    --text: #FFFFFF;
    --muted: #9AA5BE;
    --dim: #5A677D;
    --border: rgba(0, 194, 255, 0.10);
    --border2: rgba(255, 255, 255, 0.05);
    --glow: 0 0 20px rgba(0, 194, 255, 0.25);
    --radius: 14px;
    --radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: 'Inter', sans-serif;
}

img {
    display: block;
    max-width: 100%;
}

/* ─── Sidebar ───────────────────────────────── */
#dashboard-sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--surface);
    border-right: 1px solid var(--border2);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 500;
    transition: transform 0.35s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 24px 20px;
    border-bottom: 1px solid var(--border2);
    text-decoration: none;
}

.sidebar-logo-icon {
    width: 38px;
    height: 38px;
    background: var(--grad45);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--glow);
}

.sidebar-logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    max-width: 150px;
    line-height: 1.2;
}

/* User Card in Sidebar */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px 22px;
    margin: 16px 16px 0;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--grad45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}

.user-info {
    min-width: 0;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.72rem;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nav */
.sidebar-nav {
    flex: 1;
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
}

.sidebar-section-label {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--dim);
    padding: 12px 10px 6px;
    margin-top: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    position: relative;
}

.nav-link .icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.nav-link span {
    flex: 1;
}

.nav-link .badge {
    font-size: 0.62rem;
    font-weight: 800;
    background: var(--grad45);
    color: #fff;
    padding: 2px 7px;
    border-radius: 50px;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link:hover .icon {
    background: rgba(0, 194, 255, 0.12);
    color: var(--blue);
}

.nav-link.active {
    color: var(--text);
    background: rgba(0, 194, 255, 0.07);
    border: 1px solid rgba(0, 194, 255, 0.15);
}

.nav-link.active .icon {
    background: var(--grad45);
    color: #fff;
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--grad);
    border-radius: 0 3px 3px 0;
}

/* Bottom */
.sidebar-bottom {
    padding: 14px 14px 20px;
    border-top: 1px solid var(--border2);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-bottom .nav-link {
    color: var(--dim);
}

.sidebar-bottom .nav-link.logout {
    color: #FF4B4B;
}

.sidebar-bottom .nav-link.logout:hover {
    background: rgba(255, 75, 75, 0.07);
}

/* ─── Main Content ──────────────────────────── */
#dashboard-main {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
#topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 68px;
    border-bottom: 1px solid var(--border2);
    background: rgba(6, 11, 24, 0.7);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 200;
    gap: 20px;
}

.topbar-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-icon-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--muted);
    font-size: 1rem;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}

.topbar-icon-btn:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.topbar-icon-btn .notif-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    border: 1.5px solid var(--bg);
}

/* Hamburger for mobile */
#sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 6px;
}

/* ─── Panel Area ────────────────────────────── */
.panel-area {
    padding: 32px;
    flex: 1;
}

.d-panel {
    display: none;
}

.d-panel.active {
    display: block;
}

/* ─── Summary Cards (Home Panel) ───────────── */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 30px;
}

.summary-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.summary-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--glow);
}

.summary-card::after {
    content: attr(data-emoji);
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.8rem;
    opacity: 0.06;
    pointer-events: none;
}

.summary-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: var(--grad45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 6px 20px rgba(0, 194, 255, 0.18);
}

.summary-info .label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.summary-info .value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.summary-info .sub {
    font-size: 0.72rem;
    color: var(--green);
    margin-top: 4px;
}

/* ─── Section Card ──────────────────────────── */
.d-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 26px;
}

.d-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 26px;
    border-bottom: 1px solid var(--border2);
    gap: 12px;
}

.d-section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.d-section-body {
    padding: 24px 26px;
}

/* ─── Tables ────────────────────────────────── */
.d-table {
    width: 100%;
    border-collapse: collapse;
}

.d-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--dim);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border2);
}

.d-table td {
    padding: 14px 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    vertical-align: middle;
}

.d-table tr:last-child td {
    border-bottom: none;
}

.d-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-blue {
    background: rgba(0, 194, 255, 0.12);
    color: var(--blue);
    border: 1px solid rgba(0, 194, 255, 0.2);
}

.badge-green {
    background: rgba(0, 208, 132, 0.12);
    color: var(--green);
    border: 1px solid rgba(0, 208, 132, 0.2);
}

.badge-yellow {
    background: rgba(255, 210, 0, 0.12);
    color: var(--yellow);
    border: 1px solid rgba(255, 210, 0, 0.2);
}

.badge-red {
    background: rgba(255, 75, 75, 0.12);
    color: var(--red);
    border: 1px solid rgba(255, 75, 75, 0.2);
}

.badge-orange {
    background: rgba(255, 154, 0, 0.12);
    color: var(--orange);
    border: 1px solid rgba(255, 154, 0, 0.2);
}

.badge-purple {
    background: rgba(122, 95, 255, 0.12);
    color: var(--purple);
    border: 1px solid rgba(122, 95, 255, 0.2);
}

/* ─── Buttons ───────────────────────────────── */
.d-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.d-btn-primary {
    background: var(--grad45);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 194, 255, 0.2);
}

.d-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.d-btn-outline {
    background: transparent;
    color: var(--blue);
    border: 1px solid rgba(0, 194, 255, 0.3);
}

.d-btn-outline:hover {
    background: rgba(0, 194, 255, 0.06);
}

.d-btn-sm {
    padding: 7px 14px;
    font-size: 0.78rem;
    border-radius: 7px;
}

/* ─── Order Placement Form ──────────────────── */
.order-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.order-type-card {
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 22px 16px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.02);
}

.order-type-card:hover {
    border-color: rgba(0, 194, 255, 0.35);
    background: rgba(0, 194, 255, 0.04);
}

.order-type-card.selected {
    border-color: var(--blue);
    background: rgba(0, 194, 255, 0.07);
    box-shadow: var(--glow);
}

.order-type-icon {
    font-size: 2.2rem;
    margin-bottom: 10px;
}

.order-type-name {
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.order-type-desc {
    font-size: 0.72rem;
    color: var(--muted);
    line-height: 1.5;
}

/* Form grid */
.d-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.d-form-grid.full {
    grid-template-columns: 1fr;
}

.d-form-col.span2 {
    grid-column: 1 / -1;
}

.d-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.d-form-group label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.d-form-group input,
.d-form-group select,
.d-form-group textarea {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 9px;
    padding: 12px 15px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
    resize: none;
    width: 100%;
    -webkit-appearance: none;
}

.d-form-group select option {
    background: #0D1426;
    color: var(--text);
}

.d-form-group input:focus,
.d-form-group select:focus,
.d-form-group textarea:focus {
    border-color: var(--blue);
    background: rgba(0, 194, 255, 0.04);
    box-shadow: 0 0 0 3px rgba(0, 194, 255, 0.1);
}

/* ─── Order Tracking Timeline ───────────────── */
.tracking-status-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 26px;
    background: rgba(0, 194, 255, 0.04);
    border-bottom: 1px solid var(--border2);
}

.tracking-id {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 3px;
}

.timeline {
    padding: 28px 30px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
    padding-bottom: 30px;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-step::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 40px;
    width: 2px;
    height: calc(100% - 40px);
    background: var(--border2);
}

.timeline-step.done::after {
    background: var(--grad);
}

.timeline-step:last-child::after {
    display: none;
}

.tl-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border2);
    transition: var(--transition);
    z-index: 1;
}

.timeline-step.done .tl-dot {
    background: var(--grad45);
    border-color: var(--blue);
    box-shadow: 0 0 14px rgba(0, 194, 255, 0.35);
}

.timeline-step.active .tl-dot {
    background: rgba(0, 194, 255, 0.12);
    border-color: var(--blue);
    animation: glow-pulse 2.5s infinite;
}

.tl-content {
    padding-top: 8px;
}

.tl-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 3px;
}

.tl-desc {
    font-size: 0.78rem;
    color: var(--muted);
    line-height: 1.55;
}

.tl-time {
    font-size: 0.7rem;
    color: var(--dim);
    margin-top: 5px;
}

/* ─── Payment Card ──────────────────────────── */
.payment-card {
    background: linear-gradient(135deg, rgba(0, 194, 255, 0.08) 0%, rgba(122, 95, 255, 0.08) 100%);
    border: 1px solid rgba(0, 194, 255, 0.18);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.payment-card .amount {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 900;
    background: var(--grad);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-card .sub {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ─── Empty State ───────────────────────────── */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--muted);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 14px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.empty-state p {
    font-size: 0.84rem;
    line-height: 1.65;
}

/* ─── Profile ───────────────────────────────── */
.profile-avatar-wrap {
    text-align: center;
    padding: 32px;
    border-bottom: 1px solid var(--border2);
}

.profile-avatar-big {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--grad45);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: #fff;
    font-weight: 700;
    margin-bottom: 14px;
    box-shadow: var(--glow);
}

.profile-name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.2rem;
    font-weight: 800;
}

.profile-email {
    font-size: 0.84rem;
    color: var(--muted);
    margin-top: 4px;
}

/* ─── Toast ─────────────────────────────────── */
#d-toast-container {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.d-toast {
    background: rgba(13, 20, 38, 0.97);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 20px;
    color: var(--text);
    font-size: 0.87rem;
    font-weight: 500;
    min-width: 280px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.d-toast.success {
    border-color: rgba(0, 208, 132, 0.35);
}

.d-toast.error {
    border-color: rgba(255, 75, 75, 0.35);
}

/* ─── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: var(--surface);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--blue), var(--purple));
    border-radius: 4px;
}

/* ─── Misc ──────────────────────────────────── */
.text-blue {
    color: var(--blue);
}

.text-green {
    color: var(--green);
}

.text-red {
    color: var(--red);
}

.text-muted {
    color: var(--muted);
}

.fw-700 {
    font-weight: 700;
}

.fw-800 {
    font-weight: 800;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ─── Keyframes ─────────────────────────────── */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(50px) scale(0.88);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 10px rgba(0, 194, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 25px rgba(0, 194, 255, 0.6);
    }
}

/* ─── Responsive ────────────────────────────── */
@media (max-width: 900px) {
    #dashboard-sidebar {
        transform: translateX(-100%);
    }

    #dashboard-sidebar.open {
        transform: translateX(0);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.6);
    }

    #dashboard-main {
        margin-left: 0;
    }

    #sidebar-toggle {
        display: block;
    }

    .summary-grid {
        grid-template-columns: 1fr 1fr;
    }

    .order-type-grid {
        grid-template-columns: 1fr;
    }

    .d-form-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 540px) {
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .panel-area {
        padding: 18px;
    }

    .topbar-title {
        font-size: 0.95rem;
    }
}

/* Sidebar overlay for mobile */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 490;
}

#sidebar-overlay.show {
    display: block;
}