  .app{min-height:100vh;display:grid;grid-template-columns:75px minmax(0,1fr)}

  .rail{
    position:sticky;top:0;height:100vh;
    background:var(--bg-rail);
    color: #fff;
    display:flex;flex-direction:column;gap:10px;
    padding: 0 3px;
  }
  .rail .logo { width: 100% }


  .brand{
    display:flex;align-items:center;gap:7px;
    padding:4px 2px 10px;
    font-weight:800;font-size:20px;letter-spacing:.01em;
  }
  .mark{
    width:26px;height:26px;position:relative;flex:0 0 auto;
    display:grid;grid-template-columns:repeat(3,1fr);gap:2px;
  }
  .mark span{border:2px solid;border-radius:4px;background:#fff}
  .mark span:nth-child(1){border-color:#50b7ff}.mark span:nth-child(2){border-color:#ffce3d}
  .mark span:nth-child(3){border-color:#36c275}.mark span:nth-child(4){border-color:#ff7d52}
  .mark span:nth-child(5){border-color:#8a6de9}.mark span:nth-child(6){border-color:#26a6a1}

  .nav { display:flex; flex-direction:column; }
  .nav button,.mini-action{
    border:0;
    background:transparent;
    color:#fff;
    width:100%;text-align:left;border-radius:6px;padding:7px 7px;
    display:flex;align-items:center;gap:7px;
  }
  .nav button.active{background:#fff;color:var(--blue);box-shadow:var(--shadow);font-weight:650}

  .rail-foot{margin-top:auto;border-top:1px solid var(--line);padding-top:8px}
  .mini-action{font-size:12px}
  .main{min-width:0}

/* ========================================================================
   * STICKY TOP BAR + GENERIC BUTTONS
   * ====================================================================== */
  .topbar{
    height:50px;display:flex;
    align-items:center;justify-content:space-between;
    background:white;
    padding:5px 16px;
    position:sticky;top:0;z-index:20;
  }

  .crumb {display:flex;align-items:center;gap:8px;color:var(--bg)}
  .crumb strong{color:var(--ink);font-size:16px}

  .top-actions{display:flex;align-items:center;gap:8px}

  .btn{
      border:1px solid var(--line-2);background:#fff;border-radius:6px;color:var(--ink);
      font-size: 16px;
      padding:4px 8px;
      min-height:25px;
      display:inline-flex;
      align-items:center;
      gap:7px;
    }
  .btn.primary{background: #0E797DFF !important; color:#fff !important;}
  .btn.danger{background:var(--red);color:#fff}
  .btn.outline{background:transparent;color:var(--blue)}
  .btn.outline.danger{color:var(--red)}
  .btn.subtle{background:var(--panel-2)}
  .btn.icon{width:32px;padding:7px;justify-content:center}

  .btn.small{ font-size: 12px; padding: 4px 6px; min-height: 20px !important; background: var(--muted); color: white}
  .btn.tiny{
    font-size: 11px;
    padding: 0 2px;
    background: var(--muted);
    color: white;
    border-radius: 11px;
    min-height: 14px;
  }
  .btn.tab {
    background: transparent;
    font-size: 12px;
    color: var(--ink);
    border: none;
    border-radius: 0;
    padding: 3px 8px;
  }
  .btn.tab.active {
    background: white !important;
    color: black;
  }

  .warn{
    background: var(--red) !important;
  }

  .avatar{height:30px;border:1px solid var(--line);border-radius:6px;background:#fff;padding:6px 10px;color:#344054}

  .page{
    display:none;
    padding:14px;
    background:var(--bg);
    min-height:calc(100vh - 60px)
  }
  .page.active{display:block}
  .grid-home{
    display:grid;
    grid-template-columns:minmax(480px,1.45fr) minmax(300px,.75fr);
    gap:6px;
    align-items:stretch
  }
  .panel{
    border:1px solid var(--line);
    box-shadow:var(--shadow);
    min-width:0;
    background: var(--panel);
  }
  .panel-head{
    background: var(--panel-head);
    padding: 5px 10px;
    border-bottom:1px solid var(--line);
    display:flex;
    align-items:center;
    justify-content:space-between;gap:10px;
    min-height:20px;
  }
  .panel-title {
    font-weight:400;
    display:flex;
    align-items:center; gap:6px;
    font-size: 14pt;
  }

  .panel-title-right {
    margin-left: auto;
  }

  .panel-title-left {
    margin-right: auto;
  }

  .panel-body{
    padding:0;
    background: white;
  }


/* A vertical column of panels inside .grid-home */
.panel-column{
  display:flex;
  flex-direction:column;
  gap:12px;
  min-width:0;
}

/* Panels normally expand to share available vertical space */
.panel-column > .panel{
  flex:1 1 0;
  min-height:0;
}

/* Optional: panel takes only the height its content requires */
.panel-column > .panel.compact{
  flex:0 0 auto;
  height:max-content;
}

.panel.fullscreen, .compact-list.fullscreen {
  position:fixed;
  inset:0;
  width:100vw;
  height:100vh;
  max-width:none;
  max-height:none;
  margin:0;
  border-radius:0;
  z-index:1000;
  overflow:auto;
}

.panel.context { padding: 0px; }

.flat { border: 0 !important; padding: 0 !important;}

.data-card {
  font-size: 11px;
  padding: 3px;
  margin-bottom: 2px;
  background-color: var(--card-body)
}

.data-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  display: flex;
  padding: 3px;
  gap: 6px;
  align-items: baseline;
  background-color: var(--card-title)
}

th {
  text-align: left;
}

.details {
  background-color: var(--details);
}

.pf {
  font-size: 13px;
  color: var(--muted);
  margin: 5px 0;
  background-color: white !important;
}

.right {
  margin-left: auto;
}
