body { margin: 0; background: #0b0e14; font-family: -apple-system, "SF Pro Text", "Segoe UI", "Helvetica Neue", sans-serif; color: #e8ebf2; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }

.navitem { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; font-size: 14.5px; font-weight: 500; color: #9aa3b5; transition: background 120ms ease, color 120ms ease; outline: none; }
.navitem:hover, .navitem:focus-visible { background: #161b26; color: #e8ebf2; }
.navitem.active { background: #1a2338; color: #ffffff; }

.card { background: #11151e; border: 1px solid #202737; border-radius: 14px; }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 9px; border: 1px solid #2a3245; background: #151a26; font-size: 13.5px; font-weight: 500; cursor: pointer; transition: background 120ms ease, border-color 120ms ease; outline: none; }
.btn:hover, .btn:focus-visible { background: #1b2232; border-color: #3a4560; }
.btn.primary { background: #3d7bf0; border-color: #3d7bf0; color: #fff; }
.btn.primary:hover, .btn.primary:focus-visible { background: #5a90f5; border-color: #5a90f5; }
.btn.danger { color: #ff8585; }
.btn.danger:hover { border-color: #ff6b6b; background: #2a1618; }
.btn.small { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }

.rowlink { display: block; outline: none; transition: background 120ms ease; }
.rowlink:hover, .rowlink:focus-visible { background: #161c29; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.ok { background: #12301f; color: #4ade80; }
.pill.off { background: #2b1a1d; color: #ff8585; }
.pill.info { background: #172443; color: #86adff; }
.pill.warn { background: #33260d; color: #ffbe55; }

.chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 7px; font-size: 12px; background: #1a2030; color: #b8c0d0; border: 1px solid #252d40; }
.chip.warn { background: #33260d; color: #ffbe55; border-color: #4a3712; }

.filter { padding: 6px 13px; border-radius: 999px; border: 1px solid #252d40; background: transparent; font-size: 13px; color: #9aa3b5; cursor: pointer; }
.filter.active { background: #1a2338; border-color: #3d7bf0; color: #cfe0ff; }

.field { background: #0e121b; border: 1px solid #252d40; border-radius: 10px; padding: 10px 14px; font-size: 14px; outline: none; }
.field:focus { border-color: #3d7bf0; }

.tab { padding: 12px 4px; margin-right: 26px; font-size: 14.5px; font-weight: 500; color: #8b94a7; border-bottom: 2px solid transparent; outline: none; }
.tab.active { color: #fff; border-bottom-color: #3d7bf0; }

.drop { border: 1.5px dashed #34405c; border-radius: 12px; background: #0e131d; transition: background 120ms ease, border-color 120ms ease; cursor: pointer; }
.drop:hover { background: #121a2b; border-color: #3d7bf0; }

.muted { color: #8b94a7; }

/* ---- app shell ---- */
html, body { height: 100%; }
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex-shrink: 0; box-sizing: border-box; padding: 24px 16px; background: #0d1119; border-right: 1px solid #1b2130; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 10px 22px; font-size: 16px; font-weight: 700; }
.brand .logo { width: 34px; height: 34px; border-radius: 10px; background: #3d7bf0; display: flex; align-items: center; justify-content: center; }
main { flex-grow: 1; min-width: 0; padding: 32px 40px 60px; max-width: 1500px; }
h1 { margin: 0; font-size: 26px; font-weight: 700; }
.sub { color: #8b94a7; font-size: 14px; margin-top: 4px; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, Menlo, monospace; }
.hidden { display: none !important; }
.small { font-size: 12.5px; }

.filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.searchbox { position: relative; }
.searchbox svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); }
.searchbox .field { width: 340px; padding-left: 38px; box-sizing: border-box; }

.bulk { display: flex; align-items: center; gap: 10px; padding: 11px 16px; margin-bottom: 12px; border-radius: 12px; background: #142040; border: 1px solid #27447f; flex-wrap: wrap; }
.bulk .count { font-size: 14px; font-weight: 600; color: #cfe0ff; margin-right: 6px; }
.bulk .grow { flex-grow: 1; }

.table-head, .drow { display: grid; align-items: center; gap: 16px; }
.dtable .table-head, .dtable .drow { grid-template-columns: 2.1fr 1.7fr 150px 2.3fr 1.3fr 24px; }
.table-head { padding: 12px 20px 12px 0; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #6f7a90; }
.line { display: flex; align-items: stretch; border-top: 1px solid #1b2130; }
.line.selected { background: #131b2c; }
.line .cb { width: 48px; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.line .cb input, .cbhead input { width: 16px; height: 16px; accent-color: #3d7bf0; }
.cbhead { width: 48px; display: flex; justify-content: center; flex-shrink: 0; }
.line > a.rowlink { flex-grow: 1; padding: 14px 20px 14px 0; min-width: 0; }
.name { font-size: 14.5px; font-weight: 600; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { padding: 40px; text-align: center; color: #8b94a7; }

.devhead { padding: 22px 24px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.avatar { width: 56px; height: 56px; border-radius: 16px; background: #1a2338; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700; color: #86adff; flex-shrink: 0; }
.meta { display: flex; gap: 28px; margin-top: 10px; font-size: 13px; flex-wrap: wrap; }
.meta .k { color: #8b94a7; }
.meta .v { margin-top: 2px; }
.tabs { display: flex; margin: 20px 0 16px; border-bottom: 1px solid #1b2130; }
.cols { display: flex; gap: 20px; align-items: flex-start; }
.cols > .left { flex-grow: 1; min-width: 0; }
.cols > .right { width: 380px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }
.seg { display: flex; gap: 6px; padding: 4px; border-radius: 10px; background: #0d1119; border: 1px solid #1f2637; }
.seg button { border: none; cursor: pointer; padding: 7px 14px; border-radius: 7px; background: transparent; font-size: 13px; font-weight: 500; color: #8b94a7; }
.seg button.on { background: #1e2a45; font-weight: 600; color: #fff; }
.apphead, .approw { display: grid; grid-template-columns: 2.3fr 1fr 1.6fr 250px; align-items: center; gap: 16px; padding: 14px 20px; }
.apphead { padding: 8px 20px; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #6f7a90; }
.approw { border-top: 1px solid #1b2130; }
.appcell { display: flex; align-items: center; gap: 14px; min-width: 0; }
.appicon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; color: #fff; flex-shrink: 0; }
.acts { display: flex; gap: 8px; justify-content: flex-end; }
.pad { padding: 20px; }
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.up-label { margin: 18px 0 2px; font-size: 12px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: #6f7a90; }
.librow, .cmdrow { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid #1b2130; }
.cmdrow { justify-content: space-between; padding: 9px 0; }
.check { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 13px; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: #3d7bf0; }
.drop.over { background: #121a2b; border-color: #3d7bf0; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 26px 16px; text-align: center; }

.gtable .approw, .ltable .approw, .atable .approw { grid-template-columns: 2fr 1.2fr 1fr 1fr 1fr 220px; }
.atable .approw, .atable .apphead { grid-template-columns: 1.4fr 1.6fr 1fr 1fr 1.4fr; }
.gtable .approw, .gtable .apphead { grid-template-columns: 2fr 1fr 200px; }

.scrim { position: fixed; inset: 0; background: rgba(4,6,10,.7); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { width: 420px; max-width: calc(100vw - 40px); background: #11151e; border: 1px solid #2a3245; border-radius: 16px; padding: 24px; }
.modal h3 { margin: 0 0 6px; font-size: 17px; }
.modal .opts { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; max-height: 300px; overflow: auto; }
.modal .opt { text-align: left; padding: 11px 14px; border-radius: 10px; border: 1px solid #252d40; background: #0e131d; cursor: pointer; font-size: 14px; }
.modal .opt:hover, .modal .opt.on { border-color: #3d7bf0; background: #142040; }
.modal .foot { display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; right: 24px; bottom: 24px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { padding: 12px 16px; border-radius: 10px; background: #1a2338; border: 1px solid #27447f; font-size: 14px; max-width: 360px; }
.toast.err { background: #2b1a1d; border-color: #5a2a30; color: #ffb3b3; }
.uploader .dropzone { padding: 34px 16px; }
