:root {
    --primary: #10b981;
    --primary-dark: #059669;
    --bg: #f8fafc;
    --surface: #ffffff;
    --border: #f1f5f9;
    --text: #0f172a;
    --text-dim: #64748b;
    --slate-200: #e2e8f0;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Layout --- */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    width: 100%;
}

.header {
    height: 72px;
    padding: 0 2rem;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo span {
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-email {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-dim);
}

.admin-badge {
    background: #ecfdf5;
    color: var(--primary);
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* --- Stats Grid --- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--surface);
    padding: 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.04);
    border-color: var(--primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
}

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
}

/* --- Table --- */

.table-container {
    background: var(--surface);
    border-radius: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

.table-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
}

.table-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.search-input {
    background: var(--surface);
    border: 1px solid var(--slate-200);
    color: var(--text);
    padding: 0.75rem 1.25rem;
    border-radius: 1rem;
    width: 320px;
    outline: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 1rem 2rem;
    color: var(--text-dim);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: #ffffff;
}

td {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    vertical-align: middle;
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: #f8fafc;
}

.status-badge {
    padding: 0.35rem 0.75rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.status-badge.free {
    background: #f1f5f9;
    color: #475569;
}

.status-badge.pro {
    background: #ecfdf5;
    color: #10b981;
}

/* --- Buttons --- */

.btn {
    padding: 0.625rem 1.25rem;
    border-radius: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.8125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--text);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.btn-primary:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--slate-200);
}

.btn-ghost:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    border-radius: 0.75rem;
}

/* --- Auth States --- */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at center, #f8fafc, #ffffff);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.auth-card {
    text-align: center;
    max-width: 440px;
    width: 90%;
    padding: 3.5rem;
    background: white;
    border-radius: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border);
}

.auth-card h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.04em;
}

.auth-card p {
    color: var(--text-dim);
    font-size: 1.125rem;
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* --- Animations --- */

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

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f1f5f9;
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.user-cell-primary {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.user-cell-secondary {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
