/* Tivro Encoder Panel — Dark Admin CSS */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;line-height:1.6;background:#09090f;color:#f3f4f6}
a{text-decoration:none;color:inherit}
button{cursor:pointer;font-family:inherit;border:none;background:none}
input,select,textarea{font-family:inherit}
img{display:block;max-width:100%}
table{border-collapse:collapse;width:100%}

/* ── LAYOUT ── */
.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.block{display:block}.hidden{display:none}.inline-block{display:inline-block}
.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}
.items-start{align-items:flex-start}.items-center{align-items:center}.items-end{align-items:flex-end}
.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-end{justify-content:flex-end}
.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}
.min-w-0{min-width:0}.min-h-screen{min-height:100vh}.h-screen{height:100vh}.h-full{height:100%}.w-full{width:100%}.w-auto{width:auto}
.fixed{position:fixed}.relative{position:relative}.absolute{position:absolute}.sticky{position:sticky}
.inset-0{top:0;right:0;bottom:0;left:0}.top-0{top:0}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}
.overflow-hidden{overflow:hidden}.overflow-auto{overflow:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-auto{overflow-x:auto}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.break-all{word-break:break-all}
.whitespace-pre-wrap{white-space:pre-wrap}

/* ── GAP ── */
.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}

/* ── GRID COLS ── */
.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}
@media(min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}
.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(min-width:640px){.sm\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* ── PADDING ── */
.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}
.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}
.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.py-16{padding-top:4rem;padding-bottom:4rem}

/* ── MARGIN ── */
.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-5{margin-bottom:1.25rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}
.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-5{margin-top:1.25rem}.mt-6{margin-top:1.5rem}
.mr-1{margin-right:.25rem}.ml-1{margin-left:.25rem}.ml-auto{margin-left:auto}
.-translate-y-1\/2{transform:translateY(-50%)}

/* ── SIZING ── */
.w-1\.5{width:.375rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-8{width:2rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-32{width:8rem}.w-36{width:9rem}.w-48{width:12rem}.w-64{width:16rem}
.h-1\.5{height:.375rem}.h-2{height:.5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-14{height:3.5rem}.h-24{height:6rem}.h-64{height:16rem}
.max-w-xs{max-width:20rem}.max-w-sm{max-width:24rem}.max-w-md{max-width:28rem}.max-w-xl{max-width:36rem}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-4xl{max-width:56rem}.max-w-7xl{max-width:80rem}
.max-h-48{max-height:12rem}.max-h-64{max-height:16rem}.max-h-72{max-height:18rem}.max-h-96{max-height:24rem}.max-h-screen{max-height:100vh}
.mx-auto{margin-left:auto;margin-right:auto}.mx-4{margin-left:1rem;margin-right:1rem}

/* ── BORDERS ── */
.border{border-width:1px}.border-2{border-width:2px}.border-t{border-top-width:1px}.border-b{border-bottom-width:1px}.border-r{border-right-width:1px}
.border-dashed{border-style:dashed}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}
.border-transparent{border-color:transparent}
.border-gray-600{border-color:#4b5563}.border-gray-700{border-color:#374151}.border-gray-800{border-color:#1f2937}
.border-violet-500{border-color:#8b5cf6}
.border-violet-500\/30{border-color:rgba(139,92,246,.3)}
.border-red-700{border-color:#b91c1c}.border-red-800{border-color:#991b1b}.border-red-900{border-color:#7f1d1d}
.border-green-700{border-color:#15803d}.border-green-800{border-color:#166534}
.border-blue-800{border-color:#1e40af}
.divide-y>*+*{border-top-width:1px}.divide-gray-800>*+*{border-top-color:#1f2937}
.divide-y.divide-gray-800\/50>*+*{border-top-width:1px;border-top-color:rgba(31,41,55,.5)}

/* ── BACKGROUNDS ── */
.bg-gray-950{background-color:#09090f}.bg-gray-900{background-color:#111827}.bg-gray-800{background-color:#1f2937}.bg-gray-700{background-color:#374151}
.bg-gray-900\/50{background-color:rgba(17,24,39,.5)}.bg-gray-800\/50{background-color:rgba(31,41,55,.5)}.bg-gray-800\/40{background-color:rgba(31,41,55,.4)}
.bg-gray-900\/80{background-color:rgba(17,24,39,.8)}.bg-gray-950\/40{background-color:rgba(9,9,15,.4)}
.bg-violet-600{background-color:#7c3aed}.bg-violet-500{background-color:#8b5cf6}
.bg-violet-600\/20{background-color:rgba(124,58,237,.2)}
.bg-green-600{background-color:#16a34a}.bg-green-700{background-color:#15803d}
.bg-green-950{background-color:#051a0a}.bg-green-900\/30{background-color:rgba(20,83,45,.3)}.bg-green-900\/50{background-color:rgba(20,83,45,.5)}
.bg-red-600{background-color:#dc2626}.bg-red-700{background-color:#b91c1c}
.bg-red-950{background-color:#1a0505}.bg-red-900\/50{background-color:rgba(127,29,29,.5)}.bg-red-900\/60{background-color:rgba(127,29,29,.6)}
.bg-blue-600{background-color:#2563eb}.bg-indigo-600{background-color:#4f46e5}.bg-purple-600{background-color:#9333ea}
.bg-yellow-600{background-color:#ca8a04}.bg-yellow-700{background-color:#a16207}
.bg-blue-900\/50{background-color:rgba(30,58,138,.5)}.bg-blue-500\/10{background-color:rgba(59,130,246,.1)}
.bg-green-500\/10{background-color:rgba(34,197,94,.1)}.bg-red-500\/10{background-color:rgba(239,68,68,.1)}.bg-yellow-500\/10{background-color:rgba(234,179,8,.1)}
.bg-black\/60{background-color:rgba(0,0,0,.6)}

/* ── TEXT ── */
.text-white{color:#fff}.text-gray-100{color:#f3f4f6}.text-gray-200{color:#e5e7eb}.text-gray-300{color:#d1d5db}.text-gray-400{color:#9ca3af}.text-gray-500{color:#6b7280}.text-gray-600{color:#4b5563}
.text-violet-400{color:#a78bfa}.text-violet-300{color:#c4b5fd}
.text-green-400{color:#4ade80}.text-green-300{color:#86efac}
.text-red-400{color:#f87171}.text-red-300{color:#fca5a5}
.text-blue-400{color:#60a5fa}.text-yellow-400{color:#facc15}.text-yellow-500{color:#eab308}
.text-indigo-400{color:#818cf8}.text-purple-400{color:#c084fc}
.text-xs{font-size:.75rem;line-height:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-6xl{font-size:3.75rem;line-height:1}
.font-medium{font-weight:500}.font-semibold{font-weight:600}.font-bold{font-weight:700}.font-black{font-weight:900}.font-normal{font-weight:400}
.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace}
.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}
.tracking-wider{letter-spacing:.05em}
.text-center{text-align:center}.text-right{text-align:right}.text-left{text-align:left}
.leading-tight{line-height:1.25}

/* ── EFFECTS ── */
.backdrop-blur{backdrop-filter:blur(12px)}
.shadow-2xl{box-shadow:0 25px 50px -12px rgba(0,0,0,.75)}
.shadow-lg{box-shadow:0 10px 15px -3px rgba(0,0,0,.3),0 4px 6px -4px rgba(0,0,0,.2)}
.shadow-violet-900\/50{box-shadow:0 10px 15px -3px rgba(76,29,149,.5)}
.opacity-75{opacity:.75}

/* ── TRANSITIONS ── */
.transition-all{transition:all .15s ease}.transition-colors{transition:color .15s ease,background-color .15s ease,border-color .15s ease}
.transition-transform{transition:transform .2s ease}
.duration-200{transition-duration:.2s}.duration-500{transition-duration:.5s}

/* ── HOVER ── */
.hover\:bg-gray-800:hover{background-color:#1f2937}.hover\:bg-gray-700:hover{background-color:#374151}.hover\:bg-gray-600:hover{background-color:#4b5563}
.hover\:bg-violet-500:hover{background-color:#8b5cf6}.hover\:bg-green-600:hover{background-color:#16a34a}
.hover\:bg-red-900\/60:hover{background-color:rgba(127,29,29,.6)}
.hover\:bg-green-900\/50:hover{background-color:rgba(20,83,45,.5)}
.hover\:bg-gray-800\/50:hover{background-color:rgba(31,41,55,.5)}
.hover\:text-gray-100:hover{color:#f3f4f6}.hover\:text-gray-200:hover{color:#e5e7eb}.hover\:text-gray-300:hover{color:#d1d5db}
.hover\:text-violet-400:hover{color:#a78bfa}.hover\:text-violet-300:hover{color:#c4b5fd}
.hover\:text-red-400:hover{color:#f87171}.hover\:text-red-300:hover{color:#fca5a5}
.hover\:text-green-300:hover{color:#86efac}
.hover\:border-violet-500:hover{border-color:#8b5cf6}
.hover\:border-gray-700:hover{border-color:#374151}
.hover\:underline:hover{text-decoration:underline}
.hover\:bg-red-600:hover{background-color:#dc2626}
.hover\:bg-yellow-600:hover{background-color:#ca8a04}

/* ── FOCUS ── */
.focus\:outline-none:focus{outline:none}
.focus\:ring-2:focus{box-shadow:0 0 0 2px rgba(139,92,246,.5)}
.focus\:ring-1:focus{box-shadow:0 0 0 1px rgba(139,92,246,.5)}
.focus\:border-transparent:focus{border-color:transparent}

/* ── RESPONSIVE ── */
@media(min-width:640px){
  .sm\:flex-row{flex-direction:row}
  .sm\:items-center{align-items:center}
  .sm\:w-auto{width:auto}
  .sm\:table-cell{display:table-cell}
  .sm\:inline-flex{display:inline-flex}
  .sm\:inline{display:inline}
  .sm\:block{display:block}
}
@media(min-width:1024px){
  .lg\:ml-64{margin-left:16rem}
  .lg\:translate-x-0{transform:translateX(0)}
  .lg\:hidden{display:none}
  .lg\:table-cell{display:table-cell}
  .lg\:flex-row{flex-direction:row}
  .lg\:items-start{align-items:flex-start}
  .lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}
  .lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}
}
@media(min-width:768px){
  .md\:p-6{padding:1.5rem}
  .md\:table-cell{display:table-cell}
}

/* ── SIDEBAR ── */
#sidebar{transition:transform .2s ease-in-out}
#sidebar.sidebar-open{transform:translateX(0)!important}

/* ── FORM INPUTS ── */
.input-field,
input[type="text"],input[type="email"],input[type="password"],input[type="number"],input[type="url"],
select,textarea{
  width:100%;
  background-color:#1f2937;
  border:1px solid #374151;
  border-radius:.5rem;
  padding:.625rem .875rem;
  font-size:.875rem;
  color:#e5e7eb;
  outline:none;
  transition:border-color .15s,box-shadow .15s;
}
input:focus,select:focus,textarea:focus,.input-field:focus{
  border-color:#7c3aed;
  box-shadow:0 0 0 2px rgba(124,58,237,.3);
}
input::placeholder,textarea::placeholder{color:#4b5563}
input[type="checkbox"]{width:1rem;height:1rem;accent-color:#7c3aed;cursor:pointer}
.accent-violet-500{accent-color:#8b5cf6}
textarea{resize:vertical}

/* ── TABLES ── */
th,td{padding:.75rem 1rem;text-align:left}
thead th{font-size:.75rem;font-weight:500;text-transform:uppercase;letter-spacing:.05em}

/* ── PROGRESS BAR ── */
.progress-bar-wrap{background:#1f2937;border-radius:9999px;overflow:hidden}
.progress-bar-fill{height:100%;border-radius:9999px;transition:width .5s ease}

/* ── BADGE ── */
.badge{display:inline-flex;align-items:center;gap:.25rem;padding:.125rem .5rem;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1.5}

/* ── SCROLLBAR ── */
::-webkit-scrollbar{width:6px;height:6px}
::-webkit-scrollbar-track{background:#111827}
::-webkit-scrollbar-thumb{background:#374151;border-radius:3px}
::-webkit-scrollbar-thumb:hover{background:#4b5563}

/* ── MISC ── */
.space-y-0\.5>*+*{margin-top:.125rem}
.space-y-1>*+*{margin-top:.25rem}
.space-y-2>*+*{margin-top:.5rem}
.space-y-2\.5>*+*{margin-top:.625rem}
.space-y-3>*+*{margin-top:.75rem}
.space-y-4>*+*{margin-top:1rem}
.space-y-5>*+*{margin-top:1.25rem}
.space-x-2>*+*{margin-left:.5rem}
.cursor-pointer{cursor:pointer}
.select-none{user-select:none}
.pointer-events-none{pointer-events:none}
.top-1\/2{top:50%}
.right-3{right:.75rem}
.w-full.flex-1{flex:1}
.col-span-2{grid-column:span 2/span 2}

/* ── INSTALLER ── */
.install-step{display:flex;align-items:center;gap:1rem;padding:1rem;border-radius:.75rem;border:1px solid #1f2937;margin-bottom:.75rem}
.install-step.active{border-color:#7c3aed;background:rgba(124,58,237,.1)}
.install-step.done{border-color:#16a34a;background:rgba(22,163,74,.1)}
.step-num{width:2rem;height:2rem;border-radius:9999px;display:flex;align-items:center;justify-content:center;font-size:.875rem;font-weight:700;flex-shrink:0}

/* ── ANIMATIONS ── */
@keyframes spin{to{transform:rotate(360deg)}}
.animate-spin{animation:spin 1s linear infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.5}}
.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}

/* ── MOBILE RESPONSIVE FIXES ── */

/* Ensure all touch targets are at least 44px tall */
@media(max-width:639px){
  button,
  a.inline-flex,
  a[class*="px-"],
  input[type="submit"],
  .input-field,
  input[type="text"],input[type="email"],input[type="password"],
  input[type="number"],input[type="url"],select,textarea{
    min-height:44px;
  }
  /* Section padding tighter on phones */
  .p-6{ padding:1rem }
  .p-5{ padding:.875rem }
  .p-8{ padding:1.25rem }
  /* Gap reductions */
  .gap-6{ gap:1rem }
  .gap-5{ gap:.875rem }
  /* Table: make action buttons stack-friendly */
  td .flex.items-center.justify-end{ flex-direction:column; align-items:flex-end; gap:.375rem }
  /* Prevent job-id monospace from overflowing */
  .font-mono{ word-break:break-all }
  /* Wider tap area for nav items */
  aside a{ min-height:44px; display:flex; align-items:center }
  /* Stat cards: smaller text on very small phones */
  .text-2xl{ font-size:1.25rem }
  .text-3xl{ font-size:1.5rem }
}

/* sm:hidden utility (missing from original) */
@media(max-width:639px){
  .xs\\:hidden{ display:none }
}
@media(min-width:640px){
  .sm\\:hidden{ display:none }
}
@media(min-width:1024px){
  .lg\\:block{ display:block }
}

/* Prevent horizontal overflow on the whole page */
body{ overflow-x:hidden }
.main-content{ overflow-x:hidden }

/* Mobile: main content no side margin (sidebar is overlay) */
@media(max-width:1023px){
  .lg\\:ml-64{ margin-left:0 !important }
}

/* Better mobile table scroll UX */
.overflow-x-auto{
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}

/* Mobile: jobs table — show minimal columns cleanly */
@media(max-width:639px){
  table td, table th{ padding:.625rem .75rem }
  /* Tighten action column */
  td:last-child .flex{ gap:.25rem }
  td:last-child a{ padding:.25rem .5rem; font-size:.7rem }
}

/* Topbar: prevent title overflow on narrow screens */
header h1{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:calc(100vw - 180px);
}

/* Mobile: forms in cards full-width */
@media(max-width:639px){
  .flex.flex-wrap.gap-2.items-center{ flex-direction:column; align-items:stretch }
  .flex.flex-wrap.gap-2.items-center select,
  .flex.flex-wrap.gap-2.items-center button{ width:100% }
}

/* Job view: details list label width smaller on mobile */
@media(max-width:639px){
  dl .flex.gap-2 dt{ width:5rem; min-width:5rem }
}

/* Sidebar: body scroll lock when open */
body.sidebar-open-lock{ overflow:hidden }

/* Settings: nested grid tighter on mobile */
@media(max-width:639px){
  .grid.grid-cols-1.sm\\:grid-cols-2{ grid-template-columns:1fr }
}

/* Cleanup/System: stat dl grids */
@media(max-width:639px){
  dl.grid.grid-cols-1.sm\\:grid-cols-2{ grid-template-columns:1fr }
}

/* Mobile: pagination buttons larger tap target */
@media(max-width:639px){
  .flex.gap-1\\.5 a{ min-width:36px; min-height:36px; display:inline-flex; align-items:center; justify-content:center }
}

/* Mobile: footer text smaller */
@media(max-width:639px){
  footer{ font-size:.65rem; padding:.5rem }
}

/* Mobile: card section headers */
@media(max-width:639px){
  h3.text-sm.font-semibold{ font-size:.8rem }
}

/* Mobile upload drop zone less tall */
@media(max-width:639px){
  #drop-zone{ padding:1.5rem 1rem }
  #drop-zone .text-3xl{ font-size:1.5rem }
}

/* Flash messages: full width on mobile */
@media(max-width:639px){
  .mx-4.mt-4{ margin-left:.75rem; margin-right:.75rem }
}

/* sm:w-full on mobile for flex children */
@media(max-width:639px){
  .sm\\:w-auto{ width:100% }
}
