:root {
    --admin-shell-bg: linear-gradient(180deg, #eef4ff 0%, #f8fafc 45%, #eef7f6 100%);
    --admin-border: rgba(148, 163, 184, 0.24);
    --admin-appbar-bg: rgba(255, 255, 255, 0.82);
    --admin-shadow: 0 24px 80px rgba(15, 23, 42, 0.08);
}

html, body {
    font-family: "Inter", "Tajawal", "Segoe UI", sans-serif;
    overflow-x: hidden;
    background: #f8fafc;
}

html[dir="rtl"], body[dir="rtl"] {
    font-family: "Tajawal", "Inter", "Segoe UI", sans-serif;
}

body {
    margin: 0;
}

.admin-shell {
    min-height: 100vh;
    background: var(--admin-shell-bg);
}

.admin-appbar {
    height: 72px;
    padding-inline: 16px;
    backdrop-filter: blur(20px);
    background: var(--admin-appbar-bg);
    border-bottom: 1px solid var(--admin-border);
}

.appbar-action {
    border-radius: 14px;
}

.language-switcher {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--admin-border);
    background: rgba(255, 255, 255, 0.85);
    margin-inline: 12px;
}

.language-switcher__button {
    min-width: 54px;
    border-radius: 999px !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em;
}

.admin-avatar {
    cursor: pointer;
    width: 38px;
    height: 38px;
}

.admin-drawer {
    border-inline-end: 1px solid rgba(255, 255, 255, 0.12);
}

.admin-main-content {
    min-height: calc(100vh - 72px);
}

.admin-content-container {
    padding: 32px 28px 24px !important;
    animation: fadeIn 180ms ease-out;
}

.admin-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    border-top: 1px solid var(--admin-border);
    background: transparent;
}

.mud-drawer .mud-drawer-content {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.nav-menu-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 22px;
    min-height: 76px;
}

.nav-brand__content {
    min-width: 0;
}

.nav-brand__title {
    color: #f8fafc;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.nav-brand__subtitle {
    color: rgba(226, 232, 240, 0.72);
}

.nav-logo {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, rgba(255,255,255,0.18), rgba(255,255,255,0.06));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.14);
}

.nav-logo__icon {
    color: #ffffff;
    font-size: 28px;
}

.nav-mini .nav-brand {
    justify-content: center;
    padding-inline: 16px;
}

.nav-links-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
}

.nav-links-menu {
    color: #f8fafc;
}

.nav-links-wrapper .mud-nav-link {
    margin: 4px 12px;
    border-radius: 14px;
    min-height: 50px;
}

.nav-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.nav-chip {
    min-width: 34px;
    justify-content: center;
    font-size: 0.7rem;
}

.nav-admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 22px 20px;
}

.nav-admin-profile__avatar {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
}

.nav-admin-profile__content {
    min-width: 0;
}

.nav-admin-profile__name {
    color: #ffffff;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-admin-profile__role {
    color: rgba(226, 232, 240, 0.72);
}

.nav-menu-container .mud-divider {
    background: rgba(255,255,255,0.12);
    margin: 0;
}

.mud-nav-link.active {
    background: rgba(255,255,255,0.14) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

html[dir="ltr"] .mud-nav-link.active {
    border-left: 4px solid #ffffff !important;
}

html[dir="rtl"] .mud-nav-link.active {
    border-right: 4px solid #ffffff !important;
}

.mud-nav-link:hover {
    background: rgba(255,255,255,0.08) !important;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.12) !important;
}

.live-chip {
    border-radius: 999px !important;
}

.mud-chip-live {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.35); }
    50% { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
}

.new-order-row {
    animation: highlight-new 2s ease-out;
}

@keyframes highlight-new {
    0% { background-color: rgba(250, 204, 21, 0.26); }
    100% { background-color: transparent; }
}

.online-dot,
.offline-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    vertical-align: middle;
}

.online-dot {
    background: #22c55e;
    animation: online-pulse 2s infinite;
}

.offline-dot {
    background: #94a3b8;
}

html[dir="ltr"] .online-dot,
html[dir="ltr"] .offline-dot {
    margin-right: 4px;
}

html[dir="rtl"] .online-dot,
html[dir="rtl"] .offline-dot {
    margin-left: 4px;
}

@keyframes online-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.cancelled-row td {
    text-decoration: line-through;
    opacity: 0.65;
}

.chat-bubble-customer,
.chat-bubble-business {
    padding: 10px 14px;
    max-width: 70%;
    margin-bottom: 4px;
    word-wrap: break-word;
}

.chat-bubble-customer {
    background: #0f3dde;
    color: #ffffff;
    border-radius: 18px 18px 6px 18px;
    margin-inline-start: auto;
}

.chat-bubble-business {
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-divider);
    border-radius: 18px 18px 18px 6px;
    margin-inline-end: auto;
}

html[dir="rtl"] .chat-bubble-customer {
    border-radius: 18px 18px 18px 6px;
}

html[dir="rtl"] .chat-bubble-business {
    border-radius: 18px 18px 6px 18px;
}

.chat-bubble-system {
    background: var(--mud-palette-divider);
    color: var(--mud-palette-text-secondary);
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-style: italic;
    max-width: 80%;
    margin: 4px auto;
    text-align: center;
}

.conversation-item {
    cursor: pointer;
    border-bottom: 1px solid var(--mud-palette-divider);
    padding: 12px 16px;
    transition: background 0.12s ease;
}

.conversation-item:hover,
.conversation-item.active {
    background: var(--mud-palette-action-hover);
}

html[dir="ltr"] .conversation-item.active {
    border-left: 3px solid var(--mud-palette-primary);
}

html[dir="rtl"] .conversation-item.active {
    border-right: 3px solid var(--mud-palette-primary);
}

.heatmap-cell {
    width: 100%;
    height: 22px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.heatmap-cell:hover {
    opacity: 0.82;
    transform: scale(1.08);
}

.blazor-error-boundary {
    background: linear-gradient(135deg, #b91c1c, #7f1d1d);
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.35);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.6);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 960px) {
    .admin-content-container {
        padding: 20px 16px 16px !important;
    }

    .admin-appbar {
        padding-inline: 10px;
    }
}

@media (max-width: 600px) {
    .language-switcher {
        margin-inline: 6px;
    }

    .language-switcher__button {
        min-width: 46px;
        padding-inline: 10px !important;
    }

    .d-none-mobile {
        display: none !important;
    }
}
