* { box-sizing: border-box; }
body { font-family: 'Segoe UI', Tahoma, sans-serif; margin: 0; background: #f4f5f7; color: #222; }
header { background: #1f2937; color: #fff; padding: 0.75rem 1.25rem; }
header h1 { margin: 0 0 0.5rem; font-size: 1.1rem; }
nav { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.tab, nav .ghost { background: #374151; color: #fff; border: none; padding: 0.45rem 0.9rem; border-radius: 6px; cursor: pointer; }
.tab.active { background: #2563eb; }
nav .ghost { margin-left: auto; background: transparent; border: 1px solid #6b7280; }
.tab-pane { padding: 1.25rem; }
.card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 1rem; margin-bottom: 1rem; }
.card h3 { margin-top: 0; }
.row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0.5rem 0; }
.muted { color: #6b7280; font-size: 0.85rem; }
.err { color: #dc2626; font-size: 0.85rem; margin-top: 0.5rem; }
button { background: #2563eb; color: #fff; border: none; padding: 0.45rem 0.9rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
button.ghost { background: #fff; color: #374151; border: 1px solid #d1d5db; }
button:hover { opacity: 0.9; }
input, select, textarea { padding: 0.4rem 0.5rem; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.85rem; font-family: inherit; }
textarea { width: 100%; }
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid #eee; font-size: 0.85rem; }
th { background: #f9fafb; color: #374151; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 0.75rem; margin-bottom: 1rem; }
.grid label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: #374151; }
.badge { padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.72rem; font-weight: 600; }
.s-pending { background:#e5e7eb; color:#374151; } .s-done { background:#dcfce7; color:#166534; }
.s-failed { background:#fee2e2; color:#991b1b; } .s-claimed,.s-downloading,.s-processing,.s-uploading,.s-uploading-server { background:#dbeafe; color:#1e40af; }
.login { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #f4f5f7; }
.login-box { background: #fff; padding: 2rem; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.1); display: flex; flex-direction: column; gap: 0.75rem; width: 320px; }
.login-box input { width: 100%; }
code { background: #f3f4f6; padding: 0.1rem 0.35rem; border-radius: 4px; }
a.link { color: #2563eb; cursor: pointer; }

/* Checkboxes & radios */
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: #2563eb; cursor: pointer; margin: 0; flex: none; }
.grid label.chk-field { flex-direction: row; align-items: center; gap: 0.5rem; }
.grid label.chk-field span { font-size: 0.85rem; color: #222; }
.row label { display: inline-flex; align-items: center; gap: 0.4rem; }

/* Google Drive guide */
.guide { margin: 0.5rem 0 0.75rem; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: 0.6rem 0.9rem; }
.guide summary { cursor: pointer; font-weight: 600; }
.guide ol { margin: 0.6rem 0; padding-left: 1.4rem; line-height: 1.6; font-size: 0.88rem; }
.guide li { margin-bottom: 0.35rem; }
.guide code { word-break: break-all; }

/* Movie dropdown with built-in search */
.msel { position: relative; display: inline-block; min-width: 240px; }
td .msel { min-width: 200px; width: 100%; }
.msel-control { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.4rem 0.55rem; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; cursor: pointer; font-size: 0.85rem; min-height: 34px; }
.msel-control:hover { border-color: #9ca3af; }
.msel-control:focus, .msel-control:focus-visible { outline: none; border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,0.2); }
.msel-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msel-label.placeholder { color: #9ca3af; }
.msel-caret { color: #9ca3af; font-size: 0.7rem; flex: none; }
.msel-pop { position: fixed; z-index: 1000; display: none; flex-direction: column; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); overflow: hidden; }
.msel-pop.show { display: flex; }
.msel-search { margin: 6px; padding: 0.4rem 0.5rem; }
.msel-list { overflow-y: auto; max-height: 240px; }
.msel-opt { padding: 0.4rem 0.6rem; cursor: pointer; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msel-opt:hover, .msel-opt.active { background: #eff6ff; }
.msel-opt.clear { color: #6b7280; font-style: italic; }
.msel-opt.none { color: #9ca3af; cursor: default; }

/* Jobs sub-tabs */
.subtabs { display: flex; gap: 0.3rem; flex: 1; }
.subtab { background: #e5e7eb; color: #374151; border: none; padding: 0.45rem 0.9rem; border-radius: 6px; cursor: pointer; font-size: 0.85rem; }
.subtab.active { background: #2563eb; color: #fff; }
.subtab .cnt { display: inline-block; min-width: 18px; padding: 0 6px; margin-left: 5px; border-radius: 999px; background: rgba(0,0,0,0.15); font-size: 0.72rem; font-weight: 600; }
.subtab.active .cnt { background: rgba(255,255,255,0.28); }

/* Truncated cell: show ... and full text on hover (title) */
td.ellip { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
