:root {
    --sidebar-width: 280px;
    --topbar-height: 80px;
    --sa-bg: #09090b;
    --sa-card-bg: rgba(24, 24, 27, 0.8);
    --sa-card-border: rgba(255, 255, 255, 0.1);
    --sa-accent: #fb923c;
    --sa-accent-glow: rgba(251, 146, 60, 0.3);
    --sa-text: #fafafa;
    --sa-text-muted: #a1a1aa;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.super-admin-body {
    background-color: var(--sa-bg);
    color: var(--sa-text);
    font-family: 'Inter', var(--font-primary);
    margin: 0;
    display: flex;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: rgba(9, 9, 11, 0.8);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--sa-card-border);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.sidebar-header {
    padding: 32px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    font-size: 28px;
    filter: drop-shadow(0 0 8px var(--sa-accent-glow));
}

.logo-text {
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 16px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--sa-text-muted);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: var(--transition-smooth);
    font-weight: 500;
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.nav-item.active {
    background: rgba(251, 146, 60, 0.1);
    color: var(--sa-accent);
    border-color: rgba(251, 146, 60, 0.2);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.nav-icon {
    font-size: 1.2rem;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--sa-card-border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--sa-accent) 0%, #ea580c 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: #000;
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.3);
}

.user-name {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.user-role {
    font-size: 0.8rem;
    color: var(--sa-text-muted);
}

.logout-btn {
    width: 100%;
    padding: 12px;
    background: rgba(239, 68, 68, 0.05);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fff;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 0;
    background: radial-gradient(circle at top right, rgba(251, 146, 60, 0.05), transparent 600px);
}

.top-bar {
    height: var(--topbar-height);
    background-color: rgba(9, 9, 11, 0.7);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--sa-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sa-card-border);
    padding: 10px 20px;
    border-radius: 14px;
    width: 440px;
    transition: var(--transition-smooth);
}

.search-box:focus-within {
    background-color: rgba(255, 255, 255, 0.07);
    border-color: rgba(251, 146, 60, 0.4);
    box-shadow: 0 0 20px rgba(251, 146, 60, 0.1);
}

.search-box input {
    background: none;
    border: none;
    color: #fff;
    outline: none;
    width: 100%;
    font-size: 0.95rem;
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 24px;
}

.status-indicator {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--sa-text-muted);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot.online {
    background-color: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.4);
}

.action-btn-primary {
    background: linear-gradient(135deg, var(--sa-accent) 0%, #ea580c 100%);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 12px rgba(251, 146, 60, 0.2);
}

.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(251, 146, 60, 0.3);
}

.action-btn-secondary {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--sa-card-border);
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.action-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

/* View Sections */
.view {
    display: none;
    padding: 40px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view.active {
    display: block;
}

.welcome-header h1 {
    font-size: 2.2rem;
    margin: 0 0 8px 0;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
}

.welcome-header p {
    color: var(--sa-text-muted);
    font-size: 1.1rem;
    margin: 0;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-top: 40px;
}

.stats-grid.compact {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-top: 0;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--sa-card-bg);
    border: 1px solid var(--sa-card-border);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 28px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.stat-card.compact {
    border-radius: 16px;
    padding: 20px;
}

.stat-card.compact .stat-value {
    font-size: 1.5rem;
    margin-bottom: 0;
}

.stat-card:hover {
    border-color: rgba(251, 146, 60, 0.3);
    background-color: rgba(24, 24, 27, 0.95);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.stat-label {
    color: var(--sa-text-muted);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-icon {
    font-size: 1.6rem;
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.5));
}

.stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 12px;
    color: #fff;
    letter-spacing: -0.5px;
}

.stat-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--sa-text-muted);
}

.stat-trend.positive {
    color: #22c55e;
    font-weight: 700;
    background: rgba(34, 197, 94, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

.stat-trend.negative {
    color: #ef4444;
    font-weight: 700;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 8px;
    border-radius: 6px;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
    margin-top: 40px;
}

.card {
    background: var(--sa-card-bg);
    border: 1px solid var(--sa-card-border);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 32px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.card-header h2 {
    font-size: 1.4rem;
    margin: 0;
    color: #fff;
    font-weight: 700;
}

.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.view-header h1 {
    margin: 0;
    font-size: 1.7rem;
}

.see-all {
    color: var(--sa-accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.see-all:hover {
    color: #ea580c;
    text-decoration: underline;
}

.loading-spinner {
    color: var(--color-text-muted);
    padding: 18px 0;
    font-size: 0.9rem;
}

.action-btn-sm {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn-sm:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.25);
}

.action-btn-sm.danger {
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.12);
}

.action-btn-sm.danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Table Styles */
.table-container {
    background: var(--sa-card-bg);
    border: 1px solid var(--sa-card-border);
    border-radius: 24px;
    overflow: hidden;
    margin-top: 24px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 24px;
    background-color: rgba(255, 255, 255, 0.02);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

td {
    padding: 18px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

td .table-subline {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 4px;
}

.table-empty-cell {
    text-align: center;
    padding: 32px;
}

.tenant-name {
    font-weight: 600;
}

.tenant-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

tr:hover td {
    background-color: rgba(255, 255, 255, 0.02);
}

.badge {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background-color: rgba(251, 146, 60, 0.1);
    color: var(--accent-success);
}

.badge-trial {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.badge-suspended {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--accent-error);
}

.badge-pending {
    background-color: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-preparing {
    background-color: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-out_for_delivery {
    background-color: rgba(14, 165, 233, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(14, 165, 233, 0.2);
}

.badge-delivered {
    background-color: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.badge-cancelled {
    background-color: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.view-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.orders-filters {
    gap: 8px;
}

.table-filter {
    padding: 12px 16px;
    min-width: 200px;
    border-radius: 12px;
    border: 1px solid var(--sa-card-border);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
    outline: none;
    transition: var(--transition-smooth);
}

.table-filter:focus {
    border-color: rgba(251, 146, 60, 0.4);
    background: rgba(255, 255, 255, 0.08);
}

.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.95rem;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item span:last-child {
    color: var(--sa-text-muted);
    text-align: right;
    max-width: 60%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.full {
    width: 100%;
}

/* Activity List */
.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.health-metrics {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid var(--sa-card-border);
    margin-bottom: 12px;
}

.metric:last-child {
    border-bottom: none;
}

.metric-label {
    color: var(--color-text-muted);
}

.metric-status {
    font-weight: 600;
}

.metric-status.success {
    color: #4ade80;
}

.metric-status.warning {
    color: #fbbf24;
}

.metric-status.error {
    color: #f87171;
}

.metric-status.info {
    color: #94a3b8;
}

.health-refresh {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.activity-icon {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-meta {
    font-size: 0.85rem;
}

.activity-title {
    display: block;
    font-weight: 600;
}

.activity-time {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    overflow: auto;
}

.modal-content {
    background-color: #18181b;
    margin: 5% auto;
    padding: 40px;
    border: 1px solid var(--sa-card-border);
    width: min(90%, 640px);
    border-radius: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: modalSlide 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.close-modal {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--color-text-muted);
}

.close-modal:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 80px;
    }

    .logo-text,
    .user-details,
    .logout-btn span {
        display: none;
    }

    .nav-item span:not(.nav-icon) {
        display: none;
    }

    .sidebar-header,
    .sidebar-nav {
        padding: 20px;
    }

    .main-content {
        margin-left: 80px;
    }

    .search-box {
        width: 250px;
    }

    .view-actions {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .table-filter {
        min-width: 140px;
        flex: 1 1 140px;
    }
}

@keyframes loading-bar {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(150%);
    }

    100% {
        transform: translateX(-100%);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes modalSlide {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive fixes */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 0;
        display: none;
    }

    .main-content {
        margin-left: 0;
    }

    .top-bar {
        padding: 0 20px;
    }

    .search-box {
        width: 100%;
    }
}