﻿:root{
  --bg:#f3f6fb;
  --bg-accent:#e8f1fb;
  --text:#0f172a;
  --muted:#64748b;
  --card:#ffffff;
  --card-soft:#fbfdff;
  --line:#dbe5f0;
  --line-strong:#c7d6e6;
  --brand:#0ea5e9;
  --brand-600:#0284c7;
  --primary:#2563eb;
  --primary-600:#1d4ed8;
  --success:#16a34a;
  --warn:#f59e0b;
  --danger:#ef4444;
  --radius:16px;
  --shadow:0 18px 40px rgba(15,23,42,.07), 0 2px 8px rgba(15,23,42,.05);
  --shadow-soft:0 8px 20px rgba(15,23,42,.045), 0 1px 3px rgba(15,23,42,.04);
  --mono:ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --font:Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
}

*{box-sizing:border-box}
html,body{height:100%;margin:0;padding:0}
html{background:#dce3ea;}
body.tk{
  margin:0;
  padding:0;
  min-height:100%;
  background:radial-gradient(circle at top left, rgba(14,165,233,0.08), transparent 22%), linear-gradient(180deg, #f8fbff 0%, var(--bg) 220px);
  color:var(--text);
  font-family:var(--font);
  line-height:1.5;
}

.tk-header{
  position:fixed;top:0;left:0;right:0;z-index:20;
  background:#dce3ea;
  border-bottom:1px solid #c7d0da;
  box-shadow:0 6px 16px rgba(15,23,42,.04);
}
.tk-header-inner{
  width:100%;
  display:grid;
  grid-template-columns:minmax(220px, 1fr) auto minmax(220px, 1fr);
  align-items:center;
  gap:20px;
  padding:10px 22px;
}
.tk-header-side{display:flex;align-items:center;}
.tk-header-side-right{justify-content:flex-end;}
.tk-header-center{display:flex;justify-content:center;align-items:center;}
.tk-brand{
  text-decoration:none;
  color:var(--brand-600);
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0;
  min-height:auto;
  border:0;
  border-radius:0;
  background:transparent;
  box-shadow:none;
}
.tk-brand-logo{
  display:block;
  height:52px;
  width:auto;
  max-width:320px;
  object-fit:contain;
  transform:none;
}
.tk-nav{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:flex-end;
  flex-wrap:nowrap;
}
.tenant-switch-form-header{
  margin-left:0;
  flex:0 0 auto;
}
.tk-nav-link{
  color:var(--muted);
  text-decoration:none;
  padding:9px 12px;
  border-radius:10px;
  font-weight:600;
  transition:.16s background-color, .16s color, .16s border-color;
}
.tk-nav-link:hover{color:var(--text);background:#e1e8f0}
.tk-nav-link.active{
  color:#0f3b66;
  background:transparent;
  box-shadow:none;
  position:relative;
}
.tk-nav-link.active::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  bottom:4px;
  height:2px;
  border-radius:999px;
  background:#60a5fa;
}
.tk-nav-link.danger{color:var(--danger)}
.tk-nav-meta{
  padding:8px 12px;
  border-radius:999px;
  background:#eef4fb;
  border:1px solid #bfd0e3;
  color:#38506f;
  font-size:13px;
  font-weight:700;
}

.tk-header + .tk-container{
  margin-top:94px;
}
.tk-container{
  max-width:100%;
  margin:22px auto;
  padding:0 22px 26px;
  display:flex;
  justify-content:center;
  align-items:flex-start;
}
.tk-container-auth{
  margin:0 auto;
  min-height:100vh;
}
.page-wide{flex:1 1 auto;width:100%}
.panel{
  background:linear-gradient(180deg, var(--card-soft), var(--card));
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow-soft);
  padding:16px;
}
.panel.toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.panel-title{
  font-weight:800;
  font-size:20px;
  line-height:1.15;
  letter-spacing:-0.02em;
  margin-bottom:12px;
}
.viewer-empty-kicker{font-size:14px;font-weight:700;color:#475569;margin-bottom:10px}
.label{
  color:var(--muted);
  margin-bottom:8px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  display:block;
}
.input{
  background:#fff;
  border:1px solid var(--line-strong);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  outline:none;
  width:100%;
}
.input:focus{border-color:#7fb0ea;box-shadow:0 0 0 4px rgba(96,165,250,.18)}
.textarea{min-height:120px;resize:vertical;font:inherit}
.file-input{padding:8px 10px}
.btn{
  appearance:none;
  border:1px solid #bfd0e3;
  background:#eef4fb;
  color:#1e3a5f;
  padding:10px 14px;
  border-radius:12px;
  text-decoration:none;
  cursor:pointer;
  box-shadow:0 1px 0 rgba(255,255,255,.7) inset;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
}
.btn:hover{background:#e2ecf8;border-color:#93b1d2;color:#163250}
.btn.primary{background:linear-gradient(180deg,#60a5fa,#3b82f6);color:white;border-color:#3b82f6;box-shadow:none}
.table-wrap{overflow:auto}
.table{
  width:100%;border-collapse:separate;border-spacing:0;
  font-size:14px;
  background:rgba(255,255,255,.74);
  border:1px solid #dbe5f0;
  border-radius:14px;
  overflow:hidden;
}
.table thead th{
  background:linear-gradient(180deg,#f8fbff,#edf3fa);
  border-bottom:1px solid var(--line-strong);
  text-align:left;
  padding:12px 14px;
  font-weight:800;
  font-size:12px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:#475569;
}
.table td{
  border-bottom:1px solid #e7eef6;
  padding:12px 14px;
  vertical-align:top;
  color:#1e293b;
  background:rgba(255,255,255,.72);
}
.table tbody tr:nth-child(even) td{background:rgba(248,251,255,.88)}
.table tbody tr:hover td{background:rgba(232,241,251,.88)}
.table tbody tr:last-child td{border-bottom:0}
.total{
  background:linear-gradient(180deg,#fbfdff,#f3f7fc);
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
}
.t-label{color:var(--muted);font-size:12px;margin-bottom:4px}
.t-val{font-weight:800}
.mono{font-family:var(--mono);font-variant-numeric:tabular-nums}
.muted{color:var(--muted)}
.alert{border-radius:14px;padding:13px 14px;box-shadow:inset 0 1px 0 rgba(255,255,255,.6)}
.alert.success{background:#ecfdf5;border:1px solid #a7f3d0}
.alert.warn{background:#fff7ed;border:1px solid #fed7aa}

.dashboard-shell,
.detail-shell{display:grid;gap:18px}
.dashboard-hero,
.detail-hero{
  display:grid;
  grid-template-columns:minmax(0, 1.5fr) minmax(280px, .9fr);
  gap:18px;
  align-items:stretch;
}
.dashboard-hero h1,
.detail-hero h1{margin:0;font-size:40px;line-height:1.05;letter-spacing:-0.03em}
.dashboard-hero p,
.detail-hero p{margin:14px 0 0;color:#475569;max-width:760px}
.dashboard-stat-grid,
.detail-hero-meta{display:grid;gap:12px}
.detail-meta-card{
  background:linear-gradient(180deg,#ffffff 0%, #f5faff 100%);
  border:1px solid #d8e7f6;
  border-radius:18px;
  padding:16px;
}
.manifest-callout,
.manifest-compact{word-break:break-all;color:#38506f}
.app-form-grid,
.release-form-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:16px;
  align-items:start;
}
.app-form-span,
.release-form-span,
.release-file-field{grid-column:span 2}
.app-form-actions,
.release-form-actions{display:flex;align-items:end}
.dashboard-app-name{font-weight:700}
.empty-state{
  padding:32px 16px;
  border:1px dashed #bfd0e3;
  border-radius:18px;
  text-align:center;
  background:linear-gradient(180deg,#fafdff 0%, #eef4fb 100%);
}
.empty-state-title{font-size:20px;font-weight:800;margin-bottom:6px}
.release-pill{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  background:#eef4ff;
  border:1px solid #bfd0ff;
  color:#1d4ed8;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
}
.checksum{max-width:320px;word-break:break-all}
.release-notes-cell{background:#f8fbff !important}
.release-notes-title{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#64748b;margin-bottom:6px}
.release-notes-copy{white-space:pre-wrap;color:#334155}
.detail-manifest-list{display:grid;gap:4px;text-align:right}

.auth-wrap { min-height: 100vh; width: 100%; display: grid; place-items: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 720px; padding: 42px 42px 36px; background: linear-gradient(180deg, #eef2f6 0%, #dde4ec 100%); border: 1px solid #cfd8e2; box-shadow: 0 20px 48px rgba(15,23,42,.10), inset 0 1px 0 rgba(255,255,255,.92); }
.auth-logo-wrap { display:flex; justify-content:center; align-items:center; margin: 0 auto 24px; width: 100%; text-align:center; padding: 0; }
.auth-logo { display:block; width: 100%; max-width: 100%; margin: 0 auto; object-fit: contain; }
.auth-sub { color: #52637a; margin-bottom: 24px; text-align:center; font-size: 17px; }
.form-row { margin-bottom: 12px; display: grid; gap: 6px; }

.detail-upload-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:18px;
  align-items:start;
}
.upload-panel{height:100%;}
.upload-panel-copy{margin:-2px 0 14px;}
.upload-textarea{min-height:94px;}
.upload-progress{
  display:grid;
  gap:8px;
  margin-top:-4px;
}
.upload-progress-bar{
  height:12px;
  border-radius:999px;
  background:#e7eef7;
  border:1px solid #d4dfec;
  overflow:hidden;
}
.upload-progress-fill{
  height:100%;
  width:0%;
  border-radius:999px;
  background:linear-gradient(90deg, #60a5fa 0%, #2563eb 100%);
  transition:width .18s ease;
}
.upload-progress-meta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  color:#52637a;
  font-size:13px;
}
.upload-submit:disabled{
  opacity:.8;
  cursor:progress;
}

@media (max-width:1200px){
  .detail-upload-grid{grid-template-columns:1fr;}
}

@media (max-width:960px){
  .dashboard-hero,
  .detail-hero,
  .app-form-grid,
  .release-form-grid{grid-template-columns:1fr}
  .app-form-span,
  .release-form-span,
  .release-file-field{grid-column:span 1}
  .detail-manifest-list{text-align:left}
}

@media (max-width:860px){
  .tk-header-inner{grid-template-columns:1fr;}
  .tk-header-center,.tk-header-side-right{justify-content:flex-start;}
  .tk-brand-logo{
    height:52px;
    width:auto;
    max-width:320px;
    object-fit:contain;
  }
  .tk-header-inner{
    width:100%;
    display:flex;
    align-items:center;
    gap:20px;
    padding:10px 22px;
    flex-wrap:nowrap;
  }
  .tk-nav{
    width:100%;
    margin-left:0;
    justify-content:flex-start;
  }
}

.detail-hero-main{
  display:flex;
  align-items:center;
  gap:18px;
}
.app-logo-hero{
  width:112px;
  height:112px;
  border-radius:24px;
  background:linear-gradient(180deg,#ffffff 0%, #eef5fc 100%);
  border:1px solid #d7e4f1;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  flex:0 0 auto;
}
.app-logo-hero img{
  max-width:84%;
  max-height:84%;
  object-fit:contain;
}
.dashboard-app-meta{
  display:flex;
  align-items:center;
  gap:12px;
}
.dashboard-app-logo{
  width:40px;
  height:40px;
  border-radius:12px;
  object-fit:contain;
  background:#fff;
  border:1px solid #d7e4f1;
  padding:6px;
  flex:0 0 auto;
}
.table-actions{
  display:flex;
  gap:8px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.table-actions form{margin:0;}
.danger-btn{
  border-color:#ef4444;
  color:#ef4444;
  background:#fff5f5;
}
.danger-btn:hover{
  border-color:#dc2626;
  color:#dc2626;
  background:#fee2e2;
}
@media (max-width:960px){
  .detail-hero-main{
    flex-direction:column;
    align-items:flex-start;
  }
  .table-actions{
    justify-content:flex-start;
  }
}

.bundle-browser-grid{
  display:grid;
  grid-template-columns:minmax(320px, 420px) minmax(0, 1fr);
  gap:18px;
  align-items:start;
}
.bundle-breadcrumb{
  margin:2px 0 14px;
  color:#52637a;
  word-break:break-all;
}
.bundle-breadcrumb a{
  color:#2563eb;
  text-decoration:none;
}
.bundle-list{
  display:grid;
  gap:8px;
}
.bundle-entry{
  display:grid;
  gap:4px;
  padding:11px 12px;
  border-radius:14px;
  border:1px solid #dbe5f0;
  background:linear-gradient(180deg,#fbfdff 0%, #f3f7fc 100%);
  text-decoration:none;
  color:#1e293b;
}
.bundle-entry:hover{
  border-color:#bfd0e3;
  background:linear-gradient(180deg,#ffffff 0%, #edf4fb 100%);
}
.bundle-entry.active{
  border-color:#93c5fd;
  background:linear-gradient(180deg,#eff6ff 0%, #dbeafe 100%);
}
.bundle-entry.folder{
  border-style:dashed;
}
.bundle-entry-name{
  font-weight:700;
  word-break:break-all;
}
.bundle-entry-meta{
  color:#64748b;
  font-size:12px;
}
.bundle-preview-head{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid #dbe5f0;
  background:#f8fbff;
  margin-bottom:12px;
  word-break:break-all;
}
.bundle-code{
  margin:0;
  padding:16px;
  border-radius:16px;
  border:1px solid #dbe5f0;
  background:#0f172a;
  color:#e2e8f0;
  font-size:13px;
  line-height:1.45;
  overflow:auto;
  max-height:70vh;
  white-space:pre-wrap;
}
@media (max-width:1180px){
  .bundle-browser-grid{grid-template-columns:1fr;}
}

.bundle-browser-panel{
  display:flex;
  flex-direction:column;
}
.bundle-list-scroll{
  overflow:auto;
  max-height:70vh;
  padding-right:4px;
}

.collapsible-panel .toolbar{
  margin-bottom:0;
}
.collapsible-body[hidden]{
  display:none;
}

.history-table{
  table-layout:fixed;
}
.release-history-table th:nth-child(1), .release-history-table td:nth-child(1){width:7%;}
.release-history-table th:nth-child(2), .release-history-table td:nth-child(2){width:8%;}
.release-history-table th:nth-child(3), .release-history-table td:nth-child(3){width:12%;}
.release-history-table th:nth-child(4), .release-history-table td:nth-child(4){width:11%;}
.release-history-table th:nth-child(5), .release-history-table td:nth-child(5){width:24%;}
.release-history-table th:nth-child(6), .release-history-table td:nth-child(6){width:24%;}
.release-history-table th:nth-child(7), .release-history-table td:nth-child(7){width:14%;}
.source-history-table th:nth-child(1), .source-history-table td:nth-child(1){width:8%;}
.source-history-table th:nth-child(2), .source-history-table td:nth-child(2){width:15%;}
.source-history-table th:nth-child(3), .source-history-table td:nth-child(3){width:14%;}
.source-history-table th:nth-child(4), .source-history-table td:nth-child(4){width:36%;}
.source-history-table th:nth-child(5), .source-history-table td:nth-child(5){width:17%;}
.manifest-link{
  color:#2563eb;
  text-decoration:none;
}
.manifest-link:hover{
  text-decoration:underline;
}
.detail-manifest-list{
  display:grid;
  gap:8px;
  text-align:right;
}
.detail-manifest-row{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
}
.history-table th,
.history-table td{
  vertical-align:top;
}
.release-history-table th:nth-child(4), .release-history-table td:nth-child(4){width:13%;}
.release-history-table th:nth-child(5), .release-history-table td:nth-child(5){width:22%;}
.release-history-table th:nth-child(6), .release-history-table td:nth-child(6){width:22%;}
.release-history-table th:nth-child(7), .release-history-table td:nth-child(7){width:16%;}
.source-history-table th:nth-child(1), .source-history-table td:nth-child(1){width:8%;}
.source-history-table th:nth-child(2), .source-history-table td:nth-child(2){width:16%;}
.source-history-table th:nth-child(3), .source-history-table td:nth-child(3){width:16%;}
.source-history-table th:nth-child(4), .source-history-table td:nth-child(4){width:36%;}
.source-history-table th:nth-child(5), .source-history-table td:nth-child(5){width:24%;}
@media (max-width:960px){
  .detail-manifest-row{
    justify-content:flex-start;
    flex-wrap:wrap;
  }
}
.release-history-table td:last-child,
.source-history-table td:last-child{
  vertical-align:middle;
}
.release-history-table .table-actions,
.source-history-table .table-actions{
  align-items:center;
  justify-content:flex-end;
  min-height:52px;
}
.source-history-table td,
.release-history-table td{
  padding-top:14px;
  padding-bottom:14px;
}
.release-history-table th:last-child,
.source-history-table th:last-child{
  text-align:right;
  padding-right:18px;
}
.release-history-table th:nth-child(7), .release-history-table td:nth-child(7){width:11%;}
.source-history-table th:nth-child(5), .source-history-table td:nth-child(5){width:16%;}
.release-history-table th:last-child,
.source-history-table th:last-child{
  text-align:left;
  padding-left:22px;
  padding-right:12px;
}
.tenant-switch-form{
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 4px;
}
.tenant-switch-label{
  font-size:12px;
  color:#64748b;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.tenant-switch-select{
  min-width:220px;
  border:1px solid #bfd0e3;
  border-radius:12px;
  background:#fff;
  padding:8px 12px;
  color:#1e293b;
}
.tenant-inline-check{
  display:flex;
  align-items:center;
  gap:10px;
  color:#475569;
  font-weight:600;
}
.tenant-inline-check input{
  width:auto;
}
.user-admin-list{
  display:grid;
  gap:14px;
}
.user-admin-card{
  display:grid;
  gap:14px;
}
.user-admin-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0, 1fr));
  gap:14px;
  align-items:end;
}
.user-admin-actions{
  display:flex;
  justify-content:flex-end;
}
.user-delete-form{
  margin-top:-6px;
  display:flex;
  justify-content:flex-end;
}
@media (max-width:1200px){
  .user-admin-grid{grid-template-columns:repeat(2, minmax(0, 1fr));}
}
@media (max-width:960px){
  .tenant-switch-form{width:100%; justify-content:flex-start;}
  .tenant-switch-form-header{margin-left:0; order:3;}
  .tenant-switch-select{min-width:0; width:100%;}
  .user-admin-grid{grid-template-columns:1fr;}
}

.tenant-switch-form{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:0;
}
.tenant-switch-label{
  display:flex;
  align-items:center;
  height:38px;
  margin:0;
  padding:0;
  font-size:12px;
  color:#64748b;
  font-weight:700;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.tenant-switch-select{
  min-width:220px;
  height:38px;
  padding:6px 12px;
  border:1px solid #bfd0e3;
  border-radius:12px;
  background:#fff;
  color:#0f172a;
  position:static;
}
.tk-header{
  margin-top:0;
}
.tk-header-inner{
  padding:10px 22px;
}
.user-admin-actions-secondary{
  margin-top:-6px;
  justify-content:flex-end;
}
.user-delete-inline{
  margin:0;
}
.user-admin-actions{
  gap:10px;
  align-items:center;
}
.user-delete-inline{
  display:none;
}
.user-admin-actions-secondary{
  display:none;
}

/* dashboard rollback enhancements */
.dashboard-hero-enhanced{
  background:
    radial-gradient(circle at top right, rgba(96,165,250,.18), transparent 38%),
    linear-gradient(135deg, rgba(255,255,255,.98) 0%, rgba(240,247,255,.96) 58%, rgba(232,242,252,.95) 100%);
  border-color:#d5e4f3;
}
.dashboard-stat-grid-hero{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}
.total-accent{
  background:linear-gradient(180deg,#f8fcff,#ebf4ff);
  border-color:#bfd8f3;
}
.dashboard-chip-row{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  margin-top:18px;
}
.dashboard-chip{
  min-width:240px;
  display:grid;
  gap:6px;
  padding:14px 16px;
  border:1px solid #d9e7f5;
  border-radius:16px;
  background:rgba(255,255,255,.74);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
}
.dashboard-chip-label{
  font-size:11px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#64748b;
}
.dashboard-section-head{
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}
.dashboard-section-actions{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:14px;
  flex-wrap:wrap;
}
.dashboard-register-panel .collapsible-body{
  margin-top:16px;
}
.managed-apps-scroll{
  max-height:460px;
  overflow:auto;
  padding-right:4px;
}
.managed-apps-scroll thead th{
  position:sticky;
  top:0;
  z-index:1;
  background:linear-gradient(180deg,#edf4fb 0%, #e6eef8 100%);
}
.dashboard-table-compact td{
  vertical-align:top;
}
.dashboard-action-cell{
  width:252px;
}
.dashboard-rollback-row td{
  padding:0;
  border-bottom:0;
  background:transparent;
}
.rollback-panel{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:16px 18px 18px;
  background:linear-gradient(180deg,#f9fbff 0%, #eef4fb 100%);
  border-top:1px dashed #cbdae8;
}
.rollback-title{
  font-size:16px;
  font-weight:800;
  letter-spacing:-0.02em;
  margin-bottom:4px;
}
.rollback-form{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
}
.rollback-form .input{
  min-width:360px;
}
@media (max-width:1100px){
  .dashboard-stat-grid-hero{
    grid-template-columns:1fr;
  }
  .dashboard-section-actions{
    justify-content:flex-start;
  }
}
@media (max-width:960px){
  .dashboard-chip{
    min-width:0;
    width:100%;
  }
  .managed-apps-scroll{
    max-height:none;
  }
  .rollback-panel{
    flex-direction:column;
    align-items:stretch;
  }
  .rollback-form{
    justify-content:flex-start;
  }
  .rollback-form .input{
    min-width:0;
    width:100%;
  }
}







.docker-release-hint{color:#52637a;margin:-4px 0 12px;}
