* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: Arial, "Cairo", sans-serif;
    background: #0b1020;
    color: #ffffff;
}

body {
    overflow-x: hidden;
}

a {
    text-decoration: none;
}

.page-full {
    width: 100%;
    min-height: 100vh;
}

.admin-layout {
    width: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px 1fr;
    background:
        radial-gradient(circle at top right, rgba(140, 82, 255, 0.20), transparent 28%),
        radial-gradient(circle at bottom left, rgba(0, 195, 255, 0.14), transparent 24%),
        linear-gradient(180deg, #0a0f1d 0%, #11182d 100%);
}

.sidebar {
    min-height: 100vh;
    background: rgba(10, 15, 29, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sidebar-top {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.brand-box {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-logo {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, #7c4dff, #00c2ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(124, 77, 255, 0.28);
}

.brand-box h2 {
    margin: 0;
    font-size: 20px;
}

.brand-box p {
    margin: 4px 0 0;
    color: #9aa6c5;
    font-size: 13px;
}

.admin-mini-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff4fd8, #7c4dff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.admin-mini-card strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.admin-mini-card span {
    font-size: 12px;
    color: #9aa6c5;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 18px;
}

.sidebar-nav a {
    padding: 14px 16px;
    border-radius: 14px;
    color: #dfe7ff;
    background: transparent;
    transition: 0.2s ease;
    font-size: 15px;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: linear-gradient(90deg, rgba(124, 77, 255, 0.24), rgba(0, 194, 255, 0.16));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.disabled-link {
    opacity: 0.55;
    pointer-events: none;
}

.sidebar-bottom {
    margin-top: 20px;
}

.logout-btn {
    display: block;
    text-align: center;
    padding: 14px 16px;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, #ff5b7f, #ff7d4d);
    font-weight: 700;
}

.main-content {
    width: 100%;
    min-height: 100vh;
    padding: 28px;
}

.topbar {
    width: 100%;
    margin-bottom: 24px;
}

.topbar-card {
    width: 100%;
    padding: 20px 24px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.topbar-card h1 {
    margin: 0 0 6px;
    font-size: 28px;
}

.topbar-card p {
    margin: 0;
    color: #9aa6c5;
    font-size: 15px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    width: 100%;
}

.stat-card,
.welcome-card {
    width: 100%;
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-card h3,
.welcome-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
}

.stat-card p,
.welcome-card p {
    margin: 0;
    color: #c6d0ec;
    line-height: 1.8;
}

.welcome-card.large {
    grid-column: 1 / -1;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-screen {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at top right, rgba(140, 82, 255, 0.22), transparent 28%),
        radial-gradient(circle at bottom left, rgba(0, 195, 255, 0.15), transparent 24%),
        linear-gradient(180deg, #0a0f1d 0%, #11182d 100%);
}

.login-card {
    width: 100%;
    max-width: 460px;
    padding: 30px;
    border-radius: 28px;
    background: rgba(12, 18, 34, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    margin: 0 auto 18px;
    background: linear-gradient(135deg, #7c4dff, #00c2ff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
}

.login-card h1 {
    text-align: center;
    margin: 0 0 10px;
    font-size: 28px;
}

.login-card .sub {
    text-align: center;
    color: #9aa6c5;
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: #dfe7ff;
    font-size: 14px;
}

.form-input {
    width: 100%;
    height: 52px;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    background: rgba(255,255,255,0.05);
    color: #fff;
    padding: 0 16px;
    font-size: 15px;
    outline: none;
}

.form-input:focus {
    border-color: rgba(124, 77, 255, 0.80);
    box-shadow: 0 0 0 4px rgba(124, 77, 255, 0.12);
}

.btn-primary {
    width: 100%;
    height: 54px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #7c4dff, #00c2ff);
}

.alert-error {
    margin-bottom: 16px;
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 91, 127, 0.14);
    border: 1px solid rgba(255, 91, 127, 0.30);
    color: #ffd0d9;
}

@media (max-width: 991px) {
    .admin-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}


.users-topbar-card {
    padding: 24px 26px;
}

.users-topbar-flex {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.page-chip {
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #dfe7ff;
    font-size: 14px;
    font-weight: 600;
}

.users-toolbar-card {
    width: 100%;
    margin-bottom: 18px;
    padding: 20px 22px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.users-search-form {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 16px;
    align-items: end;
}

.users-search-group {
    width: 100%;
}

.users-search-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.users-search-btn,
.users-reset-btn {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    font-weight: 700;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.users-stats-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.users-stat-card {
    min-height: 160px;
}

.big-stat {
    font-size: 34px;
    font-weight: 800;
    margin: 10px 0 8px;
    color: #ffffff;
}

.table-card {
    width: 100%;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.table-card-header {
    padding: 20px 22px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.table-card-header h3 {
    margin: 0;
    font-size: 20px;
}

.table-card-header span {
    color: #9aa6c5;
    font-size: 14px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.users-table {
    width: 100%;
    min-width: 1400px;
    border-collapse: collapse;
}

.users-table thead th {
    text-align: right;
    padding: 16px 14px;
    font-size: 13px;
    color: #9aa6c5;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    white-space: nowrap;
}

.users-table tbody td {
    padding: 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    vertical-align: middle;
    color: #f5f7ff;
    font-size: 14px;
}

.users-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.user-info-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 220px;
}

.user-avatar-img,
.user-avatar-fallback {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-img {
    border: 2px solid rgba(255,255,255,0.10);
}

.user-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7c4dff, #00c2ff);
    color: #fff;
    font-weight: 800;
    font-size: 18px;
}

.user-main-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.user-main-meta strong {
    font-size: 15px;
    color: #ffffff;
}

.user-main-meta span {
    font-size: 12px;
    color: #9aa6c5;
    max-width: 210px;
    word-break: break-all;
}

.uid-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(124, 77, 255, 0.14);
    border: 1px solid rgba(124, 77, 255, 0.28);
    color: #dcd0ff;
    font-weight: 700;
    min-width: 72px;
}

.mini-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 10px;
    border-radius: 12px;
    background: rgba(0, 194, 255, 0.12);
    border: 1px solid rgba(0, 194, 255, 0.22);
    color: #c8f6ff;
    font-size: 12px;
    font-weight: 700;
    min-width: 60px;
}

.mini-badge.soft {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.10);
    color: #e6ebff;
}

.td-mono {
    font-family: monospace;
    font-size: 12px;
    color: #dbe5ff;
}

.td-text-wrap {
    max-width: 220px;
    word-break: break-word;
    line-height: 1.7;
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-left: 6px;
}

.status-dot.online {
    background: #27d17f;
    box-shadow: 0 0 12px rgba(39, 209, 127, 0.5);
}

.status-dot.offline {
    background: #ff5b7f;
    box-shadow: 0 0 12px rgba(255, 91, 127, 0.4);
}

.token-text {
    font-size: 13px;
    color: #e8eeff;
}

.empty-state-table {
    padding: 28px 10px;
    text-align: center;
    color: #9aa6c5;
    font-size: 15px;
}

.pagination-bar {
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.pagination-info {
    color: #9aa6c5;
    font-size: 14px;
}

.pagination-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 11px 16px;
    border-radius: 14px;
    color: #ffffff;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    font-weight: 700;
}

.page-btn.active {
    background: linear-gradient(135deg, #7c4dff, #00c2ff);
    border-color: transparent;
}

@media (max-width: 1200px) {
    .users-stats-grid {
        grid-template-columns: 1fr;
    }

    .users-search-form {
        grid-template-columns: 1fr;
    }

    .users-search-actions {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 640px) {
    .users-search-actions {
        grid-template-columns: 1fr;
    }

    .pagination-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-actions {
        width: 100%;
    }

    .page-btn {
        text-align: center;
    }
}