:root {
    --bg-color: #08080a;
    --sidebar-bg: #0d0d0f;
    --card-bg: #121215;
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(255, 255, 255, 0.12);

    --primary: #818cf8;
    --primary-glow: rgba(129, 140, 248, 0.15);
    --secondary: #c084fc;

    --success: #10b981;
    --danger: #f43f5e;
    --warning: #f59e0b;

    --text: #f8fafc;
    --text-muted: #94a3b8;
    --font-main: 'Inter', sans-serif;
    --font-display: 'Outfit', sans-serif;

    --transition: 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-color);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Background Blobs - Subtler */
.blob-bg {
    position: fixed;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    z-index: -1;
    filter: blur(100px);
    opacity: 0.4;
}

.blob-1 {
    top: -10%;
    left: -10%;
}

.blob-2 {
    bottom: -10%;
    right: -10%;
}

/* Layout Structure */
.app-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: 100vh;
}

/* Sidebar - Ultra Clean */
.sidebar {
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 2rem 0;
}

.sidebar-brand {
    padding: 0 2rem 2.5rem;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.sidebar-brand span {
    color: var(--primary);
}

.nav-group {
    flex: 1;
    padding: 0 1rem;
}

.nav-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    margin: 1.5rem 0 0.5rem 1rem;
    font-weight: 700;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition);
    margin-bottom: 4px;
}

.nav-link i {
    width: 18px;
    height: 18px;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
    color: var(--primary);
    background: var(--primary-glow);
}

.sidebar-user {
    margin-top: auto;
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: grid;
    place-items: center;
    font-weight: 700;
}

.user-info {
    flex: 1;
}

.user-name {
    font-size: 0.9rem;
    font-weight: 600;
    display: block;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.logout-btn {
    color: var(--text-muted);
    transition: var(--transition);
}

.logout-btn:hover {
    color: var(--danger);
}

/* Main Content Area */
.main-wrapper {
    overflow-y: auto;
    padding: 2.5rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 2rem;
    font-family: var(--font-display);
    font-weight: 700;
    margin-bottom: 4px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Stats Tiles */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-tile {
    background: var(--card-bg);
    border: 1px solid var(--border);
    padding: 1.5rem;
    border-radius: 16px;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.stat-tile:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.stat-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: grid;
    place-items: center;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    font-family: var(--font-display);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Tables & Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.01);
}

td {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.01);
}

/* Badges */
.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.badge-revoked {
    background: rgba(244, 63, 94, 0.1);
    color: var(--danger);
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #6366f1;
    box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-hover);
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: grid;
    place-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    padding: 2rem;
}

.modal-title {
    margin-bottom: 1.5rem;
    font-family: var(--font-display);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    color: white;
    padding: 12px;
    border-radius: 10px;
    outline: none;
    transition: var(--transition);
}

.form-input:focus {
    border-color: var(--primary);
}

/* Utility */
.code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

.text-muted {
    color: var(--text-muted);
}

.flex {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Grid for Dashboard */
.dash-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
}

.feed-list {
    list-style: none;
}

.feed-item {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 1rem;
}

.feed-item:first-child {
    border-top: none;
}

.feed-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    place-items: center;
}

.feed-content p {
    font-size: 0.85rem;
    margin-bottom: 2px;
}

.feed-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}