
:root{
  --slb-bg:#f7f9fb;
  --slb-surface:#ffffff;
  --slb-surface-low:#f2f4f6;
  --slb-surface-high:#e6eaef;
  --slb-surface-active:#dfe5eb;
  --slb-text:#191c1e;
  --slb-text-muted:#5d6975;
  --slb-primary:#131b2e;
  --slb-primary-2:#202b44;
  --slb-accent:#d95f00;
  --slb-accent-soft:#fff1e6;
  --slb-danger:#b42318;
  --slb-danger-soft:#fef3f2;
  --slb-outline:#d9e0e7;
  --slb-shadow:0 14px 38px rgba(16,24,40,.08);
  --slb-radius:16px;
  --slb-radius-sm:12px;
}

.slb-app,
.slb-app *{box-sizing:border-box}

.slb-app{
  color:var(--slb-text);
  background:var(--slb-bg);
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
  max-width:980px;
  margin:0 auto;
  position:relative;
}

.slb-shell{
  min-height:540px;
  padding:12px 12px 92px;
}

body.slb-open{overflow:hidden}

@media (max-width:699px){
  .slb-app{
    position:fixed;
    inset:0;
    width:100vw;
    height:100vh;
    max-width:none;
    margin:0;
    z-index:99998;
    overflow:hidden;
  }

  .slb-shell{
    min-height:100vh;
    height:100vh;
    overflow:auto;
    padding-bottom:110px;
  }
}

.slb-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}

.slb-brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.slb-brand-mark{
  width:40px;
  height:40px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--slb-primary),var(--slb-primary-2));
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:var(--slb-shadow);
}

.slb-brand h2{
  margin:0;
  font-size:20px;
  line-height:1.1;
}

.slb-brand p{
  margin:3px 0 0;
  font-size:12px;
  color:var(--slb-text-muted);
}

.slb-tabs{
  position:sticky;
  top:0;
  z-index:20;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:8px;
  background:rgba(247,249,251,.92);
  backdrop-filter:blur(12px);
  padding:8px 0 12px;
  margin-bottom:12px;
}

.slb-tab{
  border:0;
  border-radius:14px;
  background:var(--slb-surface-low);
  color:var(--slb-text-muted);
  min-height:48px;
  padding:10px 8px;
  font-weight:700;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.slb-tab.active{
  background:linear-gradient(135deg,var(--slb-primary),var(--slb-primary-2));
  color:#fff;
}
.slb-tab .dashicons{font-size:18px;width:18px;height:18px}

.slb-content{display:grid;gap:12px}

.slb-card,
.slb-panel,
.slb-sheet-content{
  background:var(--slb-surface);
  border-radius:var(--slb-radius);
  box-shadow:var(--slb-shadow);
}

.slb-card,
.slb-panel{padding:14px}

.slb-card h3,.slb-card h4,.slb-panel h3,.slb-panel h4{
  margin:0 0 10px;
  font-size:15px;
}

.slb-label-sm{
  display:block;
  color:var(--slb-text-muted);
  font-size:11px;
  font-weight:700;
  letter-spacing:.04em;
  text-transform:uppercase;
  margin-bottom:6px;
}

.slb-stack{display:grid;gap:12px}
.slb-grid{display:grid;gap:12px}
.slb-grid-2,.slb-grid-3,.slb-grid-4{grid-template-columns:1fr}

.slb-input,
.slb-select,
.slb-textarea,
.slb-upload-input-native{
  width:100%;
  border:0;
  outline:none;
  border-radius:12px;
  background:var(--slb-surface-low);
  color:var(--slb-text);
  min-height:44px;
  padding:11px 12px;
  font-size:14px;
}
.slb-textarea{min-height:110px;resize:vertical}
.slb-input:focus,.slb-select:focus,.slb-textarea:focus,.slb-upload-input-native:focus{
  background:#eaf0f7;
}

.slb-check{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:10px 12px;
  background:var(--slb-surface-low);
  border-radius:12px;
  font-size:13px;
}

.slb-btn{
  border:0;
  border-radius:12px;
  min-height:42px;
  padding:10px 14px;
  background:linear-gradient(135deg,var(--slb-primary),var(--slb-primary-2));
  color:#fff;
  font-weight:700;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  text-decoration:none;
}
.slb-btn:hover{opacity:.96}
.slb-btn-secondary{background:var(--slb-surface-low);color:var(--slb-text)}
.slb-btn-secondary-active{background:var(--slb-accent-soft);color:var(--slb-accent)}
.slb-btn-danger{background:var(--slb-danger-soft);color:var(--slb-danger)}
.slb-btn-small{min-height:34px;padding:8px 12px;font-size:13px;border-radius:10px}
.slb-btn-icon{width:38px;min-width:38px;padding:0}
.slb-btn-wide{width:100%}
.slb-file-label{position:relative;overflow:hidden}
.slb-file-label input{position:absolute;inset:0;opacity:0;cursor:pointer}

.slb-toolbar{
  display:grid;
  gap:10px;
}
.slb-toolbar-main{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}
.slb-toolbar-main h3{margin:0}
.slb-toolbar-main p{margin:4px 0 0;color:var(--slb-text-muted);font-size:13px}
.slb-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
}
.slb-actions .slb-btn{width:100%}

.slb-stats{
  display:grid;
  gap:12px;
}
.slb-stat-card{
  padding:16px;
  border-radius:16px;
  background:linear-gradient(135deg,var(--slb-primary),var(--slb-primary-2));
  color:#fff;
}
.slb-stat-card.alt{
  background:var(--slb-surface-low);
  color:var(--slb-text);
}
.slb-stat-card .slb-stat-number{
  font-size:34px;
  line-height:1;
  font-weight:800;
  margin-top:10px;
}
.slb-stat-card.alt .slb-stat-number{color:var(--slb-primary)}

.slb-profile-compact{
  display:grid;
  gap:6px;
}
.slb-profile-name{
  font-size:22px;
  font-weight:800;
  line-height:1.05;
}
.slb-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-height:28px;
  padding:5px 10px;
  border-radius:999px;
  background:var(--slb-surface-low);
  color:var(--slb-text-muted);
  font-size:12px;
  font-weight:700;
}

.slb-list{display:grid;gap:10px}
.slb-log-list{display:grid;gap:10px}
.slb-log-item{
  display:grid;
  grid-template-columns:auto 1fr auto;
  gap:12px;
  align-items:center;
  padding:12px;
  background:var(--slb-surface);
  border-radius:16px;
  box-shadow:var(--slb-shadow);
  cursor:pointer;
}
.slb-log-num{
  width:58px;
  min-height:52px;
  border-radius:14px;
  background:linear-gradient(135deg,var(--slb-primary),var(--slb-primary-2));
  color:#fff;
  display:grid;
  place-items:center;
  text-align:center;
  padding:6px;
}
.slb-log-num strong{display:block;font-size:18px;line-height:1}
.slb-log-num span{display:block;font-size:10px;opacity:.86;text-transform:uppercase;letter-spacing:.04em}
.slb-log-main{min-width:0}
.slb-log-main .slb-line-1{font-size:15px;font-weight:800;line-height:1.2}
.slb-log-main .slb-line-2{font-size:12px;color:var(--slb-text-muted);margin-top:4px}
.slb-log-main .slb-line-3{display:flex;gap:8px;flex-wrap:wrap;font-size:12px;color:var(--slb-text-muted);margin-top:5px}
.slb-log-chevron{color:var(--slb-text-muted)}

.slb-dashboard-latest .slb-log-item{box-shadow:none;border:1px solid rgba(0,0,0,.04)}

.slb-inline-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.slb-mini-list{
  display:grid;
  gap:8px;
}
.slb-mini-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:center;
  padding:10px 12px;
  border-radius:12px;
  background:var(--slb-surface-low);
}
.slb-mini-row strong{display:block;font-size:14px}
.slb-mini-row span{display:block;font-size:12px;color:var(--slb-text-muted)}

.slb-upload-box{
  padding:12px;
  border-radius:14px;
  background:var(--slb-surface-low);
  display:grid;
  gap:8px;
}
.slb-upload-file{
  font-size:12px;
  color:var(--slb-text-muted);
  word-break:break-word;
}
.slb-upload-actions{display:grid;gap:8px}

.slb-sheet{
  position:fixed;
  inset:0;
  background:rgba(19,27,46,.38);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:99999;
}
.slb-sheet.open{
  opacity:1;
  pointer-events:auto;
}
.slb-sheet-panel{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  transform:translateY(102%);
  transition:transform .24s ease;
  padding:0 10px 10px;
}
.slb-sheet.open .slb-sheet-panel{transform:translateY(0)}
.slb-sheet-content{
  max-height:min(88vh,900px);
  overflow:auto;
  border-radius:24px 24px 18px 18px;
  padding:12px;
}
.slb-sheet-grab{
  width:48px;
  height:5px;
  border-radius:999px;
  background:var(--slb-outline);
  margin:0 auto 10px;
}
.slb-sheet-head{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  align-items:start;
}
.slb-sheet-head h3{margin:0;font-size:18px}
.slb-sheet-head p{margin:4px 0 0;color:var(--slb-text-muted);font-size:13px}
.slb-sheet-summary{
  display:grid;
  gap:8px;
  margin-top:12px;
}
.slb-detail-grid{
  display:grid;
  gap:8px;
}
.slb-detail-item{
  background:var(--slb-surface-low);
  border-radius:12px;
  padding:10px 12px;
}
.slb-detail-item strong{
  display:block;
  font-size:11px;
  color:var(--slb-text-muted);
  text-transform:uppercase;
  letter-spacing:.04em;
  margin-bottom:4px;
}
.slb-sheet-actions{
  display:grid;
  grid-template-columns:1fr auto auto;
  gap:8px;
  margin-top:12px;
}
.slb-sheet-nav{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
}
.slb-form-inline-note{
  font-size:12px;
  color:var(--slb-text-muted);
  margin-top:4px;
}

.slb-logbook-filters{
  display:grid;
  gap:8px;
  grid-template-columns:1fr;
}

.slb-logbook-filter-actions{
  display:flex;
  align-items:end;
}

.slb-doc-grid{
  display:grid;
  gap:10px;
  grid-template-columns:repeat(auto-fit,minmax(160px,1fr));
}

.slb-doc-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  border-radius:14px;
  background:var(--slb-surface-low);
  color:var(--slb-text);
  text-decoration:none;
}

.slb-doc-icon{
  display:flex;
  align-items:center;
  justify-content:center;
  width:42px;
  height:42px;
  border-radius:12px;
  background:var(--slb-surface);
  flex:0 0 42px;
}

.slb-doc-name{
  font-size:13px;
  font-weight:700;
  word-break:break-word;
}

.slb-sheet-head{
  position:sticky;
  top:0;
  z-index:5;
  background:var(--slb-surface);
  padding-bottom:8px;
  margin-bottom:8px;
}

.slb-sheet-head-actions{
  display:flex;
  align-items:center;
  gap:8px;
}

.slb-sheet-content{
  scrollbar-width:thin;
}

.slb-detail-item-text{
  max-height:220px;
  overflow:auto;
}

.slb-empty{
  padding:18px;
  border-radius:16px;
  background:var(--slb-surface);
  box-shadow:var(--slb-shadow);
  color:var(--slb-text-muted);
  text-align:center;
}

.slb-modal-hidden{display:none}
.slb-table-wrap{overflow:auto}
.slb-table{width:100%;border-collapse:separate;border-spacing:0 8px}
.slb-table th{
  text-align:left;
  font-size:11px;
  color:var(--slb-text-muted);
  text-transform:uppercase;
  letter-spacing:.04em;
  padding:0 10px 4px;
}
.slb-table td{
  background:var(--slb-surface-low);
  padding:10px;
  font-size:13px;
}
.slb-table td:first-child{border-radius:12px 0 0 12px}
.slb-table td:last-child{border-radius:0 12px 12px 0}
.slb-muted{color:var(--slb-text-muted)}
.slb-row-actions{display:flex;flex-wrap:wrap;gap:8px}
.slb-divider{
  height:1px;
  background:rgba(0,0,0,.05);
  margin:4px 0;
}
.slb-toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  background:var(--slb-primary);
  color:#fff;
  padding:12px 16px;
  border-radius:14px;
  box-shadow:var(--slb-shadow);
  z-index:100000;
  font-size:13px;
}
.slb-toast.error{background:var(--slb-danger)}
.slb-loading{
  padding:20px;
  text-align:center;
  color:var(--slb-text-muted);
}

@media (min-width:700px){
  .slb-shell{padding:18px 18px 100px}
  .slb-grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}
  .slb-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .slb-grid-4{grid-template-columns:repeat(4,minmax(0,1fr))}
  .slb-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
  .slb-stats{grid-template-columns:1fr 1fr}
  .slb-logbook-filters{grid-template-columns:repeat(3,minmax(0,1fr))}
  .slb-sheet-panel{left:50%;right:auto;width:min(720px,100%);transform:translate(-50%,102%)}
  .slb-sheet.open .slb-sheet-panel{transform:translate(-50%,0)}
}

@media (min-width:980px){
  .slb-dashboard-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    align-items:stretch;
  }

  .slb-dashboard-profile,
  .slb-dashboard-stats{
    display:flex;
  }

  .slb-dashboard-profile > *,
  .slb-dashboard-stats > *{
    width:100%;
    height:100%;
  }

  .slb-dashboard-secondary{
    grid-column:1 / -1;
    display:grid;
    gap:12px;
  }
}


@media (max-width:979px){
  .slb-dashboard-grid{display:grid;gap:12px}
  .slb-dashboard-secondary{display:grid;gap:12px}
}

.slb-fab{
  position:fixed;
  left:50%;
  bottom:16px;
  transform:translateX(-50%);
  width:60px;
  height:60px;
  border-radius:999px;
  z-index:100001;
  box-shadow:var(--slb-shadow);
}
.slb-fab .dashicons{font-size:24px;width:24px;height:24px}

.slb-dashboard-mini-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.slb-dashboard-half{min-width:0}
.slb-dashboard-last-pack.is-warning{background:#ffedd5}
.slb-dashboard-last-pack.is-danger{background:#b42318;color:#fff}
.slb-dashboard-last-pack.is-danger .slb-label-sm{color:rgba(255,255,255,.82)}
.slb-metric-date{font-size:24px}

.slb-collapsible-toggle{
  width:100%;
  border:0;
  background:transparent;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0;
  font-size:16px;
  font-weight:800;
  cursor:pointer;
}
.slb-collapsible-content{padding-top:12px}

.slb-log-num{
  width:64px;
  min-width:64px;
  height:64px;
  min-height:64px;
  padding:4px;
}
.slb-log-num strong{
  font-size:clamp(14px, 2.8vw, 18px);
  width:100%;
  text-align:center;
  line-height:1.1;
  overflow:hidden;
}
.slb-line-1{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

.slb-sheet-panel-fixed{height:min(92vh, 920px)}
.slb-sheet-content-fixed{
  height:100%;
  display:flex;
  flex-direction:column;
}
.slb-sheet-head-sticky{flex:0 0 auto}
.slb-sheet-summary-scroll,
#slb-entry-form{
  overflow:auto;
}
.slb-sheet-summary-scroll{padding-bottom:8px}
.slb-sheet-delete-row{padding-top:8px}
.slb-detail-value-prewrap{
  white-space:pre-wrap;
  max-height:220px;
  overflow:auto;
}
.slb-textarea-execution{
  min-height:140px;
  max-height:260px;
  overflow:auto;
  resize:vertical;
}

.slb-upload-title-row{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  align-items:center;
}

@media (max-width:699px){
  .slb-logbook-filters-inline-mobile{
    grid-template-columns:1fr 1fr;
    align-items:end;
  }
  .slb-logbook-filter-actions{grid-column:1 / -1}
  .slb-stats{grid-template-columns:1fr 1fr}
}

@media (min-width:980px){
  .slb-dashboard-grid{
    grid-template-columns:1fr 1fr;
    grid-template-areas:
      "profile stats"
      "secondary secondary";
  }
  .slb-dashboard-profile{grid-area:profile}
  .slb-dashboard-stats{grid-area:stats}
  .slb-dashboard-secondary{grid-area:secondary}
  .slb-dashboard-profile-card,
  .slb-dashboard-stats .slb-stats{
    min-height:100%;
  }
}


.slb-toast{
  position:fixed;
  top:18px;
  left:50%;
  transform:translateX(-50%);
  z-index:100001;
}

.slb-collapsible-toggle{
  width:100%;
  min-height:52px;
  padding:14px 16px;
}

.slb-import-wrap{
  display:grid;
  gap:6px;
}

.slb-import-controls{
  display:grid;
  gap:8px;
  grid-template-columns:1fr;
}

.slb-help-text{
  margin:0 0 8px;
  color:var(--slb-text-muted);
  font-size:13px;
}

.slb-sort-block{
  margin-top:8px;
}

.slb-sort-list{
  list-style:none;
  margin:0;
  padding:0;
  display:grid;
  gap:8px;
}

.slb-sort-item{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:12px;
  background:var(--slb-surface-low);
}

.slb-sort-handle{
  cursor:grab;
  color:var(--slb-text-muted);
  display:inline-flex;
}

@media (min-width:700px){
  .slb-import-controls{
    grid-template-columns:minmax(180px, 220px) auto;
    align-items:end;
  }
}


.slb-logbook-tools{display:grid;gap:8px}
.slb-import-controls-compact{display:grid;grid-template-columns:1fr;gap:8px;align-items:end}
.slb-import-controls-compact .slb-btn{width:100%}
.slb-import-controls-compact .slb-upload-input-native{min-height:42px;padding:9px 12px}
.slb-sort-item{justify-content:space-between}
.slb-sort-label{min-width:0;flex:1;font-weight:600}
.slb-sort-buttons{display:inline-flex;gap:6px;flex-shrink:0}
.slb-sort-handle{display:none}
.slb-toast{top:16px;left:50%;transform:translateX(-50%);width:auto;max-width:min(92vw,520px);padding:12px 16px;border-radius:12px;box-shadow:var(--slb-shadow);display:inline-flex;align-items:center;justify-content:center;text-align:center;white-space:normal}
@media (min-width:700px){
  .slb-import-controls-compact{grid-template-columns:minmax(160px,200px) minmax(220px,1fr) auto auto auto}
  .slb-import-controls-compact .slb-btn{width:auto}
}


/* v0.6.4 fixes */
.slb-brand-mark{display:flex;align-items:center;justify-content:center}
.slb-brand-svg{width:28px;height:28px;display:block}
.slb-logbook-accordion{width:100%;margin-top:6px}
.slb-logbook-accordion .slb-collapsible-content{padding-top:14px}
.slb-logbook-card .slb-toolbar{display:grid;gap:12px}
.slb-toast{top:18px !important;bottom:auto !important;left:50% !important;right:auto !important;transform:translateX(-50%) !important;width:fit-content !important;max-width:min(92vw,420px) !important;height:auto !important;max-height:none !important;min-height:0 !important;padding:12px 16px !important;display:block !important;white-space:normal !important;text-align:center !important;line-height:1.35 !important;z-index:100001 !important}
@media (min-width:700px){.slb-logbook-card .slb-toolbar{gap:14px}}


.slb-logbook-toggle-row{
  margin-top:12px;
  display:grid;
  gap:8px;
  justify-items:center;
}
.slb-import-controls-minimal{
  grid-template-columns:1fr;
}
.slb-help-card{
  margin-top:8px;
}
.slb-help-block{
  display:grid;
  gap:10px;
}
.slb-help-block p{
  margin:0;
}
@media (min-width:700px){
  .slb-import-controls-minimal{
    grid-template-columns:minmax(220px,1fr) auto auto auto auto;
    align-items:end;
  }
}
