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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: #1a1a2e;
    background: #f5f7fa;
    line-height: 1.5;
}

/* ── Navbar ─────────────────────────────────────────── */
.navbar {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #1a1a2e;
    color: #fff;
    padding: 0 1.5rem;
    height: 52px;
}
.navbar-brand a { color: #fff; text-decoration: none; font-weight: 700; font-size: 1rem; }
.navbar-menu { display: flex; gap: 1rem; list-style: none; flex: 1; }
.navbar-menu a { color: #c8d0e0; text-decoration: none; padding: 0.25rem 0; }
.navbar-menu a:hover { color: #fff; }
.navbar-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: #c8d0e0; }

/* ── Container ──────────────────────────────────────── */
.container { max-width: 1600px; margin: 2rem auto; padding: 0 1.5rem; }

/* ── Page header ────────────────────────────────────── */
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.5rem; font-weight: 600; }

/* ── Alerts ─────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }

/* ── Buttons ─────────────────────────────────────────── */
.btn {
    display: inline-block;
    padding: 0.45rem 1rem;
    border-radius: 5px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    vertical-align: middle;
    box-sizing: border-box;
    transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary   { background: #4f46e5; color: #fff; }
.btn-secondary { background: #e5e7eb; color: #374151; border-color: #d1d5db; }
.btn-success   { background: #059669; color: #fff; }
.btn-warning   { background: #d97706; color: #fff; }
.btn-danger    { background: #dc2626; color: #fff; }
.btn-sm        { padding: 0.25rem 0.625rem; font-size: 0.8rem; }
.btn-link      { background: none; border: none; color: #c8d0e0; cursor: pointer; font-size: 0.85rem; padding: 0; }
.btn-block     { width: 100%; text-align: center; }

/* ── Tables ─────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.data-table th { background: #f9fafb; text-align: left; padding: 0.75rem 1rem; font-weight: 600; border-bottom: 1px solid #e5e7eb; color: #6b7280; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.data-table td { padding: 0.75rem 1rem; border-bottom: 1px solid #f3f4f6; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }

/* ── Badges ─────────────────────────────────────────── */
.badge { display: inline-block; padding: 0.2rem 0.6rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 600; }
.badge-active   { background: #d1fae5; color: #065f46; }
.badge-inactive { background: #f3f4f6; color: #6b7280; }
.badge-revoked  { background: #fee2e2; color: #991b1b; }
.badge-healthy  { background: #d1fae5; color: #065f46; }
.badge-unhealthy{ background: #fee2e2; color: #991b1b; }

/* ── Forms ───────────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-weight: 500; margin-bottom: 0.35rem; color: #374151; }
.form-control { width: 100%; padding: 0.5rem 0.75rem; border: 1px solid #d1d5db; border-radius: 5px; font-size: 0.875rem; transition: border-color 0.15s; }
.form-control:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,0.1); }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check-input { width: auto; }
.form-hint { font-size: 0.78rem; color: #6b7280; margin-top: 0.25rem; display: block; }
.field-error { color: #dc2626; font-size: 0.8rem; display: block; margin-top: 0.25rem; }
.form-actions { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.form-card { background: #fff; border-radius: 8px; padding: 1.5rem 2rem; max-width: 520px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

/* ── Detail card ────────────────────────────────────── */
.detail-card { background: #fff; border-radius: 8px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.detail-list { display: grid; grid-template-columns: 160px 1fr; gap: 0.5rem 1rem; }
.detail-list dt { font-weight: 600; color: #6b7280; }
.action-bar { display: flex; gap: 0.75rem; margin-top: 1.5rem; }
.section { margin-top: 2rem; }
.section h2 { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; }

/* ── Dashboard cards ────────────────────────────────── */
.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.dashboard-card { background: #fff; border-radius: 10px; padding: 1.5rem; text-decoration: none; color: inherit; box-shadow: 0 1px 3px rgba(0,0,0,0.08); transition: box-shadow 0.15s, transform 0.15s; }
.dashboard-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); transform: translateY(-2px); }
.card-icon { font-size: 2rem; margin-bottom: 0.75rem; }
.card-title { font-weight: 700; font-size: 1rem; margin-bottom: 0.25rem; }
.card-desc { color: #6b7280; font-size: 0.85rem; }

/* ── Pagination ─────────────────────────────────────── */
.pagination { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; }

/* ── Login page ─────────────────────────────────────── */
.login-page { background: #1a1a2e; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; border-radius: 12px; padding: 2.5rem; width: 100%; max-width: 400px; }
.login-card h1 { text-align: center; color: #4f46e5; font-size: 1.25rem; font-weight: 700; margin-bottom: 0.25rem; }
.login-card h2 { text-align: center; color: #374151; font-size: 1rem; font-weight: 500; margin-bottom: 1.5rem; }

/* ── Empty state ────────────────────────────────────── */
.empty-state { color: #6b7280; padding: 2rem; text-align: center; }

/* ── Tabs ───────────────────────────────────────────── */
.tabs { margin-top: 1.5rem; }
.tab-nav { display: flex; gap: 0; border-bottom: 2px solid #e5e7eb; margin-bottom: 1.25rem; }
.tab-btn { background: none; border: none; padding: 0.6rem 1.25rem; font-size: 0.9rem; font-weight: 500; color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: color 0.15s, border-color 0.15s; }
.tab-btn:hover { color: #4f46e5; }
.tab-btn.active { color: #4f46e5; border-bottom-color: #4f46e5; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
