:root {
    --bg-color: #0f0f13;
    --card-bg: #1a1a24;
    --primary: #6c5ce7;
    --accent: #a29bfe;
    --text: #dfe6e9;
    --text-muted: #b2bec3;
    --success: #00b894;
    --danger: #d63031;
    --warning: #fdcb6e;
    --gradient-1: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
    --gradient-bg: radial-gradient(circle at 50% 50%, rgba(108, 92, 231, 0.15) 0%, rgba(15, 15, 19, 0) 50%);
}

body {
    background-color: var(--bg-color);
    background-image: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: 0.3s;
}

a:hover {
    color: var(--accent);
    text-shadow: 0 0 10px rgba(162, 155, 254, 0.4);
}

.navbar {
    background: rgba(15, 15, 19, 0.8);
    backdrop-filter: blur(12px);
    padding: 0.8rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.brand {
    font-size: 1.4rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.navbar .nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar .btn {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
}

.card {
    background: rgba(26, 26, 36, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    min-width: 0;
    /* Prevent Grid Blowout */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(108, 92, 231, 0.15);
    border-color: rgba(108, 92, 231, 0.3);
}

.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    font-size: 1rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.5);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    transition: 0.3s;
    box-sizing: border-box;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
    margin-top: 1rem;
}

th,
td {
    padding: 1.2rem;
    text-align: left;
}

th {
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

tr {
    background: rgba(255, 255, 255, 0.02);
    transition: 0.2s;
}

tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}

.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-paid {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
    border: 1px solid rgba(0, 184, 148, 0.3);
}

.status-pending_payment {
    background: rgba(253, 203, 110, 0.15);
    color: var(--warning);
    border: 1px solid rgba(253, 203, 110, 0.3);
}

.status-failed {
    background: rgba(214, 48, 49, 0.15);
    color: var(--danger);
    border: 1px solid rgba(214, 48, 49, 0.3);
}

.hero {
    text-align: center;
    padding: 6rem 1rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(108, 92, 231, 0.2) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: -1;
    filter: blur(50px);
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: 0.3s;
}

.custom-checkbox:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.custom-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
    margin: 0;
}

.custom-checkbox label {
    margin: 0;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    background: linear-gradient(to right, #fff, #a29bfe);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.4rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(0, 184, 148, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-danger {
    background: rgba(214, 48, 49, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(9, 132, 227, 0.1);
    border-color: #0984e3;
    color: #74b9ff;
}

/* Grid Layouts */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

@media (max-width: 768px) {
    .avatar-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .hero h1 {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .brand {
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
        width: 100%;
    }
}

/* Target buttons within nav-links specifically to override inline margins if needed, 
       though it's better to remove inline styles in HTML. 
       We will assume we clean up HTML too, but this helps. */
.nav-links .btn {
    margin: 0 !important;
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
    flex-grow: 1;
    text-align: center;
}

.container {
    padding: 1rem;
}

.hero {
    padding: 3rem 1rem;
}

.hero h1 {
    font-size: 2.2rem;
}

.hero p {
    font-size: 1.1rem;
}

.card {
    padding: 1.5rem;
}

.btn {
    padding: 0.8rem 1.5rem;
}

th,
td {
    padding: 0.8rem;
    font-size: 0.9rem;
}
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    /* Mobile Menu Logic */
    .nav-toggle {
        display: block !important;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        cursor: pointer;
        z-index: 1001;
    }

    .nav-links {
        display: none;
        /* Hidden by default on mobile */
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
    }

    .nav-links.active {
        display: flex;
        /* Show when active */
    }

    .nav-links .btn {
        margin: 0.5rem 0 !important;
        width: 100%;
        text-align: center;
    }
}

/* Default state for larger screens */
.nav-toggle {
    display: none;
    font-size: 1.5rem;
    color: white;
}

/* --- Premium Redesign Styles --- */

.page-header {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.avatar-card {
    background: rgba(255, 255, 255, 0.03);
    /* Dark Glass */
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* Subtle border */
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    /* Prevent Grid Blowout */
}

.avatar-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(108, 92, 231, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.avatar-thumb {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #000;
    position: relative;
}

.avatar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    cursor: pointer;
}

.avatar-card:hover .avatar-thumb img {
    transform: scale(1.05);
    /* Subtle zoom on hover */
}

.avatar-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    word-break: break-word;
}

.avatar-name {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.3rem 0;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.avatar-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.avatar-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
    /* Push to bottom */
}

.btn-sm-glass {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    flex: 1;
    text-align: center;
    font-weight: 600;
    transition: 0.2s;
}

.btn-sm-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.btn-chat-action {
    background: rgba(0, 184, 148, 0.15);
    color: var(--success);
    border-color: rgba(0, 184, 148, 0.3);
}

.btn-chat-action:hover {
    background: rgba(0, 184, 148, 0.25);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 184, 148, 0.2);
}

.btn-floating-action {
    display: inline-flex;
    align-items: center;
    background: var(--gradient-1);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
    transition: 0.3s;
}

.btn-floating-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.6);
}

@media (max-width: 600px) {
    .avatar-actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .btn-sm-glass {
        padding: 0.8rem;
        font-size: 0.9rem;
        width: 100%;
        box-sizing: border-box;
    }
}