:root { font-family: "Segoe UI", "Microsoft JhengHei", sans-serif; color: #172026; background: #edf1f3; letter-spacing: 0; }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { border: 0; border-radius: 5px; padding: 9px 15px; color: #fff; background: #147b55; cursor: pointer; }
button:hover { background: #0f6646; }
button.secondary { color: #314049; background: #fff; border: 1px solid #ccd5da; }
.hidden { display: none !important; }
.login-page { min-height: 100vh; display: grid; place-items: center; background: #e9eef0; }
.login-panel { width: min(390px, calc(100vw - 32px)); padding: 32px; border: 1px solid #d5dde1; border-radius: 8px; background: #fff; box-shadow: 0 14px 40px rgba(23,32,38,.09); }
.logo { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 8px; color: white; background: #172026; font-weight: 800; }
.login-panel h1 { margin: 18px 0 4px; font-size: 24px; }
.login-panel p { margin: 0 0 24px; color: #718087; }
label { display: grid; gap: 7px; margin: 12px 0; color: #4a5961; font-size: 13px; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid #c9d3d8; border-radius: 5px; padding: 9px 11px; background: #fff; color: #172026; outline: none; }
input:focus, select:focus, textarea:focus { border-color: #16845b; box-shadow: 0 0 0 3px rgba(22,132,91,.12); }
.login-panel button { width: 100%; margin-top: 12px; }
.form-message { min-height: 20px; margin-top: 12px; color: #b42318; font-size: 12px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 230px minmax(0,1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; color: #dbe3e6; background: #172026; }
.side-brand { display: flex; gap: 11px; align-items: center; padding: 4px 8px 24px; border-bottom: 1px solid #344047; }
.side-brand > span { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 7px; color: #172026; background: #fff; font-weight: 800; }
.side-brand div { display: grid; gap: 2px; }
.side-brand small { color: #95a4ab; }
nav { display: grid; gap: 5px; margin-top: 22px; }
.nav-item, .logout { width: 100%; text-align: left; color: #b8c4c9; background: transparent; }
.nav-item:hover, .nav-item.active { color: #fff; background: #29363d; }
.logout { margin-top: auto; border: 1px solid #48545b; }
.content { min-width: 0; padding: 26px 30px 40px; }
.content > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.content h1 { margin: 0; font-size: 24px; }
.content header p { margin: 5px 0 0; color: #738087; }
.view { display: none; }
.view.active { display: block; }
.stats-grid { display: grid; grid-template-columns: repeat(4,minmax(150px,1fr)); gap: 14px; }
.stat { padding: 19px; border: 1px solid #d6dee2; border-radius: 7px; background: #fff; }
.stat span { color: #68767d; font-size: 12px; }
.stat strong { display: block; margin-top: 9px; font-size: 27px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; max-width: 850px; padding: 22px; border: 1px solid #d6dee2; border-radius: 7px; background: #fff; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .check { display: flex; align-items: center; gap: 8px; align-self: end; height: 39px; }
.form-grid .check input { width: 16px; }
.actions { display: flex; justify-content: flex-end; }
.code-output { margin-top: 16px; padding: 20px; border: 1px solid #bad9cc; border-radius: 7px; background: #f2fbf7; }
.code-output > div { display: flex; align-items: center; gap: 8px; }
.code-output h2 { margin: 0 auto 0 0; font-size: 16px; }
.code-output pre { max-height: 330px; overflow: auto; padding: 14px; color: #e7edf0; background: #172026; border-radius: 5px; }
.filters { display: flex; gap: 9px; margin-bottom: 12px; }
.filters input { max-width: 350px; }
.filters select { max-width: 190px; }
.table-wrap { overflow: auto; border: 1px solid #d6dee2; border-radius: 7px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #e4e9eb; }
th { position: sticky; top: 0; color: #536169; background: #f5f7f8; }
td button { padding: 5px 8px; margin-right: 4px; font-size: 11px; }
.danger { background: #b42318; }
.warning { color: #172026; background: #edb52d; }
.tag { display: inline-block; padding: 3px 7px; border-radius: 4px; background: #e9eef0; }
.tag.ACTIVE, .tag.UNUSED { color: #116b49; background: #dcf4e8; }
.tag.DISABLED, .tag.REVOKED { color: #a02218; background: #fde5e2; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 380px; padding: 11px 14px; border-radius: 5px; color: #fff; background: #26333a; opacity: 0; transform: translateY(8px); pointer-events: none; transition: .16s; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #a62c23; }
@media (max-width: 960px) { .app-shell { grid-template-columns: 190px minmax(0,1fr); } .stats-grid { grid-template-columns: repeat(2,1fr); } .content { padding: 22px 18px; } }
