* { box-sizing: border-box; }
body {
    margin: 0;
    background: #1b2028;
    color: #e6e8eb;
    font-family: "Segoe UI", Helvetica, Arial, sans-serif;
}
a { color: #4c8dff; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 24px; background: #171b22; border-bottom: 1px solid #262b34;
}
.topbar .brand { font-weight: 700; font-size: 16px; }
.topbar nav a { margin-left: 18px; color: #aeb4bd; font-size: 14px; }
.topbar nav a.active, .topbar nav a:hover { color: #ffffff; }

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

.card {
    background: #20242e; border: 1px solid #2a2f3a; border-radius: 10px;
    padding: 18px 20px; margin-bottom: 18px;
}
.card h2 { margin-top: 0; font-size: 15px; color: #f2f3f5; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.stat-box { background: #232833; border-radius: 8px; padding: 14px; text-align: center; }
.stat-box .num { font-size: 26px; font-weight: 700; }
.stat-box .label { color: #8a909c; font-size: 12px; margin-top: 4px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #2a2f3a; }
th { color: #8a909c; font-weight: 600; font-size: 12px; text-transform: uppercase; }
tr:hover td { background: #232833; }

.badge { padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.badge.unused { background: #33394a; color: #c7cbd1; }
.badge.active { background: #16342a; color: #34c77b; }
.badge.revoked { background: #3a2320; color: #e5484d; }
.badge.expired { background: #3a2320; color: #e5484d; }
.badge.ok { background: #16342a; color: #34c77b; }

input[type=text], input[type=password], input[type=number], textarea {
    background: #232833; border: 1px solid #333947; border-radius: 6px;
    padding: 8px 10px; color: #e6e8eb; font-size: 13px;
}
input:focus, textarea:focus { outline: none; border-color: #2563eb; }

button, .btn {
    background: #2563eb; color: white; border: none; border-radius: 6px;
    padding: 8px 16px; font-size: 13px; cursor: pointer; font-weight: 600;
}
button:hover, .btn:hover { background: #3b74f0; }
button.secondary, .btn.secondary { background: #2a2f3a; border: 1px solid #3a4152; }
button.secondary:hover { background: #333a48; }
button.danger { background: #e5484d; }
button.danger:hover { background: #f0605f; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.flash.success { background: #16342a; color: #34c77b; }
.flash.error { background: #3a2320; color: #f2b8b5; }

.mono { font-family: "Consolas", "SFMono-Regular", monospace; letter-spacing: 0.5px; }
.muted { color: #8a909c; }

.login-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center;
}
.login-box { width: 340px; }
.login-box h1 { font-size: 18px; text-align: center; }
.field { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.field input { width: 100%; }

.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=text] { flex: 1; min-width: 180px; }
