* { box-sizing: border-box; }
body {
    font-family: -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    margin: 0;
    background: #f4f6fa;
    color: #222;
}
.topnav {
    background: #1c2434;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
}
.topnav .brand { font-weight: 700; font-size: 18px; }
.topnav .links a { color: #cfd8ff; margin-right: 18px; text-decoration: none; }
.topnav .links a:hover { color: #fff; }
.topnav .user { font-size: 13px; color: #b7c0d8; }
.topnav .user a { color: #fff; }

.container { max-width: 1100px; margin: 24px auto; padding: 0 16px; }

.stat-row { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card {
    flex: 1;
    min-width: 110px;
    background: #fff;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.stat-card span { display: block; font-size: 26px; font-weight: 700; }
.stat-card.active span { color: #16a34a; }
.stat-card.paused span { color: #d97706; }
.stat-card.suspended span { color: #ea580c; }
.stat-card.expired span { color: #6b7280; }
.stat-card.revoked span { color: #dc2626; }

.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.search-form { display: flex; gap: 8px; }
.search-form input, .search-form select { padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; }

.btn-primary {
    background: #2d6cdf; color: #fff; padding: 10px 16px; border-radius: 6px;
    text-decoration: none; border: none; cursor: pointer; font-size: 14px;
}

.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid #eef0f4; text-align: left; font-size: 13px; }
.data-table th { background: #f8f9fc; font-weight: 600; }
.data-table code { background: #f1f3f8; padding: 2px 6px; border-radius: 4px; }

.actions a { margin-right: 8px; font-size: 12px; text-decoration: none; }
.act-good { color: #16a34a; }
.act-warn { color: #d97706; }
.act-danger { color: #dc2626; }

.badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; color: #fff; text-transform: capitalize; }
.badge-active { background: #16a34a; }
.badge-paused { background: #d97706; }
.badge-suspended { background: #ea580c; }
.badge-expired { background: #6b7280; }
.badge-revoked { background: #dc2626; }

.form-box, .login-box { background: #fff; padding: 22px; border-radius: 8px; max-width: 520px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.form-box label, .login-box label { display: block; margin-top: 12px; margin-bottom: 4px; font-size: 13px; font-weight: 600; }
.form-box input, .form-box select, .form-box textarea, .login-box input {
    width: 100%; padding: 9px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}

.alert-error { background: #fdeaea; border: 1px solid #e88; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; }
.alert-success { background: #eafbea; border: 1px solid #7fc97f; padding: 14px; border-radius: 6px; margin-bottom: 14px; }

.kv-table td { padding: 4px 8px; }

.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
