* { font-family: 'Inter', sans-serif; }

/* ── Splash ── */
.splash-screen {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    height: 100vh; background: #0f172a;
}
.splash-logo {
    width: 64px; height: 64px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 16px; display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 700; color: white; margin-bottom: 16px;
}
.splash-text { color: #e2e8f0; font-size: 20px; font-weight: 600; margin-bottom: 24px; }
.splash-spinner {
    width: 32px; height: 32px; border: 3px solid #334155;
    border-top-color: #6366f1; border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Layout ── */
html, body { height: 100%; margin: 0; background: #f1f5f9; }
.admin-wrapper { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ── */
.sidebar {
    width: 260px; min-width: 260px; background: #0f172a;
    display: flex; flex-direction: column; overflow-y: auto; z-index: 100;
}
.sidebar-brand {
    padding: 24px 20px; display: flex; align-items: center; gap: 12px;
    border-bottom: 1px solid #1e293b;
}
.brand-icon {
    width: 40px; height: 40px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: white; font-size: 18px; flex-shrink: 0;
}
.brand-name { color: white; font-weight: 700; font-size: 16px; line-height: 1.2; }
.brand-sub  { color: #475569; font-size: 11px; }
.nav-section { padding: 20px 12px 8px; }
.nav-section-title {
    color: #475569; font-size: 10px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px; padding: 0 8px; margin-bottom: 8px;
}
.nav-item { margin-bottom: 2px; }
.nav-link-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    color: #94a3b8; text-decoration: none; border-radius: 8px;
    font-size: 14px; font-weight: 500; transition: all 0.15s;
}
.nav-link-item:hover { background: #1e293b; color: #e2e8f0; }
.nav-link-item.active { background: #6366f1; color: white; }
.nav-link-item i { font-size: 18px; width: 20px; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 16px; border-top: 1px solid #1e293b; }
.sidebar-user {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    border-radius: 8px; cursor: pointer;
}
.sidebar-user:hover { background: #1e293b; }
.user-avatar {
    width: 36px; height: 36px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: white; font-weight: 600; font-size: 14px; flex-shrink: 0;
}
.user-name { color: #e2e8f0; font-size: 13px; font-weight: 600; }
.user-role { color: #475569; font-size: 11px; }

/* ── Main ── */
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
    background: white; padding: 0 24px; height: 64px;
    display: flex; align-items: center; justify-content: space-between;
    border-bottom: 1px solid #e2e8f0; flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.page-title { font-size: 18px; font-weight: 600; color: #0f172a; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-btn {
    width: 38px; height: 38px; border: 1px solid #e2e8f0; border-radius: 8px;
    background: white; display: flex; align-items: center; justify-content: center;
    color: #64748b; cursor: pointer; text-decoration: none; font-size: 16px; transition: all 0.15s;
}
.topbar-btn:hover { background: #f8fafc; color: #0f172a; }
.content-area { flex: 1; overflow-y: auto; padding: 24px; }

/* ── Stat Cards ── */
.stat-card {
    background: white; border-radius: 12px; padding: 20px 24px;
    border: 1px solid #e2e8f0; height: 100%;
}
.icon-box {
    width: 48px; height: 48px; border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px;
}
.icon-purple { background: #ede9fe; color: #7c3aed; }
.icon-green  { background: #dcfce7; color: #16a34a; }
.icon-blue   { background: #dbeafe; color: #2563eb; }
.icon-orange { background: #ffedd5; color: #ea580c; }
.stat-value  { font-size: 28px; font-weight: 700; color: #0f172a; line-height: 1; }
.stat-label  { font-size: 13px; color: #64748b; margin-top: 4px; }

/* ── Cards ── */
.card { border: 1px solid #e2e8f0 !important; border-radius: 12px !important; }
.card-header {
    background: white !important; border-bottom: 1px solid #e2e8f0 !important;
    padding: 16px 20px !important; border-radius: 12px 12px 0 0 !important;
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 600; color: #0f172a; margin: 0; }
.card-body { padding: 0 !important; }

/* ── Table ── */
.table { margin: 0; }
.table th {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; color: #64748b; background: #f8fafc;
    border-bottom: 1px solid #e2e8f0; padding: 12px 20px; white-space: nowrap;
}
.table td { padding: 14px 20px; vertical-align: middle; font-size: 14px; color: #334155; border-color: #f1f5f9; }
.table tbody tr:hover { background: #f8fafc; }

/* ── Status Badges ── */
.status-badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 20px; font-size: 12px; font-weight: 500;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.badge-active  { background: #dcfce7; color: #16a34a; }
.badge-active::before  { background: #16a34a; }
.badge-pending { background: #fef9c3; color: #ca8a04; }
.badge-pending::before { background: #ca8a04; }
.badge-expired { background: #fee2e2; color: #dc2626; }
.badge-expired::before { background: #dc2626; }
.badge-revoked { background: #f1f5f9; color: #64748b; }
.badge-revoked::before { background: #94a3b8; }

/* ── Login ── */
.login-page {
    min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    display: flex; align-items: center; justify-content: center;
}
.login-card {
    background: white; border-radius: 20px; padding: 40px;
    width: 100%; max-width: 420px; box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.login-logo {
    width: 56px; height: 56px; background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 14px; display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: white; margin: 0 auto 20px;
}
.login-title { font-size: 22px; font-weight: 700; color: #0f172a; text-align: center; }
.login-sub { font-size: 14px; color: #64748b; text-align: center; margin-bottom: 28px; }
.form-label { font-size: 13px; font-weight: 500; color: #374151; }
.form-control {
    border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 14px;
    font-size: 14px; color: #0f172a; transition: border-color 0.15s;
}
.form-control:focus { border-color: #6366f1 !important; box-shadow: 0 0 0 3px rgba(99,102,241,0.1) !important; }
.btn-login {
    background: linear-gradient(135deg, #6366f1, #8b5cf6); color: white;
    border: none; border-radius: 8px; padding: 11px; font-size: 14px;
    font-weight: 600; width: 100%; cursor: pointer; transition: opacity 0.15s;
}
.btn-login:hover:not(:disabled) { opacity: 0.9; }
.btn-login:disabled { opacity: 0.6; cursor: not-allowed; }
.alert-error {
    background: #fee2e2; color: #dc2626; border: 1px solid #fecaca;
    border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px;
}

/* ── Buttons ── */
.btn-icon {
    width: 32px; height: 32px; border-radius: 6px; border: 1px solid #e2e8f0;
    background: white; display: inline-flex; align-items: center; justify-content: center;
    color: #64748b; cursor: pointer; font-size: 14px; transition: all 0.15s; padding: 0;
}
.btn-icon:hover          { background: #f8fafc; color: #0f172a; }
.btn-icon.danger:hover   { background: #fee2e2; color: #dc2626; border-color: #fecaca; }
.btn-icon.success:hover  { background: #dcfce7; color: #16a34a; border-color: #bbf7d0; }
.btn-icon.warning:hover  { background: #fef9c3; color: #ca8a04; border-color: #fef08a; }
.btn-add {
    background: #6366f1; color: white; border: none; border-radius: 8px;
    padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px; transition: opacity 0.15s;
}
.btn-add:hover { opacity: 0.9; }

/* ── Modal ── */
.modal-content { border-radius: 12px; border: none; }
.modal-header { border-bottom: 1px solid #e2e8f0; padding: 16px 20px; }
.modal-footer { border-top: 1px solid #e2e8f0; padding: 12px 20px; }
.modal-title  { font-size: 16px; font-weight: 600; }
.modal-body   { padding: 20px; }
.select-control {
    border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px 14px;
    font-size: 14px; color: #0f172a; width: 100%; background: white;
}
.select-control:focus { outline: none; border-color: #6366f1; }

/* ── Error UI ── */
#blazor-error-ui {
    background: #fee2e2; color: #dc2626; padding: 12px 20px; position: fixed;
    bottom: 0; width: 100%; display: none; z-index: 9999; font-size: 13px;
}
#blazor-error-ui .dismiss { float: right; cursor: pointer; }

/* ── Search ── */
.search-box {
    display: flex; align-items: center; gap: 8px; background: #f8fafc;
    border: 1px solid #e2e8f0; border-radius: 8px; padding: 7px 12px; width: 240px;
}
.search-box input { border: none; background: none; font-size: 13px; outline: none; width: 100%; color: #334155; }
.search-box i { color: #94a3b8; font-size: 14px; }

/* ── Type Badge ── */
.type-badge {
    padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600;
}
.type-demo     { background: #ede9fe; color: #7c3aed; }
.type-monthly  { background: #dbeafe; color: #2563eb; }
.type-yearly   { background: #dcfce7; color: #16a34a; }
.type-lifetime { background: #fef9c3; color: #ca8a04; }
