/* Панель AppShare: оформление родственно приложению (Manrope, тёмно-синий и янтарный, день и ночь). */
@font-face { font-family: Manrope; font-weight: 400; src: url(/panel/static/fonts/Manrope-regular.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: Manrope; font-weight: 500; src: url(/panel/static/fonts/Manrope-medium.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: Manrope; font-weight: 600; src: url(/panel/static/fonts/Manrope-semibold.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: Manrope; font-weight: 700; src: url(/panel/static/fonts/Manrope-bold.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: Manrope; font-weight: 800; src: url(/panel/static/fonts/Manrope-extrabold.ttf) format("truetype"); font-display: swap; }

:root {
  --bg: #F3F4F8; --panel: #FFFFFF; --panel-border: #E3E6EE; --tile: #F7F8FB; --tile-border: #E6E9F0; --input: #F0F2F7;
  --text: #0F172A; --secondary: #64748B; --accent: #F59E0B; --on-accent: #1E293B; --nav-active: #1E293B; --on-nav-active: #FFFFFF;
  --success: #16A36A; --danger: #E5484D; --banner: #FFF4D9; --strong-border: #CBD2DE; --shadow: 0 1px 2px rgba(15,23,42,.04);
}
:root[data-theme="night"] {
  --bg: #0B1220; --panel: #121A2B; --panel-border: #1F2A3F; --tile: #172238; --tile-border: #25324D; --input: #1A2438;
  --text: #EAF0FA; --secondary: #8B97AD; --accent: #FBBF24; --on-accent: #1E293B; --nav-active: #FBBF24; --on-nav-active: #1E293B;
  --success: #34D399; --danger: #FF7A7F; --banner: #2B2410; --strong-border: #3A4966; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Manrope, system-ui, sans-serif; font-size: 16px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

/* ---- каркас ---- */
.shell { max-width: 1480px; margin: 0 auto; padding: 20px 28px 40px; }
.header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 220px; }
.brand img { width: 52px; height: 52px; border-radius: 14px; background: #1E293B; }
.brand h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.2px; }
.brand small { display: block; font-size: 12px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; color: var(--secondary); }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-border); font-weight: 600; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); display: inline-block; }
.segment { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--panel); border: 1px solid var(--panel-border); }
.segment button { border: 0; background: none; padding: 7px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--secondary); }
.segment button.on { background: var(--nav-active); color: var(--on-nav-active); }
.layout { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: start; }
.layout > *, .editor > *, .row > .field, .cols > * { min-width: 0; }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 16px; }
.nav { display: flex; flex-direction: column; gap: 12px; }
.getapp { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 20px; background: var(--tile); border: 1px solid var(--tile-border); }
.getapp { flex-wrap: wrap; }
.getapp-row { flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 12px; border-top: 1px solid var(--tile-border); }
.getapp small { display: block; font-size: 12px; color: var(--secondary); margin-top: 2px; }
.getapp .btn { text-decoration: none; flex: none; }
.side .getapp { flex-direction: column; align-items: stretch; text-align: center; }
.navcard { text-align: left; padding: 16px 18px; border-radius: 20px; border: 1px solid var(--panel-border); background: var(--panel); cursor: pointer; font-weight: 700; font-size: 16px; box-shadow: var(--shadow); }
.navcard small { display: block; font-weight: 500; font-size: 12px; color: var(--secondary); margin-top: 2px; }
.navcard.on { background: var(--nav-active); color: var(--on-nav-active); border-color: transparent; }
.navcard.on small { color: inherit; opacity: .75; }
.panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 28px; padding: 26px 28px 30px; box-shadow: var(--shadow); min-height: 480px; }
.panel h2 { margin: 0; font-size: 26px; font-weight: 800; }
.sub { color: var(--secondary); font-size: 14px; margin-top: 2px; }
.toolbar { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 200px; }

/* ---- кнопки и поля ---- */
.btn { border: 0; border-radius: 14px; padding: 11px 20px; font-weight: 700; font-size: 15px; cursor: pointer; background: var(--accent); color: var(--on-accent); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.outline { background: transparent; color: var(--text); border: 1.5px solid var(--strong-border); }
.btn.danger { background: transparent; color: var(--danger); border: 1.5px solid var(--danger); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.field > em { display: block; font-style: normal; color: var(--secondary); font-size: 12px; margin-top: 5px; }
input[type=text], input[type=password], input[type=search], select, textarea {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--strong-border); background: var(--input); outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
textarea { min-height: 96px; resize: vertical; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > .field { flex: 1; min-width: 180px; }
.check { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--strong-border); background: var(--input); cursor: pointer; font-size: 14px; font-weight: 600; user-select: none; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.check.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.checks { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---- плитки приложений ---- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.tile { background: var(--tile); border: 1px solid var(--tile-border); border-radius: 24px; padding: 18px; cursor: pointer; display: flex; flex-direction: column; gap: 10px; min-height: 190px; transition: border-color .15s, transform .15s; }
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile .top { display: flex; gap: 14px; align-items: center; }
.tile h3 { margin: 0; font-size: 20px; font-weight: 800; }
.tile p { margin: 0; color: var(--secondary); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tile .meta { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.appicon { width: 64px; height: 64px; border-radius: 16px; background: var(--input); object-fit: cover; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 26px; color: var(--secondary); }
.appicon.big { width: 112px; height: 112px; border-radius: 26px; font-size: 44px; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--input); font-size: 12px; font-weight: 700; color: var(--secondary); }
.badge.ok { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.badge.warn { background: var(--banner); color: var(--text); }
.badge.bad { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.badge.acc { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }

/* ---- таблицы и показатели ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .8px; color: var(--secondary); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--panel-border); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--panel-border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--panel-border); border-radius: 18px; padding: 4px 8px; background: var(--tile); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 22px; }
.kpi { background: var(--tile); border: 1px solid var(--tile-border); border-radius: 20px; padding: 16px 18px; }
.kpi b { display: block; font-size: 32px; font-weight: 800; line-height: 1.1; }
.kpi span { color: var(--secondary); font-size: 13px; font-weight: 600; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; margin-bottom: 22px; }
.card { background: var(--tile); border: 1px solid var(--tile-border); border-radius: 20px; padding: 18px; }
.card h3 { margin: 0 0 10px; font-size: 16px; font-weight: 800; }
.bar { display: flex; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.bar i { display: block; height: 8px; border-radius: 4px; background: var(--accent); min-width: 4px; }
.bar span:first-child { flex: 0 0 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.section { margin-top: 26px; }
.section > h3 { font-size: 17px; font-weight: 800; margin: 0 0 12px; }
.editor { display: grid; grid-template-columns: 150px 1fr; gap: 26px; }
.drop { border: 2px dashed var(--strong-border); border-radius: 22px; padding: 26px; text-align: center; color: var(--secondary); cursor: pointer; background: var(--tile); }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.drop.busy { opacity: .6; pointer-events: none; }
.drop ~ .btn { margin-top: 10px; }
.drop b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }
.progress { height: 8px; border-radius: 4px; background: var(--input); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .2s; }
.notice { border-radius: 16px; padding: 12px 16px; background: var(--banner); margin: 12px 0; font-size: 14px; }
.notice.bad { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.info { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: 14px; margin: 12px 0; }
.info dt { color: var(--secondary); font-weight: 600; } .info dd { margin: 0; word-break: break-all; }

/* ---- вход, окна, уведомления ---- */
.login { max-width: 420px; margin: 9vh auto 0; padding: 0 14px; }
.login .panel { min-height: 0; padding: 34px 32px; }
.login .brand { margin-bottom: 22px; }
.overlay { position: fixed; inset: 0; background: rgba(8,12,22,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 26px; padding: 26px 28px; max-width: 640px; width: 100%; max-height: 90vh; overflow: auto; }
.modal h3 { margin: 0 0 14px; font-size: 21px; font-weight: 800; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--nav-active); color: var(--on-nav-active); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; max-width: 360px; }
.toast.err { background: var(--danger); color: #fff; }
.empty { text-align: center; color: var(--secondary); padding: 50px 10px; }

@media (max-width: 860px) {
  .shell { padding: 12px 12px 30px; }
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .nav { flex-direction: row; overflow-x: auto; }
  .navcard { flex: none; padding: 10px 14px; }
  .panel { padding: 18px 16px 22px; border-radius: 22px; }
  .editor { grid-template-columns: 1fr; }
  .info { grid-template-columns: 1fr; }
}

.iconprev { width: 168px; height: 168px; border-radius: 38px; background: var(--input); object-fit: contain; flex: none; border: 1px solid var(--panel-border); }

/* ---------- публичная витрина ---------- */
.landing { max-width: 920px; margin: 6vh auto 0; padding: 0 16px 48px; }
.land-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.land-top .brand { flex: 1; }
.dl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.dl-card { display: flex; gap: 16px; padding: 22px; border-radius: 24px; background: var(--panel); border: 1px solid var(--panel-border); box-shadow: var(--shadow); }
.dl-ic { flex: none; width: 64px; height: 64px; border-radius: 18px; background: #1E293B; position: relative; overflow: hidden; }
.dl-ic img { width: 64px; height: 64px; border-radius: 18px; display: block; }
.dl-ic.flash { background: linear-gradient(135deg, #F59E0B, #F97316); }
.dl-ic.flash::before { content: ''; position: absolute; width: 18px; height: 28px; border-radius: 4px; background: #fff; left: 23px; top: 12px; }
.dl-ic.flash::after { content: ''; position: absolute; width: 10px; height: 10px; border-radius: 2px; background: #fff; left: 27px; bottom: 10px; }
.dl-body { display: flex; flex-direction: column; min-width: 0; }
.dl-body h3 { margin: 0 0 6px; font-size: 19px; font-weight: 800; }
.dl-body p { margin: 0 0 14px; font-size: 14px; color: var(--secondary); line-height: 1.5; }
.dl-foot { margin-top: auto; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.dl-meta { font-size: 12px; color: var(--secondary); }
.dl-foot .btn { text-decoration: none; flex: none; }
.dl-soon { font-size: 13px; color: var(--secondary); }
.gmc { display: flex; gap: 20px; align-items: center; margin-top: 16px; padding: 20px 24px; border-radius: 24px; background: var(--tile); border: 1px solid var(--tile-border); text-decoration: none; color: inherit; }
.gmc img { width: 128px; height: auto; flex: none; background: #fff; border-radius: 16px; padding: 10px; box-sizing: border-box; }
.gmc-txt b { font-size: 16px; }
.gmc-txt p { margin: 6px 0 8px; font-size: 13px; color: var(--secondary); line-height: 1.5; }
.gmc-link { font-size: 13px; font-weight: 700; color: var(--accent); }
.gmc:hover { border-color: var(--accent); }
.land-foot { text-align: center; margin-top: 24px; }
@media (max-width: 680px) {
  .dl-grid { grid-template-columns: 1fr; }
  .gmc { flex-direction: column; text-align: center; }
}
