/* ==========================================================================
   ABL EXCHANGE — REDESIGN STYLESHEET
   For implementation reference. Organized by component, top to bottom:
   Tokens -> Rail nav -> List panel -> Rows -> Kebab menu -> Detail panel ->
   Stat cards / tables -> Full-width layouts (table/gallery/tool) -> Modals
   ========================================================================== */

:root{
  /* color */
  --navy:#0C1E3A; --navy-2:#0A1830;
  --teal:#189384; --teal-deep:#0F6E63; --teal-light:#E4F6F3;
  --ink:#131B26; --muted:#64707E; --line:#E7EAEF; --bg:#F3F5F7; --white:#fff;
  --green:#159048; --green-bg:#E7F8ED;
  --amber:#B8720C; --amber-bg:#FDF1DE; --gold:#C98A1A;
  --red:#D0342C; --red-bg:#FBEAE9;
  /* layout */
  --rail-w:56px; --list-w:320px;
  --ease:cubic-bezier(.22,.8,.32,1);
}

*{box-sizing:border-box;}
html,body{margin:0;height:100%;}
body{
  font-family:'Inter',sans-serif;
  color:var(--ink);
  background:var(--bg);
  display:flex;
  height:100vh;
  overflow:hidden;
  font-size:13px;
}
h1,h2,h3{font-family:'Sora',sans-serif;margin:0;}
button{font-family:'Inter',sans-serif;}
a{color:inherit;text-decoration:none;}
.mono{font-family:'IBM Plex Mono',monospace;}
::-webkit-scrollbar{width:7px;height:7px;}
::-webkit-scrollbar-thumb{background:#D2D7DE;border-radius:8px;}

/* signature motif — thin barcode strip, used under the list header on
   list/detail pages and under the page header on full-width pages */
.barcode-strip{
  height:4px;
  background:repeating-linear-gradient(90deg,var(--navy) 0 2px, transparent 2px 5px, var(--gold) 5px 6px, transparent 6px 9px);
}

@keyframes fadeSlideIn{from{opacity:0;transform:translateY(4px);}to{opacity:1;transform:translateY(0);}}
@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}
@keyframes popIn{from{opacity:0;transform:scale(.97) translateY(-3px);}to{opacity:1;transform:scale(1) translateY(0);}}


/* ==========================================================================
   RAIL NAV — icon-only, 56px, hover reveals a tooltip label
   ========================================================================== */
.rail{
  width:var(--rail-w);
  background:linear-gradient(180deg,var(--navy),var(--navy-2));
  display:flex;flex-direction:column;align-items:center;
  padding:12px 0;flex-shrink:0;position:relative;z-index:40;
}
.rail-logo{
  width:30px;height:30px;border-radius:8px;background:var(--teal);
  display:flex;align-items:center;justify-content:center;margin-bottom:14px;
  font-family:'Sora';font-weight:800;color:#fff;font-size:13px;
}
.rail-group{display:flex;flex-direction:column;width:100%;align-items:center;}
.rail-item{
  position:relative;width:38px;height:38px;border-radius:9px;
  display:flex;align-items:center;justify-content:center;color:#8CA0C4;
  cursor:pointer;margin:1px 0;
  transition:background .16s var(--ease), color .16s var(--ease);
}
.rail-item svg{width:17px;height:17px;stroke:currentColor;fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;}
.rail-item:hover{background:rgba(255,255,255,.08);color:#fff;}
.rail-item.active{background:var(--teal);color:#fff;}
.rail-item.active::before{
  content:'';position:absolute;left:-12px;top:50%;transform:translateY(-50%);
  width:3px;height:18px;border-radius:0 3px 3px 0;background:#fff;
}
.tooltip{
  position:absolute;left:48px;top:50%;transform:translate(-8px,-50%);
  background:var(--navy);color:#fff;padding:5px 10px;border-radius:6px;
  font-size:11.5px;font-weight:600;white-space:nowrap;
  opacity:0;pointer-events:none;
  transition:opacity .14s var(--ease), transform .14s var(--ease);
  box-shadow:0 6px 16px rgba(0,0,0,.25);z-index:50;
}
.tooltip::before{content:'';position:absolute;left:-4px;top:50%;transform:translateY(-50%) rotate(45deg);width:7px;height:7px;background:var(--navy);}
.rail-item:hover .tooltip{opacity:1;transform:translate(0,-50%);}
.rail-spacer{flex:1;}
.rail-avatar{
  width:28px;height:28px;border-radius:50%;background:#EDE9FE;color:#5B21B6;
  display:flex;align-items:center;justify-content:center;font-weight:700;font-size:11.5px;
  margin-top:6px;cursor:pointer;
}


/* ==========================================================================
   LIST PANEL — used on list/detail pages (Manifests, Products, Vendors,
   Clients, Orders, Roles, Inhouse Management)
   ========================================================================== */
.list-panel{
  width:var(--list-w);flex-shrink:0;background:var(--white);
  border-right:1px solid var(--line);display:flex;flex-direction:column;height:100%;
}
.list-header{padding:12px 14px 8px;display:flex;justify-content:space-between;align-items:center;}
.list-header h1{font-size:16px;font-weight:700;}
.list-header .btn.small{padding:4px 9px;font-size:10.5px;}
.search-box{
  display:flex;align-items:center;gap:6px;background:var(--bg);
  border:1px solid var(--line);border-radius:8px;padding:6px 10px;margin:0 14px 8px;
}
.search-box svg{width:13px;height:13px;stroke:var(--muted);fill:none;stroke-width:2;flex-shrink:0;}
.search-box input{border:none;background:transparent;outline:none;font-size:12.5px;width:100%;color:var(--ink);font-family:'Inter';}
.list-tabs{display:flex;gap:5px;padding:0 10px 8px;flex-wrap:wrap;}
.list-tab{
  padding:4px 10px;border-radius:999px;font-size:11.5px;font-weight:600;
  background:var(--bg);color:var(--muted);cursor:pointer;
  display:flex;align-items:center;gap:5px;border:1px solid transparent;
}
.list-tab.active{background:var(--teal-light);color:var(--teal-deep);border-color:#BFEAE4;}
.list-tab .count{background:rgba(0,0,0,.08);border-radius:999px;padding:0 5px;font-size:10px;}
.list-tab.active .count{background:var(--teal);color:#fff;}
.list-scroll{flex:1;overflow-y:auto;padding:3px 0;border-top:1px solid var(--line);}

.row{
  display:flex;gap:9px;padding:9px 10px 9px 12px;cursor:pointer;
  border-left:3px solid transparent;position:relative;
  transition:background .14s var(--ease);
}
.row:hover{background:#FAFBFC;}
.row.selected{background:var(--teal-light);border-left-color:var(--teal);}
.row-icon{
  width:32px;height:32px;border-radius:8px;background:#EAF3FF;color:#2563EB;
  display:flex;align-items:center;justify-content:center;flex-shrink:0;
  font-weight:700;font-size:10.5px;overflow:hidden;
}
.row-body{flex:1;min-width:0;}
.row-top{display:flex;justify-content:space-between;align-items:baseline;gap:6px;}
.row-title{font-size:12.5px;font-weight:700;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.row-right{font-size:11.5px;font-weight:700;color:var(--green);flex-shrink:0;}
.row-sub{font-size:11px;color:var(--muted);margin-top:1px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.row-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:3px;}
.row-file{font-size:10.5px;color:#8A96A8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px;}
.pill{font-size:9.5px;font-weight:700;padding:1px 6px;border-radius:999px;flex-shrink:0;}
.pill.purchased,.pill.instock,.pill.verified,.pill.active-st{background:var(--green-bg);color:var(--green);}
.pill.active,.pill.low,.pill.pending{background:var(--amber-bg);color:var(--amber);}
.pill.out{background:var(--red-bg);color:var(--red);}
.row-kebab-slot{flex-shrink:0;}


/* ==========================================================================
   KEBAB (3-dot) ACTION MENU — replaces the row of separate buttons the
   original tables used (View / Edit / Permissions / Delete, etc.)
   ========================================================================== */
.kebab-btn{
  width:24px;height:24px;border-radius:6px;display:flex;align-items:center;justify-content:center;
  cursor:pointer;color:var(--muted);background:transparent;border:none;padding:0;flex-shrink:0;
}
.kebab-btn:hover{background:#EEF1F5;color:var(--ink);}
.kebab-btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;}
.kebab-wrap{position:relative;display:inline-block;}
.kebab-menu{
  position:absolute;top:100%;right:0;margin-top:2px;background:#fff;
  border:1px solid var(--line);border-radius:9px;
  box-shadow:0 10px 30px rgba(15,36,68,.16);min-width:160px;z-index:200;
  padding:5px;display:none;transform-origin:top right;
}
.kebab-menu.open{display:block;animation:popIn .14s var(--ease) both;}
.kebab-item{padding:7px 10px;font-size:12px;font-weight:600;border-radius:6px;cursor:pointer;display:flex;align-items:center;gap:8px;color:var(--ink);}
.kebab-item:hover{background:var(--bg);}
.kebab-item.danger{color:var(--red);}
.kebab-item.danger:hover{background:var(--red-bg);}
.kebab-item svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:2;flex-shrink:0;}


/* ==========================================================================
   DETAIL PANEL — right-hand pane on list/detail pages
   ========================================================================== */
.detail-panel{flex:1;display:flex;flex-direction:column;height:100%;min-width:0;background:var(--bg);}
.detail-topbar{background:var(--white);border-bottom:1px solid var(--line);padding:12px 22px;display:flex;align-items:center;justify-content:space-between;flex-shrink:0;}
.detail-title{display:flex;align-items:center;gap:10px;}
.detail-title .row-icon{width:34px;height:34px;}
.detail-title h2{font-size:15px;font-weight:700;}
.detail-title span{font-size:11px;color:var(--muted);}
.topbar-actions{display:flex;gap:6px;align-items:center;}

.btn{border:1px solid var(--line);background:#fff;padding:7px 12px;border-radius:8px;font-size:11.5px;font-weight:600;color:var(--ink);cursor:pointer;display:inline-flex;align-items:center;gap:5px;}
.btn:hover{border-color:var(--teal);color:var(--teal-deep);}
.btn.primary{background:var(--teal);color:#fff;border-color:var(--teal);}
.btn.primary:hover{background:var(--teal-deep);color:#fff;}
.btn.small{padding:4px 9px;font-size:10.5px;}

.detail-scroll{flex:1;overflow-y:auto;padding:20px 22px 30px;}

.stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px;margin-bottom:16px;}
.stat-card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px 14px;}
.stat-card .label{font-size:10.5px;color:var(--muted);font-weight:600;margin-bottom:4px;text-transform:uppercase;letter-spacing:.02em;}
.stat-card .value{font-size:17px;font-weight:800;font-family:'Sora';}
.stat-card.accent .value{color:var(--teal);}
.stat-card.good .value{color:var(--green);}

.table-card{background:#fff;border:1px solid var(--line);border-radius:10px;margin-bottom:16px;}
.table-card.clip{overflow:hidden;}
.table-card-head{padding:11px 15px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;}
.table-card-head h3{font-size:13px;font-weight:700;}
table{width:100%;border-collapse:collapse;font-size:11.5px;}
th{text-align:left;background:#FAFBFC;color:var(--muted);font-weight:700;font-size:10px;text-transform:uppercase;letter-spacing:.03em;padding:8px 15px;border-bottom:1px solid var(--line);white-space:nowrap;}
td{padding:9px 15px;border-bottom:1px solid #F0F2F5;vertical-align:middle;}
tr:last-child td{border-bottom:none;}
.prod-thumb{width:28px;height:28px;border-radius:5px;background:#EEF1F5;display:inline-block;vertical-align:middle;margin-right:6px;overflow:hidden;}
.up{color:var(--green);font-weight:700;}
.toggle{width:32px;height:18px;border-radius:999px;background:var(--teal);position:relative;display:inline-block;cursor:pointer;flex-shrink:0;}
.toggle::after{content:'';position:absolute;top:2px;right:2px;width:14px;height:14px;border-radius:50%;background:#fff;}
.toggle.off{background:#D7DEE7;}
.toggle.off::after{left:2px;right:auto;}

.product-hero{display:flex;gap:16px;background:#fff;border:1px solid var(--line);border-radius:10px;padding:16px;margin-bottom:16px;}
.product-hero .thumb{width:100px;height:100px;border-radius:9px;background:var(--bg);display:flex;align-items:center;justify-content:center;font-size:42px;flex-shrink:0;}
.product-hero h2{font-size:15px;margin-bottom:5px;}
.price-tags{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:8px;}
.price-tag{font-size:11px;font-weight:700;padding:5px 10px;border-radius:7px;background:var(--teal-light);color:var(--teal-deep);}
.price-tag.alt{background:#EAF3FF;color:#2563EB;}

.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:var(--muted);text-align:center;gap:8px;}
.empty-state svg{width:52px;height:52px;stroke:#C7D0DC;stroke-width:1.2;}
.empty-state h3{font-size:14px;}
.empty-state p{margin:0;font-size:12px;max-width:260px;}


/* ==========================================================================
   FULL-WIDTH LAYOUTS — pages that don't fit list/detail
   (Categories = table, Barcode Templates = gallery, Sequential Barcode
   Printing = tool/history page)
   ========================================================================== */
.full-header{background:#fff;border-bottom:1px solid var(--line);padding:16px 26px;display:flex;justify-content:space-between;align-items:center;flex-shrink:0;}
.full-header h1{font-size:19px;}
.full-header p{margin:2px 0 0;font-size:12px;color:var(--muted);}
.full-scroll{flex:1;overflow-y:auto;padding:20px 26px 34px;}

.gallery-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px;}
.tpl-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px;}
.tpl-card .tpl-name{font-size:12.5px;font-weight:700;margin-bottom:10px;color:var(--muted);}
.tpl-label{border:1px solid var(--line);border-radius:8px;overflow:hidden;}
.tpl-label .yellow{background:#FCE38A;padding:8px 10px;display:flex;justify-content:space-between;align-items:baseline;}
.tpl-label .yellow b{font-size:12px;}
.tpl-label .yellow span{font-size:13px;font-weight:800;}
.tpl-label .barcode-lines{height:26px;margin:10px 10px 4px;background:repeating-linear-gradient(90deg,#1a1a1a 0 2px,transparent 2px 4px);}
.tpl-label .tier{font-size:10px;color:var(--muted);text-align:center;padding-bottom:8px;}
.tpl-actions{display:flex;gap:6px;margin-top:10px;}

.history-list{background:#fff;border:1px solid var(--line);border-radius:10px;overflow:hidden;}
.history-row{display:flex;justify-content:space-between;align-items:center;padding:13px 16px;border-bottom:1px solid #F0F2F5;}
.history-row:last-child{border-bottom:none;}
.history-row .h-left{display:flex;gap:12px;align-items:center;}
.history-row .h-icon{width:34px;height:34px;border-radius:8px;background:var(--teal-light);color:var(--teal-deep);display:flex;align-items:center;justify-content:center;font-family:'IBM Plex Mono';font-weight:700;font-size:11px;}
.history-row .h-title{font-size:12.5px;font-weight:700;}
.history-row .h-sub{font-size:11px;color:var(--muted);margin-top:2px;}

.empty-panel{background:#fff;border:1px dashed var(--line);border-radius:12px;padding:44px 20px;text-align:center;color:var(--muted);}
.empty-panel svg{width:44px;height:44px;stroke:#C7D0DC;stroke-width:1.2;margin-bottom:10px;}
.empty-panel h3{color:var(--ink);font-size:14px;margin-bottom:4px;}
.empty-panel p{font-size:12px;margin:0 0 14px;}


/* ==========================================================================
   MODAL — used by every "+ Add / + Create" button across all pages
   ========================================================================== */
.modal-backdrop{
  position:fixed;inset:0;background:rgba(12,20,32,.5);
  display:none;align-items:center;justify-content:center;z-index:300;
  backdrop-filter:blur(1.5px);
}
.modal-backdrop.show{display:flex;animation:fadeIn .15s ease both;}
.modal{
  width:480px;max-width:92vw;max-height:88vh;overflow:hidden;display:flex;flex-direction:column;
  background:#fff;border-radius:14px;box-shadow:0 30px 70px rgba(0,0,0,.35);
  animation:popIn .18s var(--ease) both;
}
.modal.wide{width:640px;}
.modal-head{padding:16px 20px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;background:var(--navy);color:#fff;flex-shrink:0;}
.modal-head h3{font-size:15px;color:#fff;}
.modal-head p{margin:2px 0 0;font-size:11px;color:#B9C4D6;}
.modal-close{width:28px;height:28px;border-radius:8px;background:rgba(255,255,255,.15);border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.modal-close svg{width:14px;height:14px;stroke:#fff;fill:none;stroke-width:2;}
.modal-close:hover{background:rgba(255,255,255,.28);}
.modal-body{padding:18px 20px;overflow-y:auto;}
.modal-field{margin-bottom:14px;}
.modal-field label{font-size:11.5px;font-weight:700;display:block;margin-bottom:5px;}
.modal-field .hint{font-weight:400;color:var(--muted);font-size:10.5px;}
.modal-field input,.modal-field select,.modal-field textarea{
  width:100%;border:1px solid var(--line);border-radius:8px;padding:9px 11px;
  font-size:12.5px;font-family:'Inter';outline:none;background:#fff;color:var(--ink);
}
.modal-field input:focus,.modal-field select:focus,.modal-field textarea:focus{border-color:var(--teal);}
.modal-field textarea{resize:vertical;min-height:70px;}
.modal-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
.modal-note{background:var(--teal-light);border-radius:9px;padding:10px 12px;font-size:11.5px;color:var(--teal-deep);margin-top:2px;}
.modal-note ul{margin:0;padding-left:16px;}
.modal-note li{margin-bottom:3px;}
.modal-upload{
  border:1.5px dashed var(--line);border-radius:10px;padding:20px;text-align:center;color:var(--muted);
  font-size:12px;cursor:pointer;
}
.modal-upload:hover{border-color:var(--teal);color:var(--teal-deep);}
.modal-upload svg{width:26px;height:26px;stroke:currentColor;fill:none;stroke-width:1.6;margin-bottom:6px;}
.modal-footer{padding:14px 20px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:8px;flex-shrink:0;}

/* generic preview strip used inside the sequential-barcode modal */
.mini-preview{border:1px solid var(--line);border-radius:9px;padding:16px;text-align:center;background:var(--bg);}
.mini-preview .n{font-family:'IBM Plex Mono';font-weight:700;font-size:20px;}
.mini-preview .bars{height:26px;margin:8px auto;width:140px;background:repeating-linear-gradient(90deg,#1a1a1a 0 2px,transparent 2px 4px);}
