:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #e0e7ff;
    --secondary: #0f172a;
    --sidebar-bg: #0f172a;
    --sidebar-text: #94a3b8;
    --sidebar-active: #ffffff;
    --sidebar-active-bg: #1e293b;
    --sidebar-border: #334155;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #0ea5e9;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    border-right: 1px solid var(--sidebar-border);
}

.admin-sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--sidebar-border);
}

.admin-sidebar-brand .brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4f46e5, #06b6d4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.1rem;
    font-weight: 800;
}

.admin-sidebar-brand .brand-text {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    letter-spacing: 0.5px;
}

.admin-sidebar-brand .brand-badge {
    font-size: 0.65rem;
    background: rgba(79, 70, 229, 0.3);
    color: #a5b4fc;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    margin-left: auto;
}

.admin-nav {
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-grow: 1;
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.admin-nav-item i {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
}

.admin-nav-item:hover {
    color: var(--sidebar-active);
    background-color: rgba(255, 255, 255, 0.05);
}

.admin-nav-item.active {
    color: var(--sidebar-active);
    background-color: var(--sidebar-active-bg);
    border-left: 3px solid var(--primary);
}

.admin-sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--sidebar-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Main Content */
.admin-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.admin-topbar {
    height: 64px;
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.admin-topbar-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--secondary);
}

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

.admin-content {
    padding: 28px;
    flex-grow: 1;
}

/* Cards & Stats */
.card-stat {
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-stat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-icon.primary { background: #e0e7ff; color: #4338ca; }
.stat-icon.success { background: #dcfce7; color: #15803d; }
.stat-icon.warning { background: #fef3c7; color: #b45309; }
.stat-icon.danger { background: #fee2e2; color: #b91c1c; }
.stat-icon.info { background: #e0f2fe; color: #0369a1; }

.stat-info {
    flex-grow: 1;
}

.stat-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--secondary);
    margin: 0;
}

/* Badges */
.badge-status {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 6px;
    display: inline-block;
    text-transform: uppercase;
}

.badge-active { background: #dcfce7; color: #15803d; }
.badge-trial { background: #e0e7ff; color: #4338ca; }
.badge-suspended { background: #fee2e2; color: #b91c1c; }
.badge-expired { background: #f1f5f9; color: #64748b; }

/* Table styling */
.admin-table-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    overflow: hidden;
}

.admin-table {
    margin: 0;
    width: 100%;
}

.admin-table th {
    background: #f8fafc;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--border-color);
}

.admin-table td {
    padding: 14px 18px;
    font-size: 0.88rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.admin-table tr:hover td {
    background-color: #f8fafc;
}

/* Modals */
.modal-backdrop-custom {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    backdrop-filter: blur(4px);
}

.modal-content-custom {
    background: #ffffff;
    border-radius: 14px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.modal-header-custom {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body-custom {
    padding: 24px;
}

.modal-footer-custom {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Loading screen */
.admin-loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background-color: #0f172a;
    color: white;
}

.admin-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: #4f46e5;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

.admin-loading-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.admin-loading-subtitle {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 6px;
}

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