/* AiO Panel - Red Premium UI */
:root {
    --bg-primary: #0b0607;
    --bg-secondary: #140c0d;
    --bg-card: #1d1214;
    --bg-hover: #2a171a;
    --accent-primary: #dc2626;
    --accent-secondary: #ef4444;
    --accent-third: #f87171;
    --accent-gradient: linear-gradient(135deg, #b91c1c 0%, #dc2626 45%, #ef4444 100%);
    --text-primary: #fff7f7;
    --text-secondary: #d6b4b4;
    --text-muted: #a37d7d;
    --border-color: rgba(255, 255, 255, 0.08);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.42);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(220, 38, 38, 0.12), transparent 30%),
        radial-gradient(circle at top right, rgba(239, 68, 68, 0.08), transparent 24%),
        var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #130b0c 0%, #0f0809 100%);
    border-right: 1px solid rgba(239, 68, 68, 0.14);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
}

.admin-sidebar {
    background: linear-gradient(180deg, #1b0b0d 0%, #120708 100%);
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.12);
}

.logo {
    font-size: 1.45rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    font-weight: 600;
}

.nav-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    transform: translateX(3px);
}

.nav-item.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 8px 22px rgba(220, 38, 38, 0.35);
}

.nav-item i {
    width: 20px;
    text-align: center;
}

.nav-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 12px 0;
}

.sidebar-footer {
    padding: 16px;
}

.credits-card {
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 10px 28px rgba(220, 38, 38, 0.28);
}

.credits-label {
    font-size: 0.82rem;
    opacity: 0.86;
}

.credits-amount {
    font-size: 1.6rem;
    font-weight: 800;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 270px;
    padding: 32px;
    min-height: 100vh;
}

.main-content.full-width {
    margin-left: 0;
}

.page-header {
    margin-bottom: 28px;
}

.page-header h1 {
    font-size: 1.95rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Auth */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at top, rgba(220, 38, 38, 0.14), transparent 28%),
        linear-gradient(180deg, #12090a 0%, #090506 100%);
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    border: 1px solid rgba(239, 68, 68, 0.14);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 68px;
    height: 68px;
    background: var(--accent-gradient);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 10px 30px rgba(220, 38, 38, 0.34);
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    gap: 10px;
    flex-wrap: wrap;
}

.auth-links a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.auth-links a:hover {
    color: var(--accent-third);
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-group small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.form-input {
    padding: 13px 16px;
    background: #120c0d;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-secondary);
    box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.16);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-input.small {
    padding: 8px 12px;
    font-size: 0.85rem;
    width: 120px;
}

.form-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.form-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.inline-form {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 8px 22px rgba(220, 38, 38, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.38);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(239, 68, 68, 0.1);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(239, 68, 68, 0.08);
    background: linear-gradient(180deg, rgba(220, 38, 38, 0.05), rgba(0, 0, 0, 0));
}

.card-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.card-body {
    padding: 24px;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid rgba(239, 68, 68, 0.1);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(220, 38, 38, 0.16);
    border-color: rgba(239, 68, 68, 0.22);
}

.stat-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: white;
    box-shadow: 0 8px 22px rgba(220, 38, 38, 0.3);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.service-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(239, 68, 68, 0.1);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.service-card:hover {
    border-color: rgba(239, 68, 68, 0.22);
    box-shadow: 0 14px 30px rgba(220, 38, 38, 0.16);
    transform: translateY(-3px);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.service-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.service-price {
    font-size: 1.35rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

.service-desc {
    color: var(--text-secondary);
    font-size: 0.92rem;
    margin-bottom: 20px;
}

.service-form .form-group {
    margin-bottom: 12px;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.table th {
    background: #171012;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.table td {
    font-size: 0.95rem;
}

.table tr:hover {
    background: rgba(239, 68, 68, 0.05);
}

.table code {
    background: rgba(220, 38, 38, 0.12);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #ffb4b4;
}

/* Badges */
.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    background: #1a1214;
    color: var(--text-secondary);
}

.badge-completed {
    background: rgba(16, 185, 129, 0.16);
    color: var(--success);
}

.badge-pending {
    background: rgba(245, 158, 11, 0.16);
    color: var(--warning);
}

.badge-failed {
    background: rgba(239, 68, 68, 0.16);
    color: #ff8d8d;
}

.badge-refunded {
    background: rgba(59, 130, 246, 0.16);
    color: var(--info);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.24);
    color: #ff9d9d;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.24);
    color: #7df0bf;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 4, 5, 0.82);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius-lg);
    max-width: 420px;
    width: 90%;
    border: 1px solid rgba(239, 68, 68, 0.14);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
}

.modal-close {
    cursor: pointer;
    font-size: 24px;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-primary);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* Utility */
.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .services-grid,
    .form-row {
        grid-template-columns: 1fr;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .form-inline .form-input {
        width: 100%;
    }

    .table {
        display: block;
        overflow-x: auto;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card,
.stat-card,
.service-card,
.auth-card {
    animation: fadeIn 0.35s ease-out;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b91c1c, #ef4444);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #dc2626, #f87171);
}