/* Minimal, clean login UI */
:root{
  --bg:#0b1220;
  --card:#101a33;
  --text:#e8ecf6;
  --muted:#a9b3d1;
  --accent:#5eead4;
  --danger:#fb7185;
  --border:rgba(255,255,255,.10);
  --field-bg:rgba(16,26,51,.65);
  --card-grad-top:rgba(255,255,255,.06);
  --card-grad-bot:rgba(255,255,255,.03);
  --shadow: rgba(0,0,0,.45);
  --bg-grad-1: rgba(94,234,212,.18);
  --bg-grad-2: rgba(56,189,248,.14);
  --sidebar-active-bg:#1e293b;
  --sidebar-active-text:#fff;
}
:root[data-theme="light"],
html[data-theme="light"]{
  --bg:#f6f8ff;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#44506a;
  --accent:#0ea5e9;
  --danger:#e11d48;
  --border:rgba(15,23,42,.12);
  --field-bg:rgba(255,255,255,.9);
  --card-grad-top:rgba(15,23,42,.03);
  --card-grad-bot:rgba(15,23,42,.02);
  --shadow: rgba(2,6,23,.14);
  --bg-grad-1: rgba(14,165,233,.12);
  --bg-grad-2: rgba(94,234,212,.10);
  --sidebar-active-bg:#0f172a;
  --sidebar-active-text:#fff;
}
*{box-sizing:border-box}
html,body{height:100%}
html, body, .card, input, .panel { transition: background-color .18s ease, color .18s ease, border-color .18s ease; }
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial;
  background: radial-gradient(1200px 600px at 20% 10%, var(--bg-grad-1), transparent 60%),
              radial-gradient(900px 500px at 80% 30%, var(--bg-grad-2), transparent 55%),
              var(--bg);
  background-color: var(--bg);
  color:var(--text);
  color-scheme: light dark;
}
.wrap{
  min-height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
}
.card{
  width:100%;
  max-width:440px;
  background:linear-gradient(180deg, var(--card-grad-top), var(--card-grad-bot));
  border:1px solid var(--border);
  border-radius:16px;
  padding:22px 22px 18px;
  box-shadow:0 20px 60px var(--shadow);
  backdrop-filter: blur(10px);
}
.brand{
  display:flex;
  gap:10px;
  align-items:center;
  margin-bottom:10px;
}
.logo{
  width:38px;height:38px;border-radius:12px;
  background:linear-gradient(135deg, rgba(94,234,212,.9), rgba(56,189,248,.9));
  box-shadow:0 10px 25px rgba(56,189,248,.18);
}
.login-logo{
  width:128px;height:128px;
  object-fit:contain;
  background:none;
  box-shadow:none;
}
h1{font-size:18px;margin:0}
.sub{color:var(--muted);margin:8px 0 16px;line-height:1.4}
label{display:block;font-size:13px;color:var(--muted);margin:12px 0 6px}
input{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--field-bg);
  color:var(--text);
  outline:none;
}
textarea.ta{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--field-bg);
  color:var(--text);
  outline:none;
  resize:vertical;
  min-height:120px;
}
textarea.ta:focus{border-color:rgba(94,234,212,.6); box-shadow:0 0 0 4px rgba(94,234,212,.10)}
select.sel{
  width:100%;
  padding:12px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--field-bg);
  color:var(--text);
  outline:none;
  appearance:none;
}
select.sel:focus{border-color:rgba(94,234,212,.6); box-shadow:0 0 0 4px rgba(94,234,212,.10)}
input:focus{border-color:rgba(94,234,212,.6); box-shadow:0 0 0 4px rgba(94,234,212,.10)}
.row{display:flex;gap:10px;align-items:center;justify-content:space-between;margin-top:14px}
.btn{
  width:100%;
  padding:12px 14px;
  border:0;
  border-radius:12px;
  background:linear-gradient(135deg, rgba(94,234,212,.92), rgba(56,189,248,.92));
  color:#07101d;
  font-weight:700;
  cursor:pointer;
}
.btn:hover{filter:brightness(1.04)}

/* Pagination links: .btn is width:100% globally; keep compact */
.processing-report-pagination .btn,
.processing-processed-pagination .btn{
  width:auto;
  flex:0 0 auto;
  min-width:0;
  display:inline-block;
  box-sizing:border-box;
}

#sale-form .btn,
#sale-form .btn-remove-line {
  padding: 12px 14px;
  min-height: 44px;
  box-sizing: border-box;
}
#sale-form .btn-remove-line {
  width: auto;
}

#recycling-book-form .btn,
#recycling-book-form .btn-remove-line {
  padding: 12px 14px;
  min-height: 44px;
  box-sizing: border-box;
}
#recycling-book-form .btn-remove-line {
  width: auto;
}

.err{
  margin:10px 0 0;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(251,113,133,.35);
  background:rgba(251,113,133,.10);
  color:#ffd3db;
  font-size:13px;
}
.topnav{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:16px;
}
.themeBtn{
  border:1px solid var(--border);
  background:transparent;
  color:var(--text);
  padding:8px 10px;
  border-radius:999px;
  cursor:pointer;
  font-weight:650;
  font-size:12px;
}
.themeBtn:hover{
  border-color:rgba(94,234,212,.35);
}
.link{color:var(--accent);text-decoration:none}
.link:hover{text-decoration:underline}
.page{
  max-width:920px;
  margin:0 auto;
  padding:28px 24px;
}
.panel{
  background:rgba(255,255,255,.04);
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px;
}
:root[data-theme="light"] .panel,
html[data-theme="light"] .panel{
  background:rgba(15,23,42,.03);
}

.tbl{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  font-size:13px;
}
.tbl th,.tbl td{
  padding:10px 10px;
  border-bottom:1px solid var(--border);
  white-space:nowrap;
}
.tbl th{
  text-align:left;
  color:var(--muted);
  font-weight:700;
}
.tbl tbody tr:hover td{
  background:rgba(255,255,255,.03);
}

/* Dashboard layout (Lighting Recycle Pro wireframe) */
.page.dashboard-wrap{ max-width:none; padding:0; }
.dashboard-wrap{
  min-height:100vh;
  display:flex;
  flex-direction:column;
}
.dashboard-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 20px;
  border-bottom:1px solid var(--border);
  background:var(--card);
  flex-shrink:0;
}
.dashboard-brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:700;
  font-size:1.1rem;
  color:var(--text);
}
.dashboard-brand-icon{
  width:32px;height:32px;
  border-radius:10px;
  background:linear-gradient(135deg, rgba(94,234,212,.9), rgba(56,189,248,.9));
}
.dashboard-brand-logo{
  width:128px;
  height:128px;
  object-fit:contain;
  flex-shrink:0;
}
.dashboard-nav-center{
  display:flex;
  gap:20px;
  align-items:center;
}
.dashboard-nav-center a{
  color:var(--text);
  text-decoration:none;
  font-size:14px;
}
.dashboard-nav-center a:hover{color:var(--accent)}
.dashboard-header-right{
  display:flex;
  align-items:center;
  gap:12px;
}
.dashboard-avatar{
  width:36px;height:36px;
  border-radius:50%;
  background:var(--border);
  flex-shrink:0;
}
.dashboard-body{
  display:flex;
  flex:1;
  min-height:0;
}
.dashboard-sidebar{
  width:220px;
  flex-shrink:0;
  border-right:1px solid var(--border);
  background:var(--card);
  padding:16px 0;
}
.dashboard-sidebar a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 20px;
  color:var(--text);
  text-decoration:none;
  font-size:14px;
  transition:background .15s ease, color .15s ease;
}
.dashboard-sidebar a:hover{
  background:rgba(255,255,255,.06);
}
:root[data-theme="light"] .dashboard-sidebar a:hover,
html[data-theme="light"] .dashboard-sidebar a:hover{
  background:rgba(0,0,0,.04);
}
.dashboard-sidebar a.active{
  background:var(--sidebar-active-bg);
  color:var(--sidebar-active-text);
}
.dashboard-sidebar .nav-icon{
  width:20px;height:20px;
  opacity:.9;
  flex-shrink:0;
}
.dashboard-main{
  flex:1;
  padding:24px;
  overflow-auto;
}
.dashboard-title{
  margin:0 0 20px;
  font-size:20px;
  font-weight:700;
  color:var(--text);
}
.kpi-grid{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:16px;
  margin-bottom:28px;
}
.kpi-card{
  background:linear-gradient(180deg, var(--card-grad-top), var(--card-grad-bot));
  border:1px solid var(--border);
  border-radius:12px;
  padding:18px;
  position:relative;
}
.kpi-card .kpi-value{
  font-size:1.5rem;
  font-weight:700;
  color:var(--text);
  margin:0 0 4px;
}
.kpi-card .kpi-label{
  font-size:13px;
  color:var(--muted);
  margin:0;
}
.kpi-card .kpi-refresh{
  position:absolute;
  top:12px;right:12px;
  width:16px;height:16px;
  opacity:.5;
}
.section-head{
  margin:0 0 12px;
  font-size:16px;
  font-weight:700;
  color:var(--text);
}
.dashboard-table-wrap{
  overflow-x:auto;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--card);
}
.dashboard-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.dashboard-table th,
.dashboard-table td{
  padding:12px 16px;
  text-align:left;
  border-bottom:1px solid var(--border);
}
.dashboard-table th{
  color:var(--muted);
  font-weight:600;
}
.dashboard-table tbody tr:last-child td{border-bottom:0}
.dashboard-table tbody tr:hover td{
  background:rgba(255,255,255,.03);
}
:root[data-theme="light"] .dashboard-table tbody tr:hover td,
html[data-theme="light"] .dashboard-table tbody tr:hover td{
  background:rgba(0,0,0,.02);
}
.dashboard-table tbody tr.inventory-row-processed td{
  opacity:0.55;
  background:rgba(0,0,0,.06);
}
:root[data-theme="light"] .dashboard-table tbody tr.inventory-row-processed td,
html[data-theme="light"] .dashboard-table tbody tr.inventory-row-processed td{
  background:rgba(0,0,0,.04);
}

/* Processing: machine blocks stacked vertically, collapsible */
.processing-machine-grid{
  display:grid;
  grid-template-columns:1fr;
  gap:24px;
  align-items:stretch;
}
.processing-machine-block{
  display:flex;
  flex-direction:column;
}
.processing-machine-details{
  display:block;
}
.processing-machine-summary{
  padding:14px 20px;
  cursor:pointer;
  list-style:none;
  font-size:16px;
  font-weight:600;
  color:var(--text);
  background:var(--card);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  user-select:none;
}
.processing-machine-summary::-webkit-details-marker{ display:none; }
.processing-machine-summary::marker{ content:none; }
.processing-machine-summary::after{
  content:'';
  width:0;
  height:0;
  border-left:6px solid transparent;
  border-right:6px solid transparent;
  border-top:8px solid var(--muted);
  flex-shrink:0;
  transition:transform 0.2s ease;
}
.processing-machine-details[open] .processing-machine-summary::after{
  transform:rotate(180deg);
}
.processing-machine-summary:hover{ background:var(--bg); }
.processing-machine-summary-title{ flex:1; }
.processing-machine-summary-hint{ font-size:12px; font-weight:400; }
.processing-machine-body{
  display:flex;
  flex-direction:column;
  min-height:480px;
}
/* Clients page: cascade sections without machine block min-height */
.clients-cascade .clients-cascade-body{
  min-height:unset;
}
/* Mobile: hamburger + stacked */
.dashboard-mobile-header{
  display:none;
  align-items:center;
  justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
  background:var(--card);
}
.dashboard-mobile-header .page-title{ font-size:1rem; font-weight:700; color:var(--text); }
.dashboard-hamburger{
  background:transparent;
  border:none;
  padding:8px;
  cursor:pointer;
  color:var(--text);
}
.dashboard-hamburger svg{ width:24px; height:24px; }
.dashboard-search-btn{
  background:transparent;
  border:none;
  padding:8px;
  cursor:pointer;
  color:var(--text);
}
.dashboard-search-btn svg{ width:20px; height:20px; }
.dashboard-sidebar-mobile{
  display:none;
  padding:12px 0;
  border-bottom:1px solid var(--border);
}
.dashboard-sidebar-mobile a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 16px;
  color:var(--text);
  text-decoration:none;
  font-size:14px;
}
.dashboard-sidebar-mobile a.active{
  background:var(--sidebar-active-bg);
  color:var(--sidebar-active-text);
}
@media (max-width:900px){
  .dashboard-header{ display:none; }
  .dashboard-mobile-header{ display:flex; }
  .dashboard-body{ flex-direction:column; }
  .dashboard-sidebar{ display:none; }
  .dashboard-sidebar-mobile{
    display:none;
    background:var(--card);
  }
  .dashboard-sidebar-mobile.open{ display:block; }
  .dashboard-main{ padding:16px; }
  .kpi-grid{
    grid-template-columns:1fr;
    margin-bottom:20px;
  }
}
@media (max-width:600px){
  .dashboard-nav-center{ display:none; }
}
